Go to the documentation of this file.
12 #include "MooseVariable.h"
20 InputParameters params = validParams<Kernel>();
21 params.addRequiredParam<RealVectorValue>(
"gravity",
22 "Gravitational acceleration vector downwards (m/s^2)");
23 params.addParam<
bool>(
"multiply_by_density",
25 "If true, then this Kernel is the fluid mass "
26 "flux. If false, then this Kernel is the "
27 "fluid volume flux (which is common in "
29 params.addRequiredParam<UserObjectName>(
30 "PorousFlowDictator",
"The UserObject that holds the list of PorousFlow variable names");
31 params.addClassDescription(
"Darcy flux suitable for models involving a fully-saturated, single "
32 "phase, single component fluid. No upwinding is used");
37 const InputParameters & 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")),
58 _gravity(getParam<RealVectorValue>(
"gravity")),
59 _perm_derivs(_dictator.usePermDerivs())
62 mooseError(
"PorousFlowFullySaturatedDarcyBase should not be used for multi-phase scenarios as "
63 "it does no upwinding and does not include relative-permeability effects");
69 const unsigned ph = 0;
71 const RealVectorValue flow =
73 return _grad_test[_i][_qp] * mob * flow;
88 const unsigned ph = 0;
92 const Real dmob =
dmobility(pvar) * _phi[_j][_qp];
94 const RealVectorValue flow =
97 RealVectorValue dflow =
106 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
111 return _grad_test[_i][_qp] * (dmob * flow + mob * dflow);
117 const unsigned ph = 0;
127 const unsigned ph = 0;
registerMooseObject("PorousFlowApp", PorousFlowFullySaturatedDarcyBase)
const MaterialProperty< std::vector< std::vector< Real > > > & _dgrad_p_dgrad_var
Derivative of Grad porepressure in each phase wrt grad(PorousFlow variables)
const bool _multiply_by_density
If true then the mobility contains the fluid density, otherwise it doesn't.
const MaterialProperty< std::vector< RealTensorValue > > & _dpermeability_dvar
d(permeabiity)/d(PorousFlow variable)
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
VectorValue< Real > RealGradient
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.
virtual Real mobility() const
The mobility of the fluid = density / viscosity.
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.
const bool _perm_derivs
Flag to check whether permeabiity derivatives are non-zero.
const MaterialProperty< std::vector< Real > > & _viscosity
Viscosity of the fluid at the qp.
virtual Real computeQpResidual() override
virtual Real computeQpJacobian() override
const MaterialProperty< std::vector< std::vector< Real > > > & _ddensity_dvar
Derivative of the fluid density for each phase wrt PorousFlow variables (at the qp)
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
unsigned int numPhases() const
The number of fluid phases.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const MaterialProperty< std::vector< std::vector< RealGradient > > > & _dgrad_p_dvar
Derivative of Grad porepressure in each phase wrt PorousFlow variables.
const MaterialProperty< std::vector< RealGradient > > & _grad_p
Gradient of the pore pressure in each phase.
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dpermeability_dgradvar
d(permeabiity)/d(grad(PorousFlow variable))
Darcy advective flux for a fully-saturated, single phase, single component fluid.
PorousFlowFullySaturatedDarcyBase(const InputParameters ¶meters)
const MaterialProperty< std::vector< Real > > & _density
Fluid density for each phase (at the qp)
const RealVectorValue _gravity
Gravity pointing downwards.
const MaterialProperty< RealTensorValue > & _permeability
Permeability of porous material.
InputParameters validParams< PorousFlowFullySaturatedDarcyBase >()
const MaterialProperty< std::vector< std::vector< Real > > > & _dviscosity_dvar
Derivative of the fluid viscosity wrt PorousFlow variables.
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
virtual Real dmobility(unsigned pvar) const
The derivative of the mobility with respect to the PorousFlow variable pvar.