RichardsDensityMethane20degC Class Reference

Methane density - a quadratic fit to expressions in: "Results of (pressure, density, temperature) measurements on methane and on nitrogen in the temperature range from 273.15K to 323.15K at pressures up to 12MPa using new apparatus for accurate gas-density" This is only valid for p>=0, which is the physical region. More...

#include <RichardsDensityMethane20degC.h>

Inheritance diagram for RichardsDensityMethane20degC:
[legend]

## Public Member Functions

RichardsDensityMethane20degC (const InputParameters &parameters)

Real density (Real p) const
fluid density as a function of porepressure More...

Real ddensity (Real p) const
derivative of fluid density wrt porepressure More...

Real d2density (Real p) const
second derivative of fluid density wrt porepressure More...

void initialize ()

void execute ()

void finalize ()

## Private Attributes

Real _p_unit
Unit of measurement for pressure (should be 1 for pressure in Pa, 1E6 for pressure in MPa, etc) More...

## Detailed Description

Methane density - a quadratic fit to expressions in: "Results of (pressure, density, temperature) measurements on methane and on nitrogen in the temperature range from 273.15K to 323.15K at pressures up to 12MPa using new apparatus for accurate gas-density" This is only valid for p>=0, which is the physical region.

I extend to the p>0 domain with an exponential, which will probably be sampled as the newton interative process converges towards the solution. NOTE: this expression is only valid to about P=20MPa. Use van der Waals (RichardsDensityVDW) for higher pressures.

Definition at line 31 of file RichardsDensityMethane20degC.h.

## ◆ RichardsDensityMethane20degC()

 RichardsDensityMethane20degC::RichardsDensityMethane20degC ( const InputParameters & parameters )

Definition at line 38 of file RichardsDensityMethane20degC.C.

39  : RichardsDensity(parameters), _p_unit(getParam<Real>("p_unit"))
40 {
41 }
RichardsDensity(const InputParameters &parameters)
Real _p_unit
Unit of measurement for pressure (should be 1 for pressure in Pa, 1E6 for pressure in MPa...

## ◆ d2density()

 Real RichardsDensityMethane20degC::d2density ( Real p ) const
virtual

second derivative of fluid density wrt porepressure

Parameters
 p porepressure

Implements RichardsDensity.

Definition at line 62 of file RichardsDensityMethane20degC.C.

63 {
64  if (p >= 0)
65  return 2.08715433094E-13 * std::pow(_p_unit, 2);
66  else
67  return 0.1 * std::pow(6.54576947608E-5 * _p_unit, 2) * std::exp(6.54576947608E-5 * p * _p_unit);
68 }
Real _p_unit
Unit of measurement for pressure (should be 1 for pressure in Pa, 1E6 for pressure in MPa...
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

## ◆ ddensity()

 Real RichardsDensityMethane20degC::ddensity ( Real p ) const
virtual

derivative of fluid density wrt porepressure

Parameters
 p porepressure

Implements RichardsDensity.

Definition at line 53 of file RichardsDensityMethane20degC.C.

54 {
55  if (p >= 0)
56  return (0.00654576947608E-3 + 2.08715433094E-13 * p * _p_unit) * _p_unit;
57  else
58  return 0.1 * 6.54576947608E-5 * _p_unit * std::exp(6.54576947608E-5 * p * _p_unit);
59 }
Real _p_unit
Unit of measurement for pressure (should be 1 for pressure in Pa, 1E6 for pressure in MPa...

## ◆ density()

 Real RichardsDensityMethane20degC::density ( Real p ) const
virtual

fluid density as a function of porepressure

Parameters
 p porepressure

Implements RichardsDensity.

Definition at line 44 of file RichardsDensityMethane20degC.C.

45 {
46  if (p >= 0)
47  return 0.00654576947608E-3 * p * _p_unit + 1.04357716547E-13 * std::pow(p * _p_unit, 2);
48  else
49  return 0.1 * (std::exp(6.54576947608E-5 * p * _p_unit) - 1);
50 }
Real _p_unit
Unit of measurement for pressure (should be 1 for pressure in Pa, 1E6 for pressure in MPa...
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

## ◆ execute()

 void RichardsDensity::execute ( )
inherited

Definition at line 34 of file RichardsDensity.C.

35 {
36 }

## ◆ finalize()

 void RichardsDensity::finalize ( )
inherited

Definition at line 39 of file RichardsDensity.C.

40 {
41 }

## ◆ initialize()

 void RichardsDensity::initialize ( )
inherited

Definition at line 29 of file RichardsDensity.C.

30 {
31 }

## ◆ _p_unit

 Real RichardsDensityMethane20degC::_p_unit
private

Unit of measurement for pressure (should be 1 for pressure in Pa, 1E6 for pressure in MPa, etc)

Definition at line 56 of file RichardsDensityMethane20degC.h.

Referenced by d2density(), ddensity(), and density().

The documentation for this class was generated from the following files: