Package 'wsif97'

Title: Industrial Formulation for Properties of Ordinary Water and Steam
Description: Implementation of some methods for fast calculation of thermophysical properties of ordinary water and steam as they formulated by International Association for the Properties of Water and Steam (IAPWS).
Authors: Yuri Possokhov [aut, cre]
Maintainer: Yuri Possokhov <[email protected]>
License: GPL-3
Version: 0.0.1
Built: 2024-10-08 04:47:17 UTC
Source: https://github.com/omega1x/wsif97

Help Index


Industrial Formulation for Properties of Ordinary Water and Steam

Description

Implementation of some methods for fast calculation of thermophysical properties of water and steam as they formulated by International Association for the Properties of Water and Steam (IAPWS).

Details

The package is inspired by Java IF97 library and iapws python-module and tries to bring similar functionality to R-community without unwanted external dependencies. The package grows in functionality smoothly as needed in conjunction with analytic requirements of the author's company.

Unlike most others the package contains vectorized functions aimed for speed by using Rcpp-package and by avoiding double cycling. For actual information about the package see package README.md.

Author(s)

Yuri Possokhov, [email protected].

Maintainer: Yuri Possokhov <[email protected]>

References

IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

IAPWS AN5-13(2016), Advisory Note No. 5: Industrial Calculation of the Thermodynamic Properties of Seawater. September 2013.

Examples

## Calculate density of ordinary water at different temperatures
   ## and pressures:
   t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
   p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
   density <- tpr(t, p)  # [kg/m^3]
   print(density)

Isobaric heat capacity vs temperature and pressure

Description

Calculate specific isobaric heat capacity as a function of temperature and pressure in accordance with IAPWS R7-97 formulation.

Usage

tpcp(T, p)

Arguments

T

absolute temperature in validity range 273.15 – 2273.15, [K]. Type: NumericVector

p

absolute pressure in validity range 0 – 100 MPa, [MPa]. Type: NumericVector

Details

Vectors T and p both must have the same length. Default recycling rules are not applicable in this context.

The accuracy of calculation for this property in Region 3 depends on accuracy of specific volume in this region. See details for tpv.

Value

specific isobaric heat capacity, [kJ/kg/KkJ/kg/K], or the next error code:

-10

Fail to determine region in temperature-pressure space into which the entire range of validity of IAPWS R7-97 is divided. Possibly values of one or both arguments are out of bounds or in undeterminable subspace.

-20

Fail to determine subregion inside Region 3 in accordance with IAPWS SR5-05. Possibly values of one or both arguments are in undeterminable subspace or near singularity.

Type: NumericVector

References

  • IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

  • IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

See Also

Other properties in temperature-pressure space: tpcv(), tpe(), tph(), tpi(), tpr(), tps(), tpu(), tpv(), tpw()

Examples

t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
 p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
 tpcp(t, p)

Isochoric heat capacity vs temperature and pressure

Description

Calculate specific isochoric heat capacity as a function of temperature and pressure in accordance with IAPWS R7-97 formulation.

Usage

tpcv(T, p)

Arguments

T

absolute temperature in validity range 273.15 – 2273.15, [K]. Type: NumericVector

p

absolute pressure in validity range 0 – 100 MPa, [MPa]. Type: NumericVector

Details

Vectors T and p both must have the same length. Default recycling rules are not applicable in this context.

The accuracy of calculation for this property in Region 3 depends on accuracy of specific volume in this region. See details for tpv.

Value

specific isochoric heat capacity, [kJ/kg/KkJ/kg/K], or the next error code:

-10

Fail to determine region in temperature-pressure space into which the entire range of validity of IAPWS R7-97 is divided. Possibly values of one or both arguments are out of bounds or in undeterminable subspace.

-20

Fail to determine subregion inside Region 3 in accordance with IAPWS SR5-05. Possibly values of one or both arguments are in undeterminable subspace or near singularity.

Type: NumericVector

References

  • IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

  • IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

See Also

Other properties in temperature-pressure space: tpcp(), tpe(), tph(), tpi(), tpr(), tps(), tpu(), tpv(), tpw()

Examples

t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
 p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
 tpcv(t, p)

Expansion coefficient vs temperature and pressure

Description

Calculate cubic expansion coefficient as a function of temperature and pressure in accordance with IAPWS R7-97 formulation.

Usage

tpe(T, p)

Arguments

T

absolute temperature in validity range 273.15 – 2273.15, [K]. Type: NumericVector

p

absolute pressure in validity range 0 – 100 MPa, [MPa]. Type: NumericVector

Details

Vectors T and p both must have the same length. Default recycling rules are not applicable in this context.

The accuracy of calculation for this property in Region 3 depends on accuracy of specific volume in this region. See details for tpv.

Value

cubic expansion coefficient, [1/K1/K], or the next error code:

-10

Fail to determine region in temperature-pressure space into which the entire range of validity of IAPWS R7-97 is divided. Possibly values of one or both arguments are out of bounds or in undeterminable subspace.

