Density of a gas according to the van der Waals expression (P + n^2 a/V^2)(V - nb) = nRT How density is calculated: given P, (1/V) is calculated for n=1 and rho = molar_mass*(1/V). More...
#include <RichardsDensityVDW.h>
Public Member Functions | |
RichardsDensityVDW (const InputParameters ¶meters) | |
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 () |
Protected Member Functions | |
Real | densityVDW (Real p) const |
Density according to the van der Waals expression This is modified to yield density(p) as noted above. More... | |
Protected Attributes | |
Real | _a |
van der Waals a More... | |
Real | _b |
van der Waals b More... | |
Real | _rt |
R*T (gas constant * temperature) More... | |
Real | _molar_mass |
molar mass of gas More... | |
Real | _infinity_ratio |
density at P=-infinity is _infinity_ratio*_molar_mass More... | |
Real | _rhs |
R*T*b/a. More... | |
Real | _b2oa |
b^2/a More... | |
Real | _vdw0 |
density at P=0 according to the van der Waals expression More... | |
Real | _slope0 |
(1/_molar_mass)*d(density)/dP at P=0 More... | |
Density of a gas according to the van der Waals expression (P + n^2 a/V^2)(V - nb) = nRT How density is calculated: given P, (1/V) is calculated for n=1 and rho = molar_mass*(1/V).
The density is actually modified from this rho in the following ways: (1) density = rho - rho(P=0). This is so that density(P=0)=0, which is physically correct, but the wan der Waals expression does not hold close to a vacuum. However, it can be vital that density(P=0)=0 numerically, otherwise fluid can be withdrawn from a node where there shouldn't be any fluid at P=0. This is a miniscule correction, of many orders of magnitude below the precision of a, b, R or T (2) For P<0 we enter an unphysical region, but this may be sampled by the Newton process as the algorithm iterates towards the solution. Therefore i set density = infinity_ratio*molar_mass*(exp(-c*P) - 1) in this region where c is chosen so the derivatives match at P=0
Definition at line 36 of file RichardsDensityVDW.h.
RichardsDensityVDW::RichardsDensityVDW | ( | const InputParameters & | parameters | ) |
Definition at line 49 of file RichardsDensityVDW.C.
|
virtual |
second derivative of fluid density wrt porepressure
p | porepressure |
Implements RichardsDensity.
Definition at line 114 of file RichardsDensityVDW.C.
|
virtual |
derivative of fluid density wrt porepressure
p | porepressure |
Implements RichardsDensity.
Definition at line 91 of file RichardsDensityVDW.C.
Referenced by RichardsDensityVDW().
|
virtual |
fluid density as a function of porepressure
p | porepressure |
Implements RichardsDensity.
Definition at line 82 of file RichardsDensityVDW.C.
|
protected |
Density according to the van der Waals expression This is modified to yield density(p) as noted above.
p | porepressure |
Definition at line 64 of file RichardsDensityVDW.C.
Referenced by density(), and RichardsDensityVDW().
|
inherited |
Definition at line 34 of file RichardsDensity.C.
|
inherited |
Definition at line 39 of file RichardsDensity.C.
|
inherited |
Definition at line 29 of file RichardsDensity.C.
|
protected |
van der Waals a
Definition at line 61 of file RichardsDensityVDW.h.
|
protected |
van der Waals b
Definition at line 64 of file RichardsDensityVDW.h.
Referenced by d2density(), ddensity(), and densityVDW().
|
protected |
b^2/a
Definition at line 79 of file RichardsDensityVDW.h.
Referenced by d2density(), ddensity(), and densityVDW().
|
protected |
density at P=-infinity is _infinity_ratio*_molar_mass
Definition at line 73 of file RichardsDensityVDW.h.
Referenced by d2density(), ddensity(), density(), and RichardsDensityVDW().
|
protected |
molar mass of gas
Definition at line 70 of file RichardsDensityVDW.h.
Referenced by d2density(), ddensity(), density(), densityVDW(), and RichardsDensityVDW().
|
protected |
R*T*b/a.
Definition at line 76 of file RichardsDensityVDW.h.
Referenced by d2density(), ddensity(), and densityVDW().
|
protected |
R*T (gas constant * temperature)
Definition at line 67 of file RichardsDensityVDW.h.
|
protected |
(1/_molar_mass)*d(density)/dP at P=0
Definition at line 85 of file RichardsDensityVDW.h.
Referenced by d2density(), ddensity(), density(), and RichardsDensityVDW().
|
protected |
density at P=0 according to the van der Waals expression
Definition at line 82 of file RichardsDensityVDW.h.
Referenced by density(), and RichardsDensityVDW().