An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![GitHub R package version](https://img.shields.io/github/r-package/v/omega1x/wsif97) [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/wsif97)](https://cran.r-project.org/package=wsif97) [![wsif97 status badge](https://omega1x.r-universe.dev/badges/wsif97)](https://omega1x.r-universe.dev) [![CodeFactor](https://www.codefactor.io/repository/github/omega1x/wsif97/badge)](https://www.codefactor.io/repository/github/omega1x/wsif97) [![Codecov test coverage](https://codecov.io/gh/omega1x/wsif97/branch/master/graph/badge.svg)](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).