opm-common
Loading...
Searching...
No Matches
Opm::unit Namespace Reference

Definition of various units. More...

Namespaces

namespace  convert
 Unit conversion routines.

Functions

Common powers
constexpr double square (double v)
constexpr double cubic (double v)

Variables

constexpr double mol = 1
constexpr double ppm = 1. / prefix::mega
Length
constexpr double meter = 1
constexpr double inch = 2.54 * prefix::centi*meter
constexpr double feet = 12 * inch
Time
constexpr double second = 1
constexpr double minute = 60 * second
constexpr double hour = 60 * minute
constexpr double day = 24 * hour
constexpr double year = 365 * day
constexpr double ecl_year = 365.25 * day
Volume
constexpr double gallon = 231 * cubic(inch)
constexpr double stb = 42 * gallon
constexpr double liter = 1 * cubic(prefix::deci*meter)
Mass
constexpr double kilogram = 1
constexpr double gram = 1.0e-3 * kilogram
constexpr double pound = 0.45359237 * kilogram
Energy
constexpr double joule = 1
constexpr double btu = 1054.3503*joule
Standardised constant
constexpr double gravity = 9.80665 * meter/square(second)
Force
constexpr double Newton = kilogram*meter / square(second)
constexpr double dyne = 1e-5*Newton
constexpr double lbf = pound * gravity
Pressure
constexpr double Pascal = Newton / square(meter)
constexpr double barsa = 100000 * Pascal
constexpr double bars = 100000 * Pascal
constexpr double atma = 101325 * Pascal
constexpr double atm = 101325 * Pascal
constexpr double psia = lbf / square(inch)
constexpr double psi = lbf / square(inch)
Temperature. This one is more complicated

because the unit systems used by Eclipse (i.e.

degrees Celsius and degrees Fahrenheit require to add or subtract an offset for the conversion between from/to Kelvin

constexpr double degCelsius = 1.0
constexpr double degCelsiusOffset = 273.15
constexpr double degFahrenheit = 5.0/9.0
constexpr double degFahrenheitOffset = 459.67*degFahrenheit
Viscosity
constexpr double Pas = Pascal * second
constexpr double Poise = prefix::deci*Pas
Permeability

A porous medium with a permeability of 1 darcy permits a flow (flux) of $1\,\mathit{cm}^3/s$ of a fluid with viscosity $1\,\mathit{cP}$ ( $1\,mPa\cdot s$) under a pressure gradient of $1\,\mathit{atm}/\mathit{cm}$ acting across an area of $1\,\mathit{cm}^2$.

constexpr double darcy = perm_details::darcy

Detailed Description

Definition of various units.

All the units are defined in terms of international standard units (SI). Example of use: We define a variable k which gives a permeability. We want to set k to $1\,mD$.

We can also use one of the prefixes defined in Opm::prefix