liquid-parameters

2.1.1 • Public • Published

liquid-parameters

NPM Module Boilerplate based

Install

yarn add liquid-parameters

Usage samples

import LiquidParameters from 'liquid-parameters';

// Or separate static methods like this:
import { cp } from 'liquid-parameters';

So, you can use methods below

cp

LiquidParameters.cp({
  liquidType: 'WATER', // ('WATER'|'MEG'|'MPG')
  percentage: 100.0, // % (if WATER then should be 100)
  temperature: (7 + 12) * 0.5, // C
});

/* Output:
  {
    result: 4.19, // kJ/kg.K
    error, // bool
    report, // str
  }
*/

freezingTemperature

LiquidParameters.freezingTemperature({
  liquidType: 'MEG', // ('WATER'|'MEG'|'MPG')
  percentage: 27, // % (if WATER then should be 100)
});

// Output: -11.5 // C

density

LiquidParameters.density({
  liquidType: 'WATER', // ('WATER'|'MEG'|'MPG')
  temperature: (7 + 12) / 2, // C
  percentage: 100.0, // % (if WATER then should be 100)
});

/* Output:
  {
    diagram, // service object
    error, // bool
    result, // kg/m3
    report, // str
  }
*/

getRe

LiquidParameters.getRe({
  flow, // m3/h
  diameter, // m
  kinematicViscosity, // m2/s (x10^-6)
});

/* Output:
  {
    v,// m/s
    result, // dimensionless
  }
*/

getKinematicViscosity

LiquidParameters.getKinematicViscosity({
  liquidType: 'MEG', // ('WATER'|'MEG'|'MPG')
  temperature: (7 + 12) / 2, // C
  percentage: 27, // % (if WATER then should be 100)
});

/* Output:
  {
    result: 2.8975, // m2/s (x10^-6)
    msg, // str
  }
*/

getTubePressureDrop

LiquidParameters.getTubePressureDrop({
  Re, // dimensionless
  tubeLength, // m
  tubeDiameter, // m
  density, // kg/m3
  v, // m/s
});

/* Output:
  {
    kPa,
    bar,
  }
*/

Commands

  • npm run clean - Remove lib/ directory
  • npm test - Run tests with linting and coverage results.
  • npm test:only - Run tests without linting or coverage.
  • npm test:watch - You can even re-run tests on file changes!
  • npm test:prod - Run tests with minified code.
  • npm run test:examples - Test written examples on pure JS for better understanding module usage.
  • npm run lint - Run ESlint with airbnb-config
  • npm run cover - Get coverage report for your code.
  • npm run build - Babel will transpile ES6 => ES5 and minify the code.
  • npm run prepublish - Hook for npm. Do all the checks before publishing your module.

License

MIT © Den Pol

Package Sidebar

Install

npm i liquid-parameters

Weekly Downloads

1

Version

2.1.1

License

MIT

Unpacked Size

42.1 kB

Total Files

5

Last publish

Collaborators

  • pravosleva