www.mooseframework.org
PorousFlowPorosityHMBiotModulus.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 #include "libmesh/utility.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<PorousFlowPorosityHM>();
16  params.addRequiredRangeCheckedParam<Real>("constant_biot_modulus",
17  "constant_biot_modulus>0",
18  "Biot modulus, which is constant for this Material");
19  params.addRequiredRangeCheckedParam<Real>(
20  "constant_fluid_bulk_modulus",
21  "constant_fluid_bulk_modulus>0",
22  "Fluid bulk modulus, which is constant for this Material");
23  params.addClassDescription(
24  "This Material calculates the porosity for hydro-mechanical simulations, assuming that the "
25  "Biot modulus and the fluid bulk modulus are both constant. This is useful for comparing "
26  "with solutions from poroelasticity theory, but is less accurate than PorousFlowPorosityHM");
27  return params;
28 }
29 
31  : PorousFlowPorosityHM(parameters),
32  _porosity_old(_nodal_material ? getMaterialPropertyOld<Real>("PorousFlow_porosity_nodal")
33  : getMaterialPropertyOld<Real>("PorousFlow_porosity_qp")),
34  _biot_modulus(getParam<Real>("constant_biot_modulus")),
35  _fluid_bulk_modulus(getParam<Real>("constant_fluid_bulk_modulus")),
36  _pf_old(_nodal_material
37  ? getMaterialPropertyOld<Real>("PorousFlow_effective_fluid_pressure_nodal")
38  : getMaterialPropertyOld<Real>("PorousFlow_effective_fluid_pressure_qp")),
39  _vol_strain_qp_old(getMaterialPropertyOld<Real>("PorousFlow_total_volumetric_strain_qp")),
40  _vol_strain_rate_qp(getMaterialProperty<Real>("PorousFlow_volumetric_strain_rate_qp")),
41  _dvol_strain_rate_qp_dvar(getMaterialProperty<std::vector<RealGradient>>(
42  "dPorousFlow_volumetric_strain_rate_qp_dvar"))
43 {
44 }
45 
46 void
48 {
49  // Note that in the following _strain[_qp] is evaluated at q quadpoint
50  // So _porosity_nodal[_qp], which should be the nodal value of porosity
51  // actually uses the strain at a quadpoint. This
52  // is OK for LINEAR elements, as strain is constant over the element anyway.
53 
54  const unsigned qp_to_use =
55  (_nodal_material && (_bnd || _strain_at_nearest_qp) ? nearestQP(_qp) : _qp);
56 
57  const Real denom = 1.0 + _vol_strain_rate_qp[qp_to_use] * _dt;
58  _porosity[_qp] =
59  (_porosity_old[_qp] * std::exp(-(_pf[_qp] - _pf_old[_qp]) / _fluid_bulk_modulus) +
60  (_pf[_qp] - _pf_old[_qp]) / _biot_modulus +
61  _biot * (_vol_strain_qp[qp_to_use] - _vol_strain_qp_old[qp_to_use])) /
62  denom;
63 
64  _dporosity_dvar[_qp].resize(_num_var);
65  for (unsigned int v = 0; v < _num_var; ++v)
66  _dporosity_dvar[_qp][v] =
67  _dpf_dvar[_qp][v] *
68  (-_porosity_old[_qp] * std::exp(-(_pf[_qp] - _pf_old[_qp]) / _fluid_bulk_modulus) /
70  1.0 / _biot_modulus) /
71  denom;
72 
73  _dporosity_dgradvar[_qp].resize(_num_var);
74  for (unsigned int v = 0; v < _num_var; ++v)
75  _dporosity_dgradvar[_qp][v] =
76  _biot * _dvol_strain_qp_dvar[qp_to_use][v] / denom -
77  _porosity[_qp] / denom * _dvol_strain_rate_qp_dvar[qp_to_use][v] * _dt;
78 }
const MaterialProperty< Real > & _porosity_old
old value of porosity
PorousFlowPorosityHMBiotModulus(const InputParameters &parameters)
const MaterialProperty< Real > & _pf_old
old value of effective fluid pressure
const bool _strain_at_nearest_qp
When calculating nodal porosity, use the strain at the nearest quadpoint to the node.
MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(PorousFlow variable)
MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad PorousFlow variable)
const Real _fluid_bulk_modulus
constant fluid bulk modulus
Material designed to provide the porosity in hydro-mechanical simulations biot + (phi0 - biot)*exp(-v...
InputParameters validParams< PorousFlowPorosityHM >()
InputParameters validParams< PorousFlowPorosityHMBiotModulus >()
const MaterialProperty< Real > & _vol_strain_qp_old
old value of total volumetric strain
const MaterialProperty< std::vector< Real > > & _dpf_dvar
d(effective porepressure)/(d porflow variable)
const MaterialProperty< std::vector< RealGradient > > & _dvol_strain_rate_qp_dvar
d(volumetric strain rate)/d(PorousFlow variable)
MaterialProperty< Real > & _porosity
computed porosity at the nodes or quadpoints
const unsigned int _num_var
Number of PorousFlow variables.
const MaterialProperty< Real > & _vol_strain_rate_qp
volumetric strain rate
const Real _biot
biot coefficient
const MaterialProperty< std::vector< RealGradient > > & _dvol_strain_qp_dvar
d(strain)/(dvar)
const MaterialProperty< Real > & _vol_strain_qp
strain
const Real _biot_modulus
constant biot modulus
const MaterialProperty< Real > & _pf
effective porepressure