www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlowPorosityTM Class Reference

Material designed to provide the porosity in thermo-mechanical simulations biot + (phi0 - biot)*exp(-vol_strain + thermal_exp_coeff * (temperature - reference_temperature)) More...

#include <PorousFlowPorosityTM.h>

Inheritance diagram for PorousFlowPorosityTM:
[legend]

Public Member Functions

 PorousFlowPorosityTM (const InputParameters &parameters)
 

Protected Member Functions

virtual Real atNegInfinityQp () const override
 Returns "a" at the quadpoint (porosity = a + (b - a) * exp(decay)) More...
 
virtual Real atZeroQp () const override
 Returns "b" at the quadpoint (porosity = a + (b - a) * exp(decay)) More...
 
virtual Real decayQp () const override
 Returns "decay" at the quadpoint (porosity = a + (b - a) * exp(decay)) More...
 
virtual Real ddecayQp_dvar (unsigned pvar) const override
 d(decay)/d(porous-flow variable pvar) More...
 
virtual RealGradient ddecayQp_dgradvar (unsigned pvar) const override
 d(decay)/d(grad(porous-flow variable pvar)) More...
 
virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 

Protected Attributes

const VariableValue & _phi0
 porosity at zero strain and zero temperature More...
 
const Real _exp_coeff
 thermal expansion coefficient of the solid porous skeleton More...
 
const VariableValue & _t_reference
 reference temperature More...
 
const unsigned int _ndisp
 number of displacement variables More...
 
std::vector< unsigned int > _disp_var_num
 variable number of the displacements variables More...
 
const MaterialProperty< Real > & _vol_strain_qp
 strain More...
 
const MaterialProperty< std::vector< RealGradient > > & _dvol_strain_qp_dvar
 d(strain)/(dvar) More...
 
const MaterialProperty< Real > & _temperature
 temperature at quadpoints or nodes More...
 
const MaterialProperty< std::vector< Real > > & _dtemperature_dvar
 d(temperature)/(d porflow variable) More...
 
const bool _strain_at_nearest_qp
 When calculating nodal porosity, use the strain at the nearest quadpoint to the node. More...
 
const bool _ensure_positive
 for decayQp() > 0, porosity can be negative when using porosity = a + (b - a) * exp(decay). More...
 
MaterialProperty< Real > & _porosity
 computed porosity at the nodes or quadpoints More...
 
MaterialProperty< std::vector< Real > > & _dporosity_dvar
 d(porosity)/d(PorousFlow variable) More...
 
MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
 d(porosity)/d(grad PorousFlow variable) More...
 
const unsigned int _num_phases
 Number of phases. More...
 
const unsigned int _num_components
 Number of fluid components. More...
 
const unsigned int _num_var
 Number of PorousFlow variables. More...
 

Detailed Description

Material designed to provide the porosity in thermo-mechanical simulations biot + (phi0 - biot)*exp(-vol_strain + thermal_exp_coeff * (temperature - reference_temperature))

Definition at line 23 of file PorousFlowPorosityTM.h.

Constructor & Destructor Documentation

PorousFlowPorosityTM::PorousFlowPorosityTM ( const InputParameters &  parameters)

Definition at line 28 of file PorousFlowPorosityTM.C.

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")),
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")),
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 }
const MaterialProperty< Real > & _vol_strain_qp
strain
const MaterialProperty< std::vector< Real > > & _dtemperature_dvar
d(temperature)/(d porflow variable)
const unsigned int _ndisp
number of displacement variables
PorousFlowPorosityExponentialBase(const InputParameters &parameters)
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
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

Member Function Documentation

Real PorousFlowPorosityTM::atNegInfinityQp ( ) const
overrideprotectedvirtual

Returns "a" at the quadpoint (porosity = a + (b - a) * exp(decay))

Implements PorousFlowPorosityExponentialBase.

Definition at line 55 of file PorousFlowPorosityTM.C.

56 {
57  return 1.0;
58 }
Real PorousFlowPorosityTM::atZeroQp ( ) const
overrideprotectedvirtual

Returns "b" at the quadpoint (porosity = a + (b - a) * exp(decay))

Implements PorousFlowPorosityExponentialBase.

Definition at line 61 of file PorousFlowPorosityTM.C.

62 {
63  return _phi0[_qp];
64 }
const VariableValue & _phi0
porosity at zero strain and zero temperature
void PorousFlowPorosityExponentialBase::computeQpProperties ( )
overrideprotectedvirtualinherited

