www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlow1PhaseP Class Reference

Base material designed to calculate fluid phase porepressure and saturation for the single-phase situation assuming constant effective saturation and porepressure as the nonlinear variable. More...

#include <PorousFlow1PhaseP.h>

Inheritance diagram for PorousFlow1PhaseP:
[legend]

Public Member Functions

 PorousFlow1PhaseP (const InputParameters &parameters)
 

Protected Member Functions

virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 
void buildQpPPSS ()
 Assemble std::vectors of porepressure, saturation and temperature at the quadpoints. More...
 
virtual Real effectiveSaturation (Real pressure) const
 Effective saturation as a function of porepressure. More...
 
virtual Real dEffectiveSaturation_dP (Real pressure) const
 Derivative of effective saturation wrt to porepressure. More...
 
virtual Real d2EffectiveSaturation_dP2 (Real pressure) const
 Second derivative of effective saturation wrt to porepressure. More...
 

Protected Attributes

const VariableValue & _porepressure_var
 Nodal or quadpoint value of porepressure of the fluid phase. More...
 
const VariableGradient & _gradp_qp_var
 Gradient(_porepressure at quadpoints) More...
 
const unsigned int _porepressure_varnum
 Moose variable number of the porepressure. More...
 
const unsigned int _p_var_num
 the PorousFlow variable number of the porepressure More...
 
const PorousFlowCapillaryPressure_pc_uo
 Capillary pressure UserObject Note: This pointer can be replaced with a reference once the deprecated PP materials have been removed. More...
 
const unsigned int _num_phases
 Number of phases. More...
 
const unsigned int _num_components
 Number of components. More...
 
const unsigned int _num_pf_vars
 Number of PorousFlow variables. More...
 
MaterialProperty< std::vector< Real > > & _porepressure
 Computed nodal or quadpoint values of porepressure of the phases. More...
 
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
 d(porepressure)/d(PorousFlow variable) More...
 
MaterialProperty< std::vector< RealGradient > > *const _gradp_qp
 Grad(p) at the quadpoints. More...
 
MaterialProperty< std::vector< std::vector< Real > > > *const _dgradp_qp_dgradv
 d(grad porepressure)/d(grad PorousFlow variable) at the quadpoints More...
 
MaterialProperty< std::vector< std::vector< RealGradient > > > *const _dgradp_qp_dv
 d(grad porepressure)/d(PorousFlow variable) at the quadpoints More...
 
MaterialProperty< std::vector< Real > > & _saturation
 Computed nodal or qp saturation of the phases. More...
 
MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
 d(saturation)/d(PorousFlow variable) More...
 
MaterialProperty< std::vector< RealGradient > > *const _grads_qp
 Grad(s) at the quadpoints. More...
 
MaterialProperty< std::vector< std::vector< Real > > > *const _dgrads_qp_dgradv
 d(grad saturation)/d(grad PorousFlow variable) at the quadpoints More...
 
MaterialProperty< std::vector< std::vector< RealGradient > > > *const _dgrads_qp_dv
 d(grad saturation)/d(PorousFlow variable) at the quadpoints More...
 

Detailed Description

Base material designed to calculate fluid phase porepressure and saturation for the single-phase situation assuming constant effective saturation and porepressure as the nonlinear variable.

Inherit and over-ride effectiveSaturation, dEffectiveSaturation, and d2EffectiveSaturation to implement other capillary pressure functions

Definition at line 27 of file PorousFlow1PhaseP.h.

Constructor & Destructor Documentation

PorousFlow1PhaseP::PorousFlow1PhaseP ( const InputParameters &  parameters)

Definition at line 25 of file PorousFlow1PhaseP.C.

26  : PorousFlowVariableBase(parameters),
27 
28  _porepressure_var(_nodal_material ? coupledNodalValue("porepressure")
29  : coupledValue("porepressure")),
30  _gradp_qp_var(coupledGradient("porepressure")),
31  _porepressure_varnum(coupled("porepressure")),
32  _p_var_num(_dictator.isPorousFlowVariable(_porepressure_varnum)
33  ? _dictator.porousFlowVariableNum(_porepressure_varnum)
34  : 0),
35  _pc_uo(parameters.isParamSetByUser("capillary_pressure")
36  ? &getUserObject<PorousFlowCapillaryPressure>("capillary_pressure")
37  : nullptr)
38 {
39  if (_num_phases != 1)
40  mooseError("The Dictator proclaims that the number of phases is ",
41  _dictator.numPhases(),
42  " whereas PorousFlow1PhaseP can only be used for 1-phase simulations. Be aware "
43  "that the Dictator has noted your mistake.");
44 }
const unsigned int _p_var_num
the PorousFlow variable number of the porepressure
PorousFlowVariableBase(const InputParameters &parameters)
const VariableValue & _porepressure_var
Nodal or quadpoint value of porepressure of the fluid phase.
const PorousFlowCapillaryPressure * _pc_uo
Capillary pressure UserObject Note: This pointer can be replaced with a reference once the deprecated...
const unsigned int _num_phases
Number of phases.
const unsigned int _porepressure_varnum
Moose variable number of the porepressure.
const VariableGradient & _gradp_qp_var
Gradient(_porepressure at quadpoints)

