Contrib/IAPWS-IF97-OF

From OpenFOAMWiki
Source code repository
IAPWS-IF97-OF at GitHub

1 About

The extension makes water properties based on the IAPWS-IF97 (doi: 10.1115/1.483186) definition available for OpenFOAM (R) solvers of the compressible buoyant* family, such as buoyantPimpleFoam. The extension is based on the work for the real gas branch of openfoam-ext-1.6. The water properties come from the C-library freesteam.

2 Installation

2.1 Prerequisited

  1. Full installation of OpenFOAM >=2.2 from http://www.openfoam.org
  2. Installed freesteam >=2.0 from http://freesteam.sourceforge.net/


2.2 Installing IAPWS-IF97-OF

Open a command line window and navigate to directory you would like to store the source code for IAPWS-IF97-OF. Then run the following commands in a command line on your computer

# git clone https://github.com/romansCode/IAPWS-IF97-OF.git
# cd IAPWS-IF97-OF
# wclean && wmake libso

3 Usage

  • add libIAPWSRangeThermo.so and libfreesteam.so to the libraries in controlDict
libs
 {
        "libIAPWSRangeThermo.so" 
        "libfreesteam.so" 
 }
  • In the the thermophysicalProperties file, which can also be found in the example folder in the source code use the following.
 thermoType 
 {
    type            heRhoThermo;    // Thermophysical model based on sensible enthalpy
    mixture         pureMixture;    // Only water
    transport       IAPWSTransport; // (mu, k)
    thermo          hIAPWS;         // (Cp)
    equationOfState eosIAPWS;       // (rho)
    specie          specie;
    energy          sensibleEnthalpy;
 }
 // outside the pressure and temperature range, the properties will be capped to
 // the min and max values at the range limits
 mixture
 {
    IAPWSProperties
    {
        pMax    300e5;  // max allowed pressure
        pMin    221e5;  // min allowed pressure
    }
    specie
    {
        nMoles          1;
        molWeight       18;   // Water
    }
 }
  • The pressure limits can be used to stabilise the computations at startup, however, they are not necessary and can be set to the limits of the properties table (for 0°C < T < 800°C p<100 MPa and for 800°C < T < 2000 °C p < 10 MPa).

4 Support