# Musson Industrial's Thermodynamics Module

**URL:** <https://forum.inductiveautomation.com/t/musson-industrials-thermodynamics-module/94704>\
**Category:** 3rd Party Modules\
**Tags:** ignition81, scripting\
**Created:** [August 15, 2024, 3:40pm UTC](https://forum.inductiveautomation.com/t/musson-industrials-thermodynamics-module/94704 "2024-08-15T15:40:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [August 15, 2024, 3:40pm UTC](https://forum.inductiveautomation.com/t/musson-industrials-thermodynamics-module/94704/1 "2024-08-15T15:40:50Z")

</div>

# Embr-Thermodynamics

**Musson Industrial** is excited to announce the release of `embr-thermodynamics`, an Ignition module containing scripting and expression functions for computing properties of steam via an IF97 implementation.

## Who is this for?

Anyone needing to calculate steam properties between 273.15 K to 1073.15 K at pressures up to 100 MPa.

### Supported Properties and Parameters

| Property | Symbol | Units | (p, T) | (p, h) | (p, s) | (h, s) | (T, s) | (ρ, T) | (p, x) | (T, x) |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Absolute pressure | p | Pa | | | | ✓ | | | ✓ | ✓ sat. |
| Density | ρ | kg/m³ | ✓ | ✓ | ✓ | ✓ | | | ✓ | ✓ |
| Dielectric constant | ε | - | ✓ | ✓ | ✓ | ✓ | | ✓ | | |
| Dynamic viscosity | η | Pa·s | ✓ | ✓ | ✓ | ✓ | | ✓ | | |
| Isobaric cubic expansion coefficient | αv | 1/K | ✓ | ✓ | ✓ | ✓ | | | | |
| Isothermal compressibility | κT | 1/Pa | ✓ | ✓ | ✓ | ✓ | | | | |
| Kinematic viscosity | ν | m²/s | ✓ | ✓ | ✓ | ✓ | | ✓ | | |
| Prandtl number | Pr | - | ✓ | ✓ | ✓ | ✓ | | | | |
| Refractive index | n | - | ✓ | ✓ | ✓ | ✓ | | ✓ | | |
| Specific enthalpy | h | J/kg | ✓ | | ✓ | | | | ✓ | ✓ |
| Specific entropy | s | J/(kg·K) | ✓ | ✓ | | | | | ✓ | ✓ |
| Specific Gibbs free energy | g | J/kg | ✓ | | | | | | | |
| Specific internal energy | u | J/kg | ✓ | ✓ | ✓ | ✓ | | | | |
| Specific isobaric heat capacity | cp | J/(kg·K) | ✓ | ✓ | ✓ | ✓ | | | | |
| Specific isochoric heat capacity | cv | J/(kg·K) | ✓ | ✓ | ✓ | ✓ | | | | |
| Specific volume | v | m³/kg | ✓ | ✓ | ✓ | ✓ | | | ✓ | ✓ |
| Speed of sound | w | m/s | ✓ | ✓ | ✓ | ✓ | | | | |
| Surface tension | σ | N/m | | | | | | | ✓ | ✓ |
| Temperature | T | K | | ✓ | ✓ | ✓ | | | ✓ sat. | |
| Thermal conductivity | λ | W/(m·K) | ✓ | ✓ | ✓ | ✓ | | ✓ | | |
| Thermal diffusivity | κ | m²/s | ✓ | ✓ | ✓ | ✓ | | | | |
| Vapour fraction | x | - | | ✓ | ✓ | ✓ | ✓ | | | |
| Wavelength of light | λL | m | | | | | | | | |

### 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.

```python
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.

```python
// Usage 
if97(property, [[parameter], [value]...]) 

// Examples 
if97("specificEntropy", "p", 200000, "t", 400)
if97("saturationPressure", "t", 500)
if97("vaporFraction", "p", 110000, "t", 1150000)

```

## Sponsorship

If you benefit from this module for commercial use, we ask you to consider sponsoring our efforts through [GitHub sponsors](https://github.com/sponsors/mussonindustrial). Your support will allow us to continue development of open-source modules and tools that benefit the entire community (plus there are some bonuses for sponsors 🙂).

[https://github.com/mussonindustrial/embr/tree/main/modules/thermo](https://github.com/mussonindustrial/embr/tree/main/modules/thermo)

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [November 22, 2024, 6:21pm UTC](https://forum.inductiveautomation.com/t/musson-industrials-thermodynamics-module/94704/2 "2024-11-22T18:21:21Z")

</div>

## Updates

- First major release (1.0.0), to coincide with the publishing of documentation.
- No functional changes from 0.1.6.

## Documentation

Module documentation is now published at [docs.mussonindustrial.com](https://docs.mussonindustrial.com/).  
Check it out! 🎉

## Download

[Embr-Thermodynamics-1.0.0.modl](https://github.com/mussonindustrial/embr/releases/download/%40embr-modules%2Fthermo%401.0.0/Embr-Thermodynamics-1.0.0.modl)
