rfluids
🦀 Rusty CoolProp wrapper.
Supported platforms
Windows x86-64Windows AArch64Linux x86-64macOS x86-64macOS AArch64
MSRV
rfluids requires rustc 1.85.0 or later.
How to install
Run the following command in your project directory:
cargo add rfluids
🎁 It comes with native CoolProp dynamic libraries for supported platforms.
The library required for your platform will be automatically copied
to the target directory during build.
Examples
| ℹ️ All calculations are performed in SI units |
|---|
Specific heat [J/kg/K] of saturated water vapor at 1 atm:
use assert_relative_eq;
use *;
let mut water_vapor = from.in_state?;
assert_relative_eq!;
Dynamic viscosity [Pa·s] of propylene glycol aqueous solution with 60 % mass fraction at 100 kPa and -20 °C:
use assert_relative_eq;
use *;
let mut propylene_glycol = from.in_state?;
assert_relative_eq!;
Density [kg/m³] of ethanol aqueous solution (with ethanol 40 % mass fraction) at 200 kPa and 4 °C:
use assert_relative_eq;
use *;
use HashMap;
let mut mix = try_from?.in_state?;
assert_relative_eq!;
Wet-bulb temperature [K] of humid air at 300 m above sea level, 30 °C and 50 % relative humidity:
use assert_relative_eq;
use *;
let mut humid_air = new.in_state?;
assert_relative_eq!;
Fluid and HumidAir implement the PartialEq trait.
Equality is checked by the thermodynamic state:
use *;
let mut humid_air = new.in_state?;
let mut another_humid_air = new.in_state?;
assert_eq!;
another_humid_air.update?;
assert_ne!;
License
This project is licensed under MIT License.