fluidprop
Easy access to thermodynamic fluid properties as a function of temperature and pressure. Comes with a minimal command-line interface for quick inspection. Provides class FluidProperties() useful for working out dataseries in your own scripts.
Installation:
pip install fluidprop
or if you’re on macOS or Linux, try:
pip3 install fluidprop
Raison d’être
Science advances every year and with it the accuracy of tabulated/parametrized fluid properties. Don’t reinvent the wheel by coding your own equation-of-state models from the literature. Or copy-pasting possibly outdated values from the internet.
EOS models
Thermodynamic properties are provided by CoolProp, the open-source alternative to NIST refprop, with most of the calculations relying on the same equation-of-state (EOS) models as refprop.
Command-line interface
You can run this module from the terminal with:
python -m fluidprop
or if you’re on macOS or Linux, try:
python3 -m fluidprop
It will show a minimal command-line interface which guides the user to enter a fluid, temperature and pressure. It will print out its thermodynamic properties as a table to the terminal.
BONUS for the Rayleigh-Bénard convection community. Running:
python -m rbc
will show a command-line interface acting as a ‘pocket calculator’ to calculate the Rayleigh and other numbers based on the user input.
Example output of fluidprop:
https://github.com/Dennis-van-Gils/python-fluidprop
Thermodynamic properties by CoolProp v6.6.0
http://pubs.acs.org/doi/abs/10.1021/ie4033999
All known fluids:
0 | 1-Butene 46 | MethylLinoleate 92 | R1234yf
1 | Acetone 47 | MethylLinolenate 93 | R1234ze(E)
2 | Air 48 | MethylOleate 94 | R1234ze(Z)
3 | Ammonia 49 | MethylPalmitate 95 | R124
4 | Argon 50 | MethylStearate 96 | R1243zf
5 | Benzene 51 | MM 97 | R125
6 | CarbonDioxide 52 | n-Butane 98 | R13
7 | CarbonMonoxide 53 | n-Decane 99 | R1336mzz(E)
8 | CarbonylSulfide 54 | n-Dodecane 100 | R1336mzz(Z)
9 | Chlorine 55 | n-Heptane 101 | R134a
10 | cis-2-Butene 56 | n-Hexane 102 | R13I1
11 | CycloHexane 57 | n-Nonane 103 | R14
12 | Cyclopentane 58 | n-Octane 104 | R141b
13 | CycloPropane 59 | n-Pentane 105 | R142b
14 | D4 60 | n-Perfluorobutane 106 | R143a
15 | D5 61 | n-Perfluorohexane 107 | R152A
16 | D6 62 | n-Perfluoropentane 108 | R161
17 | Deuterium 63 | n-Propane 109 | R21
18 | Dichloroethane 64 | n-Undecane 110 | R218
19 | DiethylEther 65 | Neon 111 | R22
20 | DimethylCarbonate 66 | Neopentane 112 | R227EA
21 | DimethylEther 67 | Nitrogen 113 | R23
22 | Ethane 68 | NitrousOxide 114 | R236EA
23 | Ethanol 69 | Novec649 115 | R236FA
24 | EthylBenzene 70 | o-Xylene 116 | R245ca
25 | Ethylene 71 | OrthoDeuterium 117 | R245fa
26 | EthyleneOxide 72 | OrthoHydrogen 118 | R32
27 | Fluorine 73 | Oxygen 119 | R365MFC
28 | HeavyWater 74 | p-Xylene 120 | R40
29 | Helium 75 | ParaDeuterium 121 | R404A
30 | HFE143m 76 | ParaHydrogen 122 | R407C
31 | Hydrogen 77 | Propylene 123 | R41
32 | HydrogenChloride 78 | PropyleneGlycol 124 | R410A
33 | HydrogenSulfide 79 | Propyne 125 | R507A
34 | IsoButane 80 | R11 126 | RC318
35 | IsoButene 81 | R1123 127 | SES36
36 | Isohexane 82 | R113 128 | SulfurDioxide
37 | Isopentane 83 | R1130(E) 129 | SulfurHexafluoride
38 | Krypton 84 | R1132(E) 130 | Tetrahydrofuran
39 | m-Xylene 85 | R114 131 | Toluene
40 | MD2M 86 | R115 132 | trans-2-Butene
41 | MD3M 87 | R116 133 | VinylChloride
42 | MD4M 88 | R12 134 | Water
43 | MDM 89 | R1224YDZ 135 | Xenon
44 | Methane 90 | R123
45 | Methanol 91 | R1233zd(E)
Enter fluid number: 121
Enter temperature | T ['C] : 20
Enter pressure | P [bar] : a
Enter pressure | P [atm] : 1
------------------------------------------------------------
Liquid: Water (H₂O)
@ Temperature | T = 20.000 'C = 293.150 K
@ Pressure | P = 1.013 bar
------------------------------------------------------------
Molecular weight | MW = 18.01527 g/mol
Density | rho = 9.982e+02 kg/m^3
Kinematic viscosity | nu = 1.003e-06 m^2/s
Dynamic viscosity | eta = 1.002e-03 kg/(m s)
Thermal exp. coeff. | alpha = 2.068e-04 1/K
Thermal diffusivity | kappa = 1.432e-07 m^2/s
Thermal conductivity | lambda_ = 5.980e-01 W/(m K)
Isobaric heat capac. | Cp = 4.184e+03 J/(kg K)
Isochoric heat capac. | Cv = 4.157e+03 J/(kg K)
Isothermal compress. | comp = 4.589e-10 1/Pa
Prandtl | Pr = 7.008
------------------------------------------------------------
When asked to enter the temperature in ['C], you can once enter a single character instead to change the input unit to:
k | [K] Kelvin K - 273.15 'C
f | ['F] Degrees Fahrenheit ('F - 32) * 5 / 9 'C
When asked to enter the pressure in [bar], you can once enter a single character instead to change the input unit to:
a | [atm] Atmosphere = 1.01325 bar m | [mmHg] Millimeter mercury ≈ 1 atm / 760 p | [psi] Pounds per square inch = 1 / 14.504 bar t | [torr] Torr = 1 atm / 760
FluidProperties()
This class evaluates thermodynamic fluid properties of the given fluid at the given temperature(s) in ['C] and pressure(s) in [bar]. The results are stored as properties to this class as numpy.ndarray arrays. Useful for working out dataseries.
Example:
from fluidprop import FluidProperties
fluid = FluidProperties("Water", 20, 1)
print(fluid.rho) # [998.2065435]
fluid = FluidProperties("Water", [20, 21, 22], 1)
print(fluid.rho) # [998.2065435 997.99487638 997.77288644]
List of stored properties:
coolprop_name (str): CoolProp name of the fluid. formula (str): Chemical formula of the fluid. MW (float) : Molecular weight [kg/mol] T (ndarray): Evaluated temperature [K] P (ndarray): Evaluated pressure [Pa] rho (ndarray): Density [kg/m^3] nu (ndarray): Kinematic viscosity [m^2/s] eta (ndarray): Dynamic/shear viscosity [kg/(m s)] alpha (ndarray): Thermal expansion coefficient [1/K] kappa (ndarray): Thermal diffusivity [m^2/s] lambda_ (ndarray): Thermal conductivity [W/(m K)] Cp (ndarray): Isobaric heat capacity [J/(kg K)] Cv (ndarray): Isochoric heat capacity [J/(kg K)] comp (ndarray): Isothermal compressibility [1/Pa] Pr (ndarray): Prandtl number [-]
Dennis van Gils, 10-08-2026
Changelog
1.3.0 (2026-08-10)
Bumped CoolProp package dependency from ~=6.6 to ~=8.0.
1.2.0 (2024-05-13)
Added rbc.py: A quick ‘pocket calculator’ for Rayleigh-Bénard Convection.
show_cli() will not show an end report by itself anymore. You’ll have to call report() afterwards yourselves.
1.1.0 (2024-05-12)
Added field Cv: Isochoric heat capacity.
Added field comp: Isothermal compressibility.
1.0.0 (2024-05-11)
Initial release.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fluidprop-1.3.0.tar.gz.
File metadata
- Download URL: fluidprop-1.3.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98df48b782a8f39e5e3f066fa8376ead93b4db77af3c5931fa3f6a65fcce3bc8
|
|
| MD5 |
1b5ab07b7c0a45666aadecd012db7280
|
|
| BLAKE2b-256 |
28357cc3ffe669e2a41c47aa9d42f71b8a4862529d31595e80e21b6e3ac7962b
|
File details
Details for the file fluidprop-1.3.0-py3-none-any.whl.
File metadata
- Download URL: fluidprop-1.3.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aae1a46e8a6b24dc1b7fbf71910c498c649392b3be66c2a9f86a1b44682ec0fc
|
|
| MD5 |
20e7efc7ec5523875fd0cc4cbc5b8802
|
|
| BLAKE2b-256 |
534f70660ba6ded46dcc1b0da56a646d5e911a1d674a29270d4c09c7a86932ca
|