https://github.com/omega1x/wsif97
Fast calculation of thermophysical properties of water and steam in R
https://github.com/omega1x/wsif97
enthalpy entropy heat-capacity iapws saturation steam water
Last synced: 5 months ago
JSON representation
Fast calculation of thermophysical properties of water and steam in R
- Host: GitHub
- URL: https://github.com/omega1x/wsif97
- Owner: omega1x
- Created: 2021-04-17T14:29:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-17T15:30:17.000Z (almost 3 years ago)
- Last Synced: 2024-04-24T13:00:02.158Z (about 2 years ago)
- Topics: enthalpy, entropy, heat-capacity, iapws, saturation, steam, water
- Language: C++
- Homepage:
- Size: 210 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://www.gnu.org/licenses/gpl-3.0)  [](https://cran.r-project.org/package=wsif97) [](https://omega1x.r-universe.dev) [](https://www.codefactor.io/repository/github/omega1x/wsif97) [](https://codecov.io/gh/omega1x/wsif97?branch=master)
[R-package](https://cran.r-project.org/package=wsif97) for fast calculation of thermophysical properties of water and steam as formulated by *International Association for the Properties of Water and Steam* ([IAPWS](http://iapws.org)).
------------------------------------------------------------------------
> ⚠ The development and support of this package has been finally discontinued. Use *CRAN*-package [iapws](https://cran.r-project.org/web/packages/iapws/index.html) instead.
# Intro
The package is inspired by [Java IF97](https://www.if97.software/) library and *python's* [iapws](https://iapws.readthedocs.io/en/latest/index.html) 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](https://omega1x.r-universe.dev/) version can be installed:
```r
install.packages('wsif97', repos = 'https://omega1x.r-universe.dev')
```
> ℹ The package is linked to and imports [Rcpp](https://cran.r-project.org/package=Rcpp)-package as the only dependency.
# Usage
The usage of [wsif97](https://github.com/omega1x/wsif97) package is rather straightforward. Most of thermophysical properties are calculated by *direct* vectorized functions of appropriate arguments:
``` r
## 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](http://iapws.org/relguide/IF97-Rev.html) abandons usage of iteration algorithms we similarly avoid using them in contrast to *pythonic* [iapws](https://iapws.readthedocs.io/en/latest/index.html). So be ready to meet some inconsistencies when compare those results with [wsif97](https://github.com/omega1x/wsif97).