Conceptual Models > Incorporation PHREEQC in programming languages

water saturation in phreeqcRM above 1

(1/2) > >>

oatteia:
Hello,
I am using phreeqcRM from a c code that does solutes dans gas transport (openfoam). So at each time step, I send to phreeqc the total pressure, the porosity, water saturation, the gas volume and the number of moles of each gas. They are non reactive gases (Mtg(g) and Ntg(g) as a start. And sometimes phreeqc provide very strange solutions, the pressure can rise a lot or decrease a lot, but what is strange is that if I provide a saturation of 0.99 at the start then it returns (for the same cell) a saturation of 1.005, will my problem of pressure may come from this?
sincerely
Olivier

dlparkhurst:
The saturation that is returned is calculated as the solution volume divided by the porosity times the representative volume (usually 1 L). So the value greater than 1 indicates that the calculated solution volume has changed during the geochemical calculation.

What you do with that information is up to you. I guess ideally, you would iterate with the flow code to account for the change in solution density and solution volume. I suspect most people just account for a density change for the next flow iteration.

The PhreeqcRM method  UseSolutionDensityVolume determines whether the values you specified with SetDensity and SetSaturation or the calculated values of density and volume are used to convert Phreeqc values (moles) to your model concentrations (usually per liter). Here is the description of the method from the manual:

UseSolutionDensityVolume(true/false)

Determines the volume and density to use when converting from the reaction-cell concentrations to transport concentrations (GetConcentrations). Two options are available to convert concentration units: (1) the density and solution volume calculated by PHREEQC are used, or (2) the specified density (SetDensity) and solution volume are determined by the product of saturation (SetSaturation), porosity (SetPorosity), and representative volume (SetRepresentativeVolume). Transport models that consider density-dependent flow will probably use the PHREEQC-calculated density and solution volume (default), whereas transport models that assume constant-density flow will probably use specified values of density and solution volume. Only the following databases distributed with PhreeqcRM have molar-volume information needed to accurately calculate density and solution volume: phreeqc.dat, Amm.dat, and pitzer.dat. Density is only used when converting to or from transport units of mass fraction.

oatteia:
Hello,
thanks david. Another question on the same topic : if phreeqc receives a given volume for a gas phase with a given pressure and during its calculation some gas is incorporated in the water, this will change the gas pressure, does phreeqc then also change the gas volume? because my case is just introducing Mtg at 85 atm pressure in a medium with Ntg at the same pressure (but as a residual gas phase with wsat = 0.99)

oatteia:
Hello,
me again, that was a stupid question, as the water amount remains constant, its density changes very few, so the volume of gas shall remain constant, so I still don't understand why in that case swat should change (when there is only exchange of gas like Mtg between the aqueous and gas phase, and there is no H2O(g) in the simulation)

dlparkhurst:
You don't say whether you are using a fixed_volume or fixed_pressure GAS_PHASE, so I assume it is -fixed_pressure. In that case, the volume of gas will vary with reactions, but the solution will see a constant pressure over the course of a time step. (If you are using parts per million (mass/mass), then it is necessary to use the values of SetDensity).

You also do not say which units you are using in transport. If units are per liter, the concentrations submitted with SetConcentrations are simply multiplied by the saturation (times representative volume) to get the number of moles of each component in solution. That volume may not be equal to the volume PhreeqcRM calculates for the solution volume from the moles of components.

A thought experiment, assuming no chemical reaction and no gas phase, is to submit transported concentrations to PhreeqcRM and allow it to calculate the solution volume using the molar volumes for aqueous species in the database. Most likely, the solution volume that is calculated is not equal to the saturation, which is what you observe. Because the solution mass input and output from PhreeqcRM is the same (no additions/subtractions from reaction), that means the density of solution differs between input and output. The way I think about it is that the transport calculation is not completely accounting for the changes in volumes or density for the transported solutions. It's too complicated for me, so I don't try to do variable-density, multi-phase flow.