Reimplemented in PorousFlowPorosityHMBiotModulus.

Definition at line 60 of file PorousFlowPorosityExponentialBase.C.

61 {
62  const Real a = atNegInfinityQp();
63  const Real b = atZeroQp();
64  const Real decay = decayQp();
65 
66  Real deriv = 0.0; // = d(porosity)/d(decay)
67  if (decay <= 0.0 || !_ensure_positive)
68  {
69  _porosity[_qp] = a + (b - a) * std::exp(decay);
70  deriv = _porosity[_qp] - a;
71  }
72  else
73  {
74  const Real c = std::log(a / (a - b));
75  const Real expx = std::exp(-decay / c);
76  // note that at decay = 0, we have expx = 1, so porosity = a + b - a = b
77  // and at decay = infinity, expx = 0, so porosity = a + (b - a) * a / (a - b) = 0
78  _porosity[_qp] = a + (b - a) * std::exp(c * (1.0 - expx));
79  deriv = (_porosity[_qp] - a) * expx;
80  }
81 
82  _dporosity_dvar[_qp].resize(_num_var);
83  _dporosity_dgradvar[_qp].resize(_num_var);
84  for (unsigned int v = 0; v < _num_var; ++v)
85  {
86  _dporosity_dvar[_qp][v] = ddecayQp_dvar(v) * deriv;
87  _dporosity_dgradvar[_qp][v] = ddecayQp_dgradvar(v) * deriv;
88  }
89 }
const bool _ensure_positive
for decayQp() > 0, porosity can be negative when using porosity = a + (b - a) * exp(decay).
virtual Real atNegInfinityQp() const =0
Returns "a" at the quadpoint (porosity = a + (b - a) * exp(decay))
MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(PorousFlow variable)
MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad PorousFlow variable)
virtual Real decayQp() const =0
Returns "decay" at the quadpoint (porosity = a + (b - a) * exp(decay))
MaterialProperty< Real > & _porosity
computed porosity at the nodes or quadpoints
virtual Real ddecayQp_dvar(unsigned pvar) const =0
d(decay)/d(porous-flow variable pvar)
const unsigned int _num_var
Number of PorousFlow variables.
virtual RealGradient ddecayQp_dgradvar(unsigned pvar) const =0
d(decay)/d(grad(porous-flow variable pvar))
virtual Real atZeroQp() const =0
Returns "b" at the quadpoint (porosity = a + (b - a) * exp(decay))
RealGradient PorousFlowPorosityTM::ddecayQp_dgradvar ( unsigned  pvar) const
overrideprotectedvirtual

d(decay)/d(grad(porous-flow variable pvar))

Implements PorousFlowPorosityExponentialBase.

Definition at line 85 of file PorousFlowPorosityTM.C.

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 }
const bool _strain_at_nearest_qp
When calculating nodal porosity, use the strain at the nearest quadpoint to the node.
const MaterialProperty< std::vector< RealGradient > > & _dvol_strain_qp_dvar
d(strain)/(dvar)
Real PorousFlowPorosityTM::ddecayQp_dvar ( unsigned  pvar) const
overrideprotectedvirtual

d(decay)/d(porous-flow variable pvar)

Implements PorousFlowPorosityExponentialBase.

Definition at line 79 of file PorousFlowPorosityTM.C.

80 {
81  return _exp_coeff * _dtemperature_dvar[_qp][pvar];
82 }
const MaterialProperty< std::vector< Real > > & _dtemperature_dvar
d(temperature)/(d porflow variable)
const Real _exp_coeff
thermal expansion coefficient of the solid porous skeleton
Real PorousFlowPorosityTM::decayQp ( ) const
overrideprotectedvirtual

Returns "decay" at the quadpoint (porosity = a + (b - a) * exp(decay))

Implements PorousFlowPorosityExponentialBase.

Definition at line 67 of file PorousFlowPorosityTM.C.

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 }
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.
const Real _exp_coeff
thermal expansion coefficient of the solid porous skeleton
const MaterialProperty< Real > & _temperature
temperature at quadpoints or nodes
const VariableValue & _t_reference
reference temperature
void PorousFlowPorosityExponentialBase::initQpStatefulProperties ( )
overrideprotectedvirtualinherited

Definition at line 42 of file PorousFlowPorosityExponentialBase.C.