Member Function Documentation

void PorousFlow1PhaseP::buildQpPPSS ( )
protected

Assemble std::vectors of porepressure, saturation and temperature at the quadpoints.

Definition at line 85 of file PorousFlow1PhaseP.C.

Referenced by computeQpProperties(), and initQpStatefulProperties().

86 {
87  _porepressure[_qp][0] = _porepressure_var[_qp];
89 }
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
virtual Real effectiveSaturation(Real pressure) const
Effective saturation as a function of porepressure.
const VariableValue & _porepressure_var
Nodal or quadpoint value of porepressure of the fluid phase.
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
void PorousFlow1PhaseP::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowVariableBase.

Definition at line 54 of file PorousFlow1PhaseP.C.

55 {
56  // size stuff correctly and prepare the derivative matrices with zeroes
58 
59  buildQpPPSS();
60  const Real dseff = dEffectiveSaturation_dP(_porepressure_var[_qp]);
61 
62  if (!_nodal_material)
63  {
64  (*_gradp_qp)[_qp][0] = _gradp_qp_var[_qp];
65  (*_grads_qp)[_qp][0] = dseff * _gradp_qp_var[_qp];
66  }
67 
68  // _porepressure is only dependent on _porepressure, and its derivative is 1
69  if (_dictator.isPorousFlowVariable(_porepressure_varnum))
70  {
71  // _porepressure is a PorousFlow variable
72  _dporepressure_dvar[_qp][0][_p_var_num] = 1.0;
73  _dsaturation_dvar[_qp][0][_p_var_num] = dseff;
74  if (!_nodal_material)
75  {
76  (*_dgradp_qp_dgradv)[_qp][0][_p_var_num] = 1.0;
77  (*_dgrads_qp_dgradv)[_qp][0][_p_var_num] = dseff;
78  (*_dgrads_qp_dv)[_qp][0][_p_var_num] =
80  }
81  }
82 }
virtual Real d2EffectiveSaturation_dP2(Real pressure) const
Second derivative of effective saturation wrt to porepressure.
const unsigned int _p_var_num
the PorousFlow variable number of the porepressure
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
d(saturation)/d(PorousFlow variable)
virtual Real dEffectiveSaturation_dP(Real pressure) const
Derivative of effective saturation wrt to porepressure.
virtual void computeQpProperties() override
const VariableValue & _porepressure_var
Nodal or quadpoint value of porepressure of the fluid phase.
const unsigned int _porepressure_varnum
Moose variable number of the porepressure.
const VariableGradient & _gradp_qp_var
Gradient(_porepressure at quadpoints)
void buildQpPPSS()
Assemble std::vectors of porepressure, saturation and temperature at the quadpoints.
Real PorousFlow1PhaseP::d2EffectiveSaturation_dP2 ( Real  pressure) const
protectedvirtual

Second derivative of effective saturation wrt to porepressure.

Default = 0 for constant saturation. Over-ride in derived classes to implement other effective saturation forulations

Parameters
pressureporepressure (Pa)
Returns
second derivative of effective saturation wrt porepressure

Reimplemented in PorousFlow1PhaseP_BW, and PorousFlow1PhaseP_VG.

Definition at line 104 of file PorousFlow1PhaseP.C.

Referenced by computeQpProperties().

105 {
106  return _pc_uo->d2EffectiveSaturation(pc);
107 }
const PorousFlowCapillaryPressure * _pc_uo
Capillary pressure UserObject Note: This pointer can be replaced with a reference once the deprecated...
virtual Real d2EffectiveSaturation(Real pc) const =0
Second derivative of effective saturation wrt capillary pressure.
Real PorousFlow1PhaseP::dEffectiveSaturation_dP ( Real  pressure) const
protectedvirtual

Derivative of effective saturation wrt to porepressure.

Default = 0 for constant saturation. Over-ride in derived classes to implement other effective saturation forulations

Parameters
pressureporepressure (Pa)
Returns
derivative of effective saturation wrt porepressure

Reimplemented in PorousFlow1PhaseP_BW, and PorousFlow1PhaseP_VG.

Definition at line 98 of file PorousFlow1PhaseP.C.

Referenced by computeQpProperties().

