Skip to content

Commit

Permalink
[Thermo] Use min/max temperatures from equation of state
Browse files Browse the repository at this point in the history
The values in the liquidvapor.cti should be ignored, since this thermo data is
not actually applicable -- it is just used to set the reference state.
  • Loading branch information
speth committed Dec 3, 2017
1 parent 501b5fd commit 2ac8a0e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/cantera/thermo/PureFluidPhase.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class PureFluidPhase : public ThermoPhase
m_tpx_name = name;
}

virtual double minTemp(size_t k=npos) const;
virtual double maxTemp(size_t k=npos) const;

virtual doublereal enthalpy_mole() const;
virtual doublereal intEnergy_mole() const;
virtual doublereal entropy_mole() const;
Expand Down
5 changes: 5 additions & 0 deletions interfaces/cython/cantera/test/test_purefluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ def test_critical_properties(self):
self.assertNear(self.water.critical_temperature, 647.286)
self.assertNear(self.water.critical_density, 317.0)

def test_temperature_limits(self):
co2 = ct.CarbonDioxide()
self.assertNear(co2.min_temp, 216.54)
self.assertNear(co2.max_temp, 1500.0)

def test_set_state(self):
self.water.PX = 101325, 0.5
self.assertNear(self.water.P, 101325)
Expand Down
10 changes: 10 additions & 0 deletions src/thermo/PureFluidPhase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ void PureFluidPhase::setParametersFromXML(const XML_Node& eosdata)
}
}

double PureFluidPhase::minTemp(size_t k) const
{
return m_sub->Tmin();
}

double PureFluidPhase::maxTemp(size_t k) const
{
return m_sub->Tmax();
}

doublereal PureFluidPhase::enthalpy_mole() const
{
setTPXState();
Expand Down

0 comments on commit 2ac8a0e

Please sign in to comment.