JavaScript version

The JavaScript API version of ASALI is called JaSali and its npm package can be installed as follow:

npm i jasali

JaSali allows the estimation of thermodynamic and trasport properties of pure gas species and gas mixtures, as shown in the following examples.

Pure gas specie: O2

This example shows how to extract pure oxygen properties.

import {
  GasState,
  GasSpecie
} from "jasali"

//Generate gas state object
let state = GasState({
  temperature: 393.15,
  pressure: 4e05
})

//Generate specie object
let specie = GasSpecie({
  name: "O2",
  gasState: state
})

//Extract properties from the specie object
let name = specie.getName()
let molecularWeight = specie.getMolecularWeight()
let viscosity = specie.getViscosity()

Gas mixture: AIR

This example shows how to extract air properties from its composition.

import {
  GasState,
  GasMixture
} from "jasali"

//Generate gas state object
let state = GasState({
  temperature: 298.15,
  pressure: 101325
})

//Generate mixture object
let mixture = GasMixture({
  mixtureComposition: {
    "O2": 0.21,
    "N2": 0.78,
    "AR": 0.01
  },
  gasState: state,
  compositionType: "mole"
})

//Extract properties from the mixture object
let density = mixture.getDensity()
let molecularWeight = mixture.getMolecularWeight()
let viscosity = mixture.getViscosity()

Gas mixture: Chemical equilibrium

This example shows how to estimate the chemical equilibrium at constant pressure and temperaure for a gas mixture.

import {
  GasState,
  GasMixture
} from "jasali"

//Generate gas state object
let state = GasState({
  temperature: 3000,
  pressure: 4e05
})

//Generate mixture object
let mixture = GasMixture({
  mixtureComposition: {
    "CO": 0.1,
    "CO2": 0.2,
    "O2": 0.7
  },
  gasState: state,
  compositionType: "mole"
})

//Extract chemical equilibrium composition
let x = mixture.calculateChemicalEquilibriumTP()

Available thermodynamic and transport properties

JaSali objects estimate different thermodynamic and transport properties. Different objects share the same method to extract the same property. The following list reports all the available methods and the related objects:

Function Estimated property Method of Unit dimension
getTemperature() Temperature GasState K
getPressure() Pressure GasState Pa
updateGasState() Update gas state GasSpecie n.a
updateMoleFraction() Update mole fraction GasSpecie n.a
getName() Specie name GasSpecie n.a
getArithmeticMeanGasVelocity() Mean gas velocity GasSpecie m/s
getMeanFreePath() Mean free path GasSpecie m
getDiffusion() Binary diffusivity GasSpecie m2/s
getTemperature() Temperature GasMixture K
getPressure() Pressure GasMixture Pa
getMassFraction() Mass fraction GasMixture n.a
getMoleFraction() Mole fraction GasMixture n.a
getBinaryDiffusion() Binary diffusivity GasMixture m2/s
getMixtureDiffusion() Mixture diffusivity GasMixture m2/s
getSpeciesName() Specie name GasMixture n.a
getSpeciesArithmeticMeanGasVelocity() Mean gas velocity GasMixture m/s
getSpeciesMeanFreePath() Mean free path GasMixture m
getSpecies() Species in the mixture GasMixture n.a
getSpecieMolarSpecificHeat() Specific heat GasMixture J/kmol/K
getSpecieMassSpecificHeat() Specific heat GasMixture J/kg/K
getSpecieMolarEnthalpy() Enthalpy GasMixture J/kmol
getSpecieMassEnthalpy() Enthalpy GasMixture J/kg
getSpecieMolarEntropy() Entropy GasMixture J/kmol/K
getSpecieMassEntropy() Entropy GasMixture J/kg/K
getSpecieMolarInternalEnergy() Internal energy GasMixture J/kmol
getSpecieMassInternalEnergy() Internal energy GasMixture J/kg
getSpecieMolarGibbsFreeEnergy() Gibbs free energy GasMixture J/kmol
getSpecieMassGibbsFreeEnergy() Gibbs free energy GasMixture J/kg
getSpecieViscosity() Viscosity GasMixture Pa*s
getSpecieThermalConductivity() Thermal conductivity GasMixture W/m/K
calculateChemicalEquilibriumTP() Chemical equilibrium GasMixture mole fraction
getMolecularWeight() Molecular weight GasSpecie/GasMixture g/mol
getDensity() Density GasSpecie/GasMixture kg/m3
getMolarSpecificHeat() Specific heat GasSpecie/GasMixture J/kmol/K
getMassSpecificHeat() Specific heat GasSpecie/GasMixture J/kg/K
getMolarEnthalpy() Enthalpy GasSpecie/GasMixture J/kmol
getMassEnthalpy() Enthalpy GasSpecie/GasMixture J/kg
getMolarEntropy() Entropy GasSpecie/GasMixture J/kmol/K
getMassEntropy() Entropy GasSpecie/GasMixture J/kg/K
getMolarInternalEnergy() Internal energy GasSpecie/GasMixture J/kmol
getMassInternalEnergy() Internal energy GasSpecie/GasMixture J/kg
getMolarGibbsFreeEnergy() Gibbs free energy GasSpecie/GasMixture J/kmol
getMassGibbsFreeEnergy() Gibbs free energy GasSpecie/GasMixture J/kg
getViscosity() Viscosity GasSpecie/GasMixture Pa*s
getThermalConductivity() Thermal conductivity GasSpecie/GasMixture W/m/K