Skip to content

Estimate air density (rho) based on air temperature, pressure, relative humidity (RH) and altitude.

License

Notifications You must be signed in to change notification settings

mariuspopovici/rho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rho

A small library which helps estimate air density (rho) based on air temperature, pressure, dew point and altitude.

Installation

`npm install @mariuspopovici/rho`

Usage

Parameters

  • temperature Air temperature in degrees Celcius (°C) or Fahrenheit (°F) depending on unit type.
  • air pressure Air pressure in hPA or inHg depending on units type
  • dew point Air temperature in degrees Celcius (°C) or Fahrenheit (°F) depending on
  • units of measurement Optional, defaults to metric. Change to imperial to indicate that inputs are in imperial units of measurement.
  • altitude Optional, defaults to 0. Specify altitude if pressure is measured at sea level.

Examples

    var rho = require('@mariuspopovici/rho');
    // calculate Rho with values expressed in imperial units
    var density = rho(68.9, 30.1, 68.9, 'imperial');
Output should be 1.1984
    var rho = require('@mariuspopovici/rho');
    // calculate Rho adjusted for altitude
    var density = rho(29, 1010, 20, 'metric', 2000);
Output should be 0.9402
    var rho = require('@mariuspopovici/rho');
    // calculate Rho with values expressed in metric units (default)
    var density = rho(20.5, 1019.3, 20.5);
Output should be 1.1984

Result is reported in kg/m3 and can be optionally converted to lb/ft3.

    var rho = require('@mariuspopovici/rho');
    // calculate Rho with values expressed in imperial units
    var density = rho(68.9, 30.1, 68.9, 'imperial').toPoundsPerCubicFeet();

Tests

`npm test`

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

About

Estimate air density (rho) based on air temperature, pressure, relative humidity (RH) and altitude.

Resources

License

Stars

Watchers

Forks

Packages

No packages published