www.mooseframework.org
PorousFlowEffectiveStressCoupling.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 // MOOSE includes
11 #include "Function.h"
12 #include "MooseMesh.h"
13 #include "MooseVariable.h"
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<Kernel>();
20  params.addClassDescription("Adds -BiotCoefficient*effective_porepressure*grad_test[component]");
21  params.addRequiredParam<UserObjectName>(
22  "PorousFlowDictator", "The UserObject that holds the list of Porous-Flow variable names.");
23  params.addRangeCheckedParam<Real>(
24  "biot_coefficient", 1, "biot_coefficient>=0&biot_coefficient<=1", "Biot coefficient");
25  params.addRequiredParam<unsigned int>("component",
26  "The gradient direction (0 for x, 1 for y and 2 for z)");
27  return params;
28 }
29 
31  const InputParameters & parameters)
32  : Kernel(parameters),
33  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
34  _coefficient(getParam<Real>("biot_coefficient")),
35  _component(getParam<unsigned int>("component")),
36  _pf(getMaterialProperty<Real>("PorousFlow_effective_fluid_pressure_qp")),
37  _dpf_dvar(
38  getMaterialProperty<std::vector<Real>>("dPorousFlow_effective_fluid_pressure_qp_dvar")),
39  _rz(getBlockCoordSystem() == Moose::COORD_RZ)
40 {
41  if (_component >= _mesh.dimension())
42  mooseError("PorousFlowEffectiveStressCoupling: component should not be greater than the mesh "
43  "dimension");
44 }
45 
46 Real
48 {
49  if (_rz && _component == 0)
50  return -_coefficient * _pf[_qp] * (_grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0));
51  return -_coefficient * _pf[_qp] * _grad_test[_i][_qp](_component);
52 }
53 
54 Real
56 {
57  if (_dictator.notPorousFlowVariable(_var.number()))
58  return 0.0;
59  const unsigned int pvar = _dictator.porousFlowVariableNum(_var.number());
60  if (_rz && _component == 0)
61  return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] *
62  (_grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0));
63  return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] * _grad_test[_i][_qp](_component);
64 }
65 
66 Real
68 {
70  return 0.0;
71  const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
72  if (_rz && _component == 0)
73  return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] *
74  (_grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0));
75  return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] * _grad_test[_i][_qp](_component);
76 }
const MaterialProperty< Real > & _pf
effective porepressure
InputParameters validParams< PorousFlowEffectiveStressCoupling >()
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const PorousFlowDictator & _dictator
The Porous-Flow dictator that holds global info about the simulation.
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
bool notPorousFlowVariable(unsigned int moose_var_num) const
returns true if moose_var_num is not a porous flow variabe
const unsigned int _component
the spatial component
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
the PorousFlow variable number
PorousFlowEffectiveStressCoupling(const InputParameters &parameters)
const MaterialProperty< std::vector< Real > > & _dpf_dvar
d(effective porepressure)/(d porflow variable)
const bool _rz
Whether an RZ coordinate system is being used.