-20

Fail to determine subregion inside Region 3 in accordance with IAPWS SR5-05. Possibly values of one or both arguments are in undeterminable subspace or near singularity.

Type: NumericVector

References

  • IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

  • IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

  • IAPWS AN5-13(2016), Advisory Note No. 5: Industrial Calculation of the Thermodynamic Properties of Seawater. September 2013.//'

See Also

Other properties in temperature-pressure space: tpcp(), tpcv(), tph(), tpi(), tpr(), tps(), tpu(), tpv(), tpw()

Examples

t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
 p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
 tpe(t, p)

Enthalpy vs temperature and pressure

Description

Calculate specific enthalpy as a function of temperature and pressure in accordance with IAPWS R7-97 formulation.

Usage

tph(T, p)

Arguments

T

absolute temperature in validity range 273.15 – 2273.15, [K]. Type: NumericVector

p

absolute pressure in validity range 0 – 100 MPa, [MPa]. Type: NumericVector

Details

Vectors T and p both must have the same length. Default recycling rules are not applicable in this context.

The accuracy of calculation for this property in Region 3 depends on accuracy of specific volume in this region. See details for tpv.

Value

specific enthalpy, [kJ/kgkJ/kg], or the next error code:

-10

Fail to determine region in temperature-pressure space into which the entire range of validity of IAPWS R7-97 is divided. Possibly values of one or both arguments are out of bounds or in undeterminable subspace.

-20

Fail to determine subregion inside Region 3 in accordance with IAPWS SR5-05. Possibly values of one or both arguments are in undeterminable subspace or near singularity.

Type: NumericVector

References

  • IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

  • IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

See Also

Other properties in temperature-pressure space: tpcp(), tpcv(), tpe(), tpi(), tpr(), tps(), tpu(), tpv(), tpw()

Examples

t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
 p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
 tph(t, p)

Compressibility vs temperature and pressure

Description

Calculate isothermal compressibility as a function of temperature and pressure in accordance with IAPWS R7-97 formulation.

Usage

tpi(T, p)

Arguments

T

absolute temperature in validity range 273.15 – 2273.15, [K]. Type: NumericVector

p

absolute pressure in validity range 0 – 100 MPa, [MPa]. Type: NumericVector

Details

Vectors T and p both must have the same length. Default recycling rules are not applicable in this context.

The accuracy of calculation for this property in Region 3 depends on accuracy of specific volume in this region. See details for tpv.

Value

isothermal compressibility, [1/MPa1/MPa], or the next error code:

-10

Fail to determine region in temperature-pressure space into which the entire range of validity of IAPWS R7-97 is divided. Possibly values of one or both arguments are out of bounds or in undeterminable subspace.

-20

Fail to determine subregion inside Region 3 in accordance with IAPWS SR5-05. Possibly values of one or both arguments are in undeterminable subspace or near singularity.

Type: NumericVector

References

  • IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

  • IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

  • IAPWS AN5-13(2016), Advisory Note No. 5: Industrial Calculation of the Thermodynamic Properties of Seawater. September 2013.

See Also

Other properties in temperature-pressure space: tpcp(), tpcv(), tpe(), tph(), tpr(), tps(), tpu(), tpv(), tpw()

Examples

t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
 p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
 tpi(t, p)

Mass density vs temperature and pressure

Description

Calculate mass density as a function of temperature and pressure in accordance with IAPWS R7-97 formulation.

Usage

tpr(T, p)

Arguments

T

absolute temperature in validity range 273.15 – 2273.15, [K]. Type: NumericVector

p

absolute pressure in validity range 0 – 100 MPa, [MPa]. Type: NumericVector

Details

Vectors T and p both must have the same length. Default recycling rules are not applicable in this context.

The accuracy of calculation for this property in Region 3 depends on accuracy of specific volume in this region. See details for tpv.

Value

mass density, [kg/m3kg/m^3], or the next error code:

-10

Fail to determine region in temperature-pressure space into which the entire range of validity of IAPWS R7-97 is divided. Possibly values of one or both arguments are out of bounds or in undeterminable subspace.

-20

Fail to determine subregion inside Region 3 in accordance with IAPWS SR5-05. Possibly values of one or both arguments are in undeterminable subspace or near singularity.

Type: NumericVector

References

  • IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

  • IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

See Also

Other properties in temperature-pressure space: tpcp(), tpcv(), tpe(), tph(), tpi(), tps(), tpu(), tpv(), tpw()

Examples

t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
 p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
 tpr(t, p)

Entropy vs temperature and pressure

Description

Calculate specific entropy as a function of temperature and pressure in accordance with IAPWS R7-97 formulation.

Usage

tps(T, p)

Arguments

T

absolute temperature in validity range 273.15 – 2273.15, [K]. Type: NumericVector

p

absolute pressure in validity range 0 – 100 MPa, [MPa]. Type: NumericVector

Details

