www.mooseframework.org
PoroMechanicsCoupling.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 
10 #include "PoroMechanicsCoupling.h"
11 
12 // MOOSE includes
13 #include "Function.h"
14 #include "MooseMesh.h"
15 #include "MooseVariable.h"
16 
17 registerMooseObject("TensorMechanicsApp", PoroMechanicsCoupling);
18 
20 
21 InputParameters
23 {
24  InputParameters params = Kernel::validParams();
25  params.addClassDescription(
26  "Adds $-Bi \\cdot p_s \\cdot \\nabla \\Psi_c$, where the subscript $c$ is the component.");
27  params.addRequiredCoupledVar("porepressure", "Pore pressure, $p_s$.");
28  params.addRequiredParam<unsigned int>("component",
29  "The gradient direction (0 for x, 1 for y and 2 for z)");
30  return params;
31 }
32 
33 PoroMechanicsCoupling::PoroMechanicsCoupling(const InputParameters & parameters)
34  : Kernel(parameters),
35  _coefficient(getMaterialProperty<Real>("biot_coefficient")),
36  _porepressure(coupledValue("porepressure")),
37  _porepressure_var_num(coupled("porepressure")),
38  _component(getParam<unsigned int>("component"))
39 {
40  if (_component >= _mesh.dimension())
41  mooseError("PoroMechanicsCoupling: component should not be greater than the mesh dimension\n");
42 }
43 
44 Real
46 {
47  return -_coefficient[_qp] * _porepressure[_qp] * _grad_test[_i][_qp](_component);
48 }
49 
50 Real
52 {
53  if (_var.number() != _porepressure_var_num)
54  return 0.0;
55  return -_coefficient[_qp] * _phi[_j][_qp] * _grad_test[_i][_qp](_component);
56 }
57 
58 Real
60 {
61  if (jvar != _porepressure_var_num)
62  return 0.0;
63  return -_coefficient[_qp] * _phi[_j][_qp] * _grad_test[_i][_qp](_component);
64 }
PoroMechanicsCoupling::computeQpJacobian
virtual Real computeQpJacobian()
Definition: PoroMechanicsCoupling.C:51
PoroMechanicsCoupling
PoroMechanicsCoupling computes -coefficient*porepressure*grad_test[component].
Definition: PoroMechanicsCoupling.h:23
PoroMechanicsCoupling::_porepressure_var_num
unsigned int _porepressure_var_num
Definition: PoroMechanicsCoupling.h:43
registerMooseObject
registerMooseObject("TensorMechanicsApp", PoroMechanicsCoupling)
PoroMechanicsCoupling::computeQpResidual
virtual Real computeQpResidual()
Definition: PoroMechanicsCoupling.C:45
PoroMechanicsCoupling::_component
unsigned int _component
Definition: PoroMechanicsCoupling.h:45
PoroMechanicsCoupling::_coefficient
const MaterialProperty< Real > & _coefficient
Biot coefficient.
Definition: PoroMechanicsCoupling.h:39
PoroMechanicsCoupling::PoroMechanicsCoupling
PoroMechanicsCoupling(const InputParameters &parameters)
Definition: PoroMechanicsCoupling.C:33
defineLegacyParams
defineLegacyParams(PoroMechanicsCoupling)
validParams
InputParameters validParams()
PoroMechanicsCoupling::_porepressure
const VariableValue & _porepressure
Definition: PoroMechanicsCoupling.h:41
PoroMechanicsCoupling::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: PoroMechanicsCoupling.C:59
PoroMechanicsCoupling.h
PoroMechanicsCoupling::validParams
static InputParameters validParams()
Definition: PoroMechanicsCoupling.C:22