SteamCalculator Class Reference

#include <steamcalculator.h>

Inheritance diagram for SteamCalculator:

Inheritance graph
[legend]
Collaboration diagram for SteamCalculator:

Collaboration graph
[legend]

List of all members.

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 SteamCalculatorgetGasPart () const
const SteamCalculatorgetLiquidPart () 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 >


Detailed Description

Examples:

/home/john/freesteam/solver.h, and /home/john/freesteam/steamcalculator.h.


Constructor & Destructor Documentation

SteamCalculator::SteamCalculator (  ) 

Constructor.

References Kelvin, MPa, p, T, and x.

Referenced by copy(), and setRegion4_Tx().

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.


Member Function Documentation

SteamCalculator const & SteamCalculator::operator= ( SteamCalculator const &  original  ) 

Assignment operator (assigns a copy).

Assignment operator.

References copy().

void SteamCalculator::set_pT ( const Pressure p,
const Temperature T,
double  x = 1.0 
)

template<class F, class S>
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  ) 

void SteamCalculator::setSatSteam_T ( const Temperature T  ) 

void SteamCalculator::setB23_T ( const Temperature T  ) 

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 
)

void SteamCalculator::setRegion2_pT ( const Pressure p,
const Temperature T 
)

void SteamCalculator::setRegion4_Tx ( const Temperature T,
const Num x 
)

void SteamCalculator::setRegion3_rhoT ( const Density rho,
const Temperature T 
)

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

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   ) 

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

Density SteamCalculator::dens ( void   )  const

SpecificVolume SteamCalculator::specvol ( void   )  const

SpecificEnergy SteamCalculator::specienergy ( void   )  const

SpecificEntropy SteamCalculator::specentropy ( void   )  const

SpecificEnergy SteamCalculator::specenthalpy ( void   )  const

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.

Todo:
Check this, make sure only legal values are possible in region 3. There is a bit of confusion in the code about 'region 4 inside region 3'.

References REQUIRE, and x.

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.

Returns:
Dynamic viscosity [Pa.s]
See also:
http://www.iapws.org/relguide/visc.pdf

http://www.iapws.org/relguide/IF97.pdf

References IAPS85_VISC_REF, mu(), and REQUIRE.

ThermalConductivity SteamCalculator::conductivity (  )  const

Conductivity [mW/m.K].

Returns the thermal conductivity of water/steam.

See also:
http://www.iapws.org/relguide/thcond.pdf

J Phys Chem Ref Data, vol 13, no 1, 1984, p. 175 ff.

Range of validity is entire regions 1,2,3,4.

Returns:
Thermal conductivity [W/m.K]

References dens(), ENSURE, isnan(), lam(), REQUIRE, and T.

SurfaceTension SteamCalculator::surftens (  )  const

Calculate the surface tension (sample units are N/m).

Since:
0.7

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.

See also:
http://www.iapws.org/relguide/thcond.pdf#page=8, Eq. 4

References IAPS85_TEMP_REF, and T.

Referenced by mu0(), mu1(), and mu2().

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.

See also:
http://www.iapws.org/relguide/thcond.pdf#page=8, Eq. 5
Density calculated with IAPWS SF95 is expected, in order to meet the reference values given

References dens(), and IAPS85_DENS_REF.

Referenced by mu1(), and mu2().

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.

See also:
http://www.iapws.org/relguide/visc.pdf#page=7, Eq. 7

References IAPS85_PRES_REF, and p.

Num SteamCalculator::delpi_iaps85 ( void   )  const [protected]

References SteamState::delpi_iaps85().

Referenced by mu2().

Num SteamCalculator::pitau_iaps85 ( void   )  const [protected]

Num SteamCalculator::lam ( const Num Tbar,
const Num rhobar 
) const [protected]

Reduced thermal conductivity.

Returns:
lambda_0 [dim'less]
See also:
http://www.iapws.org/relguide/IF97.pdf

References ENSURE, isinf(), isnan(), lam0(), lam1(), and lam2().

Referenced by conductivity().

Num SteamCalculator::lam0 ( const Num Tbar  )  const [protected]

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.

See also:
http://www.iapws.org/relguide/thcond.pdf
Returns:
glambda_0 [dim'less]

References ENSURE, isinf(), isnan(), and THCON_a_COUNT.

Referenced by lam().

Num SteamCalculator::lam1 ( const Num rhobar  )  const [protected]

Density adjustment for thermal conductivity.

Reference: IAPWS Revised Release on the IAPS Formulation 1985 for the Thermal Conductivity of Ordinary Water Substance, 1998, IAPWS.

Returns:
lambda_0 [dim'less]
See also:
http://www.iapws.org/relguide/IF97.pdf

References ENSURE, isinf(), isnan(), sq(), THCON_b0, THCON_B1, THCON_b1, THCON_B2, and THCON_b2.

Referenced by lam().

Num SteamCalculator::lam2 ( const Num Tbar,
const Num rhobar 
) const [protected]

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

Returns:
lambda_0 [dim'less]
See also:
http://www.iapws.org/relguide/IF97.pdf

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]

See also:
http://www.iapws.org/relguide/visc.pdf

References mu0(), mu1(), and mu2().

Referenced by dynvisc().

Num SteamCalculator::mu0 (  )  const [protected]

Num SteamCalculator::mu1 (  )  const [protected]

Num SteamCalculator::mu2 (  )  const [protected]

Pressure SteamCalculator::getRegion3PressureError ( const Density test_rho  )  [protected]

template<>
void SteamCalculator::set ( const Pressure p,
const Temperature T 
) [inline]

template<>
void SteamCalculator::set ( const Temperature T,
const Pressure p 
) [inline]


Friends And Related Function Documentation

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]


Member Data Documentation

Density, used by Region 3 only.

Referenced by copy(), dens(), Region3::dens(), Region3::pres(), and Region3::specvol().

Num SteamCalculator::x [protected]

Num SteamCalculator::pi [protected]

Internal variable used in root-finding in region 3.

Referenced by getRegion3PressureError(), and Region3::set_pT().


The documentation for this class was generated from the following files:

Generated on Tue Feb 10 18:37:37 2009 for freesteam by  doxygen 1.5.6