1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//! # refprop
//!
//! Safe, ergonomic Rust bindings for
//! [NIST REFPROP](https://www.nist.gov/srd/refprop) — thermodynamic and
//! transport properties of refrigerants, pure fluids, and mixtures.
//!
//! ## Highlights
//!
//! * **Pure fluids** — `Fluid::new("R134A")`
//! * **Predefined mixtures** — `Fluid::new("R410A")` (loaded from `.MIX`)
//! * **Custom mixtures** — `Fluid::mixture(&[("R32", 0.5), ("R125", 0.5)])`
//! * **CoolProp-style `get()`** — `fluid.get("D", "T", 0.0, "Q", 100.0)`
//! * **Configurable units** — work in °C + bar, K + kPa, or any combination
//! * **Thread-safe** — global mutex prevents data races on REFPROP's singleton state
//! * **[`FluidApi`] trait** — common interface for [`Fluid`] and
//! [`ParallelFluid`](pool::ParallelFluid), write generic code that works
//! with either backend
//!
//! ## Quick example
//!
//! ```no_run
//! use refprop::{Fluid, UnitSystem};
//!
//! // Engineering units: °C, bar, kg/m³, kJ/kg
//! let co2 = Fluid::with_units("CO2", UnitSystem::engineering())?;
//!
//! let p = co2.get("P", "T", -5.0, "Q", 100.0)?;
//! println!("Psat(-5 °C) = {p:.2} bar");
//!
//! let d = co2.get("D", "T", -5.0, "Q", 100.0)?;
//! println!("D_vap(-5 °C) = {d:.2} kg/m³");
//! # Ok::<(), refprop::RefpropError>(())
//! ```
//!
//! ## Generic code with `FluidApi`
//!
//! ```no_run
//! use refprop::{FluidApi, Fluid, UnitSystem, Result};
//!
//! fn density(f: &impl FluidApi, t: f64, p: f64) -> Result<f64> {
//! f.get("D", "T", t, "P", p)
//! }
//!
//! let fluid = Fluid::with_units("R134A", UnitSystem::engineering())?;
//! let d = density(&fluid, 25.0, 10.0)?;
//! # Ok::<(), refprop::RefpropError>(())
//! ```
//!
//! ## Unit system
//!
//! Choose units at construction time with [`UnitSystem`] presets
//! ([`refprop()`](UnitSystem::refprop), [`engineering()`](UnitSystem::engineering),
//! [`si()`](UnitSystem::si)) or the builder:
//!
//! ```
//! use refprop::{UnitSystem, TempUnit, PressUnit};
//!
//! let units = UnitSystem::new()
//! .temperature(TempUnit::Celsius)
//! .pressure(PressUnit::Bar);
//! ```
//!
//! ## Mixtures
//!
//! ```no_run
//! use refprop::{Fluid, UnitSystem};
//!
//! // Predefined (from .MIX file)
//! let r410a = Fluid::with_units("R410A", UnitSystem::engineering())?;
//!
//! // Custom composition
//! let r454c = Fluid::mixture_with_units(
//! &[("R32", 0.215), ("R1234YF", 0.785)],
//! UnitSystem::engineering(),
//! )?;
//! # Ok::<(), refprop::RefpropError>(())
//! ```
// ── Internal modules ─────────────────────────────────────────────────
// ── Public re-exports ────────────────────────────────────────────────
pub use ;
pub use Fluid;
pub use FluidApi;
pub use ;
pub use ;
pub use ParallelFluid;