0

EOS5 / custom capillary-pressure modification: negative pressure and convergence issues when using nonzero entry pressure

Hello everyone,

I am working on a TOUGH3 EOS5 case for a Nuclear waste-cell / FORGE-type model with water + hydrogen and a rectilinear mesh.

I modified the capillary-pressure handling to use a custom negative capillary-pressure convention, and I am trying to keep a nonzero entry pressure (PE) in some materials. I would like help understanding whether the issue is in my constitutive formulation, my EOS modifications, or the way I am handling phase transitions.

What I am doing

I am using EOS5 (water + H2) and a custom PCAP function based on an SGM-type formulation.

In my model:

  • PCP(1) is negative

  • I am effectively using
    Pl = Pg + Pc

Some materials have a nonzero entry pressure, but Cledz clearly triggers the convergence problem.

  • Claym: PE = 2.0E+6

  • Bento: PE = 1.33E+6

  • Cledz: PE = 0.67E+6

  • Dredz: PE = 0.67E+6

The important point is that the issue appears specifically when Cledz uses PE = 0.67E+6.

If I keep Cledz = 0.67E+6, the model develops convergence problems.
If I set Cledz = 0, the model runs well.

So the problem seems to be specifically associated with activating PE = 0.67E+6 in Cledz.

Main symptom

At runtime, I get repeated timestep reductions and then errors like:

NO CONVERGENCE IN SUBROUTINE PP
+++++++++   CANNOT FIND PARAMETERS AT ELEMENT * 554*      XX(M) = -0.60568E+06  0.15715E-06  0.20000E+02

TOUGH ERROR: Error in the Time-dependent bc values.

So the liquid pressure becomes strongly negative because Pc is negative and large in magnitude.

My custom EOS behaviour

In the EOS, the primary variables are updated in the usual way:
 

XX(M)=X(NLOC+M)+XINCR

And I found that XX(1) can become negative during Newton iterations.
 

I tried temporarily protecting pressure with:

XX(1)=MAX(XX(1),1.0D0)

and this keeps the pressure stable enough to continue farther, but I know this is a numerical safeguard and may also affect the solution.

In the two-phase → liquid transition block, I also have logic like:
 

CALL PCAP(SATU,TX,PCP,NPH,NMAT,USRX,K)
pee = -PCP(1)
xx(1)=px-pee
DX(NLOC+1)=XX(1)-X(NLOC+1)

Since PCP(1) is negative, this is equivalent to resetting pressure with px + PCP(1).

My custom PCAP routine

My custom capillary-pressure routine uses a negative capillary-pressure convention. The relevant part is:
 

PC_0=-1.0D0/CP(3,NMAT)
PCE=-CP(6,NMAT)
...
PC=SE**(-1.0D0/AM)-1.0D0
PC=PC**(1.0D0-AM)
PC=PC_0*PC
IF(CP(4,NMAT).NE.0.0D0) PC=MAX(PC,-ABS(CP(4,NMAT)))
PCP(1)=PC

So CP(4) is acting as a soft cap on how negative Pc can become.

Parameter tests I tried

I tested several things:

  • setting PE = 0 → model runs well

  • keeping PE > 0 → convergence problems return

  • lowering CP(4) from 1.0E9 to 1.0E5 helped a bit

  • lowering CP(4) too much (for example 1.0E4) caused linear-solver issues

However, even after these changes, I still see PP failures and negative pressures during Newton iterations.

My question

I would appreciate advice on the following:

  1. Is this negative-Pc convention fundamentally problematic in EOS5, or can it be made robust?

  2. Is the main issue likely to be:

    • my PCAP formulation,

    • the EOS phase-transition reset logic,

    • Or the Newton update of pressure?

  3. For people who have implemented custom capillary-pressure laws in TOUGH3:

    • Is it better to limit DX for pressure?

    • protect XX(1),

    • or reformulate the phase-transition pressure reset?

  4. Has anyone used a similar nonzero PE formulation successfully with EOS5 / H2–water systems?

Summary

  • EOS: EOS5

  • Components: water + hydrogen

  • The problem appears only when a nonzero entry pressure is used

  • PE = 0 runs fine

  • Custom PCAP returns negative PCP(1)

  • Repeated failures occur in PP, with XX(1) becoming negative

  • Sometimes the run later stops with Time-dependent bc values or VISCOH2 range errors

Any suggestions on the best way to keep the physical nonzero PE while avoiding these EOS/convergence failures would be very helpful.

Thank you.

6 replies

