IAPWS95_PROPERTIES
This function evaluates a water state from temperature and pressure using the IAPWS-95 formulation and returns a bundle of core thermodynamic properties. It is useful for steam-table style workflows where multiple coupled properties are needed from one state point.
The state mapping is:
(T, P) \mapsto (\rho, u, s, h, c_v, c_p, w, JT, \delta_T, \beta_s, \partial\rho/\partial P|_T)
where T is temperature and P is pressure, and the output contains mass-based properties and selected derivatives.
Excel Usage
=IAPWS95_PROPERTIES(T, P)
T(float, required): Water temperature (K).P(float, required): Water pressure (Pa).
Returns (dict): Excel data type containing density as the primary value and additional IAPWS-95 state properties.
Example 1: Water state near ambient pressure
Inputs:
| T | P |
|---|---|
| 300 | 100000 |
Excel formula:
=IAPWS95_PROPERTIES(300, 100000)
Expected output:
{"type":"Double","basicValue":996.556,"properties":{"Density":{"type":"Double","basicValue":996.556},"Internal Energy":{"type":"Double","basicValue":112553},"Entropy":{"type":"Double","basicValue":393.062},"Enthalpy":{"type":"Double","basicValue":112654},"Isochoric Heat Capacity":{"type":"Double","basicValue":4130.18},"Isobaric Heat Capacity":{"type":"Double","basicValue":4180.64},"Speed Of Sound":{"type":"Double","basicValue":1501.52},"Joule Thomson Coefficient":{"type":"Double","basicValue":-2.20237e-7},"Isothermal Throttling Coefficient":{"type":"Double","basicValue":0.00092073},"Isentropic Temperature Pressure Coefficient":{"type":"Double","basicValue":1.97879e-8},"Drho Dp At Constant Temperature":{"type":"Double","basicValue":4.48964e-7}}}
Example 2: Compressed liquid state at moderate pressure
Inputs:
| T | P |
|---|---|
| 320 | 5000000 |
Excel formula:
=IAPWS95_PROPERTIES(320, 5000000)
Expected output:
{"type":"Double","basicValue":991.555,"properties":{"Density":{"type":"Double","basicValue":991.555},"Internal Energy":{"type":"Double","basicValue":195462},"Entropy":{"type":"Double","basicValue":660.657},"Enthalpy":{"type":"Double","basicValue":200505},"Isochoric Heat Capacity":{"type":"Double","basicValue":4028.54},"Isobaric Heat Capacity":{"type":"Double","basicValue":4169.2},"Speed Of Sound":{"type":"Double","basicValue":1547.57},"Joule Thomson Coefficient":{"type":"Double","basicValue":-2.08161e-7},"Isothermal Throttling Coefficient":{"type":"Double","basicValue":0.000867866},"Isentropic Temperature Pressure Coefficient":{"type":"Double","basicValue":3.37357e-8},"Drho Dp At Constant Temperature":{"type":"Double","basicValue":4.32118e-7}}}
Example 3: High temperature low pressure state
Inputs:
| T | P |
|---|---|
| 500 | 100000 |
Excel formula:
=IAPWS95_PROPERTIES(500, 100000)
Expected output:
{"type":"Double","basicValue":0.43514,"properties":{"Density":{"type":"Double","basicValue":0.43514},"Internal Energy":{"type":"Double","basicValue":2698750},"Entropy":{"type":"Double","basicValue":7944.73},"Enthalpy":{"type":"Double","basicValue":2928560},"Isochoric Heat Capacity":{"type":"Double","basicValue":1508.18},"Isobaric Heat Capacity":{"type":"Double","basicValue":1981.26},"Speed Of Sound":{"type":"Double","basicValue":548.314},"Joule Thomson Coefficient":{"type":"Double","basicValue":0.0000192977},"Isothermal Throttling Coefficient":{"type":"Double","basicValue":-0.0382338},"Isentropic Temperature Pressure Coefficient":{"type":"Double","basicValue":0.00117922},"Drho Dp At Constant Temperature":{"type":"Double","basicValue":0.00000436948}}}
Example 4: Near critical pressure water state
Inputs:
| T | P |
|---|---|
| 640 | 22000000 |
Excel formula:
=IAPWS95_PROPERTIES(640, 22000000)
Expected output:
{"type":"Double","basicValue":524.064,"properties":{"Density":{"type":"Double","basicValue":524.064},"Internal Energy":{"type":"Double","basicValue":1752480},"Entropy":{"type":"Double","basicValue":3958.24},"Enthalpy":{"type":"Double","basicValue":1794460},"Isochoric Heat Capacity":{"type":"Double","basicValue":3209.35},"Isobaric Heat Capacity":{"type":"Double","basicValue":13173.3},"Speed Of Sound":{"type":"Double","basicValue":510.381},"Joule Thomson Coefficient":{"type":"Double","basicValue":0.00000130717},"Isothermal Throttling Coefficient":{"type":"Double","basicValue":-0.0172197},"Isentropic Temperature Pressure Coefficient":{"type":"Double","basicValue":0.00000145202},"Drho Dp At Constant Temperature":{"type":"Double","basicValue":0.0000157575}}}
Python Code
Show Code
from chemicals.iapws import iapws95_properties as chemicals_iapws95_properties
def iapws95_properties(T, P):
"""
Return key water thermodynamic properties from temperature and pressure using IAPWS-95.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws95_properties
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Water temperature (K).
P (float): Water pressure (Pa).
Returns:
dict: Excel data type containing density as the primary value and additional IAPWS-95 state properties.
"""
try:
rho, U, S, H, Cv, Cp, w, JT, delta_T, beta_s, drho_dP = chemicals_iapws95_properties(T, P)
return {
"type": "Double",
"basicValue": rho,
"properties": {
"Density": {"type": "Double", "basicValue": rho},
"Internal Energy": {"type": "Double", "basicValue": U},
"Entropy": {"type": "Double", "basicValue": S},
"Enthalpy": {"type": "Double", "basicValue": H},
"Isochoric Heat Capacity": {"type": "Double", "basicValue": Cv},
"Isobaric Heat Capacity": {"type": "Double", "basicValue": Cp},
"Speed Of Sound": {"type": "Double", "basicValue": w},
"Joule Thomson Coefficient": {"type": "Double", "basicValue": JT},
"Isothermal Throttling Coefficient": {"type": "Double", "basicValue": delta_T},
"Isentropic Temperature Pressure Coefficient": {"type": "Double", "basicValue": beta_s},
"Drho Dp At Constant Temperature": {"type": "Double", "basicValue": drho_dP}
}
}
except Exception as e:
return f"Error: {str(e)}"