Loading...
Searching...
No Matches
Opm::unit::convert Namespace Reference

Unit conversion routines. More...

## Functions

constexpr double | from (const double q, const double unit)
| Convert from external units of measurements to equivalent internal units of measurements.
constexpr double | to (const double q, const double unit)
| Convert from internal units of measurements to equivalent external units of measurements.

## Detailed Description

Unit conversion routines.

## Function Documentation

## from()

double Opm::unit::convert::from | ( | const double | q,
|  | const double | unit )

constexpr

Convert from external units of measurements to equivalent internal units of measurements.

Note: The internal units of measurements are ALWAYS, and exclusively, SI.

Example: Convert a double `kx`, containing a permeability value in units of milli-darcy (mD) to the equivalent value in SI units (i.e., ).

Parameters

  [in] | q | Physical quantity.
  [in] | unit | Physical unit of measurement.

Returns
  Value of `q` in equivalent SI units of measurements.

## to()

double Opm::unit::convert::to | ( | const double | q,
|  | const double | unit )

constexpr

Convert from internal units of measurements to equivalent external units of measurements.

Note: The internal units of measurements are ALWAYS, and exclusively, SI.

Example: Convert a `std::vector<double> p`, containing pressure values in the SI unit Pascal (i.e., unit::Pascal) to the equivalent values in Psi (unit::psia).

Parameters

  [in] | q | Physical quantity, measured in SI units.
  [in] | unit | Physical unit of measurement.

Returns
  Value of `q` in unit `unit`.