Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

SteamCalculator Class Reference

Core class - define steam state in terms of p,T and optionally x. More...

#include <steamcalculator.h>

Inheritance diagram for SteamCalculator:

DesignByContract 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)
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).
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].
Conductivity conductivity () const
 Conductivity [mW/m.K].
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
 Reduced thermal conductivity.
Num lam0 () const
 Used in the calculation of reduced thermal conductivity.
Num lam1 () const
 Used in the calculation of reduced thermal conductivity.
Num lam2 () const
 Used in the calculation of reduced thermal conductivity.
Num mu () const
 http://www.iapws.org/relguide/IF97.pdf
Num mu0 () const
 http://www.iapws.org/relguide/IF97.pdf
Num mu1 () const
 http://www.iapws.org/relguide/IF97.pdf
Num mu2 () const
 http://www.iapws.org/relguide/IF97.pdf
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 ZeroIn< SteamCalculator, Pressure, Density >

Detailed Description

Core class - define steam state in terms of p,T and optionally x.

To find the enthalpy of steam at p = 10 bar, T = 250 °C,

                        SteamCalculator S;
                        S.set_pT(10.0 * bar, fromcelsius(250));
                        cerr << S.specenthalpy() << endl;


Constructor & Destructor Documentation

SteamCalculator::SteamCalculator const SteamCalculator original  ) 
 

Copy constructor.

This function creates a new uninititalised SteamCalculator, or else clones an existing one.


Member Function Documentation

Conductivity SteamCalculator::conductivity  )  const
 

Conductivity [mW/m.K].

Returns the thermal conductivity of water/steam.

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:
Thermal conductivity [W/m.K]
See also:
http://www.iapws.org/relguide/thcond.pdf

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

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

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

Num SteamCalculator::lam  )  const [protected]
 

Reduced thermal conductivity.

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

Num SteamCalculator::lam0  )  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.

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

Num SteamCalculator::lam1  )  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.

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

Num SteamCalculator::lam2  )  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

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

Pressure SteamCalculator::pres void   )  const
 

Pressure.

Returns the pressure at the state set.

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'.

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

Direct setting of rho,T for Region 3.

Todo:
Ensure rho, T are valid for region 3

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

Temperature SteamCalculator::temp void   )  const
 

Temperature.

Returns the absolute temperature at the state set.


The documentation for this class was generated from the following files:
Generated on Tue Mar 22 19:07:06 2005 for freesteam by doxygen 1.3.8