NIST REFPROP Database Skill
Query high-accuracy thermodynamic and transport properties using the NIST REFPROP (Reference Fluid Thermodynamic and Transport Properties) database - the gold standard for thermophysical property calculations.
Overview
NIST REFPROP is a commercial-grade thermophysical property database developed by the National Institute of Standards and Technology (NIST). It provides:
- Pure Fluids: 147+ pure fluids with the highest available accuracy
- Mixtures: Predefined and custom mixtures with advanced mixing rules
- Refrigerant Blends: All common refrigerant blends with temperature glide
- Transport Properties: Viscosity, thermal conductivity, surface tension
- Thermodynamic Properties: Enthalpy, entropy, density, specific heat
- Phase Equilibrium: VLE, LLE, VLLE calculations for mixtures
- Highest Accuracy: Reference-quality data validated against experimental measurements
REFPROP is the industry and research standard for:
- Critical engineering design requiring highest accuracy
- Validation of other property libraries (CoolProp is validated against REFPROP)
- Mixture calculations with complex phase behavior
- Refrigerant blend applications with temperature glide
- Research and publication-quality data
Licensing
COMMERCIAL LICENSE REQUIRED
NIST REFPROP is NOT free or open-source software. You must purchase a license from NIST:
License includes:
- REFPROP software (Windows GUI)
- Fluid database files
- Excel add-in
- FORTRAN/DLL libraries
- Python wrapper compatibility
Important Notes:
- License is per-user, perpetual (one-time fee)
- Updates and new fluid files provided for ~5 years
- Required for commercial applications
- Cannot be redistributed
Installation
Step 1: Purchase and Install REFPROP
- Purchase REFPROP license from NIST: https://www.nist.gov/srd/refprop
- Download and install REFPROP (typically to
C:\Program Files (x86)\REFPROP\)
- Note the installation directory path
Step 2: Install Python Wrapper
pip install ctREFPROP
The ctREFPROP package provides a Python interface to REFPROP using ctypes.
Step 3: Set RPPREFIX Environment Variable
The Python wrapper needs to know where REFPROP is installed:
Windows:
# PowerShell
$env:RPPREFIX = "C:\Program Files (x86)\REFPROP\"
# Or set permanently via System Properties > Environment Variables
Linux/Mac:
export RPPREFIX="/path/to/REFPROP/"
Python (alternative):
import os
os.environ['RPPREFIX'] = r'C:\Program Files (x86)\REFPROP'
Step 4: Verify Installation
from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
# Initialize REFPROP
RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])
RP.SETPATHdll(os.environ['RPPREFIX'])
# Test query
print(RP.RPVersion())
Available Fluids
REFPROP includes 147+ pure fluids organized by class:
Common Industrial Fluids
- Water (H₂O) - IAPWS-95 formulation
- Air - Dry air mixture
- Carbon Dioxide (CO₂)
- Nitrogen (N₂)
- Oxygen (O₂)
- Argon (Ar)
- Helium (He)
- Hydrogen (H₂)
Hydrocarbons (40+ fluids)
- Alkanes: Methane, Ethane, Propane, Butane, Pentane, Hexane, Heptane, Octane, Nonane, Decane (and isomers)
- Alkenes: Ethylene, Propylene, Butene
- Aromatics: Benzene, Toluene, Xylenes
- Cyclic: Cyclohexane, Cyclopentane
Refrigerants (60+ fluids)
- CFCs: R11, R12, R13, R113, R114, R115
- HCFCs: R22, R123, R124, R141b, R142b
- HFCs: R23, R32, R125, R134a, R143a, R152a, R227ea, R236fa, R245fa, R365mfc
- HFOs: R1234yf, R1234ze(E), R1233zd(E), R1336mzz(Z)
- Natural: R717 (Ammonia), R744 (CO₂), R290 (Propane), R600a (Isobutane)
- Blends: R404A, R407C, R410A, R507A, R407F, R448A, R449A, R450A, R513A
Cryogenic Fluids
- Helium, Neon, Argon, Krypton, Xenon
- Hydrogen, Deuterium, Parahydrogen
- Nitrogen, Oxygen, Fluorine
- Methane, Ethane (LNG components)
Specialty Fluids
- Siloxanes: D4, D5, D6, MD2M, MD3M, MD4M, MDM, MM (ORC applications)
- Alcohols: Methanol, Ethanol, Propanol, Butanol
- Other Organics: Acetone, Benzene, Toluene
- Inorganics: Ammonia, Sulfur dioxide, Hydrogen sulfide
See reference.md for complete fluid list.
Property Queries
Core Functions
REFPROP uses different function calls than CoolProp:
from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
import os
# Initialize
RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])
RP.SETPATHdll(os.environ['RPPREFIX'])
# Define fluid
MOLAR_BASE_SI = RP.GETENUMdll(0, "MOLAR BASE SI").iEnum
fluid = "WATER"
# Single component
r = RP.REFPROPdll(fluid, "TP", "D;H;S;CP;CV;W;VIS;TCX", MOLAR_BASE_SI, 0, 0, 298.15, 101.325, [1.0])
# Access results
density = r.Output[0] # kg/m³
enthalpy = r.Output[1] # J/kg
entropy = r.Output[2] # J/kg/K
cp = r.Output[3] # J/kg/K
cv = r.Output[4] # J/kg/K
sound_speed = r.Output[5] # m/s
viscosity = r.Output[6] # Pa·s
conductivity = r.Output[7] # W/m/K
Input Specifications
| Code |
Property |
Unit |
TP |
Temperature, Pressure |
K, kPa |
TH |
Temperature, Enthalpy |
K, J/kg |
TS |
Temperature, Entropy |
K, J/kg/K |
TD |
Temperature, Density |
K, kg/m³ |
PH |
Pressure, Enthalpy |
kPa, J/kg |
PS |
Pressure, Entropy |
kPa, J/kg/K |
PD |
Pressure, Density |
kPa, kg/m³ |
TQ |
Temperature, Quality |
K, - |
PQ |
Pressure, Quality |
kPa, - |
Output Properties
| Code |
Property |
Unit |
D |
Density |
kg/m³ |
H |
Enthalpy |
J/kg |
S |
Entropy |
J/kg/K |
U |
Internal energy |
J/kg |
CP |
Heat capacity (const P) |
J/kg/K |
CV |
Heat capacity (const V) |
J/kg/K |
W |
Speed of sound |
m/s |
VIS |
Viscosity |
Pa·s |
TCX |
Thermal conductivity |
W/m/K |
KV |
Kinematic viscosity |
m²/s |
PRANDTL |
Prandtl number |
- |
STN |
Surface tension |
N/m |
P |
Pressure |
kPa |
T |
Temperature |
K |
Q |
Quality (vapor fraction) |
- |
Multiple properties can be requested in one call, separated by semicolons: "D;H;S;CP;VIS;TCX"
Mixture Calculations
One of REFPROP's key advantages is sophisticated mixture handling:
# Define mixture by components and mole fractions
fluid = "METHANE;ETHANE;PROPANE"
z = [0.9, 0.07, 0.03] # Mole fractions (must sum to 1.0)
# Query mixture properties
r = RP.REFPROPdll(fluid, "TP", "D;H;S", MOLAR_BASE_SI, 0, 0, 250.0, 5000.0, z)
Mixture Features:
- Up to 20 components in a mixture
- Advanced mixing rules (GERG-2008, Kunz-Wagner, etc.)
- Temperature glide calculations for zeotropic blends
- Vapor-liquid equilibrium (VLE) calculations
- Liquid-liquid equilibrium (LLE) for certain systems
Advantages Over CoolProp
While CoolProp is excellent and free, REFPROP offers:
1. Higher Accuracy
- REFPROP is the reference standard that other libraries validate against
- More precise equations of state, especially near critical point
- Better transport property correlations
- Typical accuracy: 0.01% for density vs 0.1% for CoolProp
2. More Fluids
- 147+ pure fluids vs ~120 in CoolProp
- All latest refrigerants (HFOs: R1234yf, R1234ze, R1233zd, etc.)
- More industrial and specialty chemicals
- Frequently updated with new fluids
3. Better Mixture Handling
- Superior mixing rules (GERG-2008, advanced models)
- Handles complex non-ideal mixtures
- Temperature glide for zeotropic refrigerant blends
- VLE/LLE calculations
- Up to 20 components vs limited mixture support in CoolProp
4. Extended Property Range
- Valid over wider temperature and pressure ranges
- Better extrapolation behavior
- More reliable in extreme conditions
5. Additional Capabilities
- Humidity calculations (psychrometrics)
- Flash calculations (PT, PH, PS, etc.)
- Saturation properties with Jacobian
- Ancillary equations
- Pseudo-pure fluid approximations
6. Official Support
- Maintained by NIST (National Institute of Standards and Technology)
- Technical support available
- Regular updates with latest research
- Publication-quality results
When to Use REFPROP vs CoolProp
Use REFPROP when:
- Highest accuracy is required (±0.01%)
- Working with complex mixtures
- Need latest refrigerant data (HFOs)
- Publication or critical design work
- Budget allows commercial license
- Working with zeotropic blends (temperature glide)
Use CoolProp when:
- Budget constraints (free/open-source)
- Basic property needs (±0.1% accuracy acceptable)
- Pure fluids only
- Open-source license required
- Quick prototyping
Validation Note: CoolProp is validated against REFPROP, confirming REFPROP as the reference standard.
Common Workflow Example
from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
import os
# Setup
os.environ['RPPREFIX'] = r'C:\Program Files (x86)\REFPROP'
RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])
RP.SETPATHdll(os.environ['RPPREFIX'])
MOLAR_BASE_SI = RP.GETENUMdll(0, "MOLAR BASE SI").iEnum
# Query water at 25°C, 1 bar
fluid = "WATER"
T = 298.15 # K
P = 100.0 # kPa
r = RP.REFPROPdll(fluid, "TP", "D;H;S;CP;VIS;TCX", MOLAR_BASE_SI, 0, 0, T, P, [1.0])
print(f"Water at {T} K, {P} kPa:")
print(f" Density: {r.Output[0]:.4f} kg/m³")
print(f" Enthalpy: {r.Output[1]:.2f} J/kg")
print(f" Entropy: {r.Output[2]:.2f} J/kg/K")
print(f" Cp: {r.Output[3]:.2f} J/kg/K")
print(f" Viscosity: {r.Output[4]*1000:.4f} mPa·s")
print(f" Conductivity: {r.Output[5]:.4f} W/m/K")
Error Handling
REFPROP returns error codes and messages:
r = RP.REFPROPdll(fluid, "TP", "D", MOLAR_BASE_SI, 0, 0, T, P, z)
if r.ierr > 0:
print(f"Error {r.ierr}: {r.herr}")
elif r.ierr < 0:
print(f"Warning {r.ierr}: {r.herr}")
else:
print(f"Success: {r.Output[0]}")
Units
REFPROP uses different unit conventions than CoolProp:
Default Units (with MOLAR BASE SI):
- Temperature: K (Kelvin)
- Pressure: kPa (kilopascals) - Note: CoolProp uses Pa
- Density: kg/m³
- Enthalpy: J/kg
- Entropy: J/kg/K
- Viscosity: Pa·s
- Thermal conductivity: W/m/K
Unit Systems Available:
- SI with molar units
- SI with mass units (default shown above)
- English units
- Custom units
Best Practices
- Always set RPPREFIX before importing ctREFPROP
- Check ierr for errors after each call
- Use exact fluid names (case-sensitive, from FLUIDS directory)
- Pre-calculate compositions for mixtures (must sum to 1.0)
- Cache RP instance - don't reinitialize repeatedly
- Use appropriate input pairs for each phase region
- Validate results against known values initially
- Read error messages - REFPROP provides detailed diagnostics
References
Official Resources
NIST REFPROP Website
REFPROP Documentation
- Included with installation
REFPROP.pdf in installation directory
ctREFPROP Documentation
Key Publications
- Lemmon, E.W., Bell, I.H., Huber, M.L., McLinden, M.O. (2018). "NIST Standard Reference Database 23: Reference Fluid Thermodynamic and Transport Properties-REFPROP, Version 10.0", National Institute of Standards and Technology.
Support
Quick Reference
# Initialize
from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])
RP.SETPATHdll(os.environ['RPPREFIX'])
MOLAR_BASE_SI = RP.GETENUMdll(0, "MOLAR BASE SI").iEnum
# Pure fluid
r = RP.REFPROPdll("WATER", "TP", "D;H;S", MOLAR_BASE_SI, 0, 0, 300.0, 101.325, [1.0])
# Mixture
r = RP.REFPROPdll("METHANE;ETHANE", "TP", "D;H;S", MOLAR_BASE_SI, 0, 0, 200.0, 5000.0, [0.9, 0.1])
# Check for errors
if r.ierr != 0:
print(f"Error/Warning: {r.herr}")
NIST REFPROP is the gold standard for thermophysical properties. While it requires a commercial license, the investment is justified for applications requiring the highest accuracy, mixture calculations, or publication-quality results. For open-source alternatives, see the coolprop-db skill.
1---2name: nist-refprop3description: Query high-accuracy thermodynamic properties from NIST REFPROP database (commercial)4---56# NIST REFPROP Database Skill78Query high-accuracy thermodynamic and transport properties using the NIST REFPROP (Reference Fluid Thermodynamic and Transport Properties) database - the gold standard for thermophysical property calculations.910## Overview1112NIST REFPROP is a commercial-grade thermophysical property database developed by the National Institute of Standards and Technology (NIST). It provides:1314- **Pure Fluids**: 147+ pure fluids with the highest available accuracy15- **Mixtures**: Predefined and custom mixtures with advanced mixing rules16- **Refrigerant Blends**: All common refrigerant blends with temperature glide17- **Transport Properties**: Viscosity, thermal conductivity, surface tension18- **Thermodynamic Properties**: Enthalpy, entropy, density, specific heat19- **Phase Equilibrium**: VLE, LLE, VLLE calculations for mixtures20- **Highest Accuracy**: Reference-quality data validated against experimental measurements2122REFPROP is the industry and research standard for:23- Critical engineering design requiring highest accuracy24- Validation of other property libraries (CoolProp is validated against REFPROP)25- Mixture calculations with complex phase behavior26- Refrigerant blend applications with temperature glide27- Research and publication-quality data2829## Licensing3031**COMMERCIAL LICENSE REQUIRED**3233NIST REFPROP is **NOT** free or open-source software. You must purchase a license from NIST:3435- **Standard License**: ~$300 USD (one-time purchase)36- **Academic Pricing**: Available for educational institutions37- **Purchase**: https://www.nist.gov/srd/refprop3839**License includes:**40- REFPROP software (Windows GUI)41- Fluid database files42- Excel add-in43- FORTRAN/DLL libraries44- Python wrapper compatibility4546**Important Notes:**47- License is per-user, perpetual (one-time fee)48- Updates and new fluid files provided for ~5 years49- Required for commercial applications50- Cannot be redistributed5152## Installation5354### Step 1: Purchase and Install REFPROP55561. Purchase REFPROP license from NIST: https://www.nist.gov/srd/refprop572. Download and install REFPROP (typically to `C:\Program Files (x86)\REFPROP\`)583. Note the installation directory path5960### Step 2: Install Python Wrapper6162```bash63pip install ctREFPROP64```6566The `ctREFPROP` package provides a Python interface to REFPROP using ctypes.6768### Step 3: Set RPPREFIX Environment Variable6970The Python wrapper needs to know where REFPROP is installed:7172**Windows:**73```bash74# PowerShell75$env:RPPREFIX = "C:\Program Files (x86)\REFPROP\"7677# Or set permanently via System Properties > Environment Variables78```7980**Linux/Mac:**81```bash82export RPPREFIX="/path/to/REFPROP/"83```8485**Python (alternative):**86```python87import os88os.environ['RPPREFIX'] = r'C:\Program Files (x86)\REFPROP'89```9091### Step 4: Verify Installation9293```python94from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary9596# Initialize REFPROP97RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])98RP.SETPATHdll(os.environ['RPPREFIX'])99100# Test query101print(RP.RPVersion())102```103104## Available Fluids105106REFPROP includes **147+ pure fluids** organized by class:107108### Common Industrial Fluids109- **Water** (H₂O) - IAPWS-95 formulation110- **Air** - Dry air mixture111- **Carbon Dioxide** (CO₂)112- **Nitrogen** (N₂)113- **Oxygen** (O₂)114- **Argon** (Ar)115- **Helium** (He)116- **Hydrogen** (H₂)117118### Hydrocarbons (40+ fluids)119- **Alkanes**: Methane, Ethane, Propane, Butane, Pentane, Hexane, Heptane, Octane, Nonane, Decane (and isomers)120- **Alkenes**: Ethylene, Propylene, Butene121- **Aromatics**: Benzene, Toluene, Xylenes122- **Cyclic**: Cyclohexane, Cyclopentane123124### Refrigerants (60+ fluids)125- **CFCs**: R11, R12, R13, R113, R114, R115126- **HCFCs**: R22, R123, R124, R141b, R142b127- **HFCs**: R23, R32, R125, R134a, R143a, R152a, R227ea, R236fa, R245fa, R365mfc128- **HFOs**: R1234yf, R1234ze(E), R1233zd(E), R1336mzz(Z)129- **Natural**: R717 (Ammonia), R744 (CO₂), R290 (Propane), R600a (Isobutane)130- **Blends**: R404A, R407C, R410A, R507A, R407F, R448A, R449A, R450A, R513A131132### Cryogenic Fluids133- Helium, Neon, Argon, Krypton, Xenon134- Hydrogen, Deuterium, Parahydrogen135- Nitrogen, Oxygen, Fluorine136- Methane, Ethane (LNG components)137138### Specialty Fluids139- **Siloxanes**: D4, D5, D6, MD2M, MD3M, MD4M, MDM, MM (ORC applications)140- **Alcohols**: Methanol, Ethanol, Propanol, Butanol141- **Other Organics**: Acetone, Benzene, Toluene142- **Inorganics**: Ammonia, Sulfur dioxide, Hydrogen sulfide143144See `reference.md` for complete fluid list.145146## Property Queries147148### Core Functions149150REFPROP uses different function calls than CoolProp:151152```python153from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary154import os155156# Initialize157RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])158RP.SETPATHdll(os.environ['RPPREFIX'])159160# Define fluid161MOLAR_BASE_SI = RP.GETENUMdll(0, "MOLAR BASE SI").iEnum162fluid = "WATER"163164# Single component165r = RP.REFPROPdll(fluid, "TP", "D;H;S;CP;CV;W;VIS;TCX", MOLAR_BASE_SI, 0, 0, 298.15, 101.325, [1.0])166167# Access results168density = r.Output[0] # kg/m³169enthalpy = r.Output[1] # J/kg170entropy = r.Output[2] # J/kg/K171cp = r.Output[3] # J/kg/K172cv = r.Output[4] # J/kg/K173sound_speed = r.Output[5] # m/s174viscosity = r.Output[6] # Pa·s175conductivity = r.Output[7] # W/m/K176```177178### Input Specifications179180| Code | Property | Unit |181|------|----------|------|182| `TP` | Temperature, Pressure | K, kPa |183| `TH` | Temperature, Enthalpy | K, J/kg |184| `TS` | Temperature, Entropy | K, J/kg/K |185| `TD` | Temperature, Density | K, kg/m³ |186| `PH` | Pressure, Enthalpy | kPa, J/kg |187| `PS` | Pressure, Entropy | kPa, J/kg/K |188| `PD` | Pressure, Density | kPa, kg/m³ |189| `TQ` | Temperature, Quality | K, - |190| `PQ` | Pressure, Quality | kPa, - |191192### Output Properties193194| Code | Property | Unit |195|------|----------|------|196| `D` | Density | kg/m³ |197| `H` | Enthalpy | J/kg |198| `S` | Entropy | J/kg/K |199| `U` | Internal energy | J/kg |200| `CP` | Heat capacity (const P) | J/kg/K |201| `CV` | Heat capacity (const V) | J/kg/K |202| `W` | Speed of sound | m/s |203| `VIS` | Viscosity | Pa·s |204| `TCX` | Thermal conductivity | W/m/K |205| `KV` | Kinematic viscosity | m²/s |206| `PRANDTL` | Prandtl number | - |207| `STN` | Surface tension | N/m |208| `P` | Pressure | kPa |209| `T` | Temperature | K |210| `Q` | Quality (vapor fraction) | - |211212Multiple properties can be requested in one call, separated by semicolons: `"D;H;S;CP;VIS;TCX"`213214## Mixture Calculations215216One of REFPROP's key advantages is sophisticated mixture handling:217218```python219# Define mixture by components and mole fractions220fluid = "METHANE;ETHANE;PROPANE"221z = [0.9, 0.07, 0.03] # Mole fractions (must sum to 1.0)222223# Query mixture properties224r = RP.REFPROPdll(fluid, "TP", "D;H;S", MOLAR_BASE_SI, 0, 0, 250.0, 5000.0, z)225```226227**Mixture Features:**228- Up to 20 components in a mixture229- Advanced mixing rules (GERG-2008, Kunz-Wagner, etc.)230- Temperature glide calculations for zeotropic blends231- Vapor-liquid equilibrium (VLE) calculations232- Liquid-liquid equilibrium (LLE) for certain systems233234## Advantages Over CoolProp235236While CoolProp is excellent and free, REFPROP offers:237238### 1. Higher Accuracy239- REFPROP is the **reference standard** that other libraries validate against240- More precise equations of state, especially near critical point241- Better transport property correlations242- Typical accuracy: 0.01% for density vs 0.1% for CoolProp243244### 2. More Fluids245- 147+ pure fluids vs ~120 in CoolProp246- All latest refrigerants (HFOs: R1234yf, R1234ze, R1233zd, etc.)247- More industrial and specialty chemicals248- Frequently updated with new fluids249250### 3. Better Mixture Handling251- Superior mixing rules (GERG-2008, advanced models)252- Handles complex non-ideal mixtures253- Temperature glide for zeotropic refrigerant blends254- VLE/LLE calculations255- Up to 20 components vs limited mixture support in CoolProp256257### 4. Extended Property Range258- Valid over wider temperature and pressure ranges259- Better extrapolation behavior260- More reliable in extreme conditions261262### 5. Additional Capabilities263- Humidity calculations (psychrometrics)264- Flash calculations (PT, PH, PS, etc.)265- Saturation properties with Jacobian266- Ancillary equations267- Pseudo-pure fluid approximations268269### 6. Official Support270- Maintained by NIST (National Institute of Standards and Technology)271- Technical support available272- Regular updates with latest research273- Publication-quality results274275### When to Use REFPROP vs CoolProp276277**Use REFPROP when:**278- Highest accuracy is required (±0.01%)279- Working with complex mixtures280- Need latest refrigerant data (HFOs)281- Publication or critical design work282- Budget allows commercial license283- Working with zeotropic blends (temperature glide)284285**Use CoolProp when:**286- Budget constraints (free/open-source)287- Basic property needs (±0.1% accuracy acceptable)288- Pure fluids only289- Open-source license required290- Quick prototyping291292**Validation Note:** CoolProp is validated against REFPROP, confirming REFPROP as the reference standard.293294## Common Workflow Example295296```python297from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary298import os299300# Setup301os.environ['RPPREFIX'] = r'C:\Program Files (x86)\REFPROP'302RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])303RP.SETPATHdll(os.environ['RPPREFIX'])304305MOLAR_BASE_SI = RP.GETENUMdll(0, "MOLAR BASE SI").iEnum306307# Query water at 25°C, 1 bar308fluid = "WATER"309T = 298.15 # K310P = 100.0 # kPa311312r = RP.REFPROPdll(fluid, "TP", "D;H;S;CP;VIS;TCX", MOLAR_BASE_SI, 0, 0, T, P, [1.0])313314print(f"Water at {T} K, {P} kPa:")315print(f" Density: {r.Output[0]:.4f} kg/m³")316print(f" Enthalpy: {r.Output[1]:.2f} J/kg")317print(f" Entropy: {r.Output[2]:.2f} J/kg/K")318print(f" Cp: {r.Output[3]:.2f} J/kg/K")319print(f" Viscosity: {r.Output[4]*1000:.4f} mPa·s")320print(f" Conductivity: {r.Output[5]:.4f} W/m/K")321```322323## Error Handling324325REFPROP returns error codes and messages:326327```python328r = RP.REFPROPdll(fluid, "TP", "D", MOLAR_BASE_SI, 0, 0, T, P, z)329330if r.ierr > 0:331 print(f"Error {r.ierr}: {r.herr}")332elif r.ierr < 0:333 print(f"Warning {r.ierr}: {r.herr}")334else:335 print(f"Success: {r.Output[0]}")336```337338## Units339340REFPROP uses different unit conventions than CoolProp:341342**Default Units (with MOLAR BASE SI):**343- Temperature: K (Kelvin)344- Pressure: kPa (kilopascals) - **Note: CoolProp uses Pa**345- Density: kg/m³346- Enthalpy: J/kg347- Entropy: J/kg/K348- Viscosity: Pa·s349- Thermal conductivity: W/m/K350351**Unit Systems Available:**352- SI with molar units353- SI with mass units (default shown above)354- English units355- Custom units356357## Best Practices3583591. **Always set RPPREFIX** before importing ctREFPROP3602. **Check ierr** for errors after each call3613. **Use exact fluid names** (case-sensitive, from FLUIDS directory)3624. **Pre-calculate compositions** for mixtures (must sum to 1.0)3635. **Cache RP instance** - don't reinitialize repeatedly3646. **Use appropriate input pairs** for each phase region3657. **Validate results** against known values initially3668. **Read error messages** - REFPROP provides detailed diagnostics367368## References369370### Official Resources3713721. **NIST REFPROP Website**373 - URL: https://www.nist.gov/srd/refprop374 - Purchase and download3753762. **REFPROP Documentation**377 - Included with installation378 - `REFPROP.pdf` in installation directory3793803. **ctREFPROP Documentation**381 - URL: https://github.com/usnistgov/REFPROP-wrappers/tree/master/wrappers/python382 - GitHub: https://github.com/usnistgov/REFPROP-wrappers383384### Key Publications385386- Lemmon, E.W., Bell, I.H., Huber, M.L., McLinden, M.O. (2018). "NIST Standard Reference Database 23: Reference Fluid Thermodynamic and Transport Properties-REFPROP, Version 10.0", National Institute of Standards and Technology.387388### Support389390- **NIST Support**: refprop@nist.gov391- **Issue Tracker**: https://github.com/usnistgov/REFPROP-issues392- **Forum**: https://groups.google.com/g/refprop393394## Quick Reference395396```python397# Initialize398from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary399RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])400RP.SETPATHdll(os.environ['RPPREFIX'])401MOLAR_BASE_SI = RP.GETENUMdll(0, "MOLAR BASE SI").iEnum402403# Pure fluid404r = RP.REFPROPdll("WATER", "TP", "D;H;S", MOLAR_BASE_SI, 0, 0, 300.0, 101.325, [1.0])405406# Mixture407r = RP.REFPROPdll("METHANE;ETHANE", "TP", "D;H;S", MOLAR_BASE_SI, 0, 0, 200.0, 5000.0, [0.9, 0.1])408409# Check for errors410if r.ierr != 0:411 print(f"Error/Warning: {r.herr}")412```413414---415416*NIST REFPROP is the gold standard for thermophysical properties. While it requires a commercial license, the investment is justified for applications requiring the highest accuracy, mixture calculations, or publication-quality results. For open-source alternatives, see the `coolprop-db` skill.*