The standard SystemSrkCPAstatoil water parameterization underpredicts liquid
isobaric heat capacity by about 8–17% between 5 and 60 °C near atmospheric
pressure. Its good density predictions do not establish caloric accuracy.
Issue #3762 is a model-calibration
limitation: numerical differentiation confirms the legacy getCp() agrees
with the legacy enthalpy derivative. The evidence does not establish a
missing association derivative.
Enable the calibrated water alpha
SystemSrkCPAstatoil fluid = new SystemSrkCPAstatoil(298.15, 1.01325);
fluid.setUseCaloricWaterAlpha(true);
fluid.addComponent("water", 1.0);
fluid.setMixingRule(10);
new ThermodynamicOperations(fluid).TPflash();
fluid.initProperties();
double cp = fluid.getPhase(0).getCp("J/kgK");
double density = fluid.getPhase(0).getDensity("kg/m3");
The same setter is accessible through the Python/JPype interface. It may be
called before or after adding water. Reflash and initialize properties after
changing it. setUseCaloricWaterAlpha(false) restores the legacy choice;
isUsingCaloricWaterAlpha() reports the selection. The default remains legacy
CPA. Following any change to the component list, set the mixing rule again.
The new choice changes the EOS attraction function, so fugacity, enthalpy, entropy, and heat capacities use its analytic derivatives consistently. It does not patch the reported heat capacity. Other components retain their existing attraction functions, including TEG. Water ideal-gas heat capacity, association energy/volume, covolume, and existing physical-property volume correction remain unchanged. Mixtures containing water can nevertheless change because the water attraction participates in the mixing rule.
Electrolyte CPA and dissolved salts
SystemElectrolyteCPAstatoil exposes the same opt-in in Java and through JPype.
Its legacy alpha is the default. The calibrated water attraction participates in the
cubic mixture term in every fluid phase. The electrolyte model combines it with CPA
association and the Fürst ion-solvent, ion-ion, and solvation contributions. The option
uses the existing electrolyte parameter tables.
SystemElectrolyteCPAstatoil brine = new SystemElectrolyteCPAstatoil(298.15, 1.01325);
brine.setUseCaloricWaterAlpha(true);
brine.addComponent("water", 55.508);
brine.addComponent("Na+", 1.0);
brine.addComponent("Cl-", 1.0);
brine.createDatabase(true);
brine.setMixingRule(10);
new ThermodynamicOperations(brine).TPflash();
brine.initProperties();
double cp = brine.getPhase("aqueous").getCp("J/kgK");
double brineDensity = brine.getPhase("aqueous").getWaterDensity("kg/m3");
For reactive brine, add the feed species and call chemicalReactionInit() before
createDatabase(true) and mixing rule 10. The alpha selection persists when reaction
species are added and when the fluid is cloned or serialized. Toggle with
setUseCaloricWaterAlpha(false), then reflash and initialize properties.
Brine benchmarks
NaCl results at 25 °C and 1.01325 bara. The heat-capacity reference is the near-ambient saturation-pressure tabulation in Phillips et al., LBL-12810, Appendix I, pp. 43 and 45.
| NaCl in solution | Legacy Cp, kJ/(kg K) | Caloric Cp, kJ/(kg K) | Reference Cp, kJ/(kg K) |
|---|---|---|---|
| 2 wt% | 3.562 | 4.072 | 4.075 |
| 5 wt% | 3.435 | 3.914 | 3.935 |
| 10 wt% | 3.235 | 3.666 | 3.732 |
- At 25 and 50 °C, all six NaCl Cp comparisons are within 3%. The 25–50 °C sensible enthalpy increments are within 2.4%, using temperature differences on both sides to cancel enthalpy reference offsets.
- For 0.5 and 1 mol/kg KCl at 25 °C, the bulk Cp errors are below 2%. The test converts the apparent molar Cp data in Partanen et al., Part 2, Table 1 and Equation 6, to a mass basis with IAPWS pure-water Cp. An independent 25–40 °C enthalpy comparison at 0.2 mol/kg KCl combines Part 1, Tables 7–9, with the IAPWS water increment and NIST-JANAF solid KCl. At 50 °C and 1.01325 or 44 bara, the heat capacities for 1 mol/kg NaCl and KCl also agree with the fixed-composition enthalpy derivative.
- At 25 °C, the NaCl water activities at 1, 2 and 3 mol/kg agree within 0.004 absolute with osmotic-coefficient references from Partanen and Partanen.
- At the same temperature,
getWaterDensity("kg/m3")uses the empirical Laliberté–Cooper aqueous density route. It agrees within 0.15% with the NaCl and KCl tables at the tested molalities. The EOS-basedgetDensity("kg/m3")is still 4.7% low for 10 wt% NaCl. The empirical density is a separate reporting property and does not enter equilibrium, EOS volumes, or thermodynamic derivatives. - At 50 °C, 50.3 bara and 1 mol/kg NaCl, the opt-in predicts 0.598 mol CO₂ per kg water versus 0.650 ± 0.058 in Messabeb et al. (NIST ThermoML). The reactive PH flash recovers the original TP temperature and enthalpy.
- For CO₂-saturated brines at 50 °C and 1 or 2 mol/kg NaCl, the default
getpH()output was 4.12 and 4.24 versus 3.17 and 3.18 in Haghi et al., Table 5. The alpha moves the default pH by less than 0.01 units in both cases. The measured comparison needs further work on the reaction and pH conventions.
These checks cover the listed states. Treat mixed salts, glycols, additional
pressures, precipitation, and hydrate equilibrium as separate qualification cases.
The tests are in ElectrolyteCPAWaterCaloricTest.
Equations and provenance
The reduced-temperature polynomial is
\[a(T)=a_0\alpha(T),\qquad \alpha(T)=\left[1+\sum_{j=1}^{5}c_j\left(1-\sqrt{T/T_c}\right)^j\right]^2.\]| Coefficient | Value |
|---|---|
| $c_1$ | 0.6670190973128074 |
| $c_2$ | -0.25656681951681287 |
| $c_3$ | 1.3687767086793399 |
| $c_4$ | -3.1891110889699097 |
| $c_5$ | 5.218580308820144 |
These are new NeqSim calibration coefficients, inspired by the flexible-alpha
approach of Palma, Queimada and Coutinho (2017).
They are not that paper’s parameter set. NeqSim retains its original water
$a_0=0.12277$ Pa m⁶/mol², $b=1.4515\times10^{-5}$ m³/mol,
association energy 16655 J/mol, association volume 0.0692, four-site 4C scheme,
and $T_c=647.3$ K. The five-coefficient polynomial implementation is reused from
AttractiveTermMatCop5PRUMR; only its algebra is reused, and the surrounding EOS
remains SRK-CPA. Attractive-term selector 23 is used internally.
Both $a’(T)$ and $a’‘(T)$ enter the existing residual Helmholtz derivatives. There is no hard temperature switch and no pressure- or phase-dependent heat-capacity multiplier. Thermodynamic checks include
\[C_p=\left(\frac{\partial H}{\partial T}\right)_{P,n} =T\left(\frac{\partial S}{\partial T}\right)_{P,n}.\]For mixtures these identities refer to a fixed-composition single phase; an equilibrium two-phase temperature derivative also includes redistribution between phases and need not equal the sum of phase heat capacities.
Calibration and independent validation
Training uses 12 temperatures at 5 °C intervals from 5 to 60 °C, at 1 bar. The objective includes relative liquid heat-capacity and untranslated density errors, plus liquid/vapour fugacity equality at the IAPWS saturation pressure:
\[J=\sum_k\left[\left(\frac{C_{p,k}/C_{p,k}^{\rm ref}-1}{0.02}\right)^2 +\left(\frac{\rho_k/\rho_k^{\rm ref}-1}{0.01}\right)^2 +\left(\frac{\ln(f_k^L/f_k^V)}{0.02}\right)^2\right].\]These scales are fitting weights, not experimental uncertainties. The density
term uses the unshifted EOS volume; production density acceptance separately
checks NeqSim’s existing volume-corrected getDensity("kg/m3") path. The fit does
not make untranslated density equivalent to the physical-property density.
Production results at 1.01325 bara (compressed/subcooled liquid, not saturated liquid at this pressure) are:
| Temperature, °C | Legacy Cp | Caloric-alpha Cp | IAPWS-95 Cp | Cp error | Density error |
|---|---|---|---|---|---|
| 5 | 3509.13 | 4203.82 | 4205.04 | -0.029% | +0.112% |
| 10 | 3546.42 | 4195.86 | 4195.16 | +0.017% | -0.007% |
| 25 | 3651.67 | 4181.82 | 4181.31 | +0.012% | -0.192% |
| 40 | 3746.86 | 4178.83 | 4179.41 | -0.014% | -0.191% |
| 60 | 3858.79 | 4186.15 | 4184.95 | +0.029% | +0.013% |
Cp is in J/(kg K). These temperatures are represented in the training data; the small pressure difference does not make this an independent temperature validation. The recomputed IAPWS-95 values differ slightly from the rounded values originally reported in the issue.
The checked-in CSV contains 49 stable liquid states and four steam states, including temperature holdouts at 7.5, 18, 32, 80, 100, 125, and 150 °C, and pressure holdouts at 10, 50, and 100 bara. The 55 °C points are correctly labelled as training temperatures. Regression gates require liquid Cp error below 2%, and physical density error below 0.5% only between 5 and 60 °C. Separate saturation-pressure tests cover 5–150 °C with a 2% acceptance band.
The independent pure-CPA evaluator also checks 37 states with temperatures excluded from fitting, reaching 150 °C and 100 bar; its maximum Cp error is 0.841%. Tests of the production implementation check Cp/enthalpy/entropy consistency, alpha derivatives, PH/PS closure, cloning, serialization, model selection, pure TEG, single-liquid water/MEG consistency, and preservation of steam Cp relative to the legacy model. Mixture consistency is not an experimental mixture-accuracy validation.
Reproduce the calibration
devtools/generate_water_caloric_alpha_reference.py contains an independent,
analytic pure-water 4C CPA evaluator and reads the existing water parameters
from COMP.csv. Optional research dependencies are NumPy, SciPy and iapws;
they are not NeqSim runtime dependencies.
uv run --project devtools --locked devtools/generate_water_caloric_alpha_reference.py --refit --output-dir /tmp/cpa-water-reference
./mvnw -Dtest=CPAWaterCaloricTest,ElectrolyteCPAWaterCaloricTest,SystemSrkCPAstatoilTest,PHFlashCPATest test
The checked-in src/test/resources/thermo/water_caloric_alpha_fit.json records
coefficients, fixed parameters, training data, independent holdouts, objective,
optimizer configuration and package versions. The adjacent
water_caloric_alpha_iapws95_reference.csv supplies the Java reference tests.
Reference values are calculations using iapws.IAPWS95 1.5.5, following
IAPWS R6-95(2018).
The optional GPLv3 reference package is used as a numerical oracle; its source
is not copied or incorporated into the Java implementation.
Literature assessment and limits
- Palma et al. (2017) use a five-parameter alpha and a broader pure-water parameter refit, with critical-point constraints and volume translation. They report saturated-liquid Cp average absolute deviation of 0.84%, compared with 7.43% for their original CPA comparison over 260–450 K. Their complete parameter replacement has a different density tradeoff; transplanting only their alpha coefficients is not valid. This implementation instead retains NeqSim’s existing association and covolume parameters.
- Zhu et al. (2020) examine heat capacities across EOS models and support explicitly considering caloric properties rather than inferring second-derivative accuracy from VLE alone.
- Novak, Liang and Kontogeorgis (2024) introduce interconverting water structures into PC-SAFT association. This is a candidate mechanism for water anomalies, but their atmospheric liquid Cp comparison reports 18.9% average absolute deviation: it is not evidence that a two-state term automatically solves the quantitative Cp bias here.
Recommended scope: opt-in pure liquid-water caloric calculations within the checked 5–150 °C and 1–100 bara envelope, above the saturation pressure. Density qualification is narrower: 5–60 °C. This is not IAPWS accuracy throughout that rectangle, and the listed checks do not establish a mathematical error bound. At 5 °C and 300 bar the independent evaluator already gives about +2.5% Cp error. Near-critical, supercritical, electrolyte, hydrate and mixture-property accuracy remain unqualified. Steam Cp is preserved, not newly validated to 2% against IAPWS; some pre-existing steam errors remain several percent.
A future water-structure term should be added to the residual Helmholtz energy, with consistent temperature, volume and composition derivatives, and fitted jointly to Cp/Cv, density/expansivity, sound speed, VLE and mixture data. A density-independent water correction applied to every phase would also change ideal-gas/steam caloric properties. A liquid-only Cp override would break the derivative identities used in energy and entropy flashes. The present results do not require either approach for the issue’s operating range.