99 {
100  return _pc_uo->dEffectiveSaturation(pc);
101 }
virtual Real dEffectiveSaturation(Real pc) const =0
Derivative of effective saturation wrt capillary pressure.
const PorousFlowCapillaryPressure * _pc_uo
Capillary pressure UserObject Note: This pointer can be replaced with a reference once the deprecated...
Real PorousFlow1PhaseP::effectiveSaturation ( Real  pressure) const
protectedvirtual

Effective saturation as a function of porepressure.

Default is constant saturation = 1. If porepressure < 0 then saturation < 1. Over-ride in derived classes to implement other effective saturation forulations

Parameters
pressureporepressure (Pa)
Returns
effective saturation

Reimplemented in PorousFlow1PhaseP_BW, and PorousFlow1PhaseP_VG.

Definition at line 92 of file PorousFlow1PhaseP.C.

Referenced by buildQpPPSS().

93 {
94  return _pc_uo->effectiveSaturation(pc);
95 }
virtual Real effectiveSaturation(Real pc) const =0
Effective saturation as a function of capillary pressure.
const PorousFlowCapillaryPressure * _pc_uo
Capillary pressure UserObject Note: This pointer can be replaced with a reference once the deprecated...
void PorousFlow1PhaseP::initQpStatefulProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowVariableBase.

Definition at line 47 of file PorousFlow1PhaseP.C.

48 {
50  buildQpPPSS();
51 }
virtual void initQpStatefulProperties() override
void buildQpPPSS()
Assemble std::vectors of porepressure, saturation and temperature at the quadpoints.

Member Data Documentation

MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowVariableBase::_dgradp_qp_dgradv
protectedinherited

d(grad porepressure)/d(grad PorousFlow variable) at the quadpoints

Definition at line 52 of file PorousFlowVariableBase.h.

MaterialProperty<std::vector<std::vector<RealGradient> > >* const PorousFlowVariableBase::_dgradp_qp_dv
protectedinherited

d(grad porepressure)/d(PorousFlow variable) at the quadpoints

Definition at line 55 of file PorousFlowVariableBase.h.

MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowVariableBase::_dgrads_qp_dgradv
protectedinherited

d(grad saturation)/d(grad PorousFlow variable) at the quadpoints

Definition at line 67 of file PorousFlowVariableBase.h.

MaterialProperty<std::vector<std::vector<RealGradient> > >* const PorousFlowVariableBase::_dgrads_qp_dv
protectedinherited

d(grad saturation)/d(PorousFlow variable) at the quadpoints

Definition at line 70 of file PorousFlowVariableBase.h.

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dporepressure_dvar
protectedinherited
MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dsaturation_dvar
protectedinherited
MaterialProperty<std::vector<RealGradient> >* const PorousFlowVariableBase::_gradp_qp
protectedinherited

Grad(p) at the quadpoints.

Definition at line 49 of file PorousFlowVariableBase.h.

const VariableGradient& PorousFlow1PhaseP::_gradp_qp_var
protected

Gradient(_porepressure at quadpoints)

Definition at line 75 of file PorousFlow1PhaseP.h.

Referenced by computeQpProperties().

MaterialProperty<std::vector<RealGradient> >* const PorousFlowVariableBase::_grads_qp
protectedinherited

Grad(s) at the quadpoints.

Definition at line 64 of file PorousFlowVariableBase.h.

const unsigned int PorousFlowVariableBase::_num_components
protectedinherited
const unsigned int PorousFlowVariableBase::_num_pf_vars
protectedinherited
const unsigned int PorousFlowVariableBase::_num_phases
protectedinherited
const unsigned int PorousFlow1PhaseP::_p_var_num
protected

the PorousFlow variable number of the porepressure

Definition at line 79 of file PorousFlow1PhaseP.h.

Referenced by computeQpProperties().

const PorousFlowCapillaryPressure* PorousFlow1PhaseP::_pc_uo
protected

Capillary pressure UserObject Note: This pointer can be replaced with a reference once the deprecated PP materials have been removed.

Definition at line 83 of file PorousFlow1PhaseP.h.

Referenced by d2EffectiveSaturation_dP2(), dEffectiveSaturation_dP(), and effectiveSaturation().

MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_porepressure
protectedinherited
const VariableValue& PorousFlow1PhaseP::_porepressure_var
protected

Nodal or quadpoint value of porepressure of the fluid phase.

Definition at line 73 of file PorousFlow1PhaseP.h.

Referenced by buildQpPPSS(), and computeQpProperties().

const unsigned int PorousFlow1PhaseP::_porepressure_varnum
protected

Moose variable number of the porepressure.

Definition at line 77 of file PorousFlow1PhaseP.h.

Referenced by computeQpProperties().

MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_saturation
protectedinherited

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