00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00027 #ifndef OPM_IDEAL_GAS_HPP
00028 #define OPM_IDEAL_GAS_HPP
00029
00030 #include <opm/material/Constants.hpp>
00031
00032 namespace Opm {
00036 template <class Scalar>
00037 class IdealGas
00038 {
00039 public:
00041 static const Scalar R;
00042
00047 template <class Evaluation>
00048 static Evaluation density(const Evaluation& avgMolarMass,
00049 const Evaluation& temperature,
00050 const Evaluation& pressure)
00051 { return pressure*avgMolarMass/(R*temperature); }
00052
00057 template <class Evaluation>
00058 static Evaluation pressure(const Evaluation& temperature,
00059 const Evaluation& rhoMolar)
00060 { return R*temperature*rhoMolar; }
00061
00066 template <class Evaluation>
00067 static Evaluation molarDensity(const Evaluation& temperature,
00068 const Evaluation& pressure)
00069 { return pressure/(R*temperature); }
00070 };
00071
00072 template <class Scalar>
00073 const Scalar IdealGas<Scalar>::R = Opm::Constants<Scalar>::R;
00074
00075 }
00076
00077 #endif