Giter Club home page Giter Club logo

jasali's Introduction

npm npm GitHub CodeFactor

1. Installation

JaSali is part of the ASALI project and it is a JavaScript library to estimate thermodynamic and transport properties of gas mixtures.
Its npm package can be installed as follow:

npm i jasali

2. Examples - JaSali is based on International System of Units

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

2.1 Pure gas specie: O2

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()

2.2 Gas mixture: AIR

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()

2.3 Gas mixture: Chemical equilibrium at constant temperature and pressure

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()

2.4 HTML frontend

This examples shows how to use JaSali from a pure frontend HTML file:

<script type="text/javascript" src="./jasali.js"></script>

<script>
function gasMixtureProperties()
{
  //Generate gas state object
  let state = jasali.GasState({
    temperature: 3000,
    pressure: 4e05
  })

  //Generate mixture object
  let mixture = jasali.GasMixture({
    mixtureComposition: {
      "CO": 0.1,
      "CO2": 0.2,
      "O2": 0.7
    },
    gasState: state,
    compositionType: "mole"
  })
  
  //Extract properties from the mixture object
  let density = mixture.getDensity()
}
</script>

3. Available thermodynamic and transport properties

Details on the properties estimated by JaSali can be found here.

4. Contacts

If you want to contribute, ask questions, report bugs or just say hello compile the form here

jasali's People

Contributors

geopic avatar srebughini avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

seyisulu

jasali's Issues

TypeScript type declaration file

If you want I can write a TypeScript type declaration file for this package so that TS developers can utilise the type-checking feature of the language as they use this package. Let me know if you are interested.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.