SCO2 MODE boundary “Missing dof” error with RATE MASS_RATE

22 views
Skip to first unread message

Syed Hassan Ahmed

unread,
Mar 10, 2026, 3:09:10 PMMar 10
to pflotran-users

Dear PFLOTRAN developers and users,

I am a graduate student using the development version of PFLOTRAN for supercritical CO₂ (SCO2) flow with reactive transport, and I am encountering a persistent boundary-condition error that I cannot resolve from the documentation.

My setup:

  • SIMULATION_TYPE SUBSURFACE

  • SUBSURFACE_FLOW: MODE SCO2 with ISOTHERMAL_TEMPERATURE

  • SUBSURFACE_TRANSPORT: MODE GIRT with aqueous chemistry and mineral kinetics

  • Simple 1D structured grid (100 × 1 × 1), fully active cells

  • Two boundaries: west (injection) and east (production)

What I am trying to do:

  • Implement rate-controlled injection and production in SCO2 mode using
    FLOW_CONDITION with TYPE ... RATE MASS_RATE (as described in the FLOW_CONDITION / SCO2 documentation).

  • I have tried both:

    • Full “aqueous state” plus rate, and

    • Minimal rate-only and rate+pressure combinations.

Examples of FLOW_CONDITIONs I tried (and which all trigger the same error):

  1. Full aqueous state + rate:

text
FLOW_CONDITION inj TYPE RATE MASS_RATE LIQUID_PRESSURE DIRICHLET CO2_MASS_FRACTION DIRICHLET SALT_MASS_FRACTION DIRICHLET TEMPERATURE DIRICHLET / RATE 9.20d-1 0.d0 0.d0 kg/s LIQUID_PRESSURE 1.70d7 CO2_MASS_FRACTION 1.d-2 SALT_MASS_FRACTION 0.05d0 TEMPERATURE 50.d0 END
  1. Minimal, rate-only:

text
FLOW_CONDITION inj TYPE RATE MASS_RATE / RATE 9.20d-1 0.d0 0.d0 kg/s END

I pair these with:

text
BOUNDARY_CONDITION inj_bc FLOW_CONDITION inj TRANSPORT_CONDITION injection REGION west END

and similarly for a production boundary with a negative rate.

The error:

The input parses, grid is reported correctly, and then the run stops with:

text
ERROR: Error with SCO2_MODE phase boundary condition: Missing dof. Stopping!

This happens for any SCO2 FLOW_CONDITION that contains RATE MASS_RATE and is used in a BOUNDARY_CONDITION, even when it is the only TYPE entry. When I remove RATE and use only Dirichlet pressure/composition (pure “aqueous state”), the simulation runs fine.

What I have checked:

  • I have carefully followed the SCO2 FLOW_CONDITION TYPE specification, including the “Initial thermodynamic states for combinations of Dirichlet-based conditions” for Aqueous/Gas/Gas–Aqueous/Trapped Gas.

  • I have tested combinations that match exactly:
    LIQUID_PRESSURE + CO2_MASS_FRACTION (MASS_FRACTION) + SALT_MASS_FRACTION + TEMPERATURE for the aqueous state, without RATE.

  • Those Dirichlet-only SCO2 boundaries work, but any use of RATE MASS_RATE in SCO2 mode immediately triggers the “Missing dof” error.

My questions:

  1. Is RATE MASS_RATE actually supported in SCO2 mode in the development version I am using, or is it documented but not yet implemented/fully enabled for SCO2?

  2. If it is supported, could you please provide a small working example input snippet (FLOW_CONDITION + BOUNDARY_CONDITION) showing a valid SCO2 rate-controlled boundary?

  3. If it is not currently supported, is the recommended workaround to:

    • Use only Dirichlet pressure-based SCO2 boundaries and tune the pressure difference to approximate a constant rate?

    • Or is there another preferred way to impose rate control for SCO2 wells?

I can provide my minimal 1D input file if helpful, but the key behavior is that any FLOW_CONDITION with TYPE ... RATE MASS_RATE used in a BOUNDARY_CONDITION in SCO2 mode yields Error with SCO2_MODE phase boundary condition: Missing dof, while the same problem with pure pressure-based SCO2 BCs runs without issues.

Thank you very much for your time and for maintaining PFLOTRAN. Any guidance or a small working SCO2 example with RATE MASS_RATE would be greatly appreciated.

Best regards,
Hassan

Michael Nole

unread,
Mar 10, 2026, 3:29:10 PMMar 10
to pflotra...@googlegroups.com
Hassan,

RATE MASS_RATE should work. It seems like it might be expecting a thermal constraint in that rate (i.e., it thinks you are not using the isothermal version), so I would first double check how you are setting ISOTHERMAL_TEMPERATURE <double> and make sure that is correct. Then compare your setup to the short course example problems in pflotran/shortcourse/exercises/co2/sco2. Those have examples that use RATE MASS_RATE and have coupling to chemistry. Feel free to send your input deck along if you’re still stuck.

Michael

--
You received this message because you are subscribed to the Google Groups "pflotran-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pflotran-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pflotran-users/a721d7cc-7c91-436f-8f1f-d73ccdf98f64n%40googlegroups.com.

Syed Hassan Ahmed

unread,
Mar 11, 2026, 5:45:14 PMMar 11
to pflotra...@googlegroups.com
Michael,

Thankyou for your quick response.
I am still stuck in it. Here is my code. Kindly solve the problem as soon as possible.

Thank you
Hassan

You received this message because you are subscribed to a topic in the Google Groups "pflotran-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pflotran-users/1lrpRsJIBg8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pflotran-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pflotran-users/82A33636-9919-4986-8BD6-D7DB6AB72DFF%40gmail.com.
E.in

Michael Nole

unread,
Mar 11, 2026, 7:43:33 PMMar 11
to pflotra...@googlegroups.com
Hassan,

It looks like you are applying a FLOW_CONDITION with a RATE as BOUNDARY_CONDITION. Instead, apply it as SOURCE_SINK to the inside of the domain. BOUNDARY_CONDITIONs accept either DIRICHLET or NEUMANN conditions, whereas SOURCE_SINKs accept RATEs.

Michael

Syed Hassan Ahmed

unread,
Mar 12, 2026, 7:27:10 PMMar 12
to pflotra...@googlegroups.com

Dear Michael,

Thank you again for your guidance earlier.

I was able to get the model running, but currently the wells are being controlled by pressure rather than by a fixed injection/production rate. My goal is to inject and produce using a fixed mass rate.

I tried implementing the RATE MASS_RATE option with SOURCE_SINK, but I kept encountering the same “missing DOF” error and couldn’t resolve it. I believe I may still be missing something in the flow condition setup.

Would you be able to help modify the input file so the injector and producer operate at fixed rates instead of pressure control? I’ve been stuck on this for a while and would really appreciate your help.

Thank you very much for your time.

Best regards,
Hassan


D 1.in

Michael Nole

unread,
Mar 20, 2026, 10:56:02 AMMar 20
to pflotra...@googlegroups.com
Hassan,

I'd recommend starting simple and progressively making changes and testing until your model looks the way you want it to. There are a few issues with this model so I recommend:

Start from one of models in the shortcourse or regression test directories. 
Start with just a flow model before you add chemistry. 
Make sure you specify initial conditions everywhere. 
Set boundary conditions at cell faces. 
Use source/sinks inside of grid cells. 
It is not recommended to use a constant rate source and a constant rate sink in a model with no flow boundary conditions as this can easily become nonphysical.

Hope this helps,

Michael

Syed Hassan Ahmed

unread,
Mar 22, 2026, 4:00:57 PMMar 22
to pflotran-users
Hi Michael,

Thank you for your suggestions. I followed your advice and restructured the model based on the copper leaching example — using SCALED_MASS_RATE NEIGHBOR_PERM, a single pressure BC at the east face, and SOURCE_SINK regions inside the grid cells.

However, the simulation consistently crashes with a SIGABRT at global_aux.F90:383 whenever SOURCE_SINK is used together with SCO2 mode and GIRT reactive transport. The backtrace is:

  #9  global_aux_module_MOD_globalauxvarstrip  at global_aux.F90:383
  #10 global_aux_module_MOD_globalauxvararraydestroy  at global_aux.F90:358
  #11 global_aux_module_MOD_globalauxdestroy  at global_aux.F90:426

This happens with MASS_RATE, SCALED_MASS_RATE NEIGHBOR_PERM, and every other rate type I have tried. The simulation with pressure-only Dirichlet BCs (no SOURCE_SINK) runs successfully to 50 years with zero failures, so the chemistry and flow setup are correct.

Could this be a known bug in the development version with SCO2 + GIRT + SOURCE_SINK? I am attaching my input deck. Any guidance would be greatly appreciated.

Thank you,
Hassan Ahmed
Advisor: Dr. Kyung Jae Lee
Code link

Michael Nole

unread,
Mar 22, 2026, 6:56:36 PMMar 22
to pflotra...@googlegroups.com
Looks like it’s an issue with your transport constraint at initialization. I recommend sending your input deck to pflotr...@googlegroups.com as these PETSc errors should be handled with more descriptive error messaging. We recently reworked the copper leaching problem to use SCO2 Mode and well models, so I recommend using the version from our recent paper on SCO2 mode as a starting point instead. You can find the input deck zip file here:

Reply all
Reply to author
Forward
0 new messages