Skip to main content

A Python thermophysical property wrapper for real fluids, ideal gases, liquid rocket propellants, and isotropic engineering materials.

Project description

ThermoProp

PyPI version Python License

ThermoProp is a Python thermophysical property library for real fluids, fluid mixtures, ideal gases, ideal gas mixtures, liquid rocket propellants, and isotropic engineering materials.

It provides a unified API around CoolProp, PYroMat, RocketProps, and a built-in engineering material property database.

It provides a clean interface around:

  • CoolProp
  • PYroMat
  • RocketProps
  • Built-in Material Database
  • NumPy
  • SciPy

Why ThermoProp?

ThermoProp provides a unified API around CoolProp, PYroMat, RocketProps, and a built-in engineering material property database.

Instead of remembering backend-specific syntax such as:

CP.PropsSI(...)
pm.get(...)
get_prop(...)

users can write:

from thermoprop import Fluid

water = Fluid(
    "water",
    pressure=101325,
    temperature=300,
)

print(water.density)
print(water.enthalpy)

with a consistent interface for pure fluids, mixtures, ideal gases, liquid rocket propellants, and engineering materials.

Installation

pip install thermoprop

Features

Fluid

Fluid is a CoolProp-based real-fluid wrapper.

It supports:

  • Pure fluids
  • Fluid mixtures
  • Pressure-temperature states
  • Pressure-enthalpy states
  • Pressure-quality states
  • Temperature-quality states
  • Density-based states
  • Mass-fraction and mole-fraction mixtures

IdealGas

IdealGas is a PYroMat-based ideal-gas wrapper.

It supports:

  • Pure ideal gases
  • Ideal-gas mixtures
  • Temperature states
  • Enthalpy states
  • Internal-energy states
  • Pressure-density closure
  • Cp, Cv, gamma, entropy, Gibbs energy, Helmholtz energy, and speed of sound
  • Thermal expansion coefficient
  • Isothermal compressibility
  • Selected thermodynamic partial derivatives
  • Dynamic & kinematic viscosity (selected species only)
  • Approximate Prandtl number
  • Approximate thermal conductivity

Transport properties are provided for engineering calculations.

Dynamic viscosity is currently available only for species with implemented Sutherland-law coefficients. Thermal conductivity and Prandtl number are estimated using simple kinetic-theory-based correlations and should be considered approximate.

Propellant

Propellant is a RocketProps-based liquid rocket propellant wrapper.

It supports:

  • Liquid rocket propellants
  • Saturated-liquid properties
  • Compressed-liquid properties
  • Density
  • Dynamic viscosity
  • Kinematic viscosity
  • Thermal conductivity
  • Surface tension
  • Vapor pressure
  • Saturation temperature
  • Heat of vaporization
  • Critical properties

Propellant is intended for liquid propellant engineering properties. It is not a thermodynamic flash solver and does not calculate vapor-state properties, two-phase states, enthalpy, internal energy, or entropy.

Material

Material is a built-in isotropic engineering material-property wrapper.

It provides temperature-dependent engineering material properties using ThermoProp's integrated material property database.

Supported properties include:

  • Density
  • Yield strength
  • Ultimate strength
  • Elastic modulus
  • Torsional modulus
  • Poisson ratio
  • Thermal conductivity
  • Specific heat
  • Coefficient of thermal expansion
  • Thermal diffusivity
  • Melting point
  • Electrical resistivity

Currently supported materials include:

Aluminum Alloys

  • Aluminum 6061
  • Aluminum 7075

Copper Alloys

  • Copper C101
  • Copper C11000
  • Copper C17200
  • GRCop-42
  • GRCop-84

Carbon & Low-Alloy Steels

  • 1018 Carbon Steel
  • 1045 Carbon Steel
  • 3140 Low-Alloy Steel
  • 4140 Steel

Stainless Steels

  • Stainless Steel 303
  • Stainless Steel 304
  • Stainless Steel 316
  • A286 Steel

Nickel-Based Superalloys

  • Inconel 625
  • Inconel 718

Ceramics & Non-Metals

  • Graphite

MaterialRegistry

MaterialRegistry maps user-friendly aliases to canonical ThermoProp material names.

Material names can be supplied using common aliases:

from thermoprop import Material

mat = Material("in718")
mat = Material("6061")
mat = Material("304ss")

MaterialRegistry can also be used directly:

from thermoprop import MaterialRegistry

print(MaterialRegistry.name("in718"))
print(MaterialRegistry.name("6061"))
print(MaterialRegistry.name("304ss"))

Example output:

Inconel 718
Aluminum 6061
Stainless Steel 304

Custom aliases can be added at runtime:

from thermoprop import Material
from thermoprop import MaterialRegistry

