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
- LiquidParameters.cp
- LiquidParameters.freezingTemperature
- LiquidParameters.density
- LiquidParameters.getRe Need to review!
- LiquidParameters.getKinematicViscosity
- LiquidParameters.getTubePressureDrop
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
- Removelib/
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