www.mooseframework.org
PorousFlowEffectiveStressCoupling.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
12 #include "Function.h"
13 #include "MooseMesh.h"
14 #include "MooseVariable.h"
15 
17 
18 template <>
19 InputParameters
21 {
22  InputParameters params = validParams<Kernel>();
23  params.addClassDescription(
24  "Adds $-Bi \\cdot p_s \\cdot \\nabla \\Psi_c$, where the subscript $c$ is the component.");
25  params.addRequiredParam<UserObjectName>(
26  "PorousFlowDictator", "The UserObject that holds the list of PorousFlow variable names.");
27  params.addRangeCheckedParam<Real>(
28  "biot_coefficient", 1, "biot_coefficient>=0&biot_coefficient<=1", "Biot coefficient");
29  params.addRequiredParam<unsigned int>("component",
30  "The gradient direction (0 for x, 1 for y and 2 for z)");
31  return params;
32 }
33 
35  const InputParameters & parameters)
36  : Kernel(parameters),
37  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
38  _coefficient(getParam<Real>("biot_coefficient")),
39  _component(getParam<unsigned int>("component")),
40  _pf(getMaterialProperty<Real>("PorousFlow_effective_fluid_pressure_qp")),
41  _dpf_dvar(
42  getMaterialProperty<std::vector<Real>>("dPorousFlow_effective_fluid_pressure_qp_dvar")),
43  _rz(getBlockCoordSystem() == Moose::COORD_RZ)
44 {
45  if (_component >= _mesh.dimension())
46  paramError("component", "The component cannot be greater than the mesh dimension");
47 }
48 
49 Real
51 {
52  if (_rz && _component == 0)
53  return -_coefficient * _pf[_qp] * (_grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0));
54  return -_coefficient * _pf[_qp] * _grad_test[_i][_qp](_component);
55 }
56 
57 Real
59 {
60  if (_dictator.notPorousFlowVariable(_var.number()))
61  return 0.0;
62  const unsigned int pvar = _dictator.porousFlowVariableNum(_var.number());
63  if (_rz && _component == 0)
64  return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] *
65  (_grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0));
66  return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] * _grad_test[_i][_qp](_component);
67 }
68 
69 Real
71 {
73  return 0.0;
74  const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
75  if (_rz && _component == 0)
76  return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] *
77  (_grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0));
78  return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] * _grad_test[_i][_qp](_component);
79 }
PorousFlowEffectiveStressCoupling
PorousFlowEffectiveStressCoupling computes -coefficient*effective_porepressure*grad_component(test) w...
Definition: PorousFlowEffectiveStressCoupling.h:26
PorousFlowEffectiveStressCoupling::_pf
const MaterialProperty< Real > & _pf
Effective porepressure.
Definition: PorousFlowEffectiveStressCoupling.h:46
validParams< PorousFlowEffectiveStressCoupling >
InputParameters validParams< PorousFlowEffectiveStressCoupling >()
Definition: PorousFlowEffectiveStressCoupling.C:20
PorousFlowDictator::notPorousFlowVariable
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.
Definition: PorousFlowDictator.C:161
PorousFlowEffectiveStressCoupling::_rz
const bool _rz
Whether an RZ coordinate system is being used.
Definition: PorousFlowEffectiveStressCoupling.h:52
PorousFlowDictator::porousFlowVariableNum
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.
Definition: PorousFlowDictator.C:135
PorousFlowDictator
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
Definition: PorousFlowDictator.h:71
PorousFlowEffectiveStressCoupling::_component
const unsigned int _component
The spatial component.
Definition: PorousFlowEffectiveStressCoupling.h:43
PorousFlowEffectiveStressCoupling::PorousFlowEffectiveStressCoupling
PorousFlowEffectiveStressCoupling(const InputParameters &parameters)
Definition: PorousFlowEffectiveStressCoupling.C:34
PorousFlowEffectiveStressCoupling::computeQpJacobian
virtual Real computeQpJacobian() override
Definition: PorousFlowEffectiveStressCoupling.C:58
PorousFlowEffectiveStressCoupling::_coefficient
const Real _coefficient
Biot coefficient.
Definition: PorousFlowEffectiveStressCoupling.h:40
PorousFlowEffectiveStressCoupling::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
Definition: PorousFlowEffectiveStressCoupling.C:70
registerMooseObject
registerMooseObject("PorousFlowApp", PorousFlowEffectiveStressCoupling)
PorousFlowEffectiveStressCoupling.h
PorousFlowEffectiveStressCoupling::_dictator
const PorousFlowDictator & _dictator
The PorousFlow dictator that holds global info about the simulation.
Definition: PorousFlowEffectiveStressCoupling.h:37
PorousFlowEffectiveStressCoupling::_dpf_dvar
const MaterialProperty< std::vector< Real > > & _dpf_dvar
d(effective porepressure)/(d porflow variable)
Definition: PorousFlowEffectiveStressCoupling.h:49
PorousFlowEffectiveStressCoupling::computeQpResidual
virtual Real computeQpResidual() override
Definition: PorousFlowEffectiveStressCoupling.C:50