Vectors T and p both must have the same length. Default recycling rules are not applicable in this context.

The accuracy of calculation for this property in Region 3 depends on accuracy of specific volume in this region. See details for tpv.

Value

specific entropy, [kJ/kg/KkJ/kg/K], or the next error code:

-10

Fail to determine region in temperature-pressure space into which the entire range of validity of IAPWS R7-97 is divided. Possibly values of one or both arguments are out of bounds or in undeterminable subspace.

-20

Fail to determine subregion inside Region 3 in accordance with IAPWS SR5-05. Possibly values of one or both arguments are in undeterminable subspace or near singularity.

Type: NumericVector

References

  • IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

  • IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

See Also

Other properties in temperature-pressure space: tpcp(), tpcv(), tpe(), tph(), tpi(), tpr(), tpu(), tpv(), tpw()

Examples

t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
 p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
 tps(t, p)

Internal energy vs temperature and pressure

Description

Calculate specific internal energy as a function of temperature and pressure in accordance with IAPWS R7-97 formulation.

Usage

tpu(T, p)

Arguments

T

absolute temperature in validity range 273.15 – 2273.15, [K]. Type: NumericVector

p

absolute pressure in validity range 0 – 100 MPa, [MPa]. Type: NumericVector

Details

Vectors T and p both must have the same length. Default recycling rules are not applicable in this context.

The accuracy of calculation for this property in Region 3 depends on accuracy of specific volume in this region. See details for tpv.

Value

specific internal energy, [kg/m3kg/m^3], or the next error code:

-10

Fail to determine region in temperature-pressure space into which the entire range of validity of IAPWS R7-97 is divided. Possibly values of one or both arguments are out of bounds or in undeterminable subspace.

-20

Fail to determine subregion inside Region 3 in accordance with IAPWS SR5-05. Possibly values of one or both arguments are in undeterminable subspace or near singularity.

Type: NumericVector

References

  • IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

  • IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

See Also

Other properties in temperature-pressure space: tpcp(), tpcv(), tpe(), tph(), tpi(), tpr(), tps(), tpv(), tpw()

Examples

t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
 p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
 tpu(t, p)

Specific volume vs temperature and pressure

Description

Calculate specific volume as a function of temperature and pressure in accordance with IAPWS R7-97 formulation.

Usage

tpv(T, p)

Arguments

T

absolute temperature in validity range 273.15 – 2273.15, [K]. Type: NumericVector

p

absolute pressure in validity range 0 – 100 MPa, [MPa]. Type: NumericVector

Details

Vectors T and p both must have the same length. Default recycling rules are not applicable in this context.

In current version numerical consistency of the specific volume in Region 3 of IAPWS R7-97 is considered sufficient enough for most applications. That is why no additional iteration procedures are used for reaching higher accuracy in this region.

Value

specific volume, [m3/kgm^3/kg], or the next error code:

-10

Fail to determine region in temperature-pressure space into which the entire range of validity of IAPWS R7-97 is divided. Possibly values of one or both arguments are out of bounds or in undeterminable subspace.

-20

Fail to determine subregion inside Region 3 in accordance with IAPWS SR5-05. Possibly values of one or both arguments are in undeterminable subspace or near singularity.

Type: NumericVector

References

  • IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

  • IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

See Also

Other properties in temperature-pressure space: tpcp(), tpcv(), tpe(), tph(), tpi(), tpr(), tps(), tpu(), tpw()

Examples

t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
 p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
 tpv(t, p)

Speed of sound vs temperature and pressure

Description

Calculate speed of sound as a function of temperature and pressure in accordance with IAPWS R7-97 formulation.

Usage

tpw(T, p)

Arguments

T

absolute temperature in validity range 273.15 – 2273.15, [K]. Type: NumericVector

p

absolute pressure in validity range 0 – 100 MPa, [MPa]. Type: NumericVector

Details

Vectors T and p both must have the same length. Default recycling rules are not applicable in this context.

The accuracy of calculation for this property in Region 3 depends on accuracy of specific volume in this region. See details for tpv.

Value

speed of sound, [m/sm/s], or the next error code:

-10

Fail to determine region in temperature-pressure space into which the entire range of validity of IAPWS R7-97 is divided. Possibly values of one or both arguments are out of bounds or in undeterminable subspace.

-20

Fail to determine subregion inside Region 3 in accordance with IAPWS SR5-05. Possibly values of one or both arguments are in undeterminable subspace or near singularity.

Type: NumericVector

References

  • IAPWS R7-97 (2012), Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. August 2007.

  • IAPWS SR5-05 (2016), Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam. June 2014.

See Also

Other properties in temperature-pressure space: tpcp(), tpcv(), tpe(), tph(), tpi(), tpr(), tps(), tpu(), tpv()

Examples

t <- c(300,300,500,300,700,700,1500,1500,2000,0)  # [K]
 p <- c(3,80,3,.35e-2,.35e-2,30,.5,30,30,0)  # [MPa]
 tpw(t, p)