graph TD
A[Start: What do you need?] --> B{Water/steam only?}
B -- No --> C{General fluid or mixture property?}
C -- Yes --> C1[Use PROPS_SI]
C --> C2{Need phase label?}
C2 -- Yes --> C3[Use PHASE_SI]
C -- Metadata/listing --> C4[Use CP_FLUIDS_LIST or CP_FLUID_PARAM]
C -- Fast saturation ancillary --> C5[Use CP_SAT_ANC]
B -- Yes --> D{Need full state properties at T,P?}
D -- Yes --> D1[Use IAPWS95_PROPERTIES]
D --> D2{Need only density?}
D2 -- High continuity/reference --> D3[Use IAPWS95_RHO]
D2 -- Fast industrial steam --> D4[Use IAPWS97_RHO]
D --> D5{Need IF-97 region index?}
D5 -- Yes --> D6[Use IAPWS97_REGION_TP]
D --> E{Need saturation conversions?}
E -- T -> Psat --> E1[Use IAPWS95_PSAT or PSAT_IAPWS]
E -- Psat -> T --> E2[Use IAPWS95_TSAT or TSAT_IAPWS]
E -- Full saturation state --> E3[Use IAPWS95_SATURATION]
E -- dPsat/dT or sat densities --> E4[Use IAPWS92_DPSAT_DT, IAPWS92_RHOL_SAT, IAPWS92_RHOG_SAT]
D --> F{Need inverse T from P and rho?}
F -- Yes --> F1[Use IAPWS95_T]
D --> G{Ice sublimation regime?}
G -- Yes --> G1[Use IAPWS11_PSUB]
Fluid Properties
Overview
Introduction Fluid properties are quantitative thermodynamic and transport quantities (such as density, enthalpy, entropy, heat capacity, phase label, and saturation pressure) that describe the state of a fluid and determine how that fluid behaves in equipment, pipelines, heat exchangers, turbines, refrigeration cycles, and safety calculations. In practical engineering workflows, fluid-property calculations are the bridge between “known operating conditions” and “actionable design decisions.” Given a state pair like temperature and pressure, engineers need reliable values for \rho, h, s, c_p, viscosity, conductivity, and phase to size hardware, compute duties, evaluate efficiency, and validate process safety margins.
At a mathematical level, these tools apply high-accuracy equations of state and ancillary correlations. A generic equation of state can be written as:
f(P, T, \rho)=0
or, in Helmholtz form commonly used by modern multiparameter models:
a(T,\rho)=a^{0}(T,\rho)+a^{r}(T,\rho)
with thermodynamic properties obtained from derivatives of a. This is why robust property engines can generate many outputs from a single state definition. For background, see Equation of state.
This category combines two mature ecosystems: - CoolProp for broad pure-fluid and mixture coverage through high-level APIs. - chemicals.iapws for high-performance implementations of IAPWS water/steam standards.
In Boardflare, this mix supports two frequent usage patterns: 1. General multi-fluid property work (refrigerants, gases, mixtures, quick phase checks) via CoolProp wrappers. 2. High-fidelity water/steam work (industrial steam, boiler/feedwater, near-critical studies, saturation inversion) via IAPWS-focused functions.
The category includes metadata and discovery helpers like CP_FLUID_PARAM and CP_FLUIDS_LIST, state/phase solvers such as PROPS_SI, PHASE_SI, IAPWS95_RHO, and IAPWS97_RHO, and saturation/sublimation functions such as IAPWS95_PSAT, IAPWS95_TSAT, PSAT_IAPWS, TSAT_IAPWS, and IAPWS11_PSUB. Together, they cover most day-to-day thermodynamic property needs in engineering spreadsheets.
When to Use It Use this category when the job is not “derive thermodynamics from first principles,” but “obtain trustworthy fluid properties quickly and consistently inside applied engineering decisions.” Typical jobs-to-be-done include process simulation support, equipment sizing, operating envelope checks, and validation of measurements.
Scenario 1: Process and utility system design (steam, condensate, and heat duties). An engineer sizing a heat exchanger or tracing a steam network often knows T and P at multiple points and needs density, enthalpy, entropy, and heat capacities to compute mass flow, energy balances, and pinch margins. This is where IAPWS95_PROPERTIES gives an efficient “property bundle” from one state, while IAPWS95_RHO or IAPWS97_RHO provide targeted density calls when performance matters. If region logic is needed for IF-97 branch handling, IAPWS97_REGION_TP makes that explicit.
Scenario 2: Saturation and phase-envelope decisions in operations. Operations teams routinely ask questions like: “At this pressure, what is boiling temperature?” or “At this temperature, what saturation pressure should we expect?” These are direct inversion tasks addressed by IAPWS95_PSAT, IAPWS95_TSAT, PSAT_IAPWS, and TSAT_IAPWS. If you need both phase densities and pressure on the saturation line from a single temperature, IAPWS95_SATURATION is usually the most complete choice. For derivative-sensitive controls and sensitivity studies, IAPWS92_DPSAT_DT adds dP_{sat}/dT directly.
Scenario 3: Multi-fluid and refrigeration property workflows. When your fluid is not just water—such as R134a, CO2, hydrocarbon blends, or predefined mixtures—CoolProp-facing functions become the default. PROPS_SI is the workhorse for retrieving a requested property from two independent inputs and a fluid string. PHASE_SI is ideal for explicit phase labeling in spreadsheet logic (e.g., route calculations differently for liquid, gas, two-phase, supercritical). For catalog integration and fluid QA checks, CP_FLUIDS_LIST, CP_FLUID_PARAM, and CP_SAT_ANC provide metadata and fast saturation-ancillary values.
Scenario 4: Low-temperature ice-vapor equilibrium checks. Cryogenic and atmospheric applications can require sublimation pressure rather than liquid-vapor saturation pressure. IAPWS11_PSUB is the specialized tool for that regime, especially below the triple point where conventional boiling-curve intuition fails.
Scenario 5: Inverse-state reconstruction from instruments. Plants may have pressure and density estimates (or inferred density from diagnostics) and need to recover temperature quickly. IAPWS95_T supports that inverse mapping directly and is useful in reconciliation workflows where measured variables differ from model-state variables.
In short, use this category whenever property lookup precision, traceable standards, and spreadsheet-ready repeatability matter more than symbolic derivation.
How It Works These calculators rely on standard thermodynamic closure: two independent intensive variables define a simple compressible pure-fluid state. Once the state is fixed, all other properties are determined by the equation of state and derived relations.
For pure-fluid state evaluation, the foundational logic is:
(x_1, x_2)\;\Rightarrow\;\{\rho, h, s, u, c_p, c_v, w, \ldots\}
In CoolProp workflows, PROPS_SI implements this pattern generically with input/output property codes, and PHASE_SI computes a phase classification from the same state description. CoolProp internally prefers (T,\rho) and can be slower for pairs requiring heavier flash logic (for example, P-H style pairs), which is why input-pair choice affects runtime in large spreadsheet models.
For water/steam, the IAPWS family provides multiple formulations optimized for different needs:
- IAPWS-95 (scientific/reference quality): high continuity and broad accuracy, especially valuable near critical conditions and for smooth derivatives. This underpins IAPWS95_RHO, IAPWS95_PROPERTIES, IAPWS95_T, IAPWS95_PSAT, IAPWS95_TSAT, and IAPWS95_SATURATION.
- IAPWS-97 (industrial formulation): very fast and region-based for engineering steam applications, surfaced through IAPWS97_REGION_TP and IAPWS97_RHO.
- IAPWS-92 supplementary saturation fits: efficient explicit forms for saturation derivative and densities, used by IAPWS92_DPSAT_DT, IAPWS92_RHOL_SAT, and IAPWS92_RHOG_SAT.
- IAPWS explicit saturation convenience relations: PSAT_IAPWS and TSAT_IAPWS for quick T\leftrightarrow P_{sat} conversion.
- IAPWS-11 sublimation curve: IAPWS11_PSUB for ice-vapor equilibrium.
Core saturation relationships in this category follow:
P_{sat}=f(T), \qquad T_{sat}=f^{-1}(P_{sat})
and for two-phase line diagnostics:
\left(\frac{dP_{sat}}{dT},\; \rho_l^{sat},\; \rho_g^{sat}\right)=g(T)
The full saturation-state solve in IAPWS95_SATURATION enforces liquid-vapor equilibrium numerically, solving coupled conditions (equal pressure and equal Gibbs criteria at coexistence) to return P_{sat}, \rho_l, and \rho_g.
A practical implementation assumption across all tools is SI-unit consistency. Many spreadsheet errors in thermodynamic workflows come from hidden unit mismatches (bar vs Pa, °C vs K, kJ/kg vs J/kg). These functions assume SI inputs and return SI outputs, so model reliability depends on explicit unit conversion at sheet boundaries.
Another important assumption is validity range awareness. For example, IF-97 has published region limits and can show discontinuity behavior around region transitions; IAPWS-95 is generally smoother but may be computationally heavier. Selecting the right function is therefore a model-design decision, not just a coding preference.
Finally, metadata and fluid discovery functions (CP_FLUID_PARAM, CP_FLUIDS_LIST) are not numerical solvers but critical supporting tools: they reduce user-input ambiguity, help build validated dropdowns, and improve reproducibility in shared workbooks. CP_SAT_ANC sits between metadata and full flash solving by exposing saturation ancillary equations for rapid branch-specific estimates.
Practical Example Consider a utilities engineer evaluating a steam-heated process loop. The team needs to confirm whether current operating pressure is sufficient, estimate phase margins, and quantify latent-load sensitivity without building a full process simulator.
Step 1: Define known operating points and fluid context. The system uses water/steam. The measured line pressure is near atmospheric to moderate pressure depending on equipment state. Before heavy calculations, the engineer confirms references and fluid metadata in the workbook using CP_FLUIDS_LIST and CP_FLUID_PARAM for consistency checks (especially useful in mixed-fluid organizations where templates are reused).
Step 2: Compute boiling point at observed pressure. If pressure is measured and boiling onset is needed, the engineer uses IAPWS95_TSAT (or TSAT_IAPWS for lightweight inversion) to estimate saturation temperature:
T_{sat}=f^{-1}(P)
This quickly tells operations whether current bulk fluid temperature is subcooled, near saturation, or superheated.
Step 3: Compute saturation pressure at candidate temperatures. For scenario testing (e.g., “What pressure is required to avoid flashing at a new target temperature?”), use IAPWS95_PSAT or PSAT_IAPWS:
P_{sat}=f(T)
This supports setpoint planning and alarm-band design.
Step 4: Evaluate full state properties at operating points. At each measured (T,P) pair, use IAPWS95_PROPERTIES to retrieve \rho, h, s, c_p, and related derivatives from one call. This enables immediate energy-balance and pumping/transport checks in the workbook without manually chaining multiple property calls.
Step 5: Assess two-phase sensitivity and latent behavior. Use IAPWS95_SATURATION at expected saturation temperatures to get P_{sat}, \rho_l, and \rho_g. Pair this with IAPWS92_DPSAT_DT to understand how sensitive saturation pressure is to temperature perturbations near control limits.
Step 6: Cross-check industrial region behavior if needed. If this model will become an operations dashboard where speed is critical, classify the point with IAPWS97_REGION_TP and use IAPWS97_RHO as a fast density path where appropriate. This gives a pragmatic balance: IF-97 speed with awareness of region boundaries.
Step 7: Handle special low-temperature edge cases. For winterization or cold-start scenarios below the triple-point context, compute sublimation pressure with IAPWS11_PSUB rather than applying liquid-vapor assumptions outside their regime.
Step 8: Integrate broader fluid checks for non-water services. If the same plant workbook also covers refrigerants or CO2 loops, switch to PROPS_SI for generalized property retrieval and PHASE_SI for phase-tagged logic. For quick saturation-curve approximations without full state solves, CP_SAT_ANC can be used where ancillary forms are suitable.
This workflow is exactly where Boardflare’s calculator pattern helps: each function is callable from Excel-like formulas, but still grounded in trusted thermophysical libraries. Teams get reproducible, reviewable calculations without custom scripting overhead.
How to Choose Choose first by problem type (metadata, general fluid property, water state, saturation, inverse solve, or phase classification), then by accuracy/speed tradeoff.
| Function | Best use case | Strengths | Watch-outs |
|---|---|---|---|
| CP_FLUIDS_LIST | Build fluid selection lists | Quick discovery, spreadsheet-friendly | Not a property solver |
| CP_FLUID_PARAM | Retrieve identifiers/metadata | Great for validation and UI labels | Returns text, not thermodynamics |
| CP_SAT_ANC | Fast branch-specific saturation ancillary values | Lightweight and direct | Limited to ancillary form/inputs |
| PROPS_SI | General multi-fluid property queries | Flexible I/O pair + broad fluid support | Input-pair quality and phase ambiguity can affect robustness/speed |
| PHASE_SI | Explicit phase classification | Clean logic branch for models | Requires valid state pair and fluid |
| IAPWS95_PROPERTIES | Bundle of key water properties from (T,P) | Rich output in one call | More than needed for single-property use |
| IAPWS95_RHO | Water density from (T,P) with high continuity | Reference-style behavior | Slower than IF-97 in some workloads |
| IAPWS97_RHO | Fast industrial water density | Speed in steam workflows | Region transitions and validity limits matter |
| IAPWS97_REGION_TP | IF-97 region determination | Enables explicit branch control | Region model-specific interpretation |
| IAPWS95_PSAT | High-fidelity T\to P_{sat} | Smooth, accurate saturation curve | Water-only, saturation context |
| IAPWS95_TSAT | High-fidelity P_{sat}\to T | Strong inverse saturation tool | Water-only, valid pressure range |
| PSAT_IAPWS | Quick explicit T\to P_{sat} | Convenient and fast | Fewer outputs than full saturation solvers |
| TSAT_IAPWS | Quick explicit P\to T_{sat} | Convenient and fast | Saturation-only use |
| IAPWS95_SATURATION | Full coexistence state from T | Returns P_{sat},\rho_l,\rho_g together | Iterative solve; tolerance/guesses can matter |
| IAPWS92_DPSAT_DT | Sensitivity of saturation pressure to temperature | Gives derivative plus P_{sat} | Supplemental fit, not full state model |
| IAPWS92_RHOL_SAT | Saturated liquid density vs T | Simple direct call | Supplementary relation |
| IAPWS92_RHOG_SAT | Saturated vapor density vs T | Simple direct call | Supplementary relation |
| IAPWS95_T | Invert temperature from (P,\rho) | Useful for state reconstruction | Inverse solve can be sensitive in edge regions |
| IAPWS11_PSUB | Ice sublimation pressure | Correct physics below triple-point contexts | Not a liquid-vapor boiling relation |
A practical selection rule is: - Prefer IAPWS-95 when continuity, near-critical behavior, and property smoothness are the priority. - Prefer IAPWS-97 when industrial steam speed and region-oriented conventions are the priority. - Use CoolProp high-level tools for non-water fluids, mixed refrigerant tasks, and standardized phase/property API patterns.
If uncertainty remains, begin with IAPWS95_PROPERTIES for water or PROPS_SI for general fluids, validate the phase with PHASE_SI, then optimize to narrower/faster functions once the workbook logic is stable.
CP_FLUID_PARAM
This function fetches fluid metadata text from CoolProp for a given fluid name and parameter key. It is useful for displaying identifiers and descriptive attributes in spreadsheet reports.
The lookup is:
s = g(\text{fluid}, \text{param})
where the output s is a string metadata value returned by the CoolProp database.
Excel Usage
=CP_FLUID_PARAM(fluid, param)
fluid(str, required): CoolProp fluid identifier (for example Water or R134a).param(str, required): Requested metadata key (for example formula or CAS).
Returns (str): Metadata string value for the requested fluid parameter.
Example 1: Water chemical formula string
Inputs:
| fluid | param |
|---|---|
| Water | formula |
Excel formula:
=CP_FLUID_PARAM("Water", "formula")
Expected output:
"H_{2}O_{1}"
Example 2: Water CAS metadata string
Inputs:
| fluid | param |
|---|---|
| Water | CAS |
Excel formula:
=CP_FLUID_PARAM("Water", "CAS")
Expected output:
"7732-18-5"
Example 3: R134a aliases metadata string
Inputs:
| fluid | param |
|---|---|
| R134a | aliases |
Excel formula:
=CP_FLUID_PARAM("R134a", "aliases")
Expected output:
"R134A"
Example 4: Carbon dioxide InChI string
Inputs:
| fluid | param |
|---|---|
| CO2 | INCHI_String |
Excel formula:
=CP_FLUID_PARAM("CO2", "INCHI_String")
Expected output:
"InChI=1S/CO2/c2-1-3"
Python Code
Show Code
import CoolProp.CoolProp as CP
def cp_fluid_param(fluid, param):
"""
Retrieve a CoolProp metadata string for a specified fluid and metadata field.
See: https://coolprop.org/apidoc/CoolProp.CoolProp.html#CoolProp.CoolProp.get_fluid_param_string
This example function is provided as-is without any representation of accuracy.
Args:
fluid (str): CoolProp fluid identifier (for example Water or R134a).
param (str): Requested metadata key (for example formula or CAS).
Returns:
str: Metadata string value for the requested fluid parameter.
"""
try:
# CoolProp uses case-sensitive metadata keys. Accept common variations from spreadsheet users.
def normalize_param(p):
if not isinstance(p, str):
return p
p = p.strip()
if not p:
return p
# Handle common InChI name variations (e.g. INCHI_String, inchi_string)
low = p.lower().replace("_", "").replace(" ", "")
if "inchi" in low:
return "InChIKey" if "key" in low else "InChI"
# Common metadata keys in CoolProp are typically case-sensitive.
# Try removing underscores/spaces and using the value as-is.
return p.replace("_", "").replace(" ", "")
try:
return str(CP.get_fluid_param_string(fluid, param))
except Exception:
normalized = normalize_param(param)
if normalized != param:
try:
return str(CP.get_fluid_param_string(fluid, normalized))
except Exception:
pass
# last effort: try lower-case key
try:
return str(CP.get_fluid_param_string(fluid, str(param).lower()))
except Exception as e:
return f"Error: {str(e)}"
except Exception as e:
return f"Error: {str(e)}"Online Calculator
CP_FLUIDS_LIST
This function returns fluid names included in the CoolProp library. An optional maximum count can be supplied to limit the number of returned rows for lightweight previews in spreadsheet ranges.
The output set is:
\mathcal{F}_k = \{f_1, f_2, \dots, f_k\}
where each f_i is a supported CoolProp fluid name and k is either the full list length or the provided cap.
Excel Usage
=CP_FLUIDS_LIST(max_items)
max_items(int, optional, default: null): Maximum number of fluid names to return; leave blank to return all names.
Returns (list[list]): Single-column table of CoolProp fluid names.
Example 1: Retrieve capped CoolProp fluids list
Inputs:
| max_items |
|---|
| 10 |
Excel formula:
=CP_FLUIDS_LIST(10)
Expected output:
| Isopentane |
|---|
| Neon |
| Fluorine |
| R11 |
| R125 |
| cis-2-Butene |
| R13I1 |
| trans-2-Butene |
| Ethylene |
| Acetone |
Example 2: Repeat capped fluids list retrieval
Inputs:
| max_items |
|---|
| 12 |
Excel formula:
=CP_FLUIDS_LIST(12)
Expected output:
| Isopentane |
|---|
| Neon |
| Fluorine |
| R11 |
| R125 |
| cis-2-Butene |
| R13I1 |
| trans-2-Butene |
| Ethylene |
| Acetone |
| MethylPalmitate |
| DimethylEther |
Example 3: Additional capped fluids list retrieval
Inputs:
| max_items |
|---|
| 15 |
Excel formula:
=CP_FLUIDS_LIST(15)
Expected output:
| Isopentane |
|---|
| Neon |
| Fluorine |
| R11 |
| R125 |
| cis-2-Butene |
| R13I1 |
| trans-2-Butene |
| Ethylene |
| Acetone |
| MethylPalmitate |
| DimethylEther |
| R152A |
| Hydrogen |
| ParaHydrogen |
Example 4: Fourth capped fluids list retrieval
Inputs:
| max_items |
|---|
| 20 |
Excel formula:
=CP_FLUIDS_LIST(20)
Expected output:
| Isopentane |
|---|
| Neon |
| Fluorine |
| R11 |
| R125 |
| cis-2-Butene |
| R13I1 |
| trans-2-Butene |
| Ethylene |
| Acetone |
| MethylPalmitate |
| DimethylEther |
| R152A |
| Hydrogen |
| ParaHydrogen |
| R22 |
| CycloHexane |
| R1233zd(E) |
| Isohexane |
| R236EA |
Python Code
Show Code
import CoolProp.CoolProp as CP
def cp_fluids_list(max_items=None):
"""
Return a list of CoolProp fluid names, optionally capped to a maximum count.
See: https://coolprop.org/apidoc/CoolProp.CoolProp.html#CoolProp.CoolProp.FluidsList
This example function is provided as-is without any representation of accuracy.
Args:
max_items (int, optional): Maximum number of fluid names to return; leave blank to return all names. Default is None.
Returns:
list[list]: Single-column table of CoolProp fluid names.
"""
try:
names = CP.FluidsList()
if max_items is None:
selected = names
else:
if max_items < 1:
return "Error: max_items must be at least 1"
selected = names[:max_items]
return [[name] for name in selected]
except Exception as e:
return f"Error: {str(e)}"Online Calculator
CP_SAT_ANC
This function calls CoolProp’s saturation ancillary equations for a chosen fluid, output property, and quality branch. It is useful for quickly generating saturation-curve values without a full state solve.
The ancillary evaluation is:
y = g(\text{name}, \text{output}, Q, \text{input}, x)
where Q selects the liquid or vapor branch and x is the specified input value.
Excel Usage
=CP_SAT_ANC(name, output, Q, input, value)
name(str, required): CoolProp fluid name.output(str, required): Requested ancillary output property code.Q(int, required): Quality branch selector (typically 0 for liquid, 1 for vapor).input(str, required): Input variable code used by the ancillary equation.value(float, required): Input value for the ancillary equation in SI units.
Returns (float): Saturation ancillary property value for the requested fluid and branch.
Example 1: Water vapor pressure ancillary from temperature
Inputs:
| name | output | Q | input | value |
|---|---|---|---|---|
| Water | p | 1 | T | 373.15 |
Excel formula:
=CP_SAT_ANC("Water", "p", 1, "T", 373.15)
Expected output:
101414
Example 2: Water saturation temperature ancillary from pressure
Inputs:
| name | output | Q | input | value |
|---|---|---|---|---|
| Water | T | 0 | P | 101325 |
Excel formula:
=CP_SAT_ANC("Water", "T", 0, "P", 101325)
Expected output:
373.125
Example 3: R134a saturation temperature ancillary from pressure
Inputs:
| name | output | Q | input | value |
|---|---|---|---|---|
| R134a | T | 0 | P | 702801 |
Excel formula:
=CP_SAT_ANC("R134a", "T", 0, "P", 702801)
Expected output:
300
Python Code
Show Code
import CoolProp.CoolProp as CP
def cp_sat_anc(name, output, Q, input, value):
"""
Evaluate a CoolProp saturation ancillary property for a fluid and branch quality.
See: https://coolprop.org/apidoc/CoolProp.CoolProp.html#CoolProp.CoolProp.saturation_ancillary
This example function is provided as-is without any representation of accuracy.
Args:
name (str): CoolProp fluid name.
output (str): Requested ancillary output property code.
Q (int): Quality branch selector (typically 0 for liquid, 1 for vapor).
input (str): Input variable code used by the ancillary equation.
value (float): Input value for the ancillary equation in SI units.
Returns:
float: Saturation ancillary property value for the requested fluid and branch.
"""
try:
def normalize_code(code: str) -> str:
# CoolProp parameter codes are case-sensitive. Map common lower-case aliases to the correct codes.
if not isinstance(code, str):
return code
code_str = code.strip()
lcode = code_str.lower()
if lcode in ("p", "pressure"):
return "P"
if lcode in ("rho", "density", "d", "dmass", "dmolar"):
return "D"
if lcode in ("t", "temperature"):
return "T"
if lcode in ("h", "enthalpy"):
return "Hmass"
if lcode in ("s", "entropy"):
return "Smass"
if lcode in ("u", "internal_energy"):
return "Umass"
if lcode in ("cp", "cpmass"):
return "Cpmass"
if lcode in ("cv", "cvmass"):
return "Cvmass"
return code_str
output_norm = normalize_code(output)
input_norm = normalize_code(input)
# CoolProp's saturation_ancillary does not support calculating density directly from temperature.
# For density outputs (D/Dmass) with temperature input, compute the saturation pressure first,
# then evaluate density at that pressure.
if output_norm == "D" and input_norm == "T":
p_sat = CP.saturation_ancillary(name, "P", Q, "T", value)
return CP.saturation_ancillary(name, output_norm, Q, "P", p_sat)
return CP.saturation_ancillary(name, output_norm, Q, input_norm, value)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
IAPWS11_PSUB
This function computes sublimation pressure for ice from temperature with the IAPWS-11 sublimation-curve equation. It is applicable to low-temperature phase-equilibrium checks.
The sublimation relation is:
P_{sub} = f(T)
where T is temperature and P_{sub} is sublimation pressure.
Excel Usage
=IAPWS11_PSUB(T)
T(float, required): Temperature for sublimation-pressure evaluation (K).
Returns (float): Sublimation pressure of water at the specified temperature (Pa).
Example 1: Sublimation pressure in cryogenic range
Inputs:
| T |
|---|
| 180 |
Excel formula:
=IAPWS11_PSUB(180)
Expected output:
0.00539278
Example 2: Sublimation pressure near low-temperature reference
Inputs:
| T |
|---|
| 230 |
Excel formula:
=IAPWS11_PSUB(230)
Expected output:
8.94735
Example 3: Sublimation pressure near triple temperature
Inputs:
| T |
|---|
| 273 |
Excel formula:
=IAPWS11_PSUB(273)
Expected output:
603.646
Example 4: Sublimation pressure at mid-low temperature
Inputs:
| T |
|---|
| 250 |
Excel formula:
=IAPWS11_PSUB(250)
Expected output:
76.0127
Python Code
Show Code
from chemicals.iapws import iapws11_Psub as chemicals_iapws11_psub
def iapws11_psub(T):
"""
Compute water-ice sublimation pressure from temperature using IAPWS-11.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws11_Psub
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Temperature for sublimation-pressure evaluation (K).
Returns:
float: Sublimation pressure of water at the specified temperature (Pa).
"""
try:
return chemicals_iapws11_psub(T)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
IAPWS92_DPSAT_DT
This function computes the first derivative of saturation pressure with respect to temperature from the IAPWS-92 equation, and also returns the associated saturation pressure.
The evaluated quantities are:
\left(\frac{dP_{sat}}{dT}, P_{sat}\right) = f(T)
where T is saturation temperature.
Excel Usage
=IAPWS92_DPSAT_DT(T)
T(float, required): Water saturation temperature for derivative evaluation (K).
Returns (dict): Excel data type with saturation pressure derivative as primary value and saturation pressure as an additional property.
Example 1: Derivative and saturation pressure at moderate temperature
Inputs:
| T |
|---|
| 400 |
Excel formula:
=IAPWS92_DPSAT_DT(400)
Expected output:
{"type":"Double","basicValue":7483.47,"properties":{"dPsat dT":{"type":"Double","basicValue":7483.47},"Psat":{"type":"Double","basicValue":245765}}}
Example 2: Derivative and saturation pressure near room temperature
Inputs:
| T |
|---|
| 300 |
Excel formula:
=IAPWS92_DPSAT_DT(300)
Expected output:
{"type":"Double","basicValue":207.913,"properties":{"dPsat dT":{"type":"Double","basicValue":207.913},"Psat":{"type":"Double","basicValue":3536.72}}}
Example 3: Derivative and saturation pressure at elevated temperature
Inputs:
| T |
|---|
| 500 |
Excel formula:
=IAPWS92_DPSAT_DT(500)
Expected output:
{"type":"Double","basicValue":49008.6,"properties":{"dPsat dT":{"type":"Double","basicValue":49008.6},"Psat":{"type":"Double","basicValue":2639220}}}
Example 4: Derivative and saturation pressure near critical temperature
Inputs:
| T |
|---|
| 640 |
Excel formula:
=IAPWS92_DPSAT_DT(640)
Expected output:
{"type":"Double","basicValue":242499,"properties":{"dPsat dT":{"type":"Double","basicValue":242499},"Psat":{"type":"Double","basicValue":20265800}}}
Python Code
Show Code
from chemicals.iapws import iapws92_dPsat_dT as chemicals_iapws92_dpsat_dt
def iapws92_dpsat_dt(T):
"""
Compute saturation pressure derivative with respect to temperature using IAPWS-92.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws92_dPsat_dT
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Water saturation temperature for derivative evaluation (K).
Returns:
dict: Excel data type with saturation pressure derivative as primary value and saturation pressure as an additional property.
"""
try:
dPsat_dT, Psat = chemicals_iapws92_dpsat_dt(T)
return {
"type": "Double",
"basicValue": dPsat_dT,
"properties": {
"dPsat dT": {"type": "Double", "basicValue": dPsat_dT},
"Psat": {"type": "Double", "basicValue": Psat}
}
}
except Exception as e:
return f"Error: {str(e)}"Online Calculator
IAPWS92_RHOG_SAT
This function returns the saturated vapor density of water as a function of temperature using the IAPWS-92 supplementary release fit.
The correlation is:
\rho_g^{sat} = f(T)
where T is saturation temperature and \rho_g^{sat} is saturated vapor density.
Excel Usage
=IAPWS92_RHOG_SAT(T)
T(float, required): Water saturation temperature (K).
Returns (float): Saturated vapor water density at the specified temperature (kg/m^3).
Example 1: Saturated vapor density near room temperature
Inputs:
| T |
|---|
| 300 |
Excel formula:
=IAPWS92_RHOG_SAT(300)
Expected output:
0.0255887
Example 2: Saturated vapor density near boiling point
Inputs:
| T |
|---|
| 373.15 |
Excel formula:
=IAPWS92_RHOG_SAT(373.15)
Expected output:
0.598099
Example 3: Saturated vapor density at elevated temperature
Inputs:
| T |
|---|
| 450 |
Excel formula:
=IAPWS92_RHOG_SAT(450)
Expected output:
4.81192
Example 4: Saturated vapor density near critical temperature
Inputs:
| T |
|---|
| 640 |
Excel formula:
=IAPWS92_RHOG_SAT(640)
Expected output:
177.264
Python Code
Show Code
from chemicals.iapws import iapws92_rhog_sat as chemicals_iapws92_rhog_sat
def iapws92_rhog_sat(T):
"""
Compute saturated vapor water density from temperature using IAPWS-92.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws92_rhog_sat
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Water saturation temperature (K).
Returns:
float: Saturated vapor water density at the specified temperature (kg/m^3).
"""
try:
return chemicals_iapws92_rhog_sat(T)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
IAPWS92_RHOL_SAT
This function returns the saturated liquid density of water as a function of temperature using the IAPWS-92 supplementary release fit.
The correlation is:
\rho_l^{sat} = f(T)
where T is saturation temperature and \rho_l^{sat} is saturated liquid density.
Excel Usage
=IAPWS92_RHOL_SAT(T)
T(float, required): Water saturation temperature (K).
Returns (float): Saturated liquid water density at the specified temperature (kg/m^3).
Example 1: Saturated liquid density near room temperature
Inputs:
| T |
|---|
| 300 |
Excel formula:
=IAPWS92_RHOL_SAT(300)
Expected output:
996.509
Example 2: Saturated liquid density near boiling point
Inputs:
| T |
|---|
| 373.15 |
Excel formula:
=IAPWS92_RHOL_SAT(373.15)
Expected output:
958.347
Example 3: Saturated liquid density at elevated temperature
Inputs:
| T |
|---|
| 450 |
Excel formula:
=IAPWS92_RHOL_SAT(450)
Expected output:
890.344
Example 4: Saturated liquid density near critical temperature
Inputs:
| T |
|---|
| 640 |
Excel formula:
=IAPWS92_RHOL_SAT(640)
Expected output:
481.945
Python Code
Show Code
from chemicals.iapws import iapws92_rhol_sat as chemicals_iapws92_rhol_sat
def iapws92_rhol_sat(T):
"""
Compute saturated liquid water density from temperature using IAPWS-92.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws92_rhol_sat
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Water saturation temperature (K).
Returns:
float: Saturated liquid water density at the specified temperature (kg/m^3).
"""
try:
return chemicals_iapws92_rhol_sat(T)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
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)}"Online Calculator
IAPWS95_PSAT
This function computes the saturation vapor pressure of water from temperature using high-accuracy IAPWS-95 fit equations. It is intended for smooth and precise saturation-line evaluation.
The saturation mapping is:
P_{sat} = f(T)
where T is temperature and P_{sat} is saturation pressure.
Excel Usage
=IAPWS95_PSAT(T)
T(float, required): Water saturation temperature (K).
Returns (float): Saturation vapor pressure of water at the specified temperature (Pa).
Example 1: Saturation pressure at moderate temperature
Inputs:
| T |
|---|
| 400 |
Excel formula:
=IAPWS95_PSAT(400)
Expected output:
245769
Example 2: Saturation pressure near low fit range
Inputs:
| T |
|---|
| 240 |
Excel formula:
=IAPWS95_PSAT(240)
Expected output:
37.6195
Example 3: Saturation pressure at elevated temperature
Inputs:
| T |
|---|
| 500 |
Excel formula:
=IAPWS95_PSAT(500)
Expected output:
2639200
Example 4: Saturation pressure near critical point
Inputs:
| T |
|---|
| 646 |
Excel formula:
=IAPWS95_PSAT(646)
Expected output:
21774900
Python Code
Show Code
from chemicals.iapws import iapws95_Psat as chemicals_iapws95_psat
def iapws95_psat(T):
"""
Compute saturation pressure from temperature using IAPWS-95 polynomial fits.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws95_Psat
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Water saturation temperature (K).
Returns:
float: Saturation vapor pressure of water at the specified temperature (Pa).
"""
try:
return chemicals_iapws95_psat(T)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
IAPWS95_RHO
This function computes water density from temperature and pressure using the high-accuracy IAPWS-95 equation of state. It supports liquid, vapor, and supercritical regions within the model validity.
The state relation is:
\rho = f(T, P)
where \rho is mass density, T is temperature, and P is pressure.
Excel Usage
=IAPWS95_RHO(T, P)
T(float, required): Water temperature (K).P(float, required): Water pressure (Pa).
Returns (float): Water density at the specified state (kg/m^3).
Example 1: Compressed liquid density reference point
Inputs:
| T | P |
|---|---|
| 300 | 1000000 |
Excel formula:
=IAPWS95_RHO(300, 1000000)
Expected output:
996.96
Example 2: Low pressure high temperature state
Inputs:
| T | P |
|---|---|
| 500 | 100000 |
Excel formula:
=IAPWS95_RHO(500, 100000)
Expected output:
0.43514
Example 3: Near critical state density
Inputs:
| T | P |
|---|---|
| 640 | 22000000 |
Excel formula:
=IAPWS95_RHO(640, 22000000)
Expected output:
524.064
Example 4: Very high temperature and pressure state
Inputs:
| T | P |
|---|---|
| 1200 | 50000000 |
Excel formula:
=IAPWS95_RHO(1200, 50000000)
Expected output:
94.2499
Python Code
Show Code
from chemicals.iapws import iapws95_rho as chemicals_iapws95_rho
def iapws95_rho(T, P):
"""
Compute water density from temperature and pressure using IAPWS-95.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws95_rho
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Water temperature (K).
P (float): Water pressure (Pa).
Returns:
float: Water density at the specified state (kg/m^3).
"""
try:
return chemicals_iapws95_rho(T, P)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
IAPWS95_SATURATION
This function solves the IAPWS-95 vapor-liquid saturation equations at a specified temperature and returns saturation pressure and both phase densities.
The solved saturation state is:
(P_{sat}, \rho_l, \rho_g) = f(T, x_{tol}, \rho_{l,guess}, \rho_{g,guess})
where T is saturation temperature and optional solver settings control numerical convergence.
Excel Usage
=IAPWS95_SATURATION(T, xtol, rhol_guess, rhog_guess)
T(float, required): Water saturation temperature (K).xtol(float, optional, default: 0.00001): Solver tolerance for saturation equations (-).rhol_guess(float, optional, default: null): Optional initial guess for saturated liquid density (kg/m^3).rhog_guess(float, optional, default: null): Optional initial guess for saturated vapor density (kg/m^3).
Returns (dict): Excel data type containing saturation pressure as primary value and saturated liquid and vapor densities as properties.
Example 1: Saturation state at moderate temperature with default settings
Inputs:
| T | xtol | rhol_guess | rhog_guess |
|---|---|---|---|
| 400 | 0.00001 |
Excel formula:
=IAPWS95_SATURATION(400, 0.00001, , )
Expected output:
{"type":"Double","basicValue":245769,"properties":{"Psat":{"type":"Double","basicValue":245769},"Rhol":{"type":"Double","basicValue":937.486},"Rhog":{"type":"Double","basicValue":1.36941}}}
Example 2: Saturation state at elevated temperature with tighter tolerance
Inputs:
| T | xtol | rhol_guess | rhog_guess |
|---|---|---|---|
| 500 | 0.000001 |
Excel formula:
=IAPWS95_SATURATION(500, 0.000001, , )
Expected output:
{"type":"Double","basicValue":2639200,"properties":{"Psat":{"type":"Double","basicValue":2639200},"Rhol":{"type":"Double","basicValue":831.313},"Rhog":{"type":"Double","basicValue":13.1989}}}
Example 3: Near critical saturation with custom density guesses
Inputs:
| T | xtol | rhol_guess | rhog_guess |
|---|---|---|---|
| 640 | 0.00001 | 500 | 150 |
Excel formula:
=IAPWS95_SATURATION(640, 0.00001, 500, 150)
Expected output:
{"type":"Double","basicValue":20265200,"properties":{"Psat":{"type":"Double","basicValue":20265200},"Rhol":{"type":"Double","basicValue":481.526},"Rhog":{"type":"Double","basicValue":177.145}}}
Example 4: Low temperature saturation with custom density guesses
Inputs:
| T | xtol | rhol_guess | rhog_guess |
|---|---|---|---|
| 300 | 0.00001 | 996 | 0.03 |
Excel formula:
=IAPWS95_SATURATION(300, 0.00001, 996, 0.03)
Expected output:
{"type":"Double","basicValue":3536.81,"properties":{"Psat":{"type":"Double","basicValue":3536.81},"Rhol":{"type":"Double","basicValue":996.513},"Rhog":{"type":"Double","basicValue":0.0255897}}}
Python Code
Show Code
from chemicals.iapws import iapws95_saturation as chemicals_iapws95_saturation
def iapws95_saturation(T, xtol=1e-05, rhol_guess=None, rhog_guess=None):
"""
Solve IAPWS-95 saturation state from temperature.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws95_saturation
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Water saturation temperature (K).
xtol (float, optional): Solver tolerance for saturation equations (-). Default is 1e-05.
rhol_guess (float, optional): Optional initial guess for saturated liquid density (kg/m^3). Default is None.
rhog_guess (float, optional): Optional initial guess for saturated vapor density (kg/m^3). Default is None.
Returns:
dict: Excel data type containing saturation pressure as primary value and saturated liquid and vapor densities as properties.
"""
try:
Psat, rhol, rhog = chemicals_iapws95_saturation(T, xtol=xtol, rhol_guess=rhol_guess, rhog_guess=rhog_guess)
return {
"type": "Double",
"basicValue": Psat,
"properties": {
"Psat": {"type": "Double", "basicValue": Psat},
"Rhol": {"type": "Double", "basicValue": rhol},
"Rhog": {"type": "Double", "basicValue": rhog}
}
}
except Exception as e:
return f"Error: {str(e)}"Online Calculator
IAPWS95_T
This function inverts the IAPWS-95 formulation to estimate water temperature from pressure and density. It is useful for state reconstruction when pressure and density are measured inputs.
The inverse state mapping is:
T = f^{-1}(P, \rho)
where P is pressure and \rho is mass density.
Excel Usage
=IAPWS95_T(P, rho)
P(float, required): Water pressure (Pa).rho(float, required): Water mass density (kg/m^3).
Returns (float): Water temperature corresponding to the specified pressure and density (K).
Example 1: Invert compressed-water state
Inputs:
| P | rho |
|---|---|
| 1000000 | 995 |
Excel formula:
=IAPWS95_T(1000000, 995)
Expected output:
306.462
Example 2: Moderate pressure dense state inversion
Inputs:
| P | rho |
|---|---|
| 5000000 | 975 |
Excel formula:
=IAPWS95_T(5000000, 975)
Expected output:
351.482
Example 3: Low density vapor-side inversion
Inputs:
| P | rho |
|---|---|
| 200000 | 1.5 |
Excel formula:
=IAPWS95_T(200000, 1.5)
Expected output:
350.651
Example 4: Near critical dense inversion
Inputs:
| P | rho |
|---|---|
| 22000000 | 350 |
Excel formula:
=IAPWS95_T(22000000, 350)
Expected output:
646.862
Python Code
Show Code
from chemicals.iapws import iapws95_T as chemicals_iapws95_t
def iapws95_t(P, rho):
"""
Compute water temperature from pressure and density using IAPWS-95.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws95_T
This example function is provided as-is without any representation of accuracy.
Args:
P (float): Water pressure (Pa).
rho (float): Water mass density (kg/m^3).
Returns:
float: Water temperature corresponding to the specified pressure and density (K).
"""
try:
return chemicals_iapws95_t(P, rho)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
IAPWS95_TSAT
This function computes saturation temperature for water from saturation pressure using the IAPWS-95 inverse saturation fit.
The inverse relation is:
T_{sat} = f^{-1}(P_{sat})
where P_{sat} is saturation pressure and T_{sat} is saturation temperature.
Excel Usage
=IAPWS95_TSAT(Psat)
Psat(float, required): Water saturation pressure (Pa).
Returns (float): Saturation temperature of water at the specified saturation pressure (K).
Example 1: Saturation temperature at low pressure
Inputs:
| Psat |
|---|
| 50000 |
Excel formula:
=IAPWS95_TSAT(50000)
Expected output:
354.467
Example 2: Saturation temperature near one atmosphere
Inputs:
| Psat |
|---|
| 101325 |
Excel formula:
=IAPWS95_TSAT(101325)
Expected output:
373.124
Example 3: Saturation temperature at elevated pressure
Inputs:
| Psat |
|---|
| 1000000 |
Excel formula:
=IAPWS95_TSAT(1000000)
Expected output:
453.028
Example 4: Saturation temperature near critical pressure
Inputs:
| Psat |
|---|
| 20000000 |
Excel formula:
=IAPWS95_TSAT(20000000)
Expected output:
638.899
Python Code
Show Code
from chemicals.iapws import iapws95_Tsat as chemicals_iapws95_tsat
def iapws95_tsat(Psat):
"""
Compute saturation temperature from pressure using IAPWS-95.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws95_Tsat
This example function is provided as-is without any representation of accuracy.
Args:
Psat (float): Water saturation pressure (Pa).
Returns:
float: Saturation temperature of water at the specified saturation pressure (K).
"""
try:
return chemicals_iapws95_tsat(Psat)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
IAPWS97_REGION_TP
This function classifies a water state into one of the IF-97 thermodynamic regions using temperature and pressure. The result enables branch logic in formulas that require region-specific equations.
Region identification is:
r = g(T, P)
where r \in \{1,2,3,5\} for valid single-phase IF-97 regions reachable by a T-P input pair.
Excel Usage
=IAPWS97_REGION_TP(T, P, use_ninety_five_boundary)
T(float, required): Water temperature (K).P(float, required): Water pressure (Pa).use_ninety_five_boundary(bool, optional, default: false): Use IAPWS-95 vapor-pressure boundary instead of IF-97 boundary (-).
Returns (int): IF-97 region index (1, 2, 3, or 5).
Example 1: Region one liquid-like state
Inputs:
| T | P | use_ninety_five_boundary |
|---|---|---|
| 400 | 1000000 | false |
Excel formula:
=IAPWS97_REGION_TP(400, 1000000, FALSE)
Expected output:
1
Example 2: Region two vapor-like state
Inputs:
| T | P | use_ninety_five_boundary |
|---|---|---|
| 700 | 1000000 | false |
Excel formula:
=IAPWS97_REGION_TP(700, 1000000, FALSE)
Expected output:
2
Example 3: Region three dense near-critical state
Inputs:
| T | P | use_ninety_five_boundary |
|---|---|---|
| 650 | 25000000 | false |
Excel formula:
=IAPWS97_REGION_TP(650, 25000000, FALSE)
Expected output:
3
Example 4: Region five high-temperature state
Inputs:
| T | P | use_ninety_five_boundary |
|---|---|---|
| 1800 | 1000000 | true |
Excel formula:
=IAPWS97_REGION_TP(1800, 1000000, TRUE)
Expected output:
5
Python Code
Show Code
from chemicals.iapws import iapws97_identify_region_TP as chemicals_iapws97_identify_region_tp
def iapws97_region_tp(T, P, use_ninety_five_boundary=False):
"""
Identify the IF-97 region from temperature and pressure.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws97_identify_region_TP
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Water temperature (K).
P (float): Water pressure (Pa).
use_ninety_five_boundary (bool, optional): Use IAPWS-95 vapor-pressure boundary instead of IF-97 boundary (-). Default is False.
Returns:
int: IF-97 region index (1, 2, 3, or 5).
"""
try:
return chemicals_iapws97_identify_region_tp(T, P, use_95_boundary=use_ninety_five_boundary)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
IAPWS97_RHO
This function computes the mass density of water or steam from temperature and pressure using the IF-97 industrial formulation. It is suited for fast property evaluation in engineering calculations.
The mapping is:
\rho = f(T, P)
where \rho is mass density, T is temperature, and P is pressure.
Excel Usage
=IAPWS97_RHO(T, P, use_ninety_five_boundary)
T(float, required): Water temperature (K).P(float, required): Water pressure (Pa).use_ninety_five_boundary(bool, optional, default: false): Use IAPWS-95 vapor-pressure boundary instead of IF-97 boundary (-).
Returns (float): Water density at the specified state (kg/m^3).
Example 1: Compressed water density
Inputs:
| T | P | use_ninety_five_boundary |
|---|---|---|
| 330 | 800000 | false |
Excel formula:
=IAPWS97_RHO(330, 800000, FALSE)
Expected output:
985.105
Example 2: Near critical state density
Inputs:
| T | P | use_ninety_five_boundary |
|---|---|---|
| 648.6 | 22500000 | false |
Excel formula:
=IAPWS97_RHO(648.6, 22500000, FALSE)
Expected output:
353.061
Example 3: Superheated steam density
Inputs:
| T | P | use_ninety_five_boundary |
|---|---|---|
| 823 | 14000000 | false |
Excel formula:
=IAPWS97_RHO(823, 14000000, FALSE)
Expected output:
40.3929
Example 4: High temperature region-five density
Inputs:
| T | P | use_ninety_five_boundary |
|---|---|---|
| 2000 | 30000000 | true |
Excel formula:
=IAPWS97_RHO(2000, 30000000, TRUE)
Expected output:
32.1146
Python Code
Show Code
from chemicals.iapws import iapws97_rho as chemicals_iapws97_rho
def iapws97_rho(T, P, use_ninety_five_boundary=False):
"""
Compute water density from temperature and pressure using IAPWS-97.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.iapws97_rho
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Water temperature (K).
P (float): Water pressure (Pa).
use_ninety_five_boundary (bool, optional): Use IAPWS-95 vapor-pressure boundary instead of IF-97 boundary (-). Default is False.
Returns:
float: Water density at the specified state (kg/m^3).
"""
try:
return chemicals_iapws97_rho(T, P, use_95_boundary=use_ninety_five_boundary)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
PHASE_SI
This function determines the thermodynamic phase region of a fluid by querying CoolProp with two independent input properties and one fluid identifier. The output is a phase label such as liquid, gas, twophase, or supercritical.
Phase determination can be expressed as:
\phi = g\left(n_1, v_1,\; n_2, v_2,\; \text{fluid}\right)
where n_1,n_2 are property codes, v_1,v_2 are SI values, and \phi is the returned phase classification string.
Excel Usage
=PHASE_SI(phase_si_name_one, value_one, phase_si_name_two, value_two, fluid)
phase_si_name_one(str, required): Name of the first input property (e.g., ‘T’, ‘P’).value_one(float, required): Value of the first input property in SI units.phase_si_name_two(str, required): Name of the second input property (e.g., ‘P’, ‘Q’).value_two(float, required): Value of the second input property in SI units.fluid(str, required): Fluid name (e.g., ‘Water’, ‘R134a’).
Returns (str): Phase description string (e.g., ‘liquid’, ‘gas’).
Example 1: Water Liquid Phase
Inputs:
| phase_si_name_one | value_one | phase_si_name_two | value_two | fluid |
|---|---|---|---|---|
| T | 300 | P | 101325 | Water |
Excel formula:
=PHASE_SI("T", 300, "P", 101325, "Water")
Expected output:
"liquid"
Example 2: Water Gas Phase
Inputs:
| phase_si_name_one | value_one | phase_si_name_two | value_two | fluid |
|---|---|---|---|---|
| T | 400 | P | 101325 | Water |
Excel formula:
=PHASE_SI("T", 400, "P", 101325, "Water")
Expected output:
"gas"
Example 3: Water Two-Phase
Inputs:
| phase_si_name_one | value_one | phase_si_name_two | value_two | fluid |
|---|---|---|---|---|
| T | 373.15 | Q | 0.5 | Water |
Excel formula:
=PHASE_SI("T", 373.15, "Q", 0.5, "Water")
Expected output:
"twophase"
Example 4: CO2 Supercritical
Inputs:
| phase_si_name_one | value_one | phase_si_name_two | value_two | fluid |
|---|---|---|---|---|
| T | 350 | P | 10000000 | CO2 |
Excel formula:
=PHASE_SI("T", 350, "P", 10000000, "CO2")
Expected output:
"supercritical"
Python Code
Show Code
import CoolProp.CoolProp as CP
def phase_si(phase_si_name_one, value_one, phase_si_name_two, value_two, fluid):
"""
Identify the phase of a fluid at a given state using CoolProp.
See: https://coolprop.org/coolprop/HighLevelAPI.html#phasesi-function
This example function is provided as-is without any representation of accuracy.
Args:
phase_si_name_one (str): Name of the first input property (e.g., 'T', 'P'). Valid options: Temperature (T), Pressure (P), Density (D), Enthalpy (H), Entropy (S), Vapor Quality (Q), Internal Energy (U).
value_one (float): Value of the first input property in SI units.
phase_si_name_two (str): Name of the second input property (e.g., 'P', 'Q'). Valid options: Temperature (T), Pressure (P), Density (D), Enthalpy (H), Entropy (S), Vapor Quality (Q), Internal Energy (U).
value_two (float): Value of the second input property in SI units.
fluid (str): Fluid name (e.g., 'Water', 'R134a').
Returns:
str: Phase description string (e.g., 'liquid', 'gas').
"""
try:
# CoolProp.PhaseSI(name1, prop1, name2, prop2, Ref)
result = CP.PhaseSI(phase_si_name_one, value_one, phase_si_name_two, value_two, fluid)
return str(result)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
PROPS_SI
This function evaluates a requested thermophysical property for a pure fluid or mixture string using CoolProp’s high-level SI interface with two independent state inputs. It supports common thermodynamic and transport properties such as density, enthalpy, entropy, viscosity, and conductivity.
The property calculation is represented as:
y = h\left(o,\; n_1, v_1,\; n_2, v_2,\; \text{fluid}\right)
where o is the requested output property code, n_1,n_2 are input property codes, v_1,v_2 are SI values, and y is the computed scalar result.
Excel Usage
=PROPS_SI(props_si_output, props_si_name_one, value_one, props_si_name_two, value_two, fluid)
props_si_output(str, required): Desired property code (e.g., ‘D’ for density, ‘H’ for enthalpy).props_si_name_one(str, required): Name of the first input property (e.g., ‘T’, ‘P’).value_one(float, required): Value of the first input property in SI units.props_si_name_two(str, required): Name of the second input property (e.g., ‘P’, ‘Q’).value_two(float, required): Value of the second input property in SI units.fluid(str, required): Fluid name (e.g., ‘Water’, ‘R134a’) or mixture string.
Returns (float): Calculated property value in SI units.
Example 1: Density of Water at STP
Inputs:
| props_si_output | props_si_name_one | value_one | props_si_name_two | value_two | fluid |
|---|---|---|---|---|---|
| D | T | 298.15 | P | 101325 | Water |
Excel formula:
=PROPS_SI("D", "T", 298.15, "P", 101325, "Water")
Expected output:
997.048
Example 2: Boiling point of Water at 1 atm
Inputs:
| props_si_output | props_si_name_one | value_one | props_si_name_two | value_two | fluid |
|---|---|---|---|---|---|
| T | P | 101325 | Q | 0 | Water |
Excel formula:
=PROPS_SI("T", "P", 101325, "Q", 0, "Water")
Expected output:
373.124
Example 3: Enthalpy of R134a
Inputs:
| props_si_output | props_si_name_one | value_one | props_si_name_two | value_two | fluid |
|---|---|---|---|---|---|
| H | T | 298.15 | Q | 1 | R134a |
Excel formula:
=PROPS_SI("H", "T", 298.15, "Q", 1, "R134a")
Expected output:
412334
Example 4: CO2 Supercritical Density
Inputs:
| props_si_output | props_si_name_one | value_one | props_si_name_two | value_two | fluid |
|---|---|---|---|---|---|
| D | T | 350 | P | 10000000 | CO2 |
Excel formula:
=PROPS_SI("D", "T", 350, "P", 10000000, "CO2")
Expected output:
228.804
Python Code
Show Code
import CoolProp.CoolProp as CP
def props_si(props_si_output, props_si_name_one, value_one, props_si_name_two, value_two, fluid):
"""
Calculate thermophysical properties of fluids using CoolProp.
See: https://coolprop.org/coolprop/HighLevelAPI.html#propssi-function
This example function is provided as-is without any representation of accuracy.
Args:
props_si_output (str): Desired property code (e.g., 'D' for density, 'H' for enthalpy). Valid options: Temperature (T), Pressure (P), Density (D), Enthalpy (H), Entropy (S), Vapor Quality (Q), Internal Energy (U), Specific Heat Cp (C), Specific Heat Cv (O), Thermal Cond. (L), Viscosity (V), Prandtl (Prandtl), Speed of Sound (A), Phase Index (Phase).
props_si_name_one (str): Name of the first input property (e.g., 'T', 'P'). Valid options: Temperature (T), Pressure (P), Density (D), Enthalpy (H), Entropy (S), Vapor Quality (Q), Internal Energy (U).
value_one (float): Value of the first input property in SI units.
props_si_name_two (str): Name of the second input property (e.g., 'P', 'Q'). Valid options: Temperature (T), Pressure (P), Density (D), Enthalpy (H), Entropy (S), Vapor Quality (Q), Internal Energy (U).
value_two (float): Value of the second input property in SI units.
fluid (str): Fluid name (e.g., 'Water', 'R134a') or mixture string.
Returns:
float: Calculated property value in SI units.
"""
try:
# CoolProp.PropsSI(output, name1, prop1, name2, prop2, Ref)
result = CP.PropsSI(props_si_output, props_si_name_one, value_one, props_si_name_two, value_two, fluid)
return float(result)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
PSAT_IAPWS
This function calculates the vapor pressure of water as a function of temperature using the explicit IAPWS saturation relation. It is useful for boiling-point and phase-envelope calculations.
The relation is:
P_{sat} = f(T)
where T is temperature and P_{sat} is saturation pressure.
Excel Usage
=PSAT_IAPWS(T)
T(float, required): Water temperature along saturation conditions (K).
Returns (float): Saturation pressure of water at the specified temperature (Pa).
Example 1: Saturation pressure near room temperature
Inputs:
| T |
|---|
| 300 |
Excel formula:
=PSAT_IAPWS(300)
Expected output:
3536.59
Example 2: Saturation pressure near one atmosphere boiling point
Inputs:
| T |
|---|
| 373.15 |
Excel formula:
=PSAT_IAPWS(373.15)
Expected output:
101418
Example 3: Saturation pressure at elevated temperature
Inputs:
| T |
|---|
| 450 |
Excel formula:
=PSAT_IAPWS(450)
Expected output:
932041
Example 4: Saturation pressure near critical temperature
Inputs:
| T |
|---|
| 640 |
Excel formula:
=PSAT_IAPWS(640)
Expected output:
20265900
Python Code
Show Code
from chemicals.iapws import Psat_IAPWS as chemicals_psat_iapws
def psat_iapws(T):
"""
Compute water saturation pressure from temperature with the explicit IAPWS equation.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.Psat_IAPWS
This example function is provided as-is without any representation of accuracy.
Args:
T (float): Water temperature along saturation conditions (K).
Returns:
float: Saturation pressure of water at the specified temperature (Pa).
"""
try:
return chemicals_psat_iapws(T)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
TSAT_IAPWS
This function computes the saturation temperature corresponding to a specified water vapor pressure using the explicit IAPWS inverse relation. It supports pressure-to-boiling-temperature conversions in process calculations.
The inverse saturation mapping is:
T_{sat} = f^{-1}(P)
where P is saturation pressure and T_{sat} is saturation temperature.
Excel Usage
=TSAT_IAPWS(P)
P(float, required): Water saturation pressure (Pa).
Returns (float): Saturation temperature of water at the specified pressure (K).
Example 1: Saturation temperature near one atmosphere
Inputs:
| P |
|---|
| 101325 |
Excel formula:
=TSAT_IAPWS(101325)
Expected output:
373.124
Example 2: Saturation temperature at reduced pressure
Inputs:
| P |
|---|
| 50000 |
Excel formula:
=TSAT_IAPWS(50000)
Expected output:
354.467
Example 3: Saturation temperature at elevated pressure
Inputs:
| P |
|---|
| 500000 |
Excel formula:
=TSAT_IAPWS(500000)
Expected output:
424.986
Example 4: Saturation temperature near critical pressure
Inputs:
| P |
|---|
| 20000000 |
Excel formula:
=TSAT_IAPWS(20000000)
Expected output:
638.896
Python Code
Show Code
from chemicals.iapws import Tsat_IAPWS as chemicals_tsat_iapws
def tsat_iapws(P):
"""
Compute water saturation temperature from pressure with the explicit IAPWS equation.
See: https://chemicals.readthedocs.io/chemicals.iapws.html#chemicals.iapws.Tsat_IAPWS
This example function is provided as-is without any representation of accuracy.
Args:
P (float): Water saturation pressure (Pa).
Returns:
float: Saturation temperature of water at the specified pressure (K).
"""
try:
return chemicals_tsat_iapws(P)
except Exception as e:
return f"Error: {str(e)}"Online Calculator