The implementation of property calculations for edge cases (saturated liquid / vapor) is incorrect.
In [1]: import cantera as ct
...: w = ct.Water()
...: w.TP
Out[1]: (300.0, 101324.99996785645)
In [2]: w.cp_mass, w.thermal_expansion_coeff, w.isothermal_compressibility
Out[2]: (4180.788860505055, 0.0002739534956286111, 4.5370965768089256e-10)
In [3]: w.TP = 300, w.P_sat + 1 # compressed liquid
...: w.cp_mass, w.thermal_expansion_coeff, w.isothermal_compressibility
Out[19]: (4181.302071450938, 0.0002736968713794185, 4.5385398006526666e-10)
In [4]: w.TQ = 300, 0 # saturated liquid
...: w.cp_mass, w.thermal_expansion_coeff, w.isothermal_compressibility
Out[4]: (81268775.17346017, 66.66325231711855, 110675.13197217113)
In [5]: w.TQ = 300, 1 # saturated vapor
...: w.cp_mass, w.thermal_expansion_coeff, w.isothermal_compressibility
Out[5]: (81266465.29549846, 66.66325263277206, 2.834506650014112)
In [6]: w.TP = 300, w.P_sat - 1 # superheated vapor
...: w.cp_mass, w.thermal_expansion_coeff, w.isothermal_compressibility
Out[6]: (1871.4780865974458, 0.0033559522559820127, 0.00028393341634016384)
I.e. values jump to unreasonable values for edge cases (where properties are calculated based on one-sided differentials).
Problem description
The implementation of property calculations for edge cases (saturated liquid / vapor) is incorrect.
Steps to reproduce / Behavior
I.e. values jump to unreasonable values for edge cases (where properties are calculated based on one-sided differentials).
System information
Additional context
Documenting another bug found while investigating #907. There is a question whether these properties should be calculated at all (see #919)..
PS: The
cvcalculation is likewise affected (calculations for saturated mixtures yield unreasonable results).