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

Darcy advective flux for a fully-saturated, single phase, single component fluid. More...

#include <PorousFlowFullySaturatedDarcyBase.h>

Inheritance diagram for PorousFlowFullySaturatedDarcyBase:
[legend]

Public Member Functions

 PorousFlowFullySaturatedDarcyBase (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 
virtual Real mobility () const
 The mobility of the fluid = density / viscosity. More...
 
virtual Real dmobility (unsigned pvar) const
 The derivative of the mobility with respect to the PorousFlow variable pvar. More...
 

Protected Attributes

const bool _multiply_by_density
 If true then the mobility contains the fluid density, otherwise it doesn't. More...
 
const MaterialProperty< RealTensorValue > & _permeability
 Permeability of porous material. More...
 
const MaterialProperty< std::vector< RealTensorValue > > & _dpermeability_dvar
 d(permeabiity)/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dpermeability_dgradvar
 d(permeabiity)/d(grad(PorousFlow variable)) More...
 
const MaterialProperty< std::vector< Real > > & _density
 Fluid density for each phase (at the qp) More...
 
const MaterialProperty< std::vector< std::vector< Real > > > & _ddensity_dvar
 Derivative of the fluid density for each phase wrt PorousFlow variables (at the qp) More...
 
const MaterialProperty< std::vector< Real > > & _viscosity
 Viscosity of the fluid at the qp. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > & _dviscosity_dvar
 Derivative of the fluid viscosity wrt PorousFlow variables. More...
 
const MaterialProperty< std::vector< Real > > & _pp
 Quadpoint pore pressure in each phase. More...
 
const MaterialProperty< std::vector< RealGradient > > & _grad_p
 Gradient of the pore pressure in each phase. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > & _dgrad_p_dgrad_var
 Derivative of Grad porepressure in each phase wrt grad(PorousFlow variables) More...
 
const MaterialProperty< std::vector< std::vector< RealGradient > > > & _dgrad_p_dvar
 Derivative of Grad porepressure in each phase wrt PorousFlow variables. More...
 
const PorousFlowDictator_dictator
 PorousFlowDictator UserObject. More...
 
const RealVectorValue _gravity
 Gravity pointing downwards. More...
 

Detailed Description

Darcy advective flux for a fully-saturated, single phase, single component fluid.

No upwinding or relative-permeability is used.

Definition at line 26 of file PorousFlowFullySaturatedDarcyBase.h.

Constructor & Destructor Documentation

◆ PorousFlowFullySaturatedDarcyBase()

PorousFlowFullySaturatedDarcyBase::PorousFlowFullySaturatedDarcyBase ( const InputParameters &  parameters)

Definition at line 36 of file PorousFlowFullySaturatedDarcyBase.C.

38  : Kernel(parameters),
39  _multiply_by_density(getParam<bool>("multiply_by_density")),
40  _permeability(getMaterialProperty<RealTensorValue>("PorousFlow_permeability_qp")),
42  getMaterialProperty<std::vector<RealTensorValue>>("dPorousFlow_permeability_qp_dvar")),
43  _dpermeability_dgradvar(getMaterialProperty<std::vector<std::vector<RealTensorValue>>>(
44  "dPorousFlow_permeability_qp_dgradvar")),
45  _density(getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_qp")),
46  _ddensity_dvar(getMaterialProperty<std::vector<std::vector<Real>>>(
47  "dPorousFlow_fluid_phase_density_qp_dvar")),
48  _viscosity(getMaterialProperty<std::vector<Real>>("PorousFlow_viscosity_qp")),
50  getMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_viscosity_qp_dvar")),
51  _pp(getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_qp")),
52  _grad_p(getMaterialProperty<std::vector<RealGradient>>("PorousFlow_grad_porepressure_qp")),
53  _dgrad_p_dgrad_var(getMaterialProperty<std::vector<std::vector<Real>>>(
54  "dPorousFlow_grad_porepressure_qp_dgradvar")),
55  _dgrad_p_dvar(getMaterialProperty<std::vector<std::vector<RealGradient>>>(
56  "dPorousFlow_grad_porepressure_qp_dvar")),
57  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
58  _gravity(getParam<RealVectorValue>("gravity"))
59 {
60  if (_dictator.numPhases() != 1)
61  mooseError("PorousFlowFullySaturatedDarcyBase should not be used for multi-phase scenarios as "
62  "it does no upwinding and does not include relative-permeability effects");
63 }
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dpermeability_dgradvar
d(permeabiity)/d(grad(PorousFlow variable))
const MaterialProperty< std::vector< Real > > & _pp
Quadpoint pore pressure in each phase.
const MaterialProperty< RealTensorValue > & _permeability
Permeability of porous material.
const MaterialProperty< std::vector< std::vector< RealGradient > > > & _dgrad_p_dvar
Derivative of Grad porepressure in each phase wrt PorousFlow variables.
const RealVectorValue _gravity
Gravity pointing downwards.
const MaterialProperty< std::vector< std::vector< Real > > > & _ddensity_dvar
Derivative of the fluid density for each phase wrt PorousFlow variables (at the qp) ...
const MaterialProperty< std::vector< RealGradient > > & _grad_p
Gradient of the pore pressure in each phase.
const MaterialProperty< std::vector< Real > > & _viscosity
Viscosity of the fluid at the qp.
const MaterialProperty< std::vector< std::vector< Real > > > & _dviscosity_dvar
Derivative of the fluid viscosity wrt PorousFlow variables.
const bool _multiply_by_density
If true then the mobility contains the fluid density, otherwise it doesn&#39;t.
const MaterialProperty< std::vector< RealTensorValue > > & _dpermeability_dvar
d(permeabiity)/d(PorousFlow variable)
unsigned int numPhases() const
The number of fluid phases.
const MaterialProperty< std::vector< std::vector< Real > > > & _dgrad_p_dgrad_var
Derivative of Grad porepressure in each phase wrt grad(PorousFlow variables)
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const MaterialProperty< std::vector< Real > > & _density
Fluid density for each phase (at the qp)

Member Function Documentation

◆ computeQpJacobian()

Real PorousFlowFullySaturatedDarcyBase::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 76 of file PorousFlowFullySaturatedDarcyBase.C.

77 {
78  return computeQpOffDiagJacobian(_var.number());
79 }
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override

◆ computeQpOffDiagJacobian()

Real PorousFlowFullySaturatedDarcyBase::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 82 of file PorousFlowFullySaturatedDarcyBase.C.

Referenced by computeQpJacobian().

83 {
85  return 0.0;
86 
87  const unsigned ph = 0;
88  const unsigned pvar = _dictator.porousFlowVariableNum(jvar);
89 
90  const Real mob = mobility();
91  const Real dmob = dmobility(pvar) * _phi[_j][_qp];
92  ;
93 
94  const RealVectorValue flow =
95  _permeability[_qp] * (_grad_p[_qp][ph] - _density[_qp][ph] * _gravity);
96  RealVectorValue dflow = _dpermeability_dvar[_qp][pvar] * _phi[_j][_qp] *
97  (_grad_p[_qp][ph] - _density[_qp][ph] * _gravity);
98  for (unsigned i = 0; i < LIBMESH_DIM; ++i)
99  dflow += _dpermeability_dgradvar[_qp][i][pvar] * _grad_phi[_j][_qp](i) *
100  (_grad_p[_qp][ph] - _density[_qp][ph] * _gravity);
101  dflow += _permeability[_qp] * (_grad_phi[_j][_qp] * _dgrad_p_dgrad_var[_qp][ph][pvar] -
102  _phi[_j][_qp] * _ddensity_dvar[_qp][ph][pvar] * _gravity);
103  dflow += _permeability[_qp] * (_dgrad_p_dvar[_qp][ph][pvar] * _phi[_j][_qp]);
104  return _grad_test[_i][_qp] * (dmob * flow + mob * dflow);
105 }
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dpermeability_dgradvar
d(permeabiity)/d(grad(PorousFlow variable))
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.
virtual Real dmobility(unsigned pvar) const
The derivative of the mobility with respect to the PorousFlow variable pvar.
const MaterialProperty< RealTensorValue > & _permeability
Permeability of porous material.
const MaterialProperty< std::vector< std::vector< RealGradient > > > & _dgrad_p_dvar
Derivative of Grad porepressure in each phase wrt PorousFlow variables.
const RealVectorValue _gravity
Gravity pointing downwards.
const MaterialProperty< std::vector< std::vector< Real > > > & _ddensity_dvar
Derivative of the fluid density for each phase wrt PorousFlow variables (at the qp) ...
const MaterialProperty< std::vector< RealGradient > > & _grad_p
Gradient of the pore pressure in each phase.
const MaterialProperty< std::vector< RealTensorValue > > & _dpermeability_dvar
d(permeabiity)/d(PorousFlow variable)
const MaterialProperty< std::vector< std::vector< Real > > > & _dgrad_p_dgrad_var
Derivative of Grad porepressure in each phase wrt grad(PorousFlow variables)
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.
virtual Real mobility() const
The mobility of the fluid = density / viscosity.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const MaterialProperty< std::vector< Real > > & _density
Fluid density for each phase (at the qp)

◆ computeQpResidual()

Real PorousFlowFullySaturatedDarcyBase::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 66 of file PorousFlowFullySaturatedDarcyBase.C.

67 {
68  const unsigned ph = 0;
69  const Real mob = mobility();
70  const RealVectorValue flow =
71  _permeability[_qp] * (_grad_p[_qp][ph] - _density[_qp][ph] * _gravity);
72  return _grad_test[_i][_qp] * mob * flow;
73 }
const MaterialProperty< RealTensorValue > & _permeability
Permeability of porous material.
const RealVectorValue _gravity
Gravity pointing downwards.
const MaterialProperty< std::vector< RealGradient > > & _grad_p
Gradient of the pore pressure in each phase.
virtual Real mobility() const
The mobility of the fluid = density / viscosity.
const MaterialProperty< std::vector< Real > > & _density
Fluid density for each phase (at the qp)

◆ dmobility()

Real PorousFlowFullySaturatedDarcyBase::dmobility ( unsigned  pvar) const
protectedvirtual

The derivative of the mobility with respect to the PorousFlow variable pvar.

Parameters
pvarTake the derivative with respect to this PorousFlow variable

Reimplemented in PorousFlowFullySaturatedDarcyFlow, and PorousFlowFullySaturatedHeatAdvection.

Definition at line 118 of file PorousFlowFullySaturatedDarcyBase.C.

Referenced by computeQpOffDiagJacobian(), PorousFlowFullySaturatedHeatAdvection::dmobility(), and PorousFlowFullySaturatedDarcyFlow::dmobility().

119 {
120  const unsigned ph = 0;
121  Real dmob = -_dviscosity_dvar[_qp][ph][pvar] / std::pow(_viscosity[_qp][ph], 2);
123  dmob = _density[_qp][ph] * dmob + _ddensity_dvar[_qp][ph][pvar] / _viscosity[_qp][ph];
124  return dmob;
125 }
const MaterialProperty< std::vector< std::vector< Real > > > & _ddensity_dvar
Derivative of the fluid density for each phase wrt PorousFlow variables (at the qp) ...
const MaterialProperty< std::vector< Real > > & _viscosity
Viscosity of the fluid at the qp.
const MaterialProperty< std::vector< std::vector< Real > > > & _dviscosity_dvar
Derivative of the fluid viscosity wrt PorousFlow variables.
const bool _multiply_by_density
If true then the mobility contains the fluid density, otherwise it doesn&#39;t.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const MaterialProperty< std::vector< Real > > & _density
Fluid density for each phase (at the qp)

◆ mobility()

Real PorousFlowFullySaturatedDarcyBase::mobility ( ) const
protectedvirtual

The mobility of the fluid = density / viscosity.

Reimplemented in PorousFlowFullySaturatedDarcyFlow, and PorousFlowFullySaturatedHeatAdvection.

Definition at line 108 of file PorousFlowFullySaturatedDarcyBase.C.

Referenced by computeQpOffDiagJacobian(), computeQpResidual(), PorousFlowFullySaturatedHeatAdvection::dmobility(), PorousFlowFullySaturatedDarcyFlow::dmobility(), PorousFlowFullySaturatedHeatAdvection::mobility(), and PorousFlowFullySaturatedDarcyFlow::mobility().

109 {
110  const unsigned ph = 0;
111  Real mob = 1.0 / _viscosity[_qp][ph];
113  mob *= _density[_qp][ph];
114  return mob;
115 }
const MaterialProperty< std::vector< Real > > & _viscosity
Viscosity of the fluid at the qp.
const bool _multiply_by_density
If true then the mobility contains the fluid density, otherwise it doesn&#39;t.
const MaterialProperty< std::vector< Real > > & _density
Fluid density for each phase (at the qp)

Member Data Documentation

◆ _ddensity_dvar

const MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowFullySaturatedDarcyBase::_ddensity_dvar
protected

Derivative of the fluid density for each phase wrt PorousFlow variables (at the qp)

Definition at line 63 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian(), and dmobility().

◆ _density

const MaterialProperty<std::vector<Real> >& PorousFlowFullySaturatedDarcyBase::_density
protected

Fluid density for each phase (at the qp)

Definition at line 60 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian(), computeQpResidual(), dmobility(), and mobility().

◆ _dgrad_p_dgrad_var

const MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowFullySaturatedDarcyBase::_dgrad_p_dgrad_var
protected

Derivative of Grad porepressure in each phase wrt grad(PorousFlow variables)

Definition at line 78 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian().

◆ _dgrad_p_dvar

const MaterialProperty<std::vector<std::vector<RealGradient> > >& PorousFlowFullySaturatedDarcyBase::_dgrad_p_dvar
protected

Derivative of Grad porepressure in each phase wrt PorousFlow variables.

Definition at line 81 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian().

◆ _dictator

const PorousFlowDictator& PorousFlowFullySaturatedDarcyBase::_dictator
protected

◆ _dpermeability_dgradvar

const MaterialProperty<std::vector<std::vector<RealTensorValue> > >& PorousFlowFullySaturatedDarcyBase::_dpermeability_dgradvar
protected

d(permeabiity)/d(grad(PorousFlow variable))

Definition at line 57 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian().

◆ _dpermeability_dvar

const MaterialProperty<std::vector<RealTensorValue> >& PorousFlowFullySaturatedDarcyBase::_dpermeability_dvar
protected

d(permeabiity)/d(PorousFlow variable)

Definition at line 54 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian().

◆ _dviscosity_dvar

const MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowFullySaturatedDarcyBase::_dviscosity_dvar
protected

Derivative of the fluid viscosity wrt PorousFlow variables.

Definition at line 69 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by dmobility().

◆ _grad_p

const MaterialProperty<std::vector<RealGradient> >& PorousFlowFullySaturatedDarcyBase::_grad_p
protected

Gradient of the pore pressure in each phase.

Definition at line 75 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _gravity

const RealVectorValue PorousFlowFullySaturatedDarcyBase::_gravity
protected

Gravity pointing downwards.

Definition at line 87 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _multiply_by_density

const bool PorousFlowFullySaturatedDarcyBase::_multiply_by_density
protected

If true then the mobility contains the fluid density, otherwise it doesn't.

Definition at line 48 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by dmobility(), and mobility().

◆ _permeability

const MaterialProperty<RealTensorValue>& PorousFlowFullySaturatedDarcyBase::_permeability
protected

Permeability of porous material.

Definition at line 51 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _pp

const MaterialProperty<std::vector<Real> >& PorousFlowFullySaturatedDarcyBase::_pp
protected

Quadpoint pore pressure in each phase.

Definition at line 72 of file PorousFlowFullySaturatedDarcyBase.h.

◆ _viscosity

const MaterialProperty<std::vector<Real> >& PorousFlowFullySaturatedDarcyBase::_viscosity
protected

Viscosity of the fluid at the qp.

Definition at line 66 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by dmobility(), and mobility().


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