Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 3.88 KB

README.md

File metadata and controls

53 lines (40 loc) · 3.88 KB

License: GPL v3 GitHub R package version CRAN_Status_Badge wsif97 status badge CodeFactor Codecov test coverage

R-package for fast calculation of thermophysical properties of water and steam as formulated by International Association for the Properties of Water and Steam (IAPWS).


⚠ The development and support of this package has been finally discontinued. Use CRAN-package iapws instead.

Intro

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

Installation

For the present only r-universe version can be installed:

install.packages('wsif97', repos = 'https://omega1x.r-universe.dev')

ℹ The package is linked to and imports Rcpp-package as the only dependency.

Usage

The usage of wsif97 package is rather straightforward. Most of thermophysical properties are calculated by direct vectorized functions of appropriate arguments:

## Calculate density (kg/m^3) of ordinary water at different temperatures
## and pressures:
> t <- c(300,500,300,700,1500,1500,2000)  # [K]
> p <- c(3,3,.35e-2,30,.5,30,30)          # [MPa]
> density <- tpr(t, p)                    # [kg/m^3]
> print(density)
[1] 997.85294010 831.65754105   0.02532198 184.18016876   0.72225586  43.33482271
[7]  32.11456228

For the present time the next thermophysical properties can be calculated.

Property Designation Units (T-p)-space
Temperature T K -
Pressure p MPa -
Specific volume v m³/kg tpv
Specific internal energy u kJ/kg tpu
Specific entropy s kJ/kg/K tps
Specific enthalpy h kJ/kg tph
Specific isobaric heat capacity cp kJ/kg/K tpcp
Specific isohoric heat capacity cv kJ/kg/K tpcv
Speed of sound w m/s tpw
Isobaric cubic expansion coefficient αv 1/K tpe
Isothermal compressibility KT 1/MPa tpi
Mass density ρ kg/m³ tpr

Since Industrial Formulation abandons usage of iteration algorithms we similarly avoid using them in contrast to pythonic iapws. So be ready to meet some inconsistencies when compare those results with wsif97.