https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
PorousFlowHystereticRelativePermeabilityBase Class Referenceabstract

Base material for computing relative permeability for 1-phase and 2-phase hysteretic models. More...

#include <PorousFlowHystereticRelativePermeabilityBase.h>

Inheritance diagram for PorousFlowHystereticRelativePermeabilityBase:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 PorousFlowHystereticRelativePermeabilityBase (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 
virtual void computeRelPermQp ()=0
 Compute the relative permeability and its derivative wrt the _phase_num saturation, at the quadpoints, and store the result in _relative_permeability[_qp] and _drelative_permeability_ds[_qp]. More...
 
virtual void computeTurningPoint0Info (Real tp_sat)
 Compute all relevant quantities at the zeroth turning point (the transition from primary drying to first-order wetting) More...
 

Protected Attributes

const Real _s_lr
 Liquid saturation at which the liquid relperm is zero and the gas relperm is k_rg_max. More...
 
const Real _s_gr_max
 Gas residual saturation. More...
 
const Real _m
 van Genuchten m parameter More...
 
const MaterialProperty< std::vector< Real > > & _saturation
 Saturation material property. More...
 
const MaterialProperty< unsigned > & _hys_order
 Hysteresis order, as computed by PorousFlowHysteresisOrder. More...
 
const MaterialProperty< unsigned > & _hys_order_old
 Old value of hysteresis order, as computed by PorousFlowHysteresisOrder. More...
 
const MaterialProperty< std::array< Real, PorousFlowConstants::MAX_HYSTERESIS_ORDER > > & _hys_sat_tps
 Saturation values at the turning points, as computed by PorousFlowHysteresisOrder. More...
 
MaterialProperty< Real > & _relative_permeability
 Computed relative permeability. More...
 
MaterialProperty< Real > & _drelative_permeability_ds
 Derivative of relative permeability wrt the saturation of _phase_num (which is not necessarily the liquid phase) More...
 
MaterialProperty< Real > & _s_gr_tp0
 Computed nodal or quadpoint values the Land expression, at the turning point from primary drying to first-order wetting. More...
 
const unsigned int _phase_num
 Phase number of fluid. More...
 
const std::string _phase
 Stringified fluid phase number. More...
 

Private Member Functions

Real landSat (Real slDel) const
 

Detailed Description

Base material for computing relative permeability for 1-phase and 2-phase hysteretic models.

Definition at line 18 of file PorousFlowHystereticRelativePermeabilityBase.h.

Constructor & Destructor Documentation

◆ PorousFlowHystereticRelativePermeabilityBase()

PorousFlowHystereticRelativePermeabilityBase::PorousFlowHystereticRelativePermeabilityBase ( const InputParameters parameters)

Definition at line 41 of file PorousFlowHystereticRelativePermeabilityBase.C.

43  : PorousFlowMaterialBase(parameters),
44  _s_lr(getParam<Real>("S_lr")),
45  _s_gr_max(getParam<Real>("S_gr_max")),
46  _m(getParam<Real>("m")),
47  _saturation(_nodal_material
48  ? getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_nodal")
49  : getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp")),
50  _hys_order(_nodal_material ? getMaterialProperty<unsigned>("PorousFlow_hysteresis_order_nodal")
51  : getMaterialProperty<unsigned>("PorousFlow_hysteresis_order_qp")),
52  _hys_order_old(_nodal_material
53  ? getMaterialPropertyOld<unsigned>("PorousFlow_hysteresis_order_nodal")
54  : getMaterialPropertyOld<unsigned>("PorousFlow_hysteresis_order_qp")),
56  _nodal_material
57  ? getMaterialProperty<std::array<Real, PorousFlowConstants::MAX_HYSTERESIS_ORDER>>(
58  "PorousFlow_hysteresis_saturation_tps_nodal")
59  : getMaterialProperty<std::array<Real, PorousFlowConstants::MAX_HYSTERESIS_ORDER>>(
60  "PorousFlow_hysteresis_saturation_tps_qp")),
62  _nodal_material ? declareProperty<Real>("PorousFlow_relative_permeability_nodal" + _phase)
63  : declareProperty<Real>("PorousFlow_relative_permeability_qp" + _phase)),
65  _nodal_material
66  ? declarePropertyDerivative<Real>("PorousFlow_relative_permeability_nodal" + _phase,
67  _saturation_variable_name)
68  : declarePropertyDerivative<Real>("PorousFlow_relative_permeability_qp" + _phase,
69  _saturation_variable_name)),
70  _s_gr_tp0(_nodal_material
71  ? declareProperty<Real>("PorousFlow_hysteresis_s_gr_tp0_nodal" + _phase)
72  : declareProperty<Real>("PorousFlow_hysteresis_s_gr_tp0_qp" + _phase))
73 {
74  mooseAssert(_dictator.numPhases() <= 2,
75  "PorousFlowHystereticRelativePermeability Materials can only be used for "
76  "1-phase or 2-phase models. The Dictator proclaims that the number of phases "
77  "exceeds 2, and dictators are never incorrect.");
78  if (_s_gr_max >= 1 - _s_lr)
79  paramError("S_gr_max", "Must be less than 1 - S_lr");
80 }
const Real _s_lr
Liquid saturation at which the liquid relperm is zero and the gas relperm is k_rg_max.
PorousFlowMaterialBase(const InputParameters &parameters)
MaterialProperty< Real > & _s_gr_tp0
Computed nodal or quadpoint values the Land expression, at the turning point from primary drying to f...
const std::string _phase
Stringified fluid phase number.
const MaterialProperty< unsigned > & _hys_order
Hysteresis order, as computed by PorousFlowHysteresisOrder.
const MaterialProperty< unsigned > & _hys_order_old
Old value of hysteresis order, as computed by PorousFlowHysteresisOrder.
const MaterialProperty< std::vector< Real > > & _saturation
Saturation material property.
MaterialProperty< Real > & _relative_permeability
Computed relative permeability.
MaterialProperty< Real > & _drelative_permeability_ds
Derivative of relative permeability wrt the saturation of _phase_num (which is not necessarily the li...
const MaterialProperty< std::array< Real, PorousFlowConstants::MAX_HYSTERESIS_ORDER > > & _hys_sat_tps
Saturation values at the turning points, as computed by PorousFlowHysteresisOrder.

Member Function Documentation

◆ computeQpProperties()

void PorousFlowHystereticRelativePermeabilityBase::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 93 of file PorousFlowHystereticRelativePermeabilityBase.C.

94 {
95  PorousFlowMaterialBase::computeQpProperties();
96 
97  if (_hys_order[_qp] != _hys_order_old[_qp] && _hys_order[_qp] == 1)
99 
101 }
virtual void computeRelPermQp()=0
Compute the relative permeability and its derivative wrt the _phase_num saturation, at the quadpoints, and store the result in _relative_permeability[_qp] and _drelative_permeability_ds[_qp].
const MaterialProperty< unsigned > & _hys_order
Hysteresis order, as computed by PorousFlowHysteresisOrder.
const MaterialProperty< unsigned > & _hys_order_old
Old value of hysteresis order, as computed by PorousFlowHysteresisOrder.
virtual void computeTurningPoint0Info(Real tp_sat)
Compute all relevant quantities at the zeroth turning point (the transition from primary drying to fi...
const MaterialProperty< std::array< Real, PorousFlowConstants::MAX_HYSTERESIS_ORDER > > & _hys_sat_tps
Saturation values at the turning points, as computed by PorousFlowHysteresisOrder.

◆ computeRelPermQp()

virtual void PorousFlowHystereticRelativePermeabilityBase::computeRelPermQp ( )
protectedpure virtual

Compute the relative permeability and its derivative wrt the _phase_num saturation, at the quadpoints, and store the result in _relative_permeability[_qp] and _drelative_permeability_ds[_qp].

Implemented in PorousFlowHystereticRelativePermeabilityLiquid, and PorousFlowHystereticRelativePermeabilityGas.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ computeTurningPoint0Info()

void PorousFlowHystereticRelativePermeabilityBase::computeTurningPoint0Info ( Real  tp_sat)
protectedvirtual

Compute all relevant quantities at the zeroth turning point (the transition from primary drying to first-order wetting)

Parameters
tp_satLiquid saturation at the turning point

Reimplemented in PorousFlowHystereticRelativePermeabilityLiquid.

Definition at line 111 of file PorousFlowHystereticRelativePermeabilityBase.C.

Referenced by computeQpProperties(), PorousFlowHystereticRelativePermeabilityLiquid::computeTurningPoint0Info(), and initQpStatefulProperties().

112 {
113  // s_gr_tp0 is the Land expression as a function of the zeroth turning point saturation
114  _s_gr_tp0[_qp] = landSat(tp_sat);
115 }
MaterialProperty< Real > & _s_gr_tp0
Computed nodal or quadpoint values the Land expression, at the turning point from primary drying to f...

◆ initQpStatefulProperties()

void PorousFlowHystereticRelativePermeabilityBase::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 83 of file PorousFlowHystereticRelativePermeabilityBase.C.

84 {
85  PorousFlowMaterialBase::initQpStatefulProperties();
86  if (_hys_order[_qp] >= 1)
88 
90 }
virtual void computeRelPermQp()=0
Compute the relative permeability and its derivative wrt the _phase_num saturation, at the quadpoints, and store the result in _relative_permeability[_qp] and _drelative_permeability_ds[_qp].
const MaterialProperty< unsigned > & _hys_order
Hysteresis order, as computed by PorousFlowHysteresisOrder.
virtual void computeTurningPoint0Info(Real tp_sat)
Compute all relevant quantities at the zeroth turning point (the transition from primary drying to fi...
const MaterialProperty< std::array< Real, PorousFlowConstants::MAX_HYSTERESIS_ORDER > > & _hys_sat_tps
Saturation values at the turning points, as computed by PorousFlowHysteresisOrder.

◆ landSat()

Real PorousFlowHystereticRelativePermeabilityBase::landSat ( Real  slDel) const
private
Returns
the value of gas saturation (called S_gr^Delta in the markdown documentation) using the Land expression. (This is a function of the liquid saturation at the turning point)
Parameters
slDelthe value of the liquid saturation at the turning point

Definition at line 104 of file PorousFlowHystereticRelativePermeabilityBase.C.

Referenced by computeTurningPoint0Info().

105 {
106  const Real a = 1.0 / _s_gr_max - 1.0 / (1.0 - _s_lr);
107  return (1.0 - slDel) / (1.0 + a * (1.0 - slDel));
108 }
const Real _s_lr
Liquid saturation at which the liquid relperm is zero and the gas relperm is k_rg_max.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ validParams()

InputParameters PorousFlowHystereticRelativePermeabilityBase::validParams ( )
static

Definition at line 13 of file PorousFlowHystereticRelativePermeabilityBase.C.

Referenced by PorousFlowHystereticRelativePermeabilityGas::validParams(), and PorousFlowHystereticRelativePermeabilityLiquid::validParams().

14 {
16  params.addRangeCheckedParam<Real>(
17  "S_lr",
18  0.0,
19  "S_lr >= 0 & S_lr < 1",
20  "Liquid residual saturation. At liquid saturation = S_lr, the liquid relative permeability "
21  "is zero and the gas relative permeability is k_rg_max. Almost definitely you need to set "
22  "S_lr equal to the quantity used for your hysteretic capillary-pressure curve, if you are "
23  "using one.");
25  "S_gr_max",
26  "S_gr_max >= 0 & S_gr_max < 1",
27  "Residual gas saturation. For liquid saturation = 1 - S_gr_max, the gas wetting "
28  "relative-permeability is zero, if the turning point was <= S_lr. 1 - S_gr_max is the "
29  "maximum liquid saturation for which the van Genuchten expression is valid for the liquid "
30  "relative-permeability wetting curve. You must ensure S_gr_max < 1 - S_lr. Often S_gr_max "
31  "= -0.3136 * ln(porosity) - 0.1334 is used");
33  "m", "m > 0 & m < 1", "van Genuchten m parameter. Suggested value is around 0.9");
34  params.addPrivateParam<std::string>("pf_material_type", "relative_permeability");
35  params.addPrivateParam<bool>("is_ad", false);
36  params.addClassDescription("PorousFlow material that computes relative permeability for 1-phase "
37  "or 2-phase models that include hysteresis");
38  return params;
39 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
static InputParameters validParams()
void addPrivateParam(const std::string &name, const T &value)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)

Member Data Documentation

◆ _drelative_permeability_ds

MaterialProperty<Real>& PorousFlowHystereticRelativePermeabilityBase::_drelative_permeability_ds
protected

Derivative of relative permeability wrt the saturation of _phase_num (which is not necessarily the liquid phase)

Definition at line 52 of file PorousFlowHystereticRelativePermeabilityBase.h.

Referenced by PorousFlowHystereticRelativePermeabilityGas::computeRelPermQp(), and PorousFlowHystereticRelativePermeabilityLiquid::computeRelPermQp().

◆ _hys_order

const MaterialProperty<unsigned>& PorousFlowHystereticRelativePermeabilityBase::_hys_order
protected

◆ _hys_order_old

const MaterialProperty<unsigned>& PorousFlowHystereticRelativePermeabilityBase::_hys_order_old
protected

Old value of hysteresis order, as computed by PorousFlowHysteresisOrder.

Definition at line 42 of file PorousFlowHystereticRelativePermeabilityBase.h.

Referenced by computeQpProperties().

◆ _hys_sat_tps

const MaterialProperty<std::array<Real, PorousFlowConstants::MAX_HYSTERESIS_ORDER> >& PorousFlowHystereticRelativePermeabilityBase::_hys_sat_tps
protected

◆ _m

const Real PorousFlowHystereticRelativePermeabilityBase::_m
protected

◆ _phase

const std::string PorousFlowMaterialBase::_phase
protectedinherited

Stringified fluid phase number.

Definition at line 34 of file PorousFlowMaterialBase.h.

◆ _phase_num

const unsigned int PorousFlowMaterialBase::_phase_num
protectedinherited

◆ _relative_permeability

MaterialProperty<Real>& PorousFlowHystereticRelativePermeabilityBase::_relative_permeability
protected

◆ _s_gr_max

const Real PorousFlowHystereticRelativePermeabilityBase::_s_gr_max
protected

◆ _s_gr_tp0

MaterialProperty<Real>& PorousFlowHystereticRelativePermeabilityBase::_s_gr_tp0
protected

◆ _s_lr

const Real PorousFlowHystereticRelativePermeabilityBase::_s_lr
protected

◆ _saturation

const MaterialProperty<std::vector<Real> >& PorousFlowHystereticRelativePermeabilityBase::_saturation
protected

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