MaterialRegistry.add_alias(
    "chamber alloy",
    "Inconel 718",
)

mat = Material(
    "chamber alloy",
    temperature=300,
)

print(mat.yield_strength)

Aliases can be removed using:

MaterialRegistry.remove_alias(
    "chamber alloy"
)

FluidRegistry

FluidRegistry maps user-friendly names and aliases to backend-specific names.

For example:

from thermoprop import FluidRegistry

print(FluidRegistry.coolprop_name("rp-1"))
print(FluidRegistry.propellant_name("rp-1"))

outputs different backend names:

n-Dodecane
RP1

This is intentional. Fluid("rp-1") uses CoolProp's n-Dodecane as an RP-1 surrogate, while Propellant("rp-1") uses RocketProps' actual RP1 correlation.

Property Introspection

All ThermoProp wrappers provide utilities for discovering supported properties programmatically.

from thermoprop import Fluid

print(Fluid.supported_properties())

Print supported properties:

Fluid.show_supported_properties()

Check whether a property is supported:

Fluid.supports_property("enthalpy")

The same interface is available for:

  • Fluid
  • IdealGas
  • Propellant
  • Material

Thermodynamic Reference States

ThermoProp provides a unified interface to multiple thermodynamic backends.

Different property libraries may use different reference states for properties such as:

  • Enthalpy
  • Internal energy
  • Entropy

As a result, absolute values of these properties may differ between ThermoProp classes even when pressure, temperature, and composition are identical.

For example, two wrappers representing the same physical state may report different absolute enthalpy values if their underlying thermodynamic libraries use different energy reference conventions.

This behavior is expected and does not indicate an error.

Most engineering calculations depend on property differences rather than absolute values. Properties such as:

  • Temperature
  • Pressure
  • Density
  • Specific heats
  • Speed of sound
  • Enthalpy differences (Δh)
  • Internal-energy differences (Δu)

remain physically meaningful within each backend.

Users combining results from multiple ThermoProp wrappers should establish a consistent thermodynamic reference basis if absolute values of enthalpy, internal energy, or entropy are required.

Pure Fluid Example

from thermoprop import Fluid

water = Fluid(
    "water",
    pressure=101325,
    temperature=300,
)

print(water.density)
print(water.enthalpy)
print(water.phase)

Pressure-Enthalpy Example

from thermoprop import Fluid

water = Fluid(
    "water",
    pressure=101325,
    enthalpy=2.7e6,
)

print(water.temperature)
print(water.quality)
print(water.phase)

Mixture Example

from thermoprop import Fluid

air_like = Fluid(
    {"nitrogen": 0.79, "oxygen": 0.21},
    basis="mole",
    pressure=101325,
    temperature=300,
)

print(air_like.density)
print(air_like.specific_heat_cp)

Ideal Gas Example

from thermoprop import IdealGas

nitrogen = IdealGas(
    "gn2",
    pressure=101325,
    temperature=300,
)

print(nitrogen.density)
print(nitrogen.specific_heat_ratio)
print(nitrogen.speed_of_sound)

Propellant Example

from thermoprop import Propellant

rp1 = Propellant(
    "rp1",
    temperature=293.15,
)

print(rp1.density)
print(rp1.dynamic_viscosity)
print(rp1.vapor_pressure)

Material Example

from thermoprop import Material

inc718 = Material(
    "in718",
    temperature=300,
)

print(inc718.density)
print(inc718.yield_strength)
print(inc718.thermal_conductivity)

Compressed-Liquid Propellant Example

from thermoprop import Propellant

lox = Propellant(
    "lox",
    pressure=3e6,
    temperature=90,
)

print(lox.density)
print(lox.dynamic_viscosity)
print(lox.saturation_pressure)

Propellant Cavitation Margin Example

from thermoprop import Propellant

lox = Propellant(
    "lox",
    pressure=300000,
    temperature=90,
)

margin = lox.pressure - lox.vapor_pressure

print(margin)

Fluid Registry Examples

FluidRegistry can be used to inspect supported names, check backend support, and add custom aliases.

Check Backend Names

from thermoprop import FluidRegistry

print(FluidRegistry.coolprop_name("water"))
print(FluidRegistry.pyromat_name("gn2"))
print(FluidRegistry.propellant_name("rp-1"))

Example output:

Water
N2
RP1

For PYroMat, the ig. prefix can also be requested:

print(FluidRegistry.pyromat_name("gn2", include_prefix=True))

Example output:

ig.N2

Check Backend Support

from thermoprop import FluidRegistry

print(FluidRegistry.supports_coolprop("water"))
print(FluidRegistry.supports_pyromat("gn2"))
print(FluidRegistry.supports_propellant("rp-1"))

List Supported Names

