Rust version
The Rust API can be included in your code as follow:
//Include library
mod definitions;
mod omega;
mod thermo;
mod transport;
mod asali;
fn main() {
//Create asali object
let mut asali_obj = asali::Asali::new();
//Set temperature
asali_obj.set_temperature(393.15);
//Set pressure
asali_obj.set_pressure(4.0e5);
//Set number of species
asali_obj.set_number_of_species(3);
//Set specie names
asali_obj.set_species_names(vec!["H2".to_string(), "O2".to_string(), "N2".to_string()]);
//Set mole composition
asali_obj.set_mole_fraction(vec![0.1,0.2,0.7]);
//Properties evaluation
let diff = asali_obj.get_binary_diffusion();
let cp = asali_obj.get_species_mass_specific_heat();
}
Example and database generator can be compiled by typing:
cargo build
To convert the Asali database into C code run:
cargo run --bin database-generator
Available thermodynamic and transport properties
ASALI estimates different thermodynamic and transport (asali
is the library object):
Function | Estimated property | Return type | Unit dimension |
---|---|---|---|
asali.density() | Mixture density | f64 | kg/m3 |
asali.mixture_molecular_weight() | Mixture molecular weight | f64 | g/mol |
asali.mixture_thermal_conductivity() | Mixture thermal conductivity | f64 | W/m/K |
asali.mixture_viscosity() | Mixture viscosity | f64 | Pa*s |
asali.mixture_molar_cp() | Mixture specific heat | f64 | J/kmol/K |
asali.mixture_mass_cp() | Mixture specific heat | f64 | J/kg/K |
asali.mixture_molar_enthalpy() | Mixture enthalpy | f64 | J/kmol |
asali.mixture_mass_enthalpy() | Mixture enthalpy | f64 | J/kg |
asali.mixture_molar_entropy() | Mixture entropy | f64 | J/kmol/K |
asali.mixture_mass_entropy() | Mixture entropy | f64 | J/kg/K |
asali.mixture_diffusion() | Mixture diffusivity | Vec<f64> | m2/s |
asali.species_thermal_conductivity() | Single specie thermal conductivity | Vec<f64> | W/m/K |
asali.species_viscosity() | Single specie viscosity | Vec<f64> | Pa*s |
asali.species_molar_cp() | Single specie specific heat | Vec<f64> | J/kmol/K |
asali.species_mass_cp() | Single specie specific heat | Vec<f64> | J/kg/K |
asali.species_molar_enthalpy() | Single specie enthalpy | Vec<f64> | J/kmol |
asali.species_mass_enthalpy() | Single specie enthalpy | Vec<f64> | J/kg |
asali.species_molar_entropy() | Single specie entropy | Vec<f64> | J/kmol/K |
asali.species_mass_entropy() | Single specie entropy | Vec<f64> | J/kg/K |
asali.arithmetic_mean_gas_velocity() | Single gas velocity | Vec<f64> | m/s |
asali.mean_free_path() | Single mean free path | Vec<f64> | m |
asali.binary_diffusion() | Single binary diffusion | Vec<Vec<f64>> | m2/s |