www.mooseframework.org
PorousFlowPorosityTM.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 "PorousFlowPorosityTM.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<PorousFlowPorosityExponentialBase>();
15  params.addRequiredCoupledVar("porosity_zero",
16  "The porosity at zero volumetric strain and reference temperature");
17  params.addRequiredParam<Real>(
18  "thermal_expansion_coeff",
19  "Thermal expansion coefficient of the drained porous solid skeleton");
20  params.addRequiredCoupledVar("displacements", "The solid-mechanics displacement variables");
21  params.addCoupledVar(
22  "reference_temperature", 0.0, "porosity = porosity_zero at reference temperature");
23  params.addClassDescription(
24  "This Material calculates the porosity for hydro-mechanical simulations");
25  return params;
26 }
27 
28 PorousFlowPorosityTM::PorousFlowPorosityTM(const InputParameters & parameters)
30 
31  _phi0(_nodal_material ? coupledNodalValue("porosity_zero") : coupledValue("porosity_zero")),
32  _exp_coeff(getParam<Real>("thermal_expansion_coeff")),
33 
34  _t_reference(_nodal_material ? coupledNodalValue("reference_temperature")
35  : coupledValue("reference_temperature")),
36 
37  _ndisp(coupledComponents("displacements")),
38  _disp_var_num(_ndisp),
39 
40  _vol_strain_qp(getMaterialProperty<Real>("PorousFlow_total_volumetric_strain_qp")),
41  _dvol_strain_qp_dvar(getMaterialProperty<std::vector<RealGradient>>(
42  "dPorousFlow_total_volumetric_strain_qp_dvar")),
43 
44  _temperature(_nodal_material ? getMaterialProperty<Real>("PorousFlow_temperature_nodal")
45  : getMaterialProperty<Real>("PorousFlow_temperature_qp")),
46  _dtemperature_dvar(
47  _nodal_material
48  ? getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_nodal_dvar")
49  : getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_qp_dvar"))
50 {
51  for (unsigned int i = 0; i < _ndisp; ++i)
52  _disp_var_num[i] = coupled("displacements", i);
53 }
54 Real
56 {
57  return 1.0;
58 }
59 
60 Real
62 {
63  return _phi0[_qp];
64 }
65 
66 Real
68 {
69  // Note that in the following _strain[_qp] is evaluated at q quadpoint
70  // So _porosity_nodal[_qp], which should be the nodal value of porosity
71  // actually uses the strain at a quadpoint. This
72  // is OK for LINEAR elements, as strain is constant over the element anyway.
73  const unsigned qp_to_use =
74  (_nodal_material && (_bnd || _strain_at_nearest_qp) ? nearestQP(_qp) : _qp);
75  return -_vol_strain_qp[qp_to_use] + _exp_coeff * (_temperature[_qp] - _t_reference[_qp]);
76 }
77 
78 Real
80 {
81  return _exp_coeff * _dtemperature_dvar[_qp][pvar];
82 }
83 
84 RealGradient
86 {
87  const unsigned qp_to_use =
88  (_nodal_material && (_bnd || _strain_at_nearest_qp) ? nearestQP(_qp) : _qp);
89  return -_dvol_strain_qp_dvar[qp_to_use][pvar];
90 }
Base class Material designed to provide the porosity.
const MaterialProperty< Real > & _vol_strain_qp
strain
const bool _strain_at_nearest_qp
When calculating nodal porosity, use the strain at the nearest quadpoint to the node.
InputParameters validParams< PorousFlowPorosityTM >()
PorousFlowPorosityTM(const InputParameters &parameters)
const MaterialProperty< std::vector< Real > > & _dtemperature_dvar
d(temperature)/(d porflow variable)
InputParameters validParams< PorousFlowPorosityExponentialBase >()
virtual Real decayQp() const override
Returns "decay" at the quadpoint (porosity = a + (b - a) * exp(decay))
const unsigned int _ndisp
number of displacement variables
std::vector< unsigned int > _disp_var_num
variable number of the displacements variables
const Real _exp_coeff
thermal expansion coefficient of the solid porous skeleton
virtual Real atNegInfinityQp() const override
Returns "a" at the quadpoint (porosity = a + (b - a) * exp(decay))
virtual Real atZeroQp() const override
Returns "b" at the quadpoint (porosity = a + (b - a) * exp(decay))
const MaterialProperty< Real > & _temperature
temperature at quadpoints or nodes
const VariableValue & _t_reference
reference temperature
const MaterialProperty< std::vector< RealGradient > > & _dvol_strain_qp_dvar
d(strain)/(dvar)
const VariableValue & _phi0
porosity at zero strain and zero temperature
virtual RealGradient ddecayQp_dgradvar(unsigned pvar) const override
d(decay)/d(grad(porous-flow variable pvar))
virtual Real ddecayQp_dvar(unsigned pvar) const override
d(decay)/d(porous-flow variable pvar)