from thermoprop import FluidRegistry

print(FluidRegistry.names)
print(FluidRegistry.coolprop_supported_names)
print(FluidRegistry.pyromat_supported_names)
print(FluidRegistry.propellant_supported_names)

You can also print supported species directly:

FluidRegistry.show_species()
FluidRegistry.show_coolprop_species()
FluidRegistry.show_pyromat_species()
FluidRegistry.show_propellant_species()

Show Aliases

ThermoProp keeps normal fluid aliases and propellant aliases separate.

from thermoprop import FluidRegistry

FluidRegistry.show_aliases()
FluidRegistry.show_propellant_aliases()

This avoids ambiguity. For example:

print(FluidRegistry.coolprop_name("rp-1"))
print(FluidRegistry.propellant_name("rp-1"))

returns:

n-Dodecane
RP1

Add Custom Aliases

Use add_alias() for Fluid and IdealGas names:

from thermoprop import Fluid, FluidRegistry

FluidRegistry.add_alias("my-water", "Water")

water = Fluid(
    "my-water",
    pressure=101325,
    temperature=300,
)

print(water.density)

Use add_propellant_alias() for Propellant names:

from thermoprop import Propellant, FluidRegistry

FluidRegistry.add_propellant_alias("my-rp1", "RP1")

rp1 = Propellant(
    "my-rp1",
    temperature=293.15,
)

print(rp1.density)

Removing aliases works the same way:

FluidRegistry.remove_alias("my-water")
FluidRegistry.remove_propellant_alias("my-rp1")

Common Properties

from thermoprop import Fluid

fluid = Fluid(
    "water",
    pressure=101325,
    temperature=300,
)

print(fluid.pressure)
print(fluid.temperature)
print(fluid.density)
print(fluid.enthalpy)
print(fluid.entropy)
print(fluid.specific_heat_cp)
print(fluid.specific_heat_cv)
print(fluid.specific_heat_ratio)
print(fluid.speed_of_sound)
print(fluid.dynamic_viscosity)
print(fluid.conductivity)

Advanced Thermodynamic Properties

Fluid and IdealGas provide additional thermodynamic properties when supported by the underlying backend.

from thermoprop import Fluid

water = Fluid(
    "water",
    pressure=101325,
    temperature=300,
)

print(water.thermal_expansion_coefficient)
print(water.isothermal_compressibility)
print(water.helmholtz_energy)
print(water.gibbs_energy)
print(water.joule_thomson_coefficient)

For Fluid, these properties are provided by CoolProp.

For IdealGas, some properties are analytic ideal-gas results:

  • thermal_expansion_coefficient = 1 / T
  • isothermal_compressibility = 1 / P
  • joule_thomson_coefficient = 0

Propellant and Material do not support all advanced thermodynamic properties because they are not full thermodynamic equation-of-state wrappers.

Thermodynamic Partial Derivatives

Fluid provides access to CoolProp first partial derivatives using:

fluid.partial_derivative(
    "Hmass",
    "T",
    "P",
)

This evaluates:

(∂h/∂T)_P

Common derivative shortcuts are also available:

print(fluid.dhdT_const_p)
print(fluid.dhdP_const_t)

print(fluid.drhodT_const_p)
print(fluid.drhodP_const_t)

print(fluid.dTdP_const_h)

where:

  • dhdT_const_p is (∂h/∂T)_P
  • dhdP_const_t is (∂h/∂P)_T
  • drhodT_const_p is (∂ρ/∂T)_P
  • drhodP_const_t is (∂ρ/∂P)_T
  • dTdP_const_h is (∂T/∂P)_h

The Joule-Thomson coefficient is exposed as:

print(fluid.joule_thomson_coefficient)

which is equivalent to:

fluid.dTdP_const_h

IdealGas also provides selected analytic partial derivatives for common ideal-gas relationships.

Updating State Properties

ThermoProp states can be updated after creation.

Real Fluid

from thermoprop import Fluid

water = Fluid(
    "water",
    pressure=101325,
    temperature=300,
)

water.pressure = 2e5
water.temperature = 350

print(water.density)
print(water.enthalpy)

You can also update state pairs directly:

water.pressure_temperature = (2e5, 350)
water.pressure_enthalpy = (2e5, 1.5e6)
water.pressure_quality = (101325, 0.5)
water.temperature_quality = (373.15, 1.0)

Ideal Gas

Ideal gases only require a thermal state such as temperature, enthalpy, or internal energy.

from thermoprop import IdealGas

nitrogen = IdealGas(
    "gn2",
    temperature=300,
)

print(nitrogen.enthalpy)
print(nitrogen.internal_energy)
print(nitrogen.specific_heat_cp)

