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 porous-flow 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(porous-flow variable) More...
 
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dpermeability_dgradvar
 d(permeabiity)/d(grad(porous-flow 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_porousflow_dictator
 PorousFlow 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 24 of file PorousFlowFullySaturatedDarcyBase.h.

Constructor & Destructor Documentation

PorousFlowFullySaturatedDarcyBase::PorousFlowFullySaturatedDarcyBase ( const InputParameters &  parameters)

Definition at line 33 of file PorousFlowFullySaturatedDarcyBase.C.

35  : Kernel(parameters),
36  _multiply_by_density(getParam<bool>("multiply_by_density")),
37  _permeability(getMaterialProperty<RealTensorValue>("PorousFlow_permeability_qp")),
39  getMaterialProperty<std::vector<RealTensorValue>>("dPorousFlow_permeability_qp_dvar")),
40  _dpermeability_dgradvar(getMaterialProperty<std::vector<std::vector<RealTensorValue>>>(
41  "dPorousFlow_permeability_qp_dgradvar")),
42  _density(getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_qp")),
43  _ddensity_dvar(getMaterialProperty<std::vector<std::vector<Real>>>(
44  "dPorousFlow_fluid_phase_density_qp_dvar")),
45  _viscosity(getMaterialProperty<std::vector<Real>>("PorousFlow_viscosity_qp")),
47  getMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_viscosity_qp_dvar")),
48  _pp(getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_qp")),
49  _grad_p(getMaterialProperty<std::vector<RealGradient>>("PorousFlow_grad_porepressure_qp")),
50  _dgrad_p_dgrad_var(getMaterialProperty<std::vector<std::vector<Real>>>(
51  "dPorousFlow_grad_porepressure_qp_dgradvar")),
52  _dgrad_p_dvar(getMaterialProperty<std::vector<std::vector<RealGradient>>>(
53  "dPorousFlow_grad_porepressure_qp_dvar")),
54  _porousflow_dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
55  _gravity(getParam<RealVectorValue>("gravity"))
56 {
58  mooseError("PorousFlowFullySaturatedDarcyBase should not be used for multi-phase scenarios as "
59  "it does no upwinding and does not include relative-permeability effects");
60 }
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dpermeability_dgradvar
d(permeabiity)/d(grad(porous-flow 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(porous-flow variable)
const PorousFlowDictator & _porousflow_dictator
PorousFlow UserObject.
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 MaterialProperty< std::vector< Real > > & _density
Fluid density for each phase (at the qp)

Member Function Documentation

Real PorousFlowFullySaturatedDarcyBase::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 73 of file PorousFlowFullySaturatedDarcyBase.C.

74 {
75  return computeQpOffDiagJacobian(_var.number());
76 }
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
Real PorousFlowFullySaturatedDarcyBase::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 79 of file PorousFlowFullySaturatedDarcyBase.C.

Referenced by computeQpJacobian().

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

Definition at line 63 of file PorousFlowFullySaturatedDarcyBase.C.

64 {
65  const unsigned ph = 0;
66  const Real mob = mobility();
67  const RealVectorValue flow =
68  _permeability[_qp] * (_grad_p[_qp][ph] - _density[_qp][ph] * _gravity);
69  return _grad_test[_i][_qp] * mob * flow;
70 }
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)
Real PorousFlowFullySaturatedDarcyBase::dmobility ( unsigned  pvar) const
protectedvirtual

The derivative of the mobility with respect to the porous-flow variable pvar.

Parameters
pvarTake the derivative with respect to this porous-flow variable

Reimplemented in PorousFlowFullySaturatedDarcyFlow, and PorousFlowFullySaturatedHeatAdvection.

Definition at line 115 of file PorousFlowFullySaturatedDarcyBase.C.

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

116 {
117  const unsigned ph = 0;
118  Real dmob = -_dviscosity_dvar[_qp][ph][pvar] / std::pow(_viscosity[_qp][ph], 2);
120  dmob = _density[_qp][ph] * dmob + _ddensity_dvar[_qp][ph][pvar] / _viscosity[_qp][ph];
121  return dmob;
122 }
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)
Real PorousFlowFullySaturatedDarcyBase::mobility ( ) const
protectedvirtual

The mobility of the fluid = density / viscosity.

Reimplemented in PorousFlowFullySaturatedDarcyFlow, and PorousFlowFullySaturatedHeatAdvection.

Definition at line 105 of file PorousFlowFullySaturatedDarcyBase.C.

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

106 {
107  const unsigned ph = 0;
108  Real mob = 1.0 / _viscosity[_qp][ph];
110  mob *= _density[_qp][ph];
111  return mob;
112 }
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

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 61 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian(), and dmobility().

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

Fluid density for each phase (at the qp)

Definition at line 58 of file PorousFlowFullySaturatedDarcyBase.h.

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

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 76 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian().

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 79 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian().

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

d(permeabiity)/d(grad(porous-flow variable))

Definition at line 55 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian().

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

d(permeabiity)/d(porous-flow variable)

Definition at line 52 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian().

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

Derivative of the fluid viscosity wrt PorousFlow variables.

Definition at line 67 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by dmobility().

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

Gradient of the pore pressure in each phase.

Definition at line 73 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

const RealVectorValue PorousFlowFullySaturatedDarcyBase::_gravity
protected

Gravity pointing downwards.

Definition at line 85 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

const bool PorousFlowFullySaturatedDarcyBase::_multiply_by_density
protected

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

Definition at line 46 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by dmobility(), and mobility().

const MaterialProperty<RealTensorValue>& PorousFlowFullySaturatedDarcyBase::_permeability
protected

Permeability of porous material.

Definition at line 49 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

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

Quadpoint pore pressure in each phase.

Definition at line 70 of file PorousFlowFullySaturatedDarcyBase.h.

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

Viscosity of the fluid at the qp.

Definition at line 64 of file PorousFlowFullySaturatedDarcyBase.h.

Referenced by dmobility(), and mobility().


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