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
Water temperature (K).
Water pressure (Pa).
Use IAPWS-95 vapor-pressure boundary instead of IF-97 boundary (-).