#include <steamcalculator.h>


Public Member Functions | |
| SteamCalculator () | |
| Constructor. | |
| SteamCalculator (const SteamCalculator &original) | |
| Copy constructor. | |
| SteamCalculator const & | operator= (SteamCalculator const &original) |
| Assignment operator (assigns a copy). | |
| virtual | ~SteamCalculator () |
| Destructor. | |
| void | set_pT (const Pressure &p, const Temperature &T, double x=1.0) |
| Set the steam conditions by pressure, temperature and optionally quality. | |
| template<class F, class S> | |
| void | set (const F &f, const S &s) |
| void | setSatSteam_p (const Pressure &p) |
| Set state to be saturated steam at a specified pressure. | |
| void | setSatWater_p (const Pressure &p) |
| Set state to be saturated water at a specified pressure. | |
| void | setSatWater_T (const Temperature &T) |
| Set state to be saturated water at a specified temperature. | |
| void | setSatSteam_T (const Temperature &T) |
| Set state to be saturated steam at a specified temperature. | |
| void | setB23_T (const Temperature &T) |
| Set properties on B23 curve given temperature. | |
| void | setB23_p (const Pressure &p) |
| Set properties on B23 curve given pressure. | |
| void | setRegion1_pT (const Pressure &p, const Temperature &T) |
| void | setRegion2_pT (const Pressure &p, const Temperature &T) |
| void | setRegion4_Tx (const Temperature &T, const Num &x) |
| void | setRegion3_rhoT (const Density &rho, const Temperature &T) |
| Direct setting of rho,T for Region 3. | |
| bool | isSet (void) const |
| Has the state of the SteamCalculator been initialised? | |
| int | whichRegion (void) const |
| Get the region for the present SteamCalculator (1 to 4, according to IAPWS). | |
| const SteamCalculator & | getGasPart () const |
| const SteamCalculator & | getLiquidPart () const |
| SteamStateCode | whichState (void) |
| Get the state for the present SteamCalculator. | |
| const char * | whichStateStr (void) |
| Get a string version of steam state. | |
| Temperature | temp () const |
| Temperature. | |
| Pressure | pres () const |
| Pressure. | |
| Density | dens () const |
| Density, eg kg/m³. | |
| SpecificVolume | specvol () const |
| Specific volume, eg m³/kg. | |
| SpecificEnergy | specienergy () const |
| Specific internal energy, eg kJ/kg. | |
| SpecificEntropy | specentropy () const |
| Specific entropy, eg kJ/kg. | |
| SpecificEnergy | specenthalpy () const |
| Specific enthalpy, eg kJ/kg. | |
| SpecHeatCap | speccp () const |
| Specific isobaric hear capacity, eg kJ/kgK. | |
| SpecHeatCap | speccv () const |
| Specific isochoric heat capacity, eg kJ/kgK. | |
| Num | quality () const |
| Steam quality (if saturated). | |
| DynamicViscosity | dynvisc () const |
| Dynamic viscosity, mu, [µPa.s]. | |
| ThermalConductivity | conductivity () const |
| Conductivity [mW/m.K]. | |
| SurfaceTension | surftens () const |
| virtual bool | isValid (void) const |
| Used for design-by-contract IS_VALID tests:. | |
| virtual void | copy (const SteamCalculator &original) |
| Copy operation, virtual. | |
| template<> | |
| void | set (const Pressure &p, const Temperature &T) |
| template<> | |
| void | set (const Temperature &T, const Pressure &p) |
Protected Member Functions | |
| Num | tau_iaps85 () const |
| Reduced temperature for IAPWS conductivity calculation. | |
| Num | del_iaps85 () const |
| Reduced density for IAPWS conductivity calculation. | |
| Num | pi_iaps85 () const |
| Reduced pressure for IAPWS conductivity calculation. | |
| Num | delpi_iaps85 () const |
| Num | pitau_iaps85 () const |
| Num | lam (const Num &Tbar, const Num &rhobar) const |
| Reduced thermal conductivity. | |
| Num | lam0 (const Num &Tbar) const |
| Ideal-gas limit for thermal conductivity, lamda_0. | |
| Num | lam1 (const Num &rhobar) const |
| Density adjustment for thermal conductivity. | |
| Num | lam2 (const Num &Tbar, const Num &rhobar) const |
| Used in the calculation of reduced thermal conductivity. | |
| Num | mu () const |
| Num | mu0 () const |
| Num | mu1 () const |
| Num | mu2 () const |
| Pressure | getRegion3PressureError (const Density &test_rho) |
Protected Attributes | |
| Temperature | T |
| Temperature K. | |
| Pressure | p |
| Pressure MPa. | |
| Density | rho |
| Density, used by Region 3 only. | |
| Num | x |
| Quality, used by Region 4. | |
| Num | tau |
| Internal variable in IAPWS calcs. | |
| Num | pi |
| Internal variable in IAPWS calcs. | |
| Num | del |
| Internal variable in IAPWS calcs. | |
| Pressure | reg3_target_pressure |
| Internal variable used in root-finding in region 3. | |
Friends | |
| class | SteamState |
| class | Region1 |
| class | Region2 |
| class | Region3 |
| class | Region4 |
| class | ZeroIn< SteamCalculator, Pressure, Density > |
/home/john/freesteam/solver.h, and /home/john/freesteam/steamcalculator.h.
| SteamCalculator::SteamCalculator | ( | ) |
| SteamCalculator::SteamCalculator | ( | const SteamCalculator & | original | ) |
Copy constructor.
This function creates a new uninititalised SteamCalculator, or else clones an existing one.
References copy().
| SteamCalculator::~SteamCalculator | ( | ) | [virtual] |
Destructor.
| SteamCalculator const & SteamCalculator::operator= | ( | SteamCalculator const & | original | ) |
| void SteamCalculator::set_pT | ( | const Pressure & | p, | |
| const Temperature & | T, | |||
| double | x = 1.0 | |||
| ) |
Set the steam conditions by pressure, temperature and optionally quality.
| p | pressure | |
| T | temperature | |
| x | quality (only if saturated) |
References ASSERT, ENSURE, Boundaries::getpbound_T(), SteamState::getRegion(), Boundaries::getSatDensSteam_T(), Boundaries::getSatPres_T(), Region3::Instance(), Region4::Instance(), Region2::Instance(), Region1::Instance(), P_MAX, P_MIN, pres(), REQUIRE, SteamState::set_pT(), setRegion3_rhoT(), T_CRIT, T_MAX, T_MIN, TB_LOW, and whichRegion().
Referenced by freesteam_region_ph(), Region3::set_pT(), B13Curve< Ordinate, Pressure, OrdinateAlt, 0 >::solve(), Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::solveRegion3(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
| void SteamCalculator::set | ( | const F & | f, | |
| const S & | s | |||
| ) | [inline] |
| void SteamCalculator::setSatSteam_p | ( | const Pressure & | p | ) |
Set state to be saturated steam at a specified pressure.
References ENSURE, EPS_T_CRIT, Boundaries::getSatTemp_p(), Region2::Instance(), P_CRIT, REG4_P_MIN, REQUIRE, SteamState::set_pT(), T, T_CRIT, and T_MIN.
| void SteamCalculator::setSatWater_p | ( | const Pressure & | p | ) |
Set state to be saturated water at a specified pressure.
References ASSERT, EPS_T_CRIT, Boundaries::getSatTemp_p(), Region1::Instance(), Region3::Instance(), P_CRIT, PB_LOW, REG4_P_MIN, REQUIRE, SteamState::set_pT(), T, T_CRIT, and T_MIN.
| void SteamCalculator::setSatWater_T | ( | const Temperature & | T | ) |
Set state to be saturated water at a specified temperature.
References Boundaries::getSatDensWater_T(), Boundaries::getSatPres_T(), Region1::Instance(), REQUIRE, SteamState::set_pT(), setRegion3_rhoT(), T_CRIT, T_TRIPLE, and TB_LOW.
Referenced by freesteam_region_ph(), Region4::set_pT(), setRegion4_Tx(), SatCurve< Ordinate, Temperature, OrdinateAlt, 0 >::solve(), SatCurve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
| void SteamCalculator::setSatSteam_T | ( | const Temperature & | T | ) |
Set state to be saturated steam at a specified temperature.
References Boundaries::getSatDensSteam_T(), Boundaries::getSatPres_T(), Region2::Instance(), p, REQUIRE, SteamState::set_pT(), setRegion3_rhoT(), T_CRIT, T_TRIPLE, and TB_LOW.
Referenced by Region4::set_pT(), setRegion4_Tx(), SatCurve< Ordinate, Temperature, OrdinateAlt, 0 >::solve(), SatCurve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
| void SteamCalculator::setB23_T | ( | const Temperature & | T | ) |
Set properties on B23 curve given temperature.
References ASSERT, ENSURE, Boundaries::getpbound_T(), Region2::Instance(), MPa, p, PB_LOW, REQUIRE, SteamState::set_pT(), T_MAX, T_MIN, TB_HIGH, and whichRegion().
Referenced by B23Curve< Ordinate, Temperature, OrdinateAlternative, 0 >::solve(), B23Curve< Ordinate, Abscissa, OrdinateAlternative, AbscissaAlternative >::solve(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
| void SteamCalculator::setB23_p | ( | const Pressure & | p | ) |
Set properties on B23 curve given pressure.
References ASSERT, ENSURE, Boundaries::getTbound_p(), Region2::Instance(), P_MAX, PB_LOW, REQUIRE, SteamState::set_pT(), T, TB_HIGH, TB_LOW, and whichRegion().
| void SteamCalculator::setRegion1_pT | ( | const Pressure & | p, | |
| const Temperature & | T | |||
| ) |
References ASSERT, Region1::Instance(), Boundaries::isRegion1_pT(), and SteamState::set_pT().
Referenced by Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::makeRegion1Guess().
| void SteamCalculator::setRegion2_pT | ( | const Pressure & | p, | |
| const Temperature & | T | |||
| ) |
References ASSERT, Region2::Instance(), Boundaries::isRegion2_pT(), and SteamState::set_pT().
Referenced by Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::makeRegion2Guess().
| void SteamCalculator::setRegion4_Tx | ( | const Temperature & | T, | |
| const Num & | x | |||
| ) |
References ASSERT, Region4::Instance(), Boundaries::isSat_Tx(), setSatSteam_T(), setSatWater_T(), SteamCalculator(), T_CRIT, and T_TRIPLE.
| void SteamCalculator::setRegion3_rhoT | ( | const Density & | rho, | |
| const Temperature & | T | |||
| ) |
Direct setting of rho,T for Region 3.
References del, ENSURE, Region3::Instance(), isnan(), REG3_DENS_REF, REG3_TEMP_REF, REQUIRE, RHO_CRIT, T_CRIT, tau, whichRegion(), and x.
Referenced by freesteam_region_ph(), set_pT(), setSatSteam_T(), setSatWater_T(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
| bool SteamCalculator::isSet | ( | void | ) | const |
Has the state of the SteamCalculator been initialised?
Referenced by isValid(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::solve().
| int SteamCalculator::whichRegion | ( | void | ) | const |
Get the region for the present SteamCalculator (1 to 4, according to IAPWS).
References SteamState::getRegion().
Referenced by copy(), getGasPart(), getLiquidPart(), getRegion3PressureError(), set_pT(), Region4::set_pT(), Region3::set_pT(), Region2::set_pT(), Region1::set_pT(), setB23_p(), setB23_T(), setRegion3_rhoT(), Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::solve(), Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion(), and whichState().
| const SteamCalculator & SteamCalculator::getGasPart | ( | ) | const |
References ASSERT, IS_VALID, and whichRegion().
| const SteamCalculator & SteamCalculator::getLiquidPart | ( | ) | const |
References ASSERT, IS_VALID, and whichRegion().
| SteamStateCode SteamCalculator::whichState | ( | void | ) |
Get the state for the present SteamCalculator.
References dens(), Boundaries::getpbound_T(), Boundaries::getSatDensSteam_T(), Boundaries::getSatDensWater_T(), Boundaries::getSatPres_T(), pres(), STEAM_SATURATED, STEAM_SUBCOOLED, STEAM_SUPERCRITICAL, STEAM_SUPERHEATED, T, T_CRIT, TB_LOW, temp(), and whichRegion().
Referenced by whichStateStr().
| const char * SteamCalculator::whichStateStr | ( | void | ) |
Get a string version of steam state.
References STEAM_SATURATED, STEAM_SUBCOOLED, STEAM_SUPERCRITICAL, STEAM_SUPERHEATED, T_CRIT, temp(), whichState(), and x.
| Temperature SteamCalculator::temp | ( | void | ) | const |
Temperature.
Returns the absolute temperature at the state set.
References REQUIRE, and SteamState::temp().
Referenced by SteamProperty< Property, PropertyAlternative >::get(), isValid(), surftens(), whichState(), and whichStateStr().
| Pressure SteamCalculator::pres | ( | void | ) | const |
Pressure.
Returns the pressure at the state set.
References SteamState::pres(), and REQUIRE.
Referenced by freesteam_region_ph(), SteamProperty< Property, PropertyAlternative >::get(), isValid(), Region4::pres(), set_pT(), Region4::set_pT(), Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion(), and whichState().
| Density SteamCalculator::dens | ( | void | ) | const |
Density, eg kg/m³.
References SteamState::dens(), ENSURE, isnan(), REQUIRE, and rho.
Referenced by conductivity(), del_iaps85(), Region4::dens(), SteamProperty< Property, PropertyAlternative >::get(), Region3::set_pT(), and whichState().
| SpecificVolume SteamCalculator::specvol | ( | void | ) | const |
Specific volume, eg m³/kg.
References REQUIRE, and SteamState::specvol().
Referenced by SteamProperty< Property, PropertyAlternative >::get(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
| SpecificEnergy SteamCalculator::specienergy | ( | void | ) | const |
Specific internal energy, eg kJ/kg.
References REQUIRE, and SteamState::specienergy().
Referenced by SteamProperty< Property, PropertyAlternative >::get(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
| SpecificEntropy SteamCalculator::specentropy | ( | void | ) | const |
Specific entropy, eg kJ/kg.
References REQUIRE, and SteamState::specentropy().
Referenced by SteamProperty< Property, PropertyAlternative >::get(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
| SpecificEnergy SteamCalculator::specenthalpy | ( | void | ) | const |
Specific enthalpy, eg kJ/kg.
References REQUIRE, and SteamState::specenthalpy().
Referenced by freesteam_region_ph(), SteamProperty< Property, PropertyAlternative >::get(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
| SpecHeatCap SteamCalculator::speccp | ( | void | ) | const |
Specific isobaric hear capacity, eg kJ/kgK.
References REQUIRE, and SteamState::speccp().
Referenced by SteamProperty< Property, PropertyAlternative >::get().
| SpecHeatCap SteamCalculator::speccv | ( | void | ) | const |
Specific isochoric heat capacity, eg kJ/kgK.
References REQUIRE, and SteamState::speccv().
Referenced by SteamProperty< Property, PropertyAlternative >::get().
| Num SteamCalculator::quality | ( | void | ) | const |
Steam quality (if saturated).
If saturated, returns the steam quality. If not saturated, returns 0.0 for region 1, 1.0 for region2, and for region 3, indeterminate, could be anything.
Referenced by SteamProperty< Property, PropertyAlternative >::get().
| DynamicViscosity SteamCalculator::dynvisc | ( | ) | const |
Dynamic viscosity, mu, [µPa.s].
Returns the dynamic viscosity of water/steam. Assumes this->T in deg K.
Range of validity is entire regions 1,2,3,4
Reference: J Phys Chem Ref Data, vol 13, no 1, 1984, p. 175 ff.
References IAPS85_VISC_REF, mu(), and REQUIRE.
| ThermalConductivity SteamCalculator::conductivity | ( | ) | const |
Conductivity [mW/m.K].
Returns the thermal conductivity of water/steam.
J Phys Chem Ref Data, vol 13, no 1, 1984, p. 175 ff.
| SurfaceTension SteamCalculator::surftens | ( | ) | const |
Calculate the surface tension (sample units are N/m).
References REQUIRE, surfaceTension(), T_CRIT, and temp().
| bool SteamCalculator::isValid | ( | void | ) | const [virtual] |
Used for design-by-contract IS_VALID tests:.
Reimplemented from DesignByContract.
References isSet(), Boundaries::isValid_pT(), pres(), and temp().
| void SteamCalculator::copy | ( | const SteamCalculator & | original | ) | [virtual] |
Copy operation, virtual.
Copy function.
References _state, del, gas, isset, liq, p, pi, rho, SteamCalculator(), T, tau, whichRegion(), and x.
Referenced by operator=(), and SteamCalculator().
| Num SteamCalculator::tau_iaps85 | ( | ) | const [protected] |
Reduced temperature for IAPWS conductivity calculation.
Reference: IAPWS Revised Release on the IAPS Formulation 1985 for the Thermal Conductivity of Ordinary Water Substance, 1998, IAPWS.
References IAPS85_TEMP_REF, and T.
| Num SteamCalculator::del_iaps85 | ( | ) | const [protected] |
Reduced density for IAPWS conductivity calculation.
Reference: IAPWS Revised Release on the IAPS Formulation 1985 for the Thermal Conductivity of Ordinary Water Substance, 1998, IAPWS.
References dens(), and IAPS85_DENS_REF.
| Num SteamCalculator::pi_iaps85 | ( | ) | const [protected] |
Reduced pressure for IAPWS conductivity calculation.
Reference: IAPWS Revised Release on the IAPS Formulation 1985 for the Viscosity of Ordinary Water Substance, 2003, IAPWS.
References IAPS85_PRES_REF, and p.
| Num SteamCalculator::delpi_iaps85 | ( | void | ) | const [protected] |
| Num SteamCalculator::pitau_iaps85 | ( | void | ) | const [protected] |
References ENSURE, isinf(), isnan(), SteamState::pitau_iaps85(), and REQUIRE.
Ideal-gas limit for thermal conductivity, lamda_0.
Reference: IAPWS Revised Release on the IAPS Formulation 1985 for the Thermal Conductivity of Ordinary Water Substance, 1998, IAPWS.
References ENSURE, isinf(), isnan(), and THCON_a_COUNT.
Referenced by lam().
Density adjustment for thermal conductivity.
Reference: IAPWS Revised Release on the IAPS Formulation 1985 for the Thermal Conductivity of Ordinary Water Substance, 1998, IAPWS.
References ENSURE, isinf(), isnan(), sq(), THCON_b0, THCON_B1, THCON_b1, THCON_B2, and THCON_b2.
Referenced by lam().
Used in the calculation of reduced thermal conductivity.
Reference: IAPWS Revised Release on the IAPS Formulation 1985 for the Thermal Conductivity of Ordinary Water Substance, 1998, IAPWS.
Also, refer Bernhard Spang's IAPWS97 Excel Add-in, visual basic source code, version * 1.3.
TODO: crossref with Sengers et al, J Phys Chem Ref Data v13 1984 pp893-933
References ENSURE, fabs(), isinf(), isnan(), pow(), THCON_C1, THCON_C2, THCON_C3, THCON_C4, THCON_C5, THCON_C6, THCON_d1, THCON_d2, THCON_d3, and THCON_d4.
Referenced by lam().
| Num SteamCalculator::mu | ( | ) | const [protected] |
| Num SteamCalculator::mu0 | ( | ) | const [protected] |
| Num SteamCalculator::mu1 | ( | ) | const [protected] |
References IAPWS95::d, del_iaps85(), pow(), tau_iaps85(), VISC_COUNT, and VISC_N.
Referenced by mu().
| Num SteamCalculator::mu2 | ( | ) | const [protected] |
References ASSERT, del, ENSURE, MPa, p, P_MAX, Pascal, SteamState::pres(), REG3_DENS_REF, reg3_target_pressure, REG3_ZEROIN_DENS_MAX, and whichRegion().
Referenced by Region3::set_pT().
| void SteamCalculator::set | ( | const Pressure & | p, | |
| const Temperature & | T | |||
| ) | [inline] |
| void SteamCalculator::set | ( | const Temperature & | T, | |
| const Pressure & | p | |||
| ) | [inline] |
friend class SteamState [friend] |
friend class Region1 [friend] |
friend class Region2 [friend] |
friend class Region3 [friend] |
friend class Region4 [friend] |
Referenced by Region4::Instance().
friend class ZeroIn< SteamCalculator, Pressure, Density > [friend] |
Temperature SteamCalculator::T [protected] |
Temperature K.
Referenced by conductivity(), copy(), freesteam_region_ph(), Region3::pres(), Region4::set_pT(), Region3::set_pT(), Region2::set_pT(), Region1::set_pT(), setB23_p(), setSatSteam_p(), setSatWater_p(), Region3::specenthalpy(), Region2::specenthalpy(), Region1::specenthalpy(), Region3::specienergy(), Region2::specienergy(), Region1::specienergy(), Region2::specvol(), Region1::specvol(), SteamCalculator(), tau_iaps85(), Region4::temp(), Region3::temp(), Region2::temp(), Region1::temp(), and whichState().
Pressure SteamCalculator::p [protected] |
Pressure MPa.
Referenced by copy(), getRegion3PressureError(), pi_iaps85(), Region2::pres(), Region1::pres(), Region4::set_pT(), Region2::set_pT(), Region1::set_pT(), setB23_T(), setSatSteam_T(), Region2::specvol(), Region1::specvol(), and SteamCalculator().
Density SteamCalculator::rho [protected] |
Density, used by Region 3 only.
Referenced by copy(), dens(), Region3::dens(), Region3::pres(), and Region3::specvol().
Num SteamCalculator::x [protected] |
Quality, used by Region 4.
Referenced by copy(), Region4::dens(), quality(), Region4::set_pT(), Region3::set_pT(), Region2::set_pT(), Region1::set_pT(), setRegion3_rhoT(), SteamCalculator(), and whichStateStr().
Num SteamCalculator::tau [protected] |
Internal variable in IAPWS calcs.
Referenced by copy(), Region3::set_pT(), Region2::set_pT(), Region1::set_pT(), setRegion3_rhoT(), Region3::speccp(), Region2::speccp(), Region1::speccp(), Region3::speccv(), Region2::speccv(), Region1::speccv(), Region3::specenthalpy(), Region2::specenthalpy(), Region1::specenthalpy(), Region3::specentropy(), Region2::specentropy(), Region1::specentropy(), Region3::specienergy(), Region2::specienergy(), and Region1::specienergy().
Num SteamCalculator::pi [protected] |
Internal variable in IAPWS calcs.
Referenced by copy(), Region2::set_pT(), Region1::set_pT(), Region2::specienergy(), Region1::specienergy(), Region2::specvol(), and Region1::specvol().
Num SteamCalculator::del [protected] |
Internal variable in IAPWS calcs.
Referenced by copy(), getRegion3PressureError(), Region3::pres(), setRegion3_rhoT(), Region3::speccp(), and Region3::specenthalpy().
Pressure SteamCalculator::reg3_target_pressure [protected] |
Internal variable used in root-finding in region 3.
Referenced by getRegion3PressureError(), and Region3::set_pT().
1.5.6