www.mooseframework.org
PorousFlowPorosityHM.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 
8 #include "PorousFlowPorosityHM.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<PorousFlowPorosityExponentialBase>();
15  params.addRequiredCoupledVar(
16  "porosity_zero",
17  "The porosity at zero volumetric strain and reference effective porepressure");
18  params.addRangeCheckedParam<Real>(
19  "biot_coefficient", 1, "biot_coefficient>=0 & biot_coefficient<=1", "Biot coefficient");
20  params.addRequiredRangeCheckedParam<Real>(
21  "solid_bulk", "solid_bulk>0", "Bulk modulus of the drained porous solid skeleton");
22  params.addRequiredCoupledVar("displacements", "The solid-mechanics displacement variables");
23  params.addClassDescription(
24  "This Material calculates the porosity for hydro-mechanical simulations");
25  params.addCoupledVar(
26  "reference_porepressure", 0.0, "porosity = porosity_zero at reference pressure");
27  return params;
28 }
29 
30 PorousFlowPorosityHM::PorousFlowPorosityHM(const InputParameters & parameters)
32 
33  _phi0(_nodal_material ? coupledNodalValue("porosity_zero") : coupledValue("porosity_zero")),
34  _biot(getParam<Real>("biot_coefficient")),
35  _solid_bulk(getParam<Real>("solid_bulk")),
36  _coeff((_biot - 1.0) / _solid_bulk),
37 
38  _p_reference(_nodal_material ? coupledNodalValue("reference_porepressure")
39  : coupledValue("reference_porepressure")),
40 
41  _ndisp(coupledComponents("displacements")),
42  _disp_var_num(_ndisp),
43 
44  _vol_strain_qp(getMaterialProperty<Real>("PorousFlow_total_volumetric_strain_qp")),
45  _dvol_strain_qp_dvar(getMaterialProperty<std::vector<RealGradient>>(
46  "dPorousFlow_total_volumetric_strain_qp_dvar")),
47 
48  _pf(_nodal_material ? getMaterialProperty<Real>("PorousFlow_effective_fluid_pressure_nodal")
49  : getMaterialProperty<Real>("PorousFlow_effective_fluid_pressure_qp")),
50  _dpf_dvar(_nodal_material ? getMaterialProperty<std::vector<Real>>(
51  "dPorousFlow_effective_fluid_pressure_nodal_dvar")
52  : getMaterialProperty<std::vector<Real>>(
53  "dPorousFlow_effective_fluid_pressure_qp_dvar"))
54 {
55  for (unsigned int i = 0; i < _ndisp; ++i)
56  _disp_var_num[i] = coupled("displacements", i);
57 }
58 
59 Real
61 {
62  return _biot;
63 }
64 
65 Real
67 {
68  return _phi0[_qp];
69 }
70 
71 Real
73 {
74  // Note that in the following _strain[_qp] is evaluated at q quadpoint
75  // So _porosity_nodal[_qp], which should be the nodal value of porosity
76  // actually uses the strain at a quadpoint. This
77  // is OK for LINEAR elements, as strain is constant over the element anyway.
78  const unsigned qp_to_use =
79  (_nodal_material && (_bnd || _strain_at_nearest_qp) ? nearestQP(_qp) : _qp);
80 
81  return -_vol_strain_qp[qp_to_use] + _coeff * (_pf[_qp] - _p_reference[_qp]);
82 }
83 
84 Real
86 {
87  return _coeff * _dpf_dvar[_qp][pvar];
88 }
89 
90 RealGradient
92 {
93  const unsigned qp_to_use =
94  (_nodal_material && (_bnd || _strain_at_nearest_qp) ? nearestQP(_qp) : _qp);
95  return -_dvol_strain_qp_dvar[qp_to_use][pvar];
96 }
virtual Real decayQp() const override
Returns "decay" at the quadpoint (porosity = a + (b - a) * exp(decay))
virtual Real atNegInfinityQp() const override
Returns "a" at the quadpoint (porosity = a + (b - a) * exp(decay))
Base class Material designed to provide the porosity.
std::vector< unsigned int > _disp_var_num
variable number of the displacements variables
InputParameters validParams< PorousFlowPorosityHM >()
const bool _strain_at_nearest_qp
When calculating nodal porosity, use the strain at the nearest quadpoint to the node.
const VariableValue & _phi0
porosity at zero strain and zero porepressure
const VariableValue & _p_reference
reference porepressure
InputParameters validParams< PorousFlowPorosityExponentialBase >()
const MaterialProperty< std::vector< Real > > & _dpf_dvar
d(effective porepressure)/(d porflow variable)
const Real _coeff
short-hand number (biot-1)/solid_bulk
const unsigned int _ndisp
number of displacement variables
virtual RealGradient ddecayQp_dgradvar(unsigned pvar) const override
d(decay)/d(grad(porous-flow variable pvar))
const Real _biot
biot coefficient
const MaterialProperty< std::vector< RealGradient > > & _dvol_strain_qp_dvar
d(strain)/(dvar)
const MaterialProperty< Real > & _vol_strain_qp
strain
virtual Real atZeroQp() const override
Returns "b" at the quadpoint (porosity = a + (b - a) * exp(decay))
virtual Real ddecayQp_dvar(unsigned pvar) const override
d(decay)/d(porous-flow variable pvar)
PorousFlowPorosityHM(const InputParameters &parameters)
const MaterialProperty< Real > & _pf
effective porepressure