CoolProp Database Skill
Query thermodynamic and transport properties for over 100 pure and pseudo-pure fluids using the CoolProp open-source thermophysical property library.
Overview
CoolProp is a comprehensive thermophysical property database that provides:
- Pure Fluids: Water, air, ammonia, carbon dioxide, and 100+ others
- Refrigerants: R134a, R410A, R32, R404A, R407C, R507A, and many more
- Industrial Fluids: Methane, ethane, propane, butane, nitrogen, oxygen, argon
- Transport Properties: Viscosity, thermal conductivity, surface tension
- Thermodynamic Properties: Enthalpy, entropy, density, specific heat
- Phase Information: Saturation properties, two-phase behavior, critical points
CoolProp uses high-accuracy equations of state (Helmholtz energy formulations) and is validated against NIST REFPROP data.
Installation
Python
pip install CoolProp
Verify Installation
import CoolProp
print(CoolProp.__version__)
print(CoolProp.get_global_param_string("version"))
Core API Functions
PropsSI - Primary Property Query Function
from CoolProp.CoolProp import PropsSI
# Syntax: PropsSI(output, input1_name, input1_value, input2_name, input2_value, fluid)
value = PropsSI('D', 'T', 298.15, 'P', 101325, 'Water')
Props1SI - Single Input Properties
from CoolProp.CoolProp import Props1SI
# For properties requiring only fluid name
T_crit = Props1SI('Tcrit', 'Water') # Critical temperature
P_crit = Props1SI('Pcrit', 'Water') # Critical pressure
Property Codes (Input/Output Parameters)
Thermodynamic Properties
| Code |
Property |
SI Unit |
Description |
T |
Temperature |
K |
Absolute temperature |
P |
Pressure |
Pa |
Absolute pressure |
D |
Density |
kg/m³ |
Mass density |
H |
Enthalpy |
J/kg |
Specific enthalpy |
S |
Entropy |
J/kg/K |
Specific entropy |
U |
Internal Energy |
J/kg |
Specific internal energy |
Q |
Quality |
- |
Vapor mass fraction (0-1) |
Dmolar |
Molar Density |
mol/m³ |
Molar density |
Hmolar |
Molar Enthalpy |
J/mol |
Molar enthalpy |
Smolar |
Molar Entropy |
J/mol/K |
Molar entropy |
Transport Properties
| Code |
Property |
SI Unit |
Description |
V |
Viscosity |
Pa·s |
Dynamic viscosity |
L |
Thermal Conductivity |
W/m/K |
Thermal conductivity |
C |
Specific Heat (const P) |
J/kg/K |
Cp at constant pressure |
O |
Specific Heat (const V) |
J/kg/K |
Cv at constant volume |
PRANDTL |
Prandtl Number |
- |
Pr = μ·Cp/k |
I |
Surface Tension |
N/m |
Liquid-vapor interface |
Phase Properties
| Code |
Property |
SI Unit |
Description |
Phase |
Phase Index |
- |
0=Liquid, 3=Supercritical, 5=Gas, 6=Two-phase |
Q |
Quality |
- |
0=Saturated liquid, 1=Saturated vapor |
Critical/Triple Point Properties (Use with Props1SI)
| Code |
Property |
SI Unit |
Description |
Tcrit |
Critical Temperature |
K |
Critical point temperature |
Pcrit |
Critical Pressure |
Pa |
Critical point pressure |
Ttriple |
Triple Point Temp |
K |
Triple point temperature |
Ptriple |
Triple Point Press |
Pa |
Triple point pressure |
M |
Molar Mass |
kg/mol |
Molecular weight |
ACENTRIC |
Acentric Factor |
- |
Pitzer acentric factor |
Common Fluids
Water and Air
Water - Pure water (H₂O)
Air - Dry air (pseudo-pure mixture)
Common Refrigerants
R134a - HFC, common in automotive AC
R410A - HFC blend, residential AC/heat pumps
R32 - HFC, lower GWP alternative
R404A - HFC blend, commercial refrigeration
R407C - HFC blend, AC systems
R507A - HFC blend, low-temperature refrigeration
R22 - HCFC (being phased out)
R717 - Ammonia (NH₃)
R744 - Carbon dioxide (CO₂)
Hydrocarbons
Methane, Ethane, Propane, n-Butane, IsoButane
n-Pentane, Isopentane, n-Hexane, n-Heptane, n-Octane
n-Nonane, n-Decane
Cryogenic Gases
Nitrogen, Oxygen, Argon, Helium, Neon, Hydrogen
Industrial Gases
CO2 - Carbon dioxide
CO - Carbon monoxide
H2S - Hydrogen sulfide
SO2 - Sulfur dioxide
Ammonia - NH₃
Query Examples
Example 1: Water Properties at Standard Conditions
from CoolProp.CoolProp import PropsSI
# Water at 25°C (298.15 K) and 1 atm (101325 Pa)
T = 298.15 # K
P = 101325 # Pa
density = PropsSI('D', 'T', T, 'P', P, 'Water') # kg/m³
enthalpy = PropsSI('H', 'T', T, 'P', P, 'Water') # J/kg
entropy = PropsSI('S', 'T', T, 'P', P, 'Water') # J/kg/K
viscosity = PropsSI('V', 'T', T, 'P', P, 'Water') # Pa·s
cp = PropsSI('C', 'T', T, 'P', P, 'Water') # J/kg/K
print(f"Water at {T-273.15}°C and {P/1000:.1f} kPa:")
print(f" Density: {density:.2f} kg/m³")
print(f" Enthalpy: {enthalpy/1000:.2f} kJ/kg")
print(f" Entropy: {entropy/1000:.4f} kJ/kg·K")
print(f" Viscosity: {viscosity*1000:.4f} mPa·s")
print(f" Cp: {cp/1000:.4f} kJ/kg·K")
Example 2: Refrigerant Saturation Properties
from CoolProp.CoolProp import PropsSI
# R134a saturation properties at 25°C
T_sat = 298.15 # K
fluid = 'R134a'
# Get saturation pressure at this temperature
P_sat = PropsSI('P', 'T', T_sat, 'Q', 0, fluid) # Pa
# Saturated liquid properties (Q=0)
rho_liquid = PropsSI('D', 'T', T_sat, 'Q', 0, fluid)
h_liquid = PropsSI('H', 'T', T_sat, 'Q', 0, fluid)
s_liquid = PropsSI('S', 'T', T_sat, 'Q', 0, fluid)
# Saturated vapor properties (Q=1)
rho_vapor = PropsSI('D', 'T', T_sat, 'Q', 1, fluid)
h_vapor = PropsSI('H', 'T', T_sat, 'Q', 1, fluid)
s_vapor = PropsSI('S', 'T', T_sat, 'Q', 1, fluid)
# Latent heat
h_fg = h_vapor - h_liquid
print(f"{fluid} at {T_sat-273.15}°C:")
print(f" Saturation pressure: {P_sat/1000:.2f} kPa")
print(f" Liquid density: {rho_liquid:.2f} kg/m³")
print(f" Vapor density: {rho_vapor:.2f} kg/m³")
print(f" Latent heat: {h_fg/1000:.2f} kJ/kg")
Example 3: Pressure-Enthalpy (P-H) State Point
from CoolProp.CoolProp import PropsSI
# Find temperature at known pressure and enthalpy
P = 500000 # 5 bar = 500 kPa
h = 250000 # 250 kJ/kg
T = PropsSI('T', 'P', P, 'H', h, 'R134a')
Q = PropsSI('Q', 'P', P, 'H', h, 'R134a')
print(f"R134a at {P/1000:.0f} kPa and {h/1000:.0f} kJ/kg:")
print(f" Temperature: {T-273.15:.2f}°C")
print(f" Quality: {Q:.4f} (0=liquid, 1=vapor)")
Example 4: Critical and Triple Point Data
from CoolProp.CoolProp import Props1SI
fluids = ['Water', 'CO2', 'Nitrogen', 'R134a']
for fluid in fluids:
T_crit = Props1SI('Tcrit', fluid)
P_crit = Props1SI('Pcrit', fluid)
T_triple = Props1SI('Ttriple', fluid)
M = Props1SI('M', fluid)
print(f"\n{fluid}:")
print(f" Critical point: {T_crit-273.15:.2f}°C, {P_crit/1e6:.2f} MPa")
print(f" Triple point: {T_triple-273.15:.2f}°C")
print(f" Molar mass: {M*1000:.2f} g/mol")
Example 5: Viscosity Temperature Dependence
from CoolProp.CoolProp import PropsSI
import numpy as np
# Calculate water viscosity from 0°C to 100°C at atmospheric pressure
P = 101325 # Pa
temperatures = np.linspace(273.15, 373.15, 11) # 0 to 100°C
print("Water viscosity vs temperature:")
print("T(°C) μ(mPa·s)")
for T in temperatures:
mu = PropsSI('V', 'T', T, 'P', P, 'Water') * 1000 # Convert to mPa·s
print(f"{T-273.15:5.0f} {mu:.4f}")
Example 6: Two-Phase Properties
from CoolProp.CoolProp import PropsSI
# R134a at 10 bar with 50% quality
P = 1000000 # 10 bar = 1 MPa
Q = 0.5 # 50% vapor
T = PropsSI('T', 'P', P, 'Q', Q, 'R134a')
h = PropsSI('H', 'P', P, 'Q', Q, 'R134a')
s = PropsSI('S', 'P', P, 'Q', Q, 'R134a')
rho = PropsSI('D', 'P', P, 'Q', Q, 'R134a')
print(f"R134a two-phase at {P/1e6:.1f} MPa, quality = {Q}:")
print(f" Temperature: {T-273.15:.2f}°C")
print(f" Enthalpy: {h/1000:.2f} kJ/kg")
print(f" Entropy: {s/1000:.4f} kJ/kg·K")
print(f" Density: {rho:.2f} kg/m³")
Temperature and Pressure Effects
Temperature Ranges
- Each fluid has valid temperature ranges between triple point and maximum temperature
- Typical range: Triple point temperature < T < 2000 K (varies by fluid)
- Check limits using
Props1SI('Tmin', fluid) and Props1SI('Tmax', fluid)
Pressure Ranges
- Each fluid has valid pressure ranges
- Typical range: Triple point pressure < P < 1000 MPa (varies by fluid)
- Check limits using
Props1SI('pmin', fluid) and Props1SI('pmax', fluid)
Phase Regions
- Subcooled Liquid: T < T_sat at given P, or P > P_sat at given T
- Two-Phase: T = T_sat and 0 < Q < 1
- Superheated Vapor: T > T_sat at given P, or P < P_sat at given T
- Supercritical: T > T_crit and P > P_crit
Input Pair Restrictions
Not all input pairs are valid in all regions:
- (T, P): Valid in single-phase regions only (not in two-phase)
- (P, Q): Valid for two-phase and saturation (0 ≤ Q ≤ 1)
- (T, Q): Valid for two-phase and saturation (0 ≤ Q ≤ 1)
- (P, H): Valid in all regions
- (P, S): Valid in all regions
- (H, S): Valid in all regions (useful for isentropic processes)
Error Handling
Common Errors and Solutions
Error: "CoolProp error: [PropsSI] Two saturation inputs are not valid"
- Problem: Trying to use (T, P) in two-phase region
- Solution: Use (T, Q) or (P, Q) for two-phase states
Error: "CoolProp error: Value is outside range"
- Problem: Temperature or pressure outside valid range
- Solution: Check fluid limits with Props1SI('Tmin', fluid), etc.
Error: "CoolProp error: Fluid not found"
- Problem: Incorrect fluid name or spelling
- Solution: Use exact fluid names (case-sensitive), check documentation
Error: "Unable to match the inputs"
- Problem: Invalid input combination or iteration failed
- Solution: Check that input values are physically reasonable
Safe Query Pattern
from CoolProp.CoolProp import PropsSI
def safe_props(output, input1, value1, input2, value2, fluid):
"""Query CoolProp with error handling"""
try:
result = PropsSI(output, input1, value1, input2, value2, fluid)
return result
except ValueError as e:
print(f"Error querying {fluid}: {e}")
return None
except Exception as e:
print(f"Unexpected error: {e}")
return None
# Usage
density = safe_props('D', 'T', 300, 'P', 101325, 'Water')
if density is not None:
print(f"Density: {density:.2f} kg/m³")
Engineering Applications
HVAC System Design
- Refrigerant cycle analysis (evaporator, condenser, compressor, expansion)
- Heat exchanger calculations
- Coefficient of performance (COP) calculations
Power Cycles
- Rankine cycle (steam turbines)
- Brayton cycle (gas turbines)
- Organic Rankine Cycle (ORC)
Process Engineering
- Heat transfer calculations
- Pipe flow and pressure drop
- Phase equilibrium
- Storage tank design
Cryogenic Systems
- Liquefaction processes
- Storage and handling
- Heat leak calculations
References
Official Documentation
Key Papers
- Bell, I. H., Wronski, J., Quoilin, S., & Lemort, V. (2014). "Pure and Pseudo-pure Fluid Thermophysical Property Evaluation and the Open-Source Thermophysical Property Library CoolProp." Industrial & Engineering Chemistry Research, 53(6), 2498-2508.
Equation of State References
- Lemmon, E. W., Huber, M. L., & McLinden, M. O. (2013). NIST Standard Reference Database 23: Reference Fluid Thermodynamic and Transport Properties (REFPROP), Version 9.1. National Institute of Standards and Technology.
Source Code
Best Practices
- Always use SI units for inputs and outputs (K, Pa, J/kg, etc.)
- Check phase regions before choosing input pairs
- Handle errors gracefully with try-except blocks
- Validate ranges before querying (especially temperature and pressure)
- Use quality (Q) for two-phase calculations
- Cache critical properties if querying multiple times
- Use Props1SI for fluid-only properties (critical points, molar mass)
- Prefer (P, H) or (P, S) for robust queries across all phase regions
Quick Reference Table
| Task |
Function |
Example |
| Two-input property |
PropsSI(output, in1, val1, in2, val2, fluid) |
PropsSI('D', 'T', 300, 'P', 101325, 'Water') |
| Single-input property |
Props1SI(param, fluid) |
Props1SI('Tcrit', 'Water') |
| Saturation liquid |
Use Q=0 |
PropsSI('H', 'T', 300, 'Q', 0, 'R134a') |
| Saturation vapor |
Use Q=1 |
PropsSI('H', 'T', 300, 'Q', 1, 'R134a') |
| Two-phase |
Use 0<Q<1 |
PropsSI('D', 'P', 500000, 'Q', 0.5, 'R134a') |
| List all fluids |
CoolProp.__fluids__ |
import CoolProp; print(CoolProp.__fluids__) |
This skill provides access to one of the most comprehensive open-source thermophysical property databases available, suitable for research, engineering design, and educational applications.
1---2name: coolprop-db3description: Query thermodynamic properties for 100+ fluids from CoolProp database4---56# CoolProp Database Skill78Query thermodynamic and transport properties for over 100 pure and pseudo-pure fluids using the CoolProp open-source thermophysical property library.910## Overview1112CoolProp is a comprehensive thermophysical property database that provides:1314- **Pure Fluids**: Water, air, ammonia, carbon dioxide, and 100+ others15- **Refrigerants**: R134a, R410A, R32, R404A, R407C, R507A, and many more16- **Industrial Fluids**: Methane, ethane, propane, butane, nitrogen, oxygen, argon17- **Transport Properties**: Viscosity, thermal conductivity, surface tension18- **Thermodynamic Properties**: Enthalpy, entropy, density, specific heat19- **Phase Information**: Saturation properties, two-phase behavior, critical points2021CoolProp uses high-accuracy equations of state (Helmholtz energy formulations) and is validated against NIST REFPROP data.2223## Installation2425### Python26```bash27pip install CoolProp28```2930### Verify Installation31```python32import CoolProp33print(CoolProp.__version__)34print(CoolProp.get_global_param_string("version"))35```3637## Core API Functions3839### PropsSI - Primary Property Query Function40```python41from CoolProp.CoolProp import PropsSI4243# Syntax: PropsSI(output, input1_name, input1_value, input2_name, input2_value, fluid)44value = PropsSI('D', 'T', 298.15, 'P', 101325, 'Water')45```4647### Props1SI - Single Input Properties48```python49from CoolProp.CoolProp import Props1SI5051# For properties requiring only fluid name52T_crit = Props1SI('Tcrit', 'Water') # Critical temperature53P_crit = Props1SI('Pcrit', 'Water') # Critical pressure54```5556## Property Codes (Input/Output Parameters)5758### Thermodynamic Properties59| Code | Property | SI Unit | Description |60|------|----------|---------|-------------|61| `T` | Temperature | K | Absolute temperature |62| `P` | Pressure | Pa | Absolute pressure |63| `D` | Density | kg/m³ | Mass density |64| `H` | Enthalpy | J/kg | Specific enthalpy |65| `S` | Entropy | J/kg/K | Specific entropy |66| `U` | Internal Energy | J/kg | Specific internal energy |67| `Q` | Quality | - | Vapor mass fraction (0-1) |68| `Dmolar` | Molar Density | mol/m³ | Molar density |69| `Hmolar` | Molar Enthalpy | J/mol | Molar enthalpy |70| `Smolar` | Molar Entropy | J/mol/K | Molar entropy |7172### Transport Properties73| Code | Property | SI Unit | Description |74|------|----------|---------|-------------|75| `V` | Viscosity | Pa·s | Dynamic viscosity |76| `L` | Thermal Conductivity | W/m/K | Thermal conductivity |77| `C` | Specific Heat (const P) | J/kg/K | Cp at constant pressure |78| `O` | Specific Heat (const V) | J/kg/K | Cv at constant volume |79| `PRANDTL` | Prandtl Number | - | Pr = μ·Cp/k |80| `I` | Surface Tension | N/m | Liquid-vapor interface |8182### Phase Properties83| Code | Property | SI Unit | Description |84|------|----------|---------|-------------|85| `Phase` | Phase Index | - | 0=Liquid, 3=Supercritical, 5=Gas, 6=Two-phase |86| `Q` | Quality | - | 0=Saturated liquid, 1=Saturated vapor |8788### Critical/Triple Point Properties (Use with Props1SI)89| Code | Property | SI Unit | Description |90|------|----------|---------|-------------|91| `Tcrit` | Critical Temperature | K | Critical point temperature |92| `Pcrit` | Critical Pressure | Pa | Critical point pressure |93| `Ttriple` | Triple Point Temp | K | Triple point temperature |94| `Ptriple` | Triple Point Press | Pa | Triple point pressure |95| `M` | Molar Mass | kg/mol | Molecular weight |96| `ACENTRIC` | Acentric Factor | - | Pitzer acentric factor |9798## Common Fluids99100### Water and Air101- `Water` - Pure water (H₂O)102- `Air` - Dry air (pseudo-pure mixture)103104### Common Refrigerants105- `R134a` - HFC, common in automotive AC106- `R410A` - HFC blend, residential AC/heat pumps107- `R32` - HFC, lower GWP alternative108- `R404A` - HFC blend, commercial refrigeration109- `R407C` - HFC blend, AC systems110- `R507A` - HFC blend, low-temperature refrigeration111- `R22` - HCFC (being phased out)112- `R717` - Ammonia (NH₃)113- `R744` - Carbon dioxide (CO₂)114115### Hydrocarbons116- `Methane`, `Ethane`, `Propane`, `n-Butane`, `IsoButane`117- `n-Pentane`, `Isopentane`, `n-Hexane`, `n-Heptane`, `n-Octane`118- `n-Nonane`, `n-Decane`119120### Cryogenic Gases121- `Nitrogen`, `Oxygen`, `Argon`, `Helium`, `Neon`, `Hydrogen`122123### Industrial Gases124- `CO2` - Carbon dioxide125- `CO` - Carbon monoxide126- `H2S` - Hydrogen sulfide127- `SO2` - Sulfur dioxide128- `Ammonia` - NH₃129130## Query Examples131132### Example 1: Water Properties at Standard Conditions133```python134from CoolProp.CoolProp import PropsSI135136# Water at 25°C (298.15 K) and 1 atm (101325 Pa)137T = 298.15 # K138P = 101325 # Pa139140density = PropsSI('D', 'T', T, 'P', P, 'Water') # kg/m³141enthalpy = PropsSI('H', 'T', T, 'P', P, 'Water') # J/kg142entropy = PropsSI('S', 'T', T, 'P', P, 'Water') # J/kg/K143viscosity = PropsSI('V', 'T', T, 'P', P, 'Water') # Pa·s144cp = PropsSI('C', 'T', T, 'P', P, 'Water') # J/kg/K145146print(f"Water at {T-273.15}°C and {P/1000:.1f} kPa:")147print(f" Density: {density:.2f} kg/m³")148print(f" Enthalpy: {enthalpy/1000:.2f} kJ/kg")149print(f" Entropy: {entropy/1000:.4f} kJ/kg·K")150print(f" Viscosity: {viscosity*1000:.4f} mPa·s")151print(f" Cp: {cp/1000:.4f} kJ/kg·K")152```153154### Example 2: Refrigerant Saturation Properties155```python156from CoolProp.CoolProp import PropsSI157158# R134a saturation properties at 25°C159T_sat = 298.15 # K160fluid = 'R134a'161162# Get saturation pressure at this temperature163P_sat = PropsSI('P', 'T', T_sat, 'Q', 0, fluid) # Pa164165# Saturated liquid properties (Q=0)166rho_liquid = PropsSI('D', 'T', T_sat, 'Q', 0, fluid)167h_liquid = PropsSI('H', 'T', T_sat, 'Q', 0, fluid)168s_liquid = PropsSI('S', 'T', T_sat, 'Q', 0, fluid)169170# Saturated vapor properties (Q=1)171rho_vapor = PropsSI('D', 'T', T_sat, 'Q', 1, fluid)172h_vapor = PropsSI('H', 'T', T_sat, 'Q', 1, fluid)173s_vapor = PropsSI('S', 'T', T_sat, 'Q', 1, fluid)174175# Latent heat176h_fg = h_vapor - h_liquid177178print(f"{fluid} at {T_sat-273.15}°C:")179print(f" Saturation pressure: {P_sat/1000:.2f} kPa")180print(f" Liquid density: {rho_liquid:.2f} kg/m³")181print(f" Vapor density: {rho_vapor:.2f} kg/m³")182print(f" Latent heat: {h_fg/1000:.2f} kJ/kg")183```184185### Example 3: Pressure-Enthalpy (P-H) State Point186```python187from CoolProp.CoolProp import PropsSI188189# Find temperature at known pressure and enthalpy190P = 500000 # 5 bar = 500 kPa191h = 250000 # 250 kJ/kg192193T = PropsSI('T', 'P', P, 'H', h, 'R134a')194Q = PropsSI('Q', 'P', P, 'H', h, 'R134a')195196print(f"R134a at {P/1000:.0f} kPa and {h/1000:.0f} kJ/kg:")197print(f" Temperature: {T-273.15:.2f}°C")198print(f" Quality: {Q:.4f} (0=liquid, 1=vapor)")199```200201### Example 4: Critical and Triple Point Data202```python203from CoolProp.CoolProp import Props1SI204205fluids = ['Water', 'CO2', 'Nitrogen', 'R134a']206207for fluid in fluids:208 T_crit = Props1SI('Tcrit', fluid)209 P_crit = Props1SI('Pcrit', fluid)210 T_triple = Props1SI('Ttriple', fluid)211 M = Props1SI('M', fluid)212213 print(f"\n{fluid}:")214 print(f" Critical point: {T_crit-273.15:.2f}°C, {P_crit/1e6:.2f} MPa")215 print(f" Triple point: {T_triple-273.15:.2f}°C")216 print(f" Molar mass: {M*1000:.2f} g/mol")217```218219### Example 5: Viscosity Temperature Dependence220```python221from CoolProp.CoolProp import PropsSI222import numpy as np223224# Calculate water viscosity from 0°C to 100°C at atmospheric pressure225P = 101325 # Pa226temperatures = np.linspace(273.15, 373.15, 11) # 0 to 100°C227228print("Water viscosity vs temperature:")229print("T(°C) μ(mPa·s)")230for T in temperatures:231 mu = PropsSI('V', 'T', T, 'P', P, 'Water') * 1000 # Convert to mPa·s232 print(f"{T-273.15:5.0f} {mu:.4f}")233```234235### Example 6: Two-Phase Properties236```python237from CoolProp.CoolProp import PropsSI238239# R134a at 10 bar with 50% quality240P = 1000000 # 10 bar = 1 MPa241Q = 0.5 # 50% vapor242243T = PropsSI('T', 'P', P, 'Q', Q, 'R134a')244h = PropsSI('H', 'P', P, 'Q', Q, 'R134a')245s = PropsSI('S', 'P', P, 'Q', Q, 'R134a')246rho = PropsSI('D', 'P', P, 'Q', Q, 'R134a')247248print(f"R134a two-phase at {P/1e6:.1f} MPa, quality = {Q}:")249print(f" Temperature: {T-273.15:.2f}°C")250print(f" Enthalpy: {h/1000:.2f} kJ/kg")251print(f" Entropy: {s/1000:.4f} kJ/kg·K")252print(f" Density: {rho:.2f} kg/m³")253```254255## Temperature and Pressure Effects256257### Temperature Ranges258- Each fluid has valid temperature ranges between triple point and maximum temperature259- Typical range: Triple point temperature < T < 2000 K (varies by fluid)260- Check limits using `Props1SI('Tmin', fluid)` and `Props1SI('Tmax', fluid)`261262### Pressure Ranges263- Each fluid has valid pressure ranges264- Typical range: Triple point pressure < P < 1000 MPa (varies by fluid)265- Check limits using `Props1SI('pmin', fluid)` and `Props1SI('pmax', fluid)`266267### Phase Regions2681. **Subcooled Liquid**: T < T_sat at given P, or P > P_sat at given T2692. **Two-Phase**: T = T_sat and 0 < Q < 12703. **Superheated Vapor**: T > T_sat at given P, or P < P_sat at given T2714. **Supercritical**: T > T_crit and P > P_crit272273### Input Pair Restrictions274Not all input pairs are valid in all regions:275- **(T, P)**: Valid in single-phase regions only (not in two-phase)276- **(P, Q)**: Valid for two-phase and saturation (0 ≤ Q ≤ 1)277- **(T, Q)**: Valid for two-phase and saturation (0 ≤ Q ≤ 1)278- **(P, H)**: Valid in all regions279- **(P, S)**: Valid in all regions280- **(H, S)**: Valid in all regions (useful for isentropic processes)281282## Error Handling283284### Common Errors and Solutions285286**Error: "CoolProp error: [PropsSI] Two saturation inputs are not valid"**287- Problem: Trying to use (T, P) in two-phase region288- Solution: Use (T, Q) or (P, Q) for two-phase states289290**Error: "CoolProp error: Value is outside range"**291- Problem: Temperature or pressure outside valid range292- Solution: Check fluid limits with Props1SI('Tmin', fluid), etc.293294**Error: "CoolProp error: Fluid not found"**295- Problem: Incorrect fluid name or spelling296- Solution: Use exact fluid names (case-sensitive), check documentation297298**Error: "Unable to match the inputs"**299- Problem: Invalid input combination or iteration failed300- Solution: Check that input values are physically reasonable301302### Safe Query Pattern303```python304from CoolProp.CoolProp import PropsSI305306def safe_props(output, input1, value1, input2, value2, fluid):307 """Query CoolProp with error handling"""308 try:309 result = PropsSI(output, input1, value1, input2, value2, fluid)310 return result311 except ValueError as e:312 print(f"Error querying {fluid}: {e}")313 return None314 except Exception as e:315 print(f"Unexpected error: {e}")316 return None317318# Usage319density = safe_props('D', 'T', 300, 'P', 101325, 'Water')320if density is not None:321 print(f"Density: {density:.2f} kg/m³")322```323324## Engineering Applications325326### HVAC System Design327- Refrigerant cycle analysis (evaporator, condenser, compressor, expansion)328- Heat exchanger calculations329- Coefficient of performance (COP) calculations330331### Power Cycles332- Rankine cycle (steam turbines)333- Brayton cycle (gas turbines)334- Organic Rankine Cycle (ORC)335336### Process Engineering337- Heat transfer calculations338- Pipe flow and pressure drop339- Phase equilibrium340- Storage tank design341342### Cryogenic Systems343- Liquefaction processes344- Storage and handling345- Heat leak calculations346347## References348349### Official Documentation350- **CoolProp Website**: http://www.coolprop.org/351- **Python Documentation**: http://www.coolprop.org/coolprop/HighLevelAPI.html352- **Fluid Properties**: http://www.coolprop.org/fluid_properties/PurePseudoPure.html353- **Validation Data**: http://www.coolprop.org/validation/index.html354355### Key Papers356- Bell, I. H., Wronski, J., Quoilin, S., & Lemort, V. (2014). "Pure and Pseudo-pure Fluid Thermophysical Property Evaluation and the Open-Source Thermophysical Property Library CoolProp." *Industrial & Engineering Chemistry Research*, 53(6), 2498-2508.357358### Equation of State References359- Lemmon, E. W., Huber, M. L., & McLinden, M. O. (2013). NIST Standard Reference Database 23: Reference Fluid Thermodynamic and Transport Properties (REFPROP), Version 9.1. National Institute of Standards and Technology.360361### Source Code362- **GitHub**: https://github.com/CoolProp/CoolProp363- **Issue Tracker**: https://github.com/CoolProp/CoolProp/issues364365## Best Practices3663671. **Always use SI units** for inputs and outputs (K, Pa, J/kg, etc.)3682. **Check phase regions** before choosing input pairs3693. **Handle errors** gracefully with try-except blocks3704. **Validate ranges** before querying (especially temperature and pressure)3715. **Use quality (Q)** for two-phase calculations3726. **Cache critical properties** if querying multiple times3737. **Use Props1SI** for fluid-only properties (critical points, molar mass)3748. **Prefer (P, H) or (P, S)** for robust queries across all phase regions375376## Quick Reference Table377378| Task | Function | Example |379|------|----------|---------|380| Two-input property | `PropsSI(output, in1, val1, in2, val2, fluid)` | `PropsSI('D', 'T', 300, 'P', 101325, 'Water')` |381| Single-input property | `Props1SI(param, fluid)` | `Props1SI('Tcrit', 'Water')` |382| Saturation liquid | Use Q=0 | `PropsSI('H', 'T', 300, 'Q', 0, 'R134a')` |383| Saturation vapor | Use Q=1 | `PropsSI('H', 'T', 300, 'Q', 1, 'R134a')` |384| Two-phase | Use 0<Q<1 | `PropsSI('D', 'P', 500000, 'Q', 0.5, 'R134a')` |385| List all fluids | `CoolProp.__fluids__` | `import CoolProp; print(CoolProp.__fluids__)` |386387---388389*This skill provides access to one of the most comprehensive open-source thermophysical property databases available, suitable for research, engineering design, and educational applications.*