Pressure is optional, but it is required for pressure-dependent properties such as density and entropy:

nitrogen.pressure = 101325

print(nitrogen.density)
print(nitrogen.entropy)

You can also update ideal-gas states:

nitrogen.temperature = 500
nitrogen.pressure_temperature = (101325, 300)
nitrogen.pressure_enthalpy = (101325, nitrogen.enthalpy)

Propellant

Propellants require temperature. Pressure is optional.

from thermoprop import Propellant

rp1 = Propellant(
    "rp1",
    temperature=293.15,
)

print(rp1.density)
print(rp1.specific_heat_cp)

If pressure is omitted, saturated-liquid properties are used.

rp1.pressure = 2e6

print(rp1.density)
print(rp1.dynamic_viscosity)

You can also update the propellant state pair directly:

rp1.pressure_temperature = (2e6, 300)

Propellant Limitations

Propellant wraps RocketProps liquid propellant correlations.

It is intended for liquid engineering properties and does not calculate:

  • Mixture properties
  • Vapor-state properties
  • Two-phase flash states
  • Enthalpy
  • Internal energy
  • Entropy
  • Cv
  • Specific heat ratio
  • Speed of sound

Unsupported properties raise NotImplementedError.

Ideal-Gas Transport Properties

IdealGas provides approximate transport-property support.

Dynamic Viscosity

IdealGas.dynamic_viscosity uses Sutherland's law.

Viscosity is currently supported only for gases with available Sutherland-law constants. Supported gases include:

  • Air
  • Argon
  • Carbon dioxide
  • Carbon monoxide
  • Nitrogen
  • Oxygen
  • Hydrogen
  • Water vapor

Ideal-gas mixtures are supported using Wilke's viscosity mixing rule when viscosity data is available for all constituent species.

from thermoprop import IdealGas

air = IdealGas(
    "air",
    pressure=101325,
    temperature=300,
)

print(air.dynamic_viscosity)

If viscosity data is unavailable for a species, ThermoProp raises NotImplementedError.

Prandtl Number

IdealGas.prandtl provides an approximate Prandtl number based on an Eucken-style kinetic-theory correlation.

print(air.prandtl)

This approximation is intended for engineering calculations and should not be considered a replacement for detailed transport-property models.

Thermal Conductivity

IdealGas.conductivity and IdealGas.thermal_conductivity provide approximate thermal conductivity estimates computed from:

k = Cp μ / Pr

using the wrapper's specific heat, dynamic viscosity, and approximate Prandtl number.

print(air.conductivity)
print(air.thermal_conductivity)

These estimates are intended for engineering calculations and do not use detailed transport-property databases such as those employed by CEA, Cantera, or REFPROP.

Material Limitations

Material currently provides temperature-dependent isotropic engineering material properties.

It does not currently support:

  • Anisotropic materials
  • Composite materials
  • Stress-strain curves
  • Fatigue data
  • Fracture mechanics properties
  • Creep data
  • Pressure-dependent material behavior

Attempting to access unsupported thermodynamic properties such as enthalpy, entropy, viscosity, or vapor quality will raise NotImplementedError.

Acknowledgments

ThermoProp's isotropic material property database was adapted from material property data compiled and distributed through the MatProtLib project.

The author gratefully acknowledges Tyson Tran and the MatProtLib project for making these engineering material datasets publicly available.

MatProtLib:

https://github.com/tysontran/MatProtLib

Source Code

GitHub:

https://github.com/saakethramoju/ThermoProp

License

ThermoProp is released under the GNU General Public License v3.0.

See LICENSE and THIRD_PARTY_LICENSES.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thermoprop-0.3.3.tar.gz (55.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thermoprop-0.3.3-py3-none-any.whl (58.1 kB view details)

Uploaded Python 3

File details

Details for the file thermoprop-0.3.3.tar.gz.

File metadata

  • Download URL: thermoprop-0.3.3.tar.gz
  • Upload date:
  • Size: 55.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for thermoprop-0.3.3.tar.gz
Algorithm Hash digest
SHA256 ae0fa828ef57dd1292f90db94495442f770d9448194449c3679701075cedf2ce
MD5 4fe2e97c90c179aef196b19c5382a39b
BLAKE2b-256 c0e0bbb254f323537c89b4faccaea6b2f69cb43fea1d3ebe0db0c657499c0f74

See more details on using hashes here.

File details

Details for the file thermoprop-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: thermoprop-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 58.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for thermoprop-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 86df4b2933f52a26508052bee108d4c27be90ec38cc474f4e072bd10634785fd
MD5 71e91be62f7f6def2f2c04530a20bb16
BLAKE2b-256 8f2418e741343a31a34ad2bb73a2a8ff873c42582e3a11696bafc46ed06a849d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page