0.1.4 • Published 10 months ago

@embr-modules/thermo v0.1.4

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

Embr Thermodynamics Module

An Ignition module containing scripting and expression functions for computing properties of steam via an IF97 implementation.

Getting Started

  1. Download the latest version from releases.
  2. Install the module through the Ignition Gateway web interface.

Module Documentation


IAPWS-IF97

IAPWS (The International Association for the Properties of Water and Steam) is an international non-profit association of national organizations concerned with the properties of water and steam, particularly thermophysical properties, cycle chemistry guidelines, and other aspects of high-temperature steam, water and aqueous mixtures relevant to thermal power cycles and other industrial and scientific applications.

This formulation (IAPWS-IF97) is recommended for industrial use (primarily the steam power industry) for the calculation of thermodynamic properties of ordinary water in its fluid phases, including vapor-liquid equilibrium. The formulation is a close approximation to the IAPWS-IF95 formulation for general and scientific use, but is designed for much greater computational speed.

The range of validity is divided into several regions (with close tolerances for consistency at region boundaries), each of which is represented by a different fundamental equation. Appropriate combinations of derivatives from this equation can produce any thermodynamic property desired (density or specific volume, sound speed, heat capacity, enthalpy, entropy, etc.). The formulation is valid from 273.15 K to 1073.15 K at pressures to 100 MPa, and there is a high-temperature region extending to 2273.15 K at pressures to 50 MPa. There is also a separate equation for metastable steam at pressures up to 10 MPa.

Valid Regions

if97 regions

Supported Properties and Parameters

PropertySymbolUnits(p, T)(p, h)(p, s)(h, s)(T, s)(ρ, T)(p, x)(T, x)
Absolute pressurepPa✓ sat.
Densityρkg/m³
Dielectric constantε-
Dynamic viscosityηPa·s
Isobaric cubic expansion coefficientαv1/K
Isothermal compressibilityκT1/Pa
Kinematic viscosityνm²/s
Prandtl numberPr-
Refractive indexn-
Specific enthalpyhJ/kg
Specific entropysJ/(kg·K)
Specific Gibbs free energygJ/kg
Specific internal energyuJ/kg
Specific isobaric heat capacitycpJ/(kg·K)
Specific isochoric heat capacitycvJ/(kg·K)
Specific volumevm³/kg
Speed of soundwm/s
Surface tensionσN/m
TemperatureTK✓ sat.
Thermal conductivityλW/(m·K)
Thermal diffusivityκm²/s
Vapour fractionx-
Wavelength of lightλLm

Scripting Functions

The following scripting functions are available in all Ignition scopes.

Each scripting function has a variety of overloads to match the Table of Supported Properties. The designer scripting hints also list the accepted parameters sets.

system.thermo.if97.compressibility(h, p, s, t)
system.thermo.if97.compressionFactor(p, t)
system.thermo.if97.density(h, p, s, t, x)
system.thermo.if97.dielectricConstant(h, p, rho, s, t)
system.thermo.if97.heatCapacityRatio(h, p, s, t)
system.thermo.if97.isentropicExponent(h, p, s, t)
system.thermo.if97.isobaricCubicExpansionCoefficient(h, p, s, t, x)
system.thermo.if97.isobaricHeatCapacity(h, p, s, t)
system.thermo.if97.isochoricHeatCapacity(h, p, s, t)
system.thermo.if97.kinematicViscosity(h, p, rho, s, t)
system.thermo.if97.prandtl(h, p, s, t)
system.thermo.if97.pressure(h, s)
system.thermo.if97.refractiveIndex(h, l, p, rho, s, t)
system.thermo.if97.saturationPressure(h, s, t)
system.thermo.if97.saturationTemperature(h, p, s)
system.thermo.if97.specificEnthalpy(p, s, t, x)
system.thermo.if97.specificEnthalpySaturatedLiquid(p, t)
system.thermo.if97.specificEnthalpySaturatedVapor(p, t)
system.thermo.if97.specificEntropy(h, p, t, x)
system.thermo.if97.specificEntropySaturatedLiquid(p, t)
system.thermo.if97.specificEntropySaturatedVapor(p, t)
system.thermo.if97.specificGibbsFreeEnergy(p, t)
system.thermo.if97.specificInternalEnergy(h, p, s, t, x)
system.thermo.if97.specificInternalEnergySaturatedLiquid(p, t)
system.thermo.if97.specificInternalEnergySaturatedVapor(p, t)
system.thermo.if97.specificVolume(h, p, s, t, x)
system.thermo.if97.specificVolumeSaturatedLiquid(p, t)
system.thermo.if97.specificVolumeSaturatedVapor(p, t)
system.thermo.if97.speedOfSound(h, p, s, t)
system.thermo.if97.vaporFraction(h, p, s, t)

Expression Functions

Because expression functions do not support operator overloading (and adding functions to cover all possibilities of parameters is impractical), this module provides a single expression function for accessing all if97 properties.

property is case-insensitive and parameters can be specified in any order.

// Usage
if97(property, [[parameter], [value]...])
    
// Examples
if97("specificEntropy", "p", 200000, "t", 400)
if97("saturationPressure", "t", 500)
if97("vaporFraction", "p", 110000, "t", 1150000)

Changelog

The changelog is regularly updated to reflect what's changed in each new release.

Copyright and Licensing

Copyright (C) 2024 Musson Industrial

Free use of this software is granted under the terms of the MIT License.

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

11 months ago

0.1.1

11 months ago