gas-force
gas-force is a dependency-free Rust library for ideal-gas relationships. It
keeps pressure, volume, absolute temperature, amount, and volumetric flow in
separate validated types.
The library applies the ideal gas equation PV = nRT and can derive any one
state variable from the other three. It also converts volume and volumetric
flow between two pressure and temperature conditions while preserving the
same amount of ideal gas.
Example
use ;
let state = from_pressure_volume_temperature?;
assert!;
let source = new;
let destination = new;
let converted = convert_volume?;
assert!;
# Ok::
Run the bundled example:
cargo run --example ideal_gas
Scope and safety
This crate assumes an ideal gas in equilibrium and absolute pressure. It does not model real-gas compressibility, mixtures, phase change, combustion, leakage, pipe friction, toxicity, ventilation, ignition, equipment limits, or regulatory compliance. It must not be used as a gas-safety decision system.
License
MIT