www.mooseframework.org
PoroMechanicsCoupling.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*porepressure*grad_test[component]");
21  params.addRequiredCoupledVar(
22  "porepressure",
23  "Porepressure. This kernel adds -BiotCoefficient*porepressure*grad_test[component]");
24  params.addRequiredParam<unsigned int>("component",
25  "The gradient direction (0 for x, 1 for y and 2 for z)");
26  return params;
27 }
28 
29 PoroMechanicsCoupling::PoroMechanicsCoupling(const InputParameters & parameters)
30  : Kernel(parameters),
31  _coefficient(getMaterialProperty<Real>("biot_coefficient")),
32  _porepressure(coupledValue("porepressure")),
33  _porepressure_var_num(coupled("porepressure")),
34  _component(getParam<unsigned int>("component"))
35 {
36  if (_component >= _mesh.dimension())
37  mooseError("PoroMechanicsCoupling: component should not be greater than the mesh dimension\n");
38 }
39 
40 Real
42 {
43  return -_coefficient[_qp] * _porepressure[_qp] * _grad_test[_i][_qp](_component);
44 }
45 
46 Real
48 {
49  if (_var.number() != _porepressure_var_num)
50  return 0.0;
51  return -_coefficient[_qp] * _phi[_j][_qp] * _grad_test[_i][_qp](_component);
52 }
53 
54 Real
56 {
57  if (jvar != _porepressure_var_num)
58  return 0.0;
59  return -_coefficient[_qp] * _phi[_j][_qp] * _grad_test[_i][_qp](_component);
60 }
PoroMechanicsCoupling(const InputParameters &parameters)
const VariableValue & _porepressure
virtual Real computeQpResidual()
InputParameters validParams< PoroMechanicsCoupling >()
const MaterialProperty< Real > & _coefficient
Biot coefficient.
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
virtual Real computeQpJacobian()