Problems calculating the saturation vapor pressure of aqueous solutions containing only water #285
Replies: 4 comments 21 replies
-
Hi @martinvoigt , your code works after changing the upper bound pressure from 1000 bar to 2000 bar. It prints:
However, if we compute the saturation pressure of water at 10 °C using the Wagner & Pruss (1995) EOS: Psat = rkt.waterSaturationPressureWagnerPruss(10 + 273.15)
print(Psat) we get 1228.11 bar. The difference is because Peng-Robinson is not as accurate for water vapor as Wagner-Pruss. Something I tend to do when the calculation does not succeed is to print the log of the computation: options = EquilibriumOptions()
options.optima.output.active = True
solver.setOptions(options) You would most likely find out that the iterations got stuck on the upper bound 1000 bar, because pressure could not go beyond this value. I see you are using |
Beta Was this translation helpful? Give feedback.
-
Hi Martin, I investigated this a bit more. You are using a PHREEQC database. Reaktoro will then resort to the same equation of state for water used in PHREEQC, which depends on first computing the density of water along the saturation pressure line and then interpolating to the desired pressure. I believe this is the reason why computing saturation pressure of pure water fails when PHREEQC databases are used. We would need to replace this simplified water EOS by the full Wagner & Pruss EOS. The SUPCRT databases supported in Reaktoro will actually use Wagner & Pruss EOS. However, the calculation still fails. Now, for a different reason I believe. I recently improved the performance of this WP-EOS by creating a large table of densities for given T,P across a wide range. An approximate density can be quickly extracted from this table for a given (T, P) condition. This is then used as initial guess in the solution of the WP-EOS (i.e., the full EOS will refine the density and other properties). However, it's important to ensure that for the aqueous phase, initial guess for density reflects a liquid density. I think a gaseous density is being retrieved from this table and this, as an initial guess for the WP-EOS, ends up producing vapor-like properties instead of liquid-like ones. I'll try to ensure that liquid densities are always produced for the aqueous solution (no matter the current value of P in the iterations) and then determine if this solves the issue (when using SUPCRT databases). However, I think if water saturation properties are really needed, then it's best to just use the available methods that compute it rather quickly, e.g., In summary, I'd say that vapor pressure calculations for brines will work just fine with the setup above as long as the aqueous solution does not collapse into pure water. |
Beta Was this translation helpful? Give feedback.
-
Just discovered that the issue lies on how Peng-Robinson EOS behaves. If you replace Peng-Robinson by Redlich-Kwong, you should get the desired saturation pressures when the solution is pure water: gases.setActivityModel(rkt.ActivityModelRedlichKwong()) Executing the script below produces Psat = 0.0123 bar (WG-EOS produces 0.01228 bar) at 10 °C: from reaktoro import *
db = PhreeqcDatabase('phreeqc.dat')
solution = AqueousPhase()
solution.setActivityModel(ActivityModelDavies())
gases = GaseousPhase("CO2(g) H2O(g)")
gases.set(ActivityModelRedlichKwong())
system = ChemicalSystem(db, solution, gases)
specs = EquilibriumSpecs(system)
specs.temperature()
specs.phaseAmount("GaseousPhase")
solver = EquilibriumSolver(specs)
state = ChemicalState(system)
state.set("H2O", 1.0, "kg")
conditions = EquilibriumConditions(specs)
conditions.temperature(10, "celsius")
conditions.phaseAmount("GaseousPhase", 1, "umol")
conditions.setLowerBoundPressure(0.001, "bar")
conditions.setUpperBoundPressure(2000, "bar")
res = solver.solve(state, conditions)
assert res.succeeded()
print(state) At 50 °C, the script above produces 0.1215 bar (WG-EOS produces 0.12352 bar). At least now I know that there is nothing fundamentally wrong. What is happening is that Peng-Robinson is producing liquid-like properties for the gas phase because at these temperature and pressure conditions, the liquid state is more stable (perhaps by a tiny numerical margin under these conditions). So, I need to revisit this and ensure that thermodynamic properties are always gas-like. |
Beta Was this translation helpful? Give feedback.
-
Hi @martinvoigt , just to let you know that in the next release (possibly tomorrow), we'll have a new
|
Beta Was this translation helpful? Give feedback.
-
I ran into a problem where the solver is not able to find the correct or any solution for a simple case.
Essentially, it's about finding the water vapor pressure:
Without adding the CO2 (or adding very little), the pressure should be quite low at 10 °C, essentially the water vapor pressure, something like 0.01 bar. However, the solver doesn't converge and seems to go to the 100 bar upper bound.
I played around a bit with the bounds, as well as using other activity models, GasPhase amounts, etc, but didn't manage to get the right solution. It works fine with adding substantial amounts of CO2 (removing the # in the code above).
What's the problem here, and how do I solve this so that the code works robustly for both no/little amounts of CO2 as well as substantial amounts of CO2?
Beta Was this translation helpful? Give feedback.
All reactions