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