C++ version
The C++ API can be included in your code as follow:
//Include library
#include "Asali.h"
//Main
int main()
{
//Create composition using std vectors
std::vector<std::string> names(3);
std::vector<double> x(3);
names[0] = "H2";
names[1] = "O2";
names[2] = "N2";
x[0] = 0.1;
x[1] = 0.2;
x[2] = 1. - x[0] - x[1];
//Initialize Asali
ASALI::Asali asali;
//Set up composition/pressure and temperature
asali.setSpecies(names);
asali.setTemperature(393.15); //K
asali.setPressure(4e05); //Pa
asali.setMoleFraction(x);
//Properties evaluation
std::vector<std::vector<double>> diff = asali.binaryDiffusion();
std::vector<double> cp = asali.speciesMassCp();
return 0;
}
Example and database generator can be compiled by typing:
./compile.sh
To convert the Asali database into C code run:
./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 | double | kg/m3 |
asali.mixtureMolecularWeight() | Mixture molecular weight | double | g/mol |
asali.mixtureThermalConductivity() | Mixture thermal conductivity | double | W/m/K |
asali.mixtureViscosity() | Mixture viscosity | double | Pa*s |
asali.mixtureMolarCp() | Mixture specific heat | double | J/kmol/K |
asali.mixtureMassCp() | Mixture specific heat | double | J/kg/K |
asali.mixtureMolarEnthalpy() | Mixture enthalpy | double | J/kmol |
asali.mixtureMassEnthalpy() | Mixture enthalpy | double | J/kg |
asali.mixtureMolarEntropy() | Mixture entropy | double | J/kmol/K |
asali.mixtureMassEntropy() | Mixture entropy | double | J/kg/K |
asali.mixtureDiffusion() | Mixture diffusivity | std::vector<double> | m2/s |
asali.speciesThermalConductivity() | Single specie thermal conductivity | std::vector<double> | W/m/K |
asali.speciesViscosity() | Single specie viscosity | std::vector<double> | Pa*s |
asali.speciesMolarCp() | Single specie specific heat | std::vector<double> | J/kmol/K |
asali.speciesMassCp() | Single specie specific heat | std::vector<double> | J/kg/K |
asali.speciesMolarEnthalpy() | Single specie enthalpy | std::vector<double> | J/kmol |
asali.speciesMassEnthalpy() | Single specie enthalpy | std::vector<double> | J/kg |
asali.speciesMolarEntropy() | Single specie entropy | std::vector<double> | J/kmol/K |
asali.speciesMassEntropy() | Single specie entropy | std::vector<double> | J/kg/K |
asali.arithmeticMeanGasVelocity() | Single gas velocity | std::vector<double> | m/s |
asali.meanFreePath() | Single mean free path | std::vector<double> | m |
asali.binaryDiffusion() | Single binary diffusion | std::vector<std::vector<double>> | m2/s |