Base class for capillary pressure for multiphase flow in porous media. More...
#include <PorousFlowCapillaryPressure.h>
Public Member Functions | |
PorousFlowCapillaryPressure (const InputParameters ¶meters) | |
virtual void | initialize () final |
virtual void | initialSetup () override |
virtual Real | capillaryPressure (Real saturation, unsigned qp=0) const |
Capillary pressure is calculated as a function of true saturation. More... | |
virtual Real | dCapillaryPressure (Real saturation, unsigned qp=0) const |
Derivative of capillary pressure wrt true saturation. More... | |
virtual Real | d2CapillaryPressure (Real saturation, unsigned qp=0) const |
Second derivative of capillary pressure wrt true saturation. More... | |
virtual DualReal | capillaryPressure (DualReal saturation, unsigned qp=0) const |
virtual Real | effectiveSaturation (Real pc, unsigned qp=0) const =0 |
Effective saturation as a function of capillary pressure. More... | |
virtual Real | dEffectiveSaturation (Real pc, unsigned qp=0) const =0 |
Derivative of effective saturation wrt capillary pressure. More... | |
virtual Real | d2EffectiveSaturation (Real pc, unsigned qp=0) const =0 |
Second derivative of effective saturation wrt capillary pressure. More... | |
Real | saturation (Real pc, unsigned qp=0) const |
Saturation as a function of capillary pressure. More... | |
Real | dSaturation (Real pc, unsigned qp=0) const |
Derivative of saturation wrt capillary pressure. More... | |
Real | d2Saturation (Real pc, unsigned qp=0) const |
Second derivative of saturation wrt capillary pressure. More... | |
Protected Member Functions | |
Real | effectiveSaturationFromSaturation (Real saturation) const |
Effective saturation of liquid phase given liquid saturation and residual liquid saturation. More... | |
Real | extensionSaturation () const |
Calculates the saturation where the logarithmic extension to capillary pressure meets the raw curve using Newton's method. More... | |
Real | interceptFunction (Real s) const |
Calculates the saturation where the logarithmic extension to capillary pressure at low saturation. More... | |
Real | interceptFunctionDeriv (Real s) const |
Calculates the saturation where the logarithmic extension to capillary pressure at low saturation. More... | |
Real | capillaryPressureLogExt (Real s) const |
The capillary pressure in the logarithmic extension This implementation assumes capillary-pressure is a function of saturation only, and not any other quad-point dependent quantities. More... | |
Real | dCapillaryPressureLogExt (Real s) const |
The derivative of capillary pressure in the logarithmic extension This implementation assumes capillary-pressure is a function of saturation only, and not any other quad-point dependent quantities. More... | |
Real | d2CapillaryPressureLogExt (Real s) const |
The second derivative of capillary pressure in the logarithmic extension This implementation assumes capillary-pressure is a function of saturation only, and not any other quad-point dependent quantities. More... | |
virtual Real | capillaryPressureCurve (Real saturation, unsigned qp=0) const =0 |
Raw capillary pressure curve (does not include logarithmic extension) More... | |
virtual Real | dCapillaryPressureCurve (Real saturation, unsigned qp=0) const =0 |
Derivative of raw capillary pressure wrt true saturation. More... | |
virtual Real | d2CapillaryPressureCurve (Real saturation, unsigned qp=0) const =0 |
Second derivative of raw capillary pressure wrt true saturation. More... | |
Protected Attributes | |
const Real | _sat_lr |
Liquid residual saturation. More... | |
const Real | _dseff_ds |
Derivative of effective saturation with respect to saturation. More... | |
bool | _log_ext |
Flag to use a logarithmic extension for low saturation. More... | |
const Real | _pc_max |
Maximum capillary pressure (Pa). Note: must be <= 0. More... | |
Real | _sat_ext |
Saturation where the logarithmic extension meets the raw curve This is computed only for qp=0. More... | |
Real | _pc_ext |
Capillary pressure where the extension meets the raw curve. More... | |
Real | _slope_ext |
Gradient of the logarithmic extension This is computed only for qp=0. More... | |
const Real | _log10 |
log(10) More... | |
Base class for capillary pressure for multiphase flow in porous media.
To implement an effective saturation formulation, override effectiveSaturation() and derivatives. To implement a capillary pressure curve that will include the logarithmic extension, override capillaryPressureCurve() and derivatives.
Note: Capillary pressure is calculated as a function of true saturation, not effective saturation (saturation minus residual). Derivatives are returned wrt true saturation, so no scaling of them is required in objects using these methods.
Includes an optional logarithmic extension in the low saturation region where capillary pressure can go to infinity as saturation tends to 0. Calculation of logarithmic extension from Webb, A simple extension of two-phase characteristic curves to include the dry region, Water Resources Research 36, 1425-1430 (2000) The logarithmic extension is only computed for qp=0. If your overriding class has no qp dependence (capillary pressure is a function only of saturation, for example) then no changes are required. Otherwise, if you use log_extension, you will have to modify this base class to correctly calculate the log-extension parameters at each quadpoint.
Definition at line 39 of file PorousFlowCapillaryPressure.h.
PorousFlowCapillaryPressure::PorousFlowCapillaryPressure | ( | const InputParameters & | parameters | ) |
Definition at line 37 of file PorousFlowCapillaryPressure.C.
|
virtual |
Definition at line 177 of file PorousFlowCapillaryPressure.C.
|
virtual |
Capillary pressure is calculated as a function of true saturation.
Note that this method includes the ability to use a logarithmic extension at low saturation.
saturation | true saturation |
qp | quadpoint to use (when capillary-pressure depends on coupled variables, not just saturation) |
Definition at line 64 of file PorousFlowCapillaryPressure.C.
Referenced by PorousFlow2PhasePS::buildQpPPSS(), capillaryPressure(), initialSetup(), PorousFlowWaterVapor::thermophysicalProperties(), PorousFlowWaterNCG::thermophysicalProperties(), PorousFlowBrineCO2::thermophysicalProperties(), PorousFlowWaterNCG::totalMassFraction(), PorousFlowBrineCO2::totalMassFraction(), PorousFlowWaterNCG::twoPhaseProperties(), and PorousFlowBrineCO2::twoPhaseProperties().
|
protectedpure virtual |
Raw capillary pressure curve (does not include logarithmic extension)
saturation | true saturation |
Implemented in PorousFlowCapillaryPressureBC, PorousFlowCapillaryPressureVG, PorousFlowCapillaryPressureBW, PorousFlowCapillaryPressureConst, and PorousFlowCapillaryPressureRSC.
Referenced by capillaryPressure(), interceptFunction(), and interceptFunctionDeriv().
|
protected |
The capillary pressure in the logarithmic extension This implementation assumes capillary-pressure is a function of saturation only, and not any other quad-point dependent quantities.
s | liquid saturation |
Definition at line 115 of file PorousFlowCapillaryPressure.C.
Referenced by capillaryPressure().
|
virtual |
Second derivative of capillary pressure wrt true saturation.
saturation | true saturation |
qp | quadpoint to use (when capillary-pressure depends on coupled variables, not just saturation) |
Definition at line 82 of file PorousFlowCapillaryPressure.C.
Referenced by PorousFlow2PhasePS::computeQpProperties(), PorousFlowFluidStateSingleComponent::computeQpProperties(), and PorousFlowFluidState::computeQpProperties().
|
protectedpure virtual |
Second derivative of raw capillary pressure wrt true saturation.
saturation | true saturation |
Implemented in PorousFlowCapillaryPressureBC, PorousFlowCapillaryPressureVG, PorousFlowCapillaryPressureBW, PorousFlowCapillaryPressureConst, and PorousFlowCapillaryPressureRSC.
Referenced by d2CapillaryPressure(), and interceptFunctionDeriv().
|
protected |
The second derivative of capillary pressure in the logarithmic extension This implementation assumes capillary-pressure is a function of saturation only, and not any other quad-point dependent quantities.
s | liquid saturation |
Definition at line 127 of file PorousFlowCapillaryPressure.C.
Referenced by d2CapillaryPressure().
|
pure virtual |
Second derivative of effective saturation wrt capillary pressure.
pc | capillary pressure |
qp | quadpoint to use (when effective saturation depends on coupled variables, not just pc) |
Implemented in PorousFlowCapillaryPressureBC, PorousFlowCapillaryPressureVG, PorousFlowCapillaryPressureBW, PorousFlowCapillaryPressureConst, and PorousFlowCapillaryPressureRSC.
Referenced by d2Saturation().
Real PorousFlowCapillaryPressure::d2Saturation | ( | Real | pc, |
unsigned | qp = 0 |
||
) | const |
Second derivative of saturation wrt capillary pressure.
pc | capillary pressure |
qp | quadpoint to use (when saturation depends on coupled variables, not just pc) |
Definition at line 109 of file PorousFlowCapillaryPressure.C.
Referenced by PorousFlow2PhasePP::computeQpProperties(), and PorousFlow1PhaseP::computeQpProperties().
|
virtual |
Derivative of capillary pressure wrt true saturation.
saturation | true saturation |
qp | quadpoint to use (when capillary-pressure depends on coupled variables, not just saturation) |
Definition at line 73 of file PorousFlowCapillaryPressure.C.
Referenced by capillaryPressure(), PorousFlow2PhasePS::computeQpProperties(), PorousFlowFluidStateSingleComponent::computeQpProperties(), and PorousFlowFluidState::computeQpProperties().
|
protectedpure virtual |
Derivative of raw capillary pressure wrt true saturation.
saturation | true saturation |
Implemented in PorousFlowCapillaryPressureBC, PorousFlowCapillaryPressureVG, PorousFlowCapillaryPressureBW, PorousFlowCapillaryPressureConst, and PorousFlowCapillaryPressureRSC.
Referenced by dCapillaryPressure(), interceptFunction(), and interceptFunctionDeriv().
|
protected |
The derivative of capillary pressure in the logarithmic extension This implementation assumes capillary-pressure is a function of saturation only, and not any other quad-point dependent quantities.
s | liquid saturation |
Definition at line 121 of file PorousFlowCapillaryPressure.C.
Referenced by dCapillaryPressure().
|
pure virtual |
Derivative of effective saturation wrt capillary pressure.
pc | capillary pressure (Pa) |
qp | quadpoint to use (when effective saturation depends on coupled variables, not just pc) |
Implemented in PorousFlowCapillaryPressureBC, PorousFlowCapillaryPressureVG, PorousFlowCapillaryPressureBW, PorousFlowCapillaryPressureConst, and PorousFlowCapillaryPressureRSC.
Referenced by dSaturation().
Real PorousFlowCapillaryPressure::dSaturation | ( | Real | pc, |
unsigned | qp = 0 |
||
) | const |
Derivative of saturation wrt capillary pressure.
pc | capillary pressure (Pa) |
qp | quadpoint to use (when saturation depends on coupled variables, not just pc) |
Definition at line 103 of file PorousFlowCapillaryPressure.C.
Referenced by PorousFlow2PhasePP::computeQpProperties(), and PorousFlow1PhaseP::computeQpProperties().
|
pure virtual |
Effective saturation as a function of capillary pressure.
pc | capillary pressure (Pa) |
qp | quadpoint to use (when effective saturation depends on coupled variables, not just pc) |
Implemented in PorousFlowCapillaryPressureBC, PorousFlowCapillaryPressureVG, PorousFlowCapillaryPressureBW, PorousFlowCapillaryPressureConst, and PorousFlowCapillaryPressureRSC.
Referenced by saturation().
|
protected |
Effective saturation of liquid phase given liquid saturation and residual liquid saturation.
Note: not to be mistaken with effectiveSaturation(pc) which is a function of capillary pressure.
saturation | true saturation |
Definition at line 91 of file PorousFlowCapillaryPressure.C.
Referenced by PorousFlowCapillaryPressureVG::capillaryPressureCurve(), PorousFlowCapillaryPressureBC::capillaryPressureCurve(), PorousFlowCapillaryPressureVG::d2CapillaryPressureCurve(), PorousFlowCapillaryPressureBC::d2CapillaryPressureCurve(), PorousFlowCapillaryPressureVG::dCapillaryPressureCurve(), and PorousFlowCapillaryPressureBC::dCapillaryPressureCurve().
|
protected |
Calculates the saturation where the logarithmic extension to capillary pressure meets the raw curve using Newton's method.
This implementation assumes capillary-pressure is a function of saturation only, and not any other quad-point dependent quantities
Definition at line 134 of file PorousFlowCapillaryPressure.C.
Referenced by initialSetup().
|
inlinefinalvirtual |
Definition at line 44 of file PorousFlowCapillaryPressure.h.
|
overridevirtual |
Definition at line 51 of file PorousFlowCapillaryPressure.C.
|
protected |
Calculates the saturation where the logarithmic extension to capillary pressure at low saturation.
This is computed for qp=0 only. This implementation assumes capillary-pressure is a function of saturation only, and not any other quad-point dependent quantities
s | effective saturation |
Definition at line 158 of file PorousFlowCapillaryPressure.C.
Referenced by extensionSaturation().
|
protected |
Calculates the saturation where the logarithmic extension to capillary pressure at low saturation.
This implementation assumes capillary-pressure is a function of saturation only, and not any other quad-point dependent quantities
s | effective saturation |
Definition at line 167 of file PorousFlowCapillaryPressure.C.
Referenced by extensionSaturation().
Real PorousFlowCapillaryPressure::saturation | ( | Real | pc, |
unsigned | qp = 0 |
||
) | const |
Saturation as a function of capillary pressure.
pc | capillary pressure (Pa) |
qp | quadpoint to use (when saturation depends on coupled variables, not just pc) |
Definition at line 97 of file PorousFlowCapillaryPressure.C.
Referenced by PorousFlow1PhaseP::buildQpPPSS(), PorousFlow2PhasePP::buildQpPPSS(), capillaryPressure(), PorousFlowCapillaryPressureVG::capillaryPressureCurve(), PorousFlowCapillaryPressureBC::capillaryPressureCurve(), capillaryPressureLogExt(), d2CapillaryPressure(), PorousFlowCapillaryPressureVG::d2CapillaryPressureCurve(), PorousFlowCapillaryPressureBC::d2CapillaryPressureCurve(), d2CapillaryPressureLogExt(), dCapillaryPressure(), PorousFlowCapillaryPressureVG::dCapillaryPressureCurve(), PorousFlowCapillaryPressureBC::dCapillaryPressureCurve(), dCapillaryPressureLogExt(), effectiveSaturationFromSaturation(), interceptFunction(), and interceptFunctionDeriv().
|
protected |
Derivative of effective saturation with respect to saturation.
Definition at line 227 of file PorousFlowCapillaryPressure.h.
Referenced by PorousFlowCapillaryPressureVG::d2CapillaryPressureCurve(), PorousFlowCapillaryPressureBC::d2CapillaryPressureCurve(), PorousFlowCapillaryPressureVG::dCapillaryPressureCurve(), and PorousFlowCapillaryPressureBC::dCapillaryPressureCurve().
|
protected |
log(10)
Definition at line 249 of file PorousFlowCapillaryPressure.h.
Referenced by d2CapillaryPressureLogExt(), dCapillaryPressureLogExt(), interceptFunction(), and interceptFunctionDeriv().
|
protected |
Flag to use a logarithmic extension for low saturation.
Definition at line 229 of file PorousFlowCapillaryPressure.h.
Referenced by capillaryPressure(), d2CapillaryPressure(), dCapillaryPressure(), initialSetup(), PorousFlowCapillaryPressureBW::PorousFlowCapillaryPressureBW(), PorousFlowCapillaryPressureConst::PorousFlowCapillaryPressureConst(), and PorousFlowCapillaryPressureRSC::PorousFlowCapillaryPressureRSC().
|
protected |
Capillary pressure where the extension meets the raw curve.
This is computed only for qp=0.
Definition at line 242 of file PorousFlowCapillaryPressure.h.
Referenced by capillaryPressureLogExt(), d2CapillaryPressureLogExt(), dCapillaryPressureLogExt(), and initialSetup().
|
protected |
Maximum capillary pressure (Pa). Note: must be <= 0.
Definition at line 231 of file PorousFlowCapillaryPressure.h.
Referenced by PorousFlowCapillaryPressureVG::capillaryPressureCurve(), PorousFlowCapillaryPressureBC::capillaryPressureCurve(), PorousFlowCapillaryPressureVG::d2CapillaryPressureCurve(), PorousFlowCapillaryPressureBC::d2CapillaryPressureCurve(), PorousFlowCapillaryPressureVG::dCapillaryPressureCurve(), PorousFlowCapillaryPressureBC::dCapillaryPressureCurve(), initialSetup(), and interceptFunction().
|
protected |
Saturation where the logarithmic extension meets the raw curve This is computed only for qp=0.
Definition at line 237 of file PorousFlowCapillaryPressure.h.
Referenced by capillaryPressure(), capillaryPressureLogExt(), d2CapillaryPressure(), d2CapillaryPressureLogExt(), dCapillaryPressure(), dCapillaryPressureLogExt(), and initialSetup().
|
protected |
Liquid residual saturation.
Definition at line 225 of file PorousFlowCapillaryPressure.h.
Referenced by d2Saturation(), dSaturation(), effectiveSaturationFromSaturation(), extensionSaturation(), and saturation().
|
protected |
Gradient of the logarithmic extension This is computed only for qp=0.
Definition at line 247 of file PorousFlowCapillaryPressure.h.
Referenced by capillaryPressureLogExt(), d2CapillaryPressureLogExt(), dCapillaryPressureLogExt(), and initialSetup().