Java version
The Java API can be included in your code as follow:
//Include library
import java.io.*;
import java.util.*;
import java.lang.*;
import java.text.*;
class AsaliJava
{
//Main
public static void main(String args[]) throws Exception
{
int N = Integer.valueOf(args[0]);
//Create composition using Vector and ArrayList
ArrayList<String> names = new ArrayList<String>();
names.add("H2");
names.add("O2");
names.add("N2");
Vector<Double> x = new Vector<Double>();
x.add(0.1);
x.add(0.2);
x.add(0.7);
//Initialize ASALI
Asali asali_ = new Asali();
//Set up composition/pressure and temperature
asali_.set_number_of_species(3);
asali_.set_species_names(names);
asali_.set_mole_fraction(x);
asali_.set_pressure(4e05); //Pa
asali_.set_temperature(393.15); //K
//Properties evaluation
double [][] diff;
diff = asali_.get_binary_diffusion();
double [] cp;
cp = asali_.get_species_mass_specific_heat();
}
}
Example and database generator can be compiled by typing:
./compile.sh
Available thermodynamic and transport properties
ASALI estimates different thermodynamic and transport (asali
is the library object):
Function | Estimated property | Return type | Unit dimension |
---|---|---|---|
asali.get_density() | Mixture density | double | kg/m3 |
asali.get_mixture_molecular_weight() | Mixture molecular weight | double | g/mol |
asali.get_mixture_thermal_conductivity() | Mixture thermal conductivity | double | W/m/K |
asali.get_mixture_viscosity() | Mixture viscosity | double | Pa*s |
asali.get_mixture_molar_cp() | Mixture specific heat | double | J/kmol/K |
asali.get_mixture_mass_cp() | Mixture specific heat | double | J/kg/K |
asali.get_mixture_molar_enthalpy() | Mixture enthalpy | double | J/kmol |
asali.get_mixture_mass_enthalpy() | Mixture enthalpy | double | J/kg |
asali.get_mixture_molar_entropy() | Mixture entropy | double | J/kmol/K |
asali.get_mixture_mass_entropy() | Mixture entropy | double | J/kg/K |
asali.get_mixture_diffusion() | Mixture diffusivity | double [] | m2/s |
asali.get_species_thermal_conductivity() | Single specie thermal conductivity | double [] | W/m/K |
asali.get_species_viscosity() | Single specie viscosity | double [] | Pa*s |
asali.get_species_molar_cp() | Single specie specific heat | double [] | J/kmol/K |
asali.get_species_mass_cp() | Single specie specific heat | double [] | J/kg/K |
asali.get_species_molar_enthalpy() | Single specie enthalpy | double [] | J/kmol |
asali.get_species_mass_enthalpy() | Single specie enthalpy | double [] | J/kg |
asali.get_species_molar_entropy() | Single specie entropy | double [] | J/kmol/K |
asali.get_species_mass_entropy() | Single specie entropy | double [] | J/kg/K |
asali.get_arithmetic_mean_gas_velocity() | Single gas velocity | double [] | m/s |
asali.get_mean_free_path() | Single mean free path | double [] | m |
asali.get_binary_diffusion() | Single binary diffusion | double [][] | m2/s |