Skip to content

Solubility

Methods

Coupled H2O–CO2 volatile solubility (dissolved-content) closures can be set with:

GeoParams.MaterialParameters.Solubility.Liu2005_Solubility Type
julia
Liu2005_Solubility(; coeffs=(b1..b6, c1..c4), Pref=1MPa, Tref=1K)

Coupled H2O–CO2 solubility for silicic (rhyolite) melt after Liu et al. (2005), as used by Degruyter & Huber (2014). compute_dissolved returns the dissolved H2O and CO2 mass fractions of the melt as a function of pressure, temperature, and the CO2 mole fraction of the gas X_co2:

mH2O=(b1Pw1/2+b2Pw+b3Pw3/2)TrefT+b4Pw3/2+Pc(b5Pw1/2+b6Pw)mCO2=Pc(c1+c2Pw)TrefT+Pc(c3Pw1/2+c4Pw3/2)

with the dimensionless partial pressures Pw=P(1Xco2)/Pref and Pc=PXco2/Pref. With Pref=1MPa, Tref=1K these equal the reference partial pressures in MPa and reproduce the Liu (2005) numbers; because they are ratios of like-dimensioned quantities, the closure is dimensionally homogeneous and nondimensionalizes cleanly. The fitted coeffs are dimensionless; isdimensional tracks the reference GeoUnits.

References

source
GeoParams.MaterialParameters.Solubility.Mafic_Solubility Type
julia
Mafic_Solubility(; coeffs=(b1..b10, c1..c4), T0=273.15K, Tref=1K, Pref=1MPa)

Coupled H2O–CO2 solubility for mafic (basalt) melt. Dissolved H2O follows the mafic polynomial of the Scholz/Degruyter–Huber reference in the dimensionless groups TC=(TT0)/Tref (numerically °C) and Pm=P/Pref (numerically MPa); dissolved CO2 reuses the Liu (2005) rhyolite CO2 block. Nondimensionalizes like Liu2005_Solubility. The H2O polynomial has no floor at zero and goes negative outside its calibration (high X_co2, low P); the dissolved H2O output is floored at zero rather than returned as a negative mass fraction.

References

source
GeoParams.MaterialParameters.Solubility.GasMixture Type
julia
GasMixture(; Cp_h2o=3880J/kg/K, Cp_co2=1200J/kg/K, M_h2o=18.02e-3kg/mol, M_co2=44.01e-3kg/mol)

H2O–CO2 gas-mixture properties keyed on the CO2 mole fraction of the gas X_co2 (Degruyter & Huber 2014). The effective molar mass is

mg=MH2O(1Xco2)+MCO2Xco2

and the mass-weighted specific heat is

cg=MH2OcH2O(1Xco2)+MCO2cCO2Xco2mg

with the reference convention cg=0 at Xco2=0 — a discontinuity, since the formula's own limit as Xco20 is cH2O.

All fields are GeoUnits, so the struct nondimensionalizes, but both accessors read values rather than Quantitys: neither return carries units.

source

Computational routines

To evaluate dissolved H2O and CO2 (mass fractions) within a user routine, use this:

GeoParams.MaterialParameters.Solubility.compute_dissolved Function
julia
compute_dissolved(s::AbstractSolubility, P, T, X_co2) -> (m_h2o, m_co2)

Dissolved H2O and CO2 mass fractions of the melt (P in Pa, T in K, X_co2 the CO2 mole fraction of the gas). Also callable as compute_dissolved(s; P, T, X_co2) and compute_dissolved(s, args::NamedTuple).

source
GeoParams.MaterialParameters.Solubility.compute_dissolved! Function
julia
compute_dissolved!(m_h2o, m_co2, MatParam, Phases, args)

In-place dissolved H2O and CO2 over a domain. args is a NamedTuple of P, T, X_co2 index-matched to the output arrays. Also accepts a single solubility or phase struct in place of (MatParam, Phases).

source

Partial derivatives (via ForwardDiff, useful for implicit/Newton solves) are available for pressure, temperature, and gas composition:

GeoParams.MaterialParameters.Solubility.∂dissolved_∂P Function
julia
∂dissolved_∂P(s, P, T, X_co2) -> (∂m_h2o/∂P, ∂m_co2/∂P)

ForwardDiff partial derivatives of compute_dissolved with respect to pressure. Companions ∂dissolved_∂T, ∂dissolved_∂Xco2.

source
GeoParams.MaterialParameters.Solubility.∂dissolved_∂T Function
julia
∂dissolved_∂T(s, P, T, X_co2) -> (∂m_h2o/∂T, ∂m_co2/∂T)
source
GeoParams.MaterialParameters.Solubility.∂dissolved_∂Xco2 Function
julia
∂dissolved_∂Xco2(s, P, T, X_co2) -> (∂m_h2o/∂X_co2, ∂m_co2/∂X_co2)
source

Given a target dissolved H2O content, the gas composition X_co2 that produces it can be found with:

GeoParams.MaterialParameters.Solubility.find_Xco2 Function
julia
find_Xco2(s::AbstractSolubility, P, T, m_h2o_target; X0=0.5, tol=1e-8, max_iter=50) -> X_co2

Invert compute_dissolved for the gas composition: solve for X_co2 ∈ [0,1] such that compute_dissolved(s, P, T, X_co2)[1] == m_h2o_target, at fixed pressure P and temperature T. Uses a safeguarded Newton iteration (via ∂dissolved_∂Xco2) bracketed by bisection, so an out-of-bounds Newton step always falls back to a bisection halving instead of leaving [0,1].

Throws an ErrorException if m_h2o_target is infeasible at this P,T (outside the achievable range between X_co2=0 and X_co2=1) or if the iteration fails to converge within max_iter steps — this never returns a clamped or out-of-tolerance answer.

source

Gas-mixture helpers for the energy equation:

GeoParams.MaterialParameters.Solubility.compute_gas_heatcapacity Function
julia
compute_gas_heatcapacity(s::GasMixture, X_co2)

Mass-weighted specific heat of the H2O–CO2 gas mixture; zero at X_co2 == 0 (reference convention).

source
GeoParams.MaterialParameters.Solubility.effective_molar_mass Function
julia
effective_molar_mass(s::GasMixture, X_co2)

Effective molar mass of the H2O–CO2 gas mixture at CO2 mole fraction X_co2.

source

Note that ε_g (exsolved-gas volume fraction) and X_co2 (CO2 mole fraction of the gas) are typically ODE state variables owned by the solver, not closed algebraically at a point — the closures above are the entries to that mass-balance, not a replacement for it.