43 {
44  const Real a = atNegInfinityQp();
45  const Real b = atZeroQp();
46  mooseAssert(a > b, "PorousFlowPorosityExponentialBase a must be larger than b");
47  const Real decay = decayQp();
48 
49  if (decay <= 0.0 || !_ensure_positive)
50  _porosity[_qp] = a + (b - a) * std::exp(decay);
51  else
52  {
53  const Real c = std::log(a / (a - b));
54  const Real expx = std::exp(-decay / c);
55  _porosity[_qp] = a + (b - a) * std::exp(c * (1.0 - expx));
56  }
57 }
const bool _ensure_positive
for decayQp() > 0, porosity can be negative when using porosity = a + (b - a) * exp(decay).
virtual Real atNegInfinityQp() const =0
Returns "a" at the quadpoint (porosity = a + (b - a) * exp(decay))
virtual Real decayQp() const =0
Returns "decay" at the quadpoint (porosity = a + (b - a) * exp(decay))
MaterialProperty< Real > & _porosity
computed porosity at the nodes or quadpoints
virtual Real atZeroQp() const =0
Returns "b" at the quadpoint (porosity = a + (b - a) * exp(decay))

Member Data Documentation

std::vector<unsigned int> PorousFlowPorosityTM::_disp_var_num
protected

variable number of the displacements variables

Definition at line 48 of file PorousFlowPorosityTM.h.

Referenced by PorousFlowPorosityTM().

MaterialProperty<std::vector<RealGradient> >& PorousFlowPorosityBase::_dporosity_dgradvar
protectedinherited
MaterialProperty<std::vector<Real> >& PorousFlowPorosityBase::_dporosity_dvar
protectedinherited
const MaterialProperty<std::vector<Real> >& PorousFlowPorosityTM::_dtemperature_dvar
protected

d(temperature)/(d porflow variable)

Definition at line 60 of file PorousFlowPorosityTM.h.

Referenced by ddecayQp_dvar().

const MaterialProperty<std::vector<RealGradient> >& PorousFlowPorosityTM::_dvol_strain_qp_dvar
protected

d(strain)/(dvar)

Definition at line 54 of file PorousFlowPorosityTM.h.

Referenced by ddecayQp_dgradvar().

const bool PorousFlowPorosityExponentialBase::_ensure_positive
protectedinherited

for decayQp() > 0, porosity can be negative when using porosity = a + (b - a) * exp(decay).

This expression is modified if ensure_positive = true to read porosity = a + (b - a) * exp(c * (1 - Exp(- decay / c))) where c = log(a/(b-a))

Definition at line 70 of file PorousFlowPorosityExponentialBase.h.

Referenced by PorousFlowPorosityExponentialBase::computeQpProperties(), and PorousFlowPorosityExponentialBase::initQpStatefulProperties().

const Real PorousFlowPorosityTM::_exp_coeff
protected

thermal expansion coefficient of the solid porous skeleton

Definition at line 39 of file PorousFlowPorosityTM.h.

Referenced by ddecayQp_dvar(), and decayQp().

const unsigned int PorousFlowPorosityTM::_ndisp
protected

number of displacement variables

Definition at line 45 of file PorousFlowPorosityTM.h.

Referenced by PorousFlowPorosityTM().

const unsigned int PorousFlowMaterialVectorBase::_num_components
protectedinherited
const unsigned int PorousFlowMaterialVectorBase::_num_phases
protectedinherited
const unsigned int PorousFlowMaterialVectorBase::_num_var
protectedinherited
const VariableValue& PorousFlowPorosityTM::_phi0
protected

porosity at zero strain and zero temperature

Definition at line 36 of file PorousFlowPorosityTM.h.

Referenced by atZeroQp().

MaterialProperty<Real>& PorousFlowPorosityBase::_porosity
protectedinherited
const bool PorousFlowPorosityExponentialBase::_strain_at_nearest_qp
protectedinherited
const VariableValue& PorousFlowPorosityTM::_t_reference
protected

reference temperature

Definition at line 42 of file PorousFlowPorosityTM.h.

Referenced by decayQp().

const MaterialProperty<Real>& PorousFlowPorosityTM::_temperature
protected

temperature at quadpoints or nodes

Definition at line 57 of file PorousFlowPorosityTM.h.

Referenced by decayQp().

const MaterialProperty<Real>& PorousFlowPorosityTM::_vol_strain_qp
protected

strain

Definition at line 51 of file PorousFlowPorosityTM.h.

Referenced by decayQp().


The documentation for this class was generated from the following files: