Re: Simulating headspace for a batch reactor system

60 views
Skip to first unread message

Hammond, Glenn E

unread,
Aug 21, 2025, 8:03:32 PMAug 21
to Kumar, Girish, pflotran-users
See my comments below in red.

Glenn

From: Kumar, Girish <girish...@austin.utexas.edu>
Date: Wednesday, August 20, 2025 at 3:09 PM
To: Hammond, Glenn E <glenn....@pnnl.gov>
Subject: RE: Simulating headspace for a batch reactor system

Check twice before you click! This email originated from outside PNNL.

Dear Glenn,

Hope you're doing well! 

I'm currently using PFLOTRAN to simulate a simple closed batch reaction system involving microbial (monod) reaction kinetics, but I'm stuck with some questions and unable to proceed. I posted this to the google group also just in case some of the users can help before you did. I'd highly appreciate if you or anybody from your PFLOTRAN support group can help clarify my questions. I've also attached the input deck and dbs file for reference.

volume of the closed system = 35 ml
volume of solution = 10 ml
volume of headspace = 35 - 10 = 25 ml

I have certain gas species in my system that partition to headspace and liquid assuming equilibrium partitioning via Henry's law and I have invoked appropriate primary and gas species in the dbs file. I'm having trouble understanding how to simulate headspace so that I know that when I constrain the aqueous forms of the gas species to certain partial pressure of the gas forms or directly specify their total concentrations, that the code will do equilibrium partitioning and distribute the mass of the species into headspace and liquid as the aqueous form of the species is being consumed during the course of the simulation (i.e., the mass/concentration of the species in the solution equilibrates with the mass in the headspace over the course of the simulation). 

Use solely transport, specify the REFERENCE_SATURATION and constraint against a gas partial pressure, and the code should distribute the mass.

I tried to specify a porosity of 1 and liquid saturation of 10 ml/35ml = 0.28 under MATERIAL_PROPERTY block so that PFLOTRAN knows there's headspace in the remaining pore space, but it doesn't allow me to specify LIQUID_SATURTAION under general mode. I'll have to perhaps use FLOW mode (RICHARDS) to specify saturation, but then I'm not sure how I would specify flow condition under such case since there's no flow involved in this batch system.

Here are my questions:

  1. Could you please help me understand/simulate this system with headspace and specific blocks correction I may have to introduce in the attached input deck?
Try the attached. I added the REFERENCE_SATURATION and GASES to CHEMISTRY OUTPUT.
  1. Do I need to include PASSIVE_GAS_SPECIES in addition to ACTIVE_GAS_SPECIES to simulate the gas partitioning appropriately. Frankly, I don't completely understand the difference between or the use cases for Active and Passive gas species blocks (i.e., when to use either or both). The documentation does explain a bit, but could you please further clarify?
Any gas species that is explicitly simulated as a gas species in the gas phase, needs to be an ACTIVE_GAS_SPECIES. PASSIVE_GAS_SPECIES are often needed when a gas is a reactant in a database reaction (e.g., O2(g) is often used in redox species for aqueous complexes and minerals). Passive gas species are also needed in CONSTRAINTS for constraining against a gas partial pressure.
  1. How can I print gas concentrations in the headspace in the output? It was definitely not possible in the General mode and was throwing me an error when I did, so I believe the option to print this opens up only in FLOW mode? 
Add the name of the gas species or GASES (for all) to the CHEMISTRY OUTPUT block.
  1. Also, how does PFLOTRAN exactly define the parameter "Yield" in Monod kinetics? What are the units of yield in PFLOTRAN? Any typical range of values you recommend for this parameter to start with (I've usually seen you use 1e-4 for this parameter in most examples)? I have usually come across yield coefficient being defined in terms of portion of electron/energy that goes to biomass growth vs substrate utilization (i.e., ratio of max substrate utilization rate to the biomass production/growth rate).
I agree with you. See Eq. 14 in the attached paper. Think of the yield as a stoichiometry.  For every mole of reaction, how many of those moles produce biomass. Let’s discuss further if this does not make sense. You can also see where yield is used in the code at:

Please let me know if any of my questions are unclear.

Thanks,
Girish

Girish Kumar, PhD
Research Associate
Maseeh Department of Civil, Architectural and Environmental Engineering

Cockrell School of Engineering  

The University of Texas at Austin

Work Email: girish...@austin.utexas.edu

Personal Email: girish...@gmail.com
Mobile: 312-721-7864


Hammond, 2022.pdf
pflotran.in

Kumar, Girish

unread,
Aug 25, 2025, 3:48:07 PMAug 25
to Hammond, Glenn E, pflotran-users
Hello Glenn, 

Thanks so much for your response and clarifications. The changes you suggested worked. I'll let you know if I run into any other issues.

Regards,
Girish





From: Hammond, Glenn E <glenn....@pnnl.gov>
Sent: Thursday, August 21, 2025 7:03 PM
To: Kumar, Girish <girish...@austin.utexas.edu>; pflotran-users <pflotra...@googlegroups.com>
Subject: Re: Simulating headspace for a batch reactor system
 
This message is from an external sender. Learn more about why this matters.

Kumar, Girish

unread,
Oct 28, 2025, 12:09:49 PM (10 days ago) Oct 28
to pflotra...@googlegroups.com
Hello Glenn,

Thanks for taking time to respond. I like your suggestion. I wasn't aware that you could specify a flow condition to the west and east side of the top cell only and that the remainder of the west and east side is treated as no flow by the code, if not specified. Is my understanding correct? I thought that you are allowed to apply the boundary condition to the entire face and no just parts of the face. Simulating the flow in the top grid cell is not very important given the scale of the experiment, so just the flow rate passing through the top grid cell is fine and the mass flux calculation on the east side of the top grid cell should be okay for comparison with data.

But I have the below follow-up questions for this set-up:

  • Do I have to invoke Richards mode for the volumetric rate? From the documentation, it looks like the general mode doesn't have it.  
  • How do I specify a porosity of 1 and/or a liquid saturation of 1 in the top grid cell so as to simulate just water passing through, and a different porosity for the clay? Should I define two material property cards one for water and one for clay and define respective porosities there?
  • In this experimental set-up eventually, I would like to simulate some electron donor at a certain concentration in the flushing solution which can diffuse into the clay from the top. In this case, how do we define a chemical constraint for top grid cell? In this case, should we define a source/sink and apply a transport condition with a chemical constraint list specifying the concentration of the donor, and will it be held constant throughout the top grid cell for the duration of the simulation?

I haven't worked with flow as such in PFLOTRAN. Do you happen to have the input deck for an example problem, or can you point me to one that might have these elements in it in the exercises or the tests?

Thanks so much for your help!

Regards,
Girish    

Girish Kumar, PhD
Research Associate
Maseeh Department of Civil, Architectural and Environmental Engineering

Cockrell School of Engineering  

The University of Texas at Austin




From: Hammond, Glenn E <glenn....@pnnl.gov>
Sent: Monday, October 27, 2025 6:14 PM
To: Kumar, Girish <girish...@austin.utexas.edu>

Subject: Re: Simulating headspace for a batch reactor system
 
Girish,

What do you think of the following?  Use a 1D vertical column with lateral flow through the top grid cell to flush the diffused tracer. The top and bottom boundaries of the column have no flow while the east/west sides of the top cell have a specified flow rate and ZERO_GRADIENT transport conditions applied to either side (to ensure solely advective fluxes [sweeping out the tracer]). You could also use a NEUMANN flow condition on one side and a DIRICHLET on the other if you are modeling flow.

Thoughts?

Glenn
image.png

From: Kumar, Girish <girish...@austin.utexas.edu>
Date: Friday, October 24, 2025 at 10:23 AM
To: Hammond, Glenn E <glenn....@pnnl.gov>
Subject: Re: Simulating headspace for a batch reactor system

Dear Glenn,

Hope you are doing well! 

I'd like your suggestion on a capability in PFLOTRAN for a 1D diffusion problem that I'm trying to simulate and describe below. I have simplified the system to focus on the issue, while the real problem I'm simulating involves many reactions that can be added later.

I have a diffusion column of about 8 cm long 3.5 cm in diameter filled with clay. I have a chemical (say a Tracer) with fixed concentration at the bottom of the domain. The initial concentration within the domain is zero. The top boundary is flushed with pure water pumped from a reservoir flask at a specific volumetric flow rate (in L/day). We monitor the effluent concentration (i.e., concentration of the Tracer diffusing out of the top of the domain in the flushed water) to plot the breakthrough curve for the Tracer. Now the issue is that, initially I was trying to apply a Dirichlet boundary condition of zero concentration at the top boundary assuming that the advective flow of the flush water is high enough that the concentration of Tracer could be assumed zero. However, based on Peclet number for this system, I see that the flow rate is not high enough, so a zero-concentration boundary condition won't be suitable to match the measured concentration in the effluent. 

I would like to know if there's any way we can simulate this flushing effect at the top in PFLOTRAN such that there is flow at a specific flow rate parallel to the top boundary that takes out the diffusive flux of the Tracer at the top. I have provided a simple schematic of the set-up below. I have also attached the input deck and the database file for your review and suggestions. I'd greatly appreciate your help in figuring this out.



Thanks,
Girish


Girish Kumar, PhD
Research Associate
Maseeh Department of Civil, Architectural and Environmental Engineering

Cockrell School of Engineering  

The University of Texas at Austin


This message is from an external sender. Learn more about why this matters.

Hammond, Glenn E

unread,
Oct 28, 2025, 3:26:28 PM (10 days ago) Oct 28
to pflotra...@googlegroups.com
Girish,

Please see my responses in red below.

Glenn

From: pflotra...@googlegroups.com <pflotra...@googlegroups.com> on behalf of Kumar, Girish <girish...@austin.utexas.edu>
Date: Tuesday, October 28, 2025 at 9:09 AM
To: pflotra...@googlegroups.com <pflotra...@googlegroups.com>
Subject: [pflotran-users: 8604] Re: Question on simulating flushing effect in PFLOTRAN

Check twice before you click! This email originated from outside PNNL.

Hello Glenn,

Thanks for taking time to respond. I like your suggestion. I wasn't aware that you could specify a flow condition to the west and east side of the top cell only and that the remainder of the west and east side is treated as no flow by the code, if not specified. Is my understanding correct? 

PFLOTRAN grids are inherently three-dimensional (3D). Boundary conditions can be assigned to any of the six faces, assuming a structured grid format. By default, all boundary faces are set to "no flow." However, boundary conditions can be applied on a cell-by-cell basis using regions that define either individual cell faces or groups of multiple cell faces.
This approach ensures flexibility and precision when specifying boundary parameters within the grid.

I thought that you are allowed to apply the boundary condition to the entire face and no just parts of the face. Simulating the flow in the top grid cell is not very important given the scale of the experiment, so just the flow rate passing through the top grid cell is fine and the mass flux calculation on the east side of the top grid cell should be okay for comparison with data.

But I have the below follow-up questions for this set-up:

  • Do I have to invoke Richards mode for the volumetric rate? From the documentation, it looks like the general mode doesn't have it.  
    • No. You can specify the flow rate for transport only. Note that the specified Darcy fluxes only apply to internal and boundary connections. Faces that are no flow on the boundary will have a zero Darcy flux.
  • How do I specify a porosity of 1 and/or a liquid saturation of 1 in the top grid cell so as to simulate just water passing through, and a different porosity for the clay? Should I define two material property cards one for water and one for clay and define respective porosities there?
    • Specify a separate region for the head space with different material property (porosity = 1) and couple them with the STRATA card.
  • In this experimental set-up eventually, I would like to simulate some electron donor at a certain concentration in the flushing solution which can diffuse into the clay from the top. In this case, how do we define a chemical constraint for top grid cell? In this case, should we define a source/sink and apply a transport condition with a chemical constraint list specifying the concentration of the donor, and will it be held constant throughout the top grid cell for the duration of the simulation?
    • Use a ZERO_GRADIENT transport condition for the side of the top call. ZERO_GRADIENT will prevent diffusion upwind through the inlet. No need for a source/sink as the Darcy flux assigned to the inlet is the volumetric flux (when multiplied by the face area).

I haven't worked with flow as such in PFLOTRAN. Do you happen to have the input deck for an example problem, or can you point me to one that might have these elements in it in the exercises or the tests?

See the attached example. The pflotran-mas.dat file stores the global, inlet, and outlet mass fluxes for the tracer. You can swap in your chemistry once you like the transport solution. I note that to me it seems that the mass is diffusing out slower than I would expect. You may want to verify the solution against an analytical solution.
--
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/PH8PR06MB92234E9CE84713A649C36220D4FDA%40PH8PR06MB9223.namprd06.prod.outlook.com.
girish_flushing.in

Girish Kumar

unread,
Oct 31, 2025, 3:34:57 PM (7 days ago) Oct 31
to pflotran-users
Hello Glenn,

Thanks for the clarification. 

In the example input deck you had provided, I see that you specify a uniform velocity in the X-direction to specify flow from west to east. But doesn't this impose the flow across the entire west face and not just the west face of the top grid cell? 

OR

Is PFLOTRAN coded such a way that if a boundary condition is specified to any face of a grid cell, the specified uniform flow applies only to that face and not the entire west face of the domain, because there is no boundary condition specified to the remainder of the west face of the domain?

I'd appreciate your clarification.

Thanks,
Girish

Hammond, Glenn E

unread,
Oct 31, 2025, 5:36:24 PM (7 days ago) Oct 31
to pflotra...@googlegroups.com
When a uniform velocity is imposed on a grid, it is applied to all internal connections as well as boundary connections. However, if a boundary face (defined as a face that is not shared and is referenced by only one cell) is set to "no flow" (the default setting), no flux or velocity is assigned to that face. Essentially, the velocity does not apply to such faces.

In the specific scenario I shared, an X-direction velocity is assigned. Since all internal connections lie within the YZ plane, this prescribed velocity has no impact on internal flow, as it is orthogonal to all internal connections. However, the top cell includes two boundary connections: one to the west and one to the east (along the X direction). These boundary connections inherit the assigned velocity.

See specific answers below in red.

Glenn

From: pflotra...@googlegroups.com <pflotra...@googlegroups.com> on behalf of Girish Kumar <girish...@gmail.com>
Date: Friday, October 31, 2025 at 12:38 PM
To: pflotran-users <pflotra...@googlegroups.com>
Subject: [pflotran-users: 8611] Re: Question on simulating flushing effect in PFLOTRAN

Hello Glenn,

Thanks for the clarification. 

In the example input deck you had provided, I see that you specify a uniform velocity in the X-direction to specify flow from west to east. But doesn't this impose the flow across the entire west face and not just the west face of the top grid cell? 

The velocity only applied to faces that have a boundary condition assigned to them.

OR

Is PFLOTRAN coded such a way that if a boundary condition is specified to any face of a grid cell, the specified uniform flow applies only to that face and not the entire west face of the domain, because there is no boundary condition specified to the remainder of the west face of the domain?

Correct.
Reply all
Reply to author
Forward
0 new messages