null
    • kenny
    • 5 days ago
    • Reported - view

    Great problem statement — this is very likely a sign-consistency issue plus Newton overshoot, not just a single bad parameter.

     

    From your description, the key risk is that EOS5 internals are generally written around the convention

    Pc = Pg - Pl (nonnegative),

    while your custom path uses negative Pc and then applies transformations in multiple places (PCAP, phase-transition reset, BC checks). If even one branch still assumes the native sign, PP/BC lookups can receive unphysical pressure states (as you see with XX(1) < 0).

     

    What I would do (in order):

     

    1) Keep one internal convention everywhere (recommended: native EOS sign)

    - Return PCP(1) as nonnegative capillary pressure inside EOS routines.

    - If you want negative Pc for reporting, apply the sign only at I/O boundaries (plots/output), not in state updates.

     

    2) Recheck the two-phase -> liquid reset formula

    - With native convention: Pl = Pg - Pc.

    - Your current reset xx(1)=px+PCP(1) is only correct if PCP is negative everywhere and all downstream code also expects that. Any mixed usage causes exactly this failure mode.

     

    3) Use step limiting on DX(pressure), not hard clipping XX(1)

    - Hard clamp XX(1)=MAX(XX(1),...) can hide inconsistency and hurt Newton convergence.

    - Better: damp the pressure increment (trust-region style), then recompute residual/Jacobian.

     

    4) Smooth entry-pressure activation

    - Nonzero PE introduces a kink if implemented as hard max/min. Ensure Pc(Sl) and dPc/dSl are continuous around the entry transition (small smoothing interval).

     

    5) Run a minimal 1-element/1D debug case with identical constitutive law

    - Log per Newton iteration: Pg, Pl, PCP, Sg, dPc/dS, and the exact branch taken in phase-transition reset.

    - First target: prove all branches preserve the same identity (Pc = Pg - Pl).

     

    Quick diagnostic for your current run:

    - For the failing element/time step, print both

      A = Pg - Pl

      B = PCP(1)

      and their sign.

    If A and B differ by sign or magnitude after a branch switch, that is the root cause.

     

    So to your direct question: yes, a negative-Pc convention can be made to work, but only if every EOS/transition/BC path is transformed consistently. In practice, it is much more robust to keep native sign internally and only map sign at output.

     

    If useful, I can sketch a branch-by-branch checklist for EOS5 transition points (single-phase liquid, two-phase, boundary-condition update) to verify consistency quickly.

      • Abdelrazik_Elfar
      • 5 days ago
      • Reported - view

       

      Thank you for your prompt reply.

      Yes, if you could sketch the branch-by-branch checklist, that would be very helpful. I agree with your point that this is likely a sign-consistency issue together with Newton overshoot, rather than simply a bad parameter choice.

      • kenny
      • 5 days ago
      • Reported - view

       

      Great—here is a compact branch-by-branch checklist you can run in EOS5.

      1. One internal sign convention (global)
      • Decide one internal identity and enforce it everywhere (recommended: Pc = Pg - Pl >= 0).
      • In each routine that touches pressure/capillary terms, log once at startup which convention it assumes.
      1. PCAP return contract
      • Verify PCAP always returns the same sign/units for all materials (including Cledz).
      • Log per call (debug mode): material, Sg/Sl, PCP(1), dPc/dS, clamp trigger.
      • Confirm continuity near entry-pressure activation (no derivative jump spike).
      1. Primary-variable update stage (Newton)
      • After XX update, log XX(1), DX pressure component, and damping factor.
      • Add pressure-increment limiter (DX) before residual recomputation; avoid hard XX clamp unless emergency.
      1. Phase-transition branch reset (2-phase <-> liquid)
      • At each transition branch, log pre/post values of Pg, Pl, Pc, and branch ID.
      • Immediately check invariant: A = Pg - Pl, B = Pc_internal.
      • If |A-B| exceeds tolerance right after branch switch, that branch is the bug source.
      1. BC/source-sink interface checks
      • Before PP/BC lookup, print the same invariant (A vs B) plus effective phase state.
      • This catches sign mismatch crossing from EOS state update into BC routines.
      1. Material-isolated reproduction
      • Run minimal case with only Cledz constitutive settings first.
      • Then add one neighboring material at a time.
      • Compare first timestep/element where invariant fails.
      1. Convergence decision rule
      • If invariant holds but Newton still diverges -> tune numerics (DX damping, timestep control).
      • If invariant breaks at branch boundary -> fix branch algebra/sign mapping first (do not tune parameters yet).
    • Reservoir Engineer
    • Alfredo_b
    • yesterday
    • Reported - view

    Interesting posts on an intriguing topic.

    I add few comments about some of the questions initially asked.

    - implementing the entry P in EOS5. I have some experience in implementing an entry P in EOS3 of TOUGH2. EOS5 is very similar to EOS3, so the same approach should work. The implementation was entirely  based on a memo sent by Karsten Pruess and was using the Brooks-Corey Pcap model. The implementation required changes to L<->L+G phase transitions  to have a smooth PL across the phase change.

    - I see BC's Pcap model is already supported by TOUGH3, so I wonder why you don't use the native BC available. If BC is already supported by TOUGH3, I guess the needed logic in the phase transition should already be in place.

    - At the time, I made few checks of entry P implementation in EOS3 as my goal was to implement the entry P in TMGAS, the EOS module for GHG and acid gas mixtures injection. Karsten's approach was working well when coded into TMGAS.

    - The approach followed the TOUGH2 convention about the definition of capillary pressure, where the reference phase is the gas phase, the aqueous phase has a lower P than the gas phase, and Pcap is negative (from TOUGH2 user's guide):

     - Another simple way of adding a non-zero entry P is to allow the use of SLS>1.0 in the van Genuchten Pcap model. I'm using it not to simulate high gas entry P, as those characteristics of a cap-rock, but mainly to avoid the steep change of VG Pcap when SL approaches 1. A small non-zero gas entry P usually improves the convergence at phase transition. If the logic for a non-zero gas entry P is implemented in the EOS, the modified VG Pcap can be used instead of the BC model even for high entry pressures.

    - About the failed convergence in PP. The convergence fails because of the negative P used to call the routine. The P cannot be negative, as it gives problems in the computation of several thermophysical parameters. In sub PP, for instance, a negative P gives a negative gas density DGAS, which affects the calculation of steam density D and then the partial P of steam PS.

    - So, the issue is why P becomes negative? It is due to the NR iteration process itself, may be with low total P values? Or the negative P is due to the reassignement of total P for the two-phase --> L phase transition? In this case a wrong sign could be the root cause.

     

    Capillary P in porous media raises several questions. 

    - we should account for the VPL when evaluating the saturation P of liquid water. In a porous medium liquid water can exist even at P lower than the saturation P for local T. At low T the effects may not be huge, while in HT geothermal applications it may make a big difference, such as in modeling two-phase conditions in steam dominated reservoirs.

    - in two-phase conditions the water phase is at a P lower than that of the gas phase. Are we computing liquid water properties accounting for PL=PG+Pcap?  PL may be lower than the saturation P !

    - for low PG and high (abs) Pcap, PL may become negative. Water properties correlations (IFC67, IAPWS-97) are for water above the triple point. How to compute capillary liquid water properties at metastable conditions ?  See Lassin et al., GCA, 2005. 

    Regards,

    Alfredo 

    • Finsterle GeoConsulting
    • Stefan_Finsterle
    • yesterday
    • Reported - view

    This is by far the best AI: "Alfredo Intelligence"!

    Thank you, Alfredo, for this comprehensive discussion!

    Stefan

      • Reservoir Engineer
      • Alfredo_b
      • 9 hrs ago
      • Reported - view

       

      You'r wellcome, Stefan !

      But I basically asked questions, rather than giving answers.

      I'd be very interested to know about more comprehensive treatments of adsorption and suction pressure effects in the TOUGH family of codes.

      In TOUGH2-EWASG we have VPL implemented, but accounting for brine vapor P only, neglecting the effects of NCG. We prevent calling liquid water properties correlations with wrong P by simply using PL= max(PX, Psat). I do not know how VPL is handled in TOUGH3-EWASG, as I have no access to the source code.

      At Saipem, my former Company, we did something more in TMGAS, where the brine - Non-aqueous phase equilibrium is computed by equating the fugacities of all components in both phases. 

      In TMGAS we included the effects of capillarity on the thermodynamic equilibrium calculations following Firoozabadi (1988), Thermodynamics of hydrocarbon reservoirs.

      Basically, the phase pressures including Pcap effect are used to compute the fugacities. We also included the option to compute liquid water (brine) properties  accounting for the Paq = Pgas + Pcap. We included limitations on Paq values to avoid calling water correlations with Paq<Psat, and negative Paq pressures in the computation of fugacities. No calculations of metastable liquid water properties are implemented.

      In GHG applications involving the injection of a rich-CO2 mixture in natural gas reservoirs and acid gas  mixtures in sour gas reservoirs, we found significant differences only at high capillary pressures, as anyone can expect, mostly located at the brine evaporation front in the near wellbore zone. The effects included changes in the composition of phases too, with likely related effects on geochemical equilibria between Aq and gas (Non-Aqueous) phases, and water-rock interactions.

      --------------

      By the way, I'm not a big fun of artificial intelligence. First of all, why calling it intelligence at all?

      But The Times They Are A-Changin', so people needs to live with that. Being an old-school guy, likely I'll never use AI tools.

Content aside

  • 9 hrs agoLast active
  • 6Replies
  • 29Views
  • 4 Following