Closed ctudpython closed 3 years ago
@ctudpython, can I take up this issue?
I confirmed that the exact same behavior is observed with WaterSSTP
(via #921 before fix was applied).
In [1]: import cantera as ct
...: water = ct.Water(backend='IAPWS95') # uses new option introduced in #921
...: water.TP
...:
Out[1]: (300.0, 101325.00031846752)
In [2]: water.P_sat
Out[2]: 3536.8066267992676
In [3]: water.TP = 287.9, 1e5
---------------------------------------------------------------------------
CanteraError Traceback (most recent call last)
<ipython-input-4-9394a227489f> in <module>()
----> 1 water.TP = 287.9, 1e5
/src/interfaces/cython/cantera/thermo.pyx in cantera._cantera.ThermoPhase.TP.__set__()
1296 T = values[0] if values[0] is not None else self.T
1297 P = values[1] if values[1] is not None else self.P
-> 1298 self.thermo.setState_TP(T, P)
1299
1300 property TPX:
CanteraError:
***********************************************************************
CanteraError thrown by WaterPropsIAPWS::corr:
Error occurred trying to find liquid density at (T,P) = 287.9 1678.1227333795669
***********************************************************************
There is a curious shift from compressed liquid to vapor, similar to the one observed in #721, although unlike in #721, both initial state and end state are in the compressed liquid phase.
Cantera version
2.4.0
Operating System
Windows 7 (Linux also tested)
Python/MATLAB version
3.6.5 (Anaconda distribution)
Description of the problem
When trying to use the PDSS module for non-ideal mixtures, the calculation of the water density crashes at exactly 287.9 K regardless of the pressure used. Other temperatures work just fine.
A small model to check this is to get the xml file for the solution of NaCl from the repository: https://github.com/Cantera/cantera/blob/master/test_problems/VCSnonideal/NaCl_equil/HMW_NaCl.xml and changing a few lines of code (18-23) to disable the solute molalities. We change from:
to
and we run this small code under jupyter notebook:
Then, the following error occurs:
And there we did not go deeper. It would give no convergence when called with the previous code, but it would work if we did the calculation alone with the supposed input data of the corresponding failed iteration.
For more data or questions, we would be glad to give/answer them, respectively.