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

Material designed to provide the porosity in PorousFlow simulations chemistry + biot + (phi0 - reference_chemistry - biot) * exp(-vol_strain. More...

#include <PorousFlowPorosity.h>

Inheritance diagram for PorousFlowPorosity:
[legend]

Public Member Functions

 PorousFlowPorosity (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 datNegInfinityQp (unsigned pvar) const override
 d(a)/d(PorousFlow variable pvar) More...
 
virtual Real atZeroQp () const override
 Returns "b" at the quadpoint (porosity = a + (b - a) * exp(decay)) More...
 
virtual Real datZeroQp (unsigned pvar) const override
 d(a)/d(PorousFlow variable pvar) 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(PorousFlow variable pvar) More...
 
virtual RealGradient ddecayQp_dgradvar (unsigned pvar) const override
 d(decay)/d(grad(PorousFlow variable pvar)) More...
 
virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 

Protected Attributes

const bool _mechanical
 Porosity is a function of volumetric strain. More...
 
const bool _fluid
 Porosity is a function of effective porepressure. More...
 
const bool _thermal
 Porosity is a function of temperature. More...
 
const bool _chemical
 Porosity is a function of chemistry. More...
 
const VariableValue & _phi0
 Porosity at zero strain and zero porepressure and zero temperature. More...
 
const Real _biot
 Biot coefficient. More...
 
const Real _exp_coeff
 Thermal expansion coefficient of the solid porous skeleton. More...
 
const Real _solid_bulk
 Drained bulk modulus of the porous skeleton. More...
 
const Real _coeff
 Short-hand number (biot-1)/solid_bulk. More...
 
const VariableValue & _t_reference
 Reference temperature. More...
 
const VariableValue & _p_reference
 Reference porepressure. More...
 
const unsigned _num_c_ref
 Number of reference mineral concentrations provided by user. More...
 
std::vector< const VariableValue * > _c_reference
 Reference mineral concentrations. More...
 
const unsigned _num_initial_c
 Number of reference mineral concentrations provided by user. More...
 
std::vector< const VariableValue * > _initial_c
 Reference mineral concentrations. More...
 
std::vector< Real > _c_weights
 Weights for the mineral concentrations. More...
 
const MaterialProperty< Real > & _porosity_old
 Old value of porosity. More...
 
const MaterialProperty< Real > *const _vol_strain_qp
 Strain (first const means we never want to dereference and change the value, second means we'll always be pointing to the same address after initialization (like a reference)) More...
 
const MaterialProperty< std::vector< RealGradient > > *const _dvol_strain_qp_dvar
 d(strain)/(dvar) (first const means we never want to dereference and change the value, second means we'll always be pointing to the same address after initialization (like a reference)) More...
 
const MaterialProperty< Real > *const _pf
 Effective porepressure at the quadpoints or nodes. More...
 
const MaterialProperty< std::vector< Real > > *const _dpf_dvar
 d(effective porepressure)/(d porflow variable) More...
 
const MaterialProperty< Real > *const _temperature
 Temperature at the quadpoints or nodes. More...
 
const MaterialProperty< std::vector< Real > > *const _dtemperature_dvar
 d(temperature)/(d porflow variable) More...
 
const MaterialProperty< std::vector< Real > > *const _mineral_conc_old
 Old value of mineral concentration at the quadpoints or nodes. More...
 
const MaterialProperty< std::vector< Real > > *const _reaction_rate
 Reaction rate of mineralisation. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _dreaction_rate_dvar
 d(reaction_rate_conc)/d(porflow variable) More...
 
const unsigned int _aq_ph
 Aqueous phase number. More...
 
const MaterialProperty< std::vector< Real > > *const _saturation
 Saturation. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _dsaturation_dvar
 d(saturation)/d(PorousFlow var) 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 PorousFlow simulations chemistry + biot + (phi0 - reference_chemistry - biot) * exp(-vol_strain.

Definition at line 26 of file PorousFlowPorosity.h.

Constructor & Destructor Documentation

◆ PorousFlowPorosity()

PorousFlowPorosity::PorousFlowPorosity ( const InputParameters &  parameters)

Definition at line 60 of file PorousFlowPorosity.C.

62 
63  _mechanical(getParam<bool>("mechanical")),
64  _fluid(getParam<bool>("fluid")),
65  _thermal(getParam<bool>("thermal")),
66  _chemical(getParam<bool>("chemical")),
67  _phi0(coupledValue("porosity_zero")),
68  _biot(getParam<Real>("biot_coefficient")),
69  _exp_coeff(isParamValid("thermal_expansion_coeff") ? getParam<Real>("thermal_expansion_coeff")
70  : 0.0),
71  _solid_bulk(isParamValid("solid_bulk") ? getParam<Real>("solid_bulk")
72  : std::numeric_limits<Real>::max()),
73  _coeff((_biot - 1.0) / _solid_bulk),
74 
75  _t_reference(_nodal_material ? coupledNodalValue("reference_temperature")
76  : coupledValue("reference_temperature")),
77  _p_reference(_nodal_material ? coupledNodalValue("reference_porepressure")
78  : coupledValue("reference_porepressure")),
79  _num_c_ref(coupledComponents("reference_chemistry")),
81  _num_initial_c(coupledComponents("initial_mineral_concentrations")),
83  _c_weights(isParamValid("chemical_weights") ? getParam<std::vector<Real>>("chemical_weights")
84  : std::vector<Real>(_num_c_ref, 1.0)),
85 
86  _porosity_old(_nodal_material ? getMaterialPropertyOld<Real>("PorousFlow_porosity_nodal")
87  : getMaterialPropertyOld<Real>("PorousFlow_porosity_qp")),
88  _vol_strain_qp(_mechanical ? &getMaterialProperty<Real>("PorousFlow_total_volumetric_strain_qp")
89  : nullptr),
90  _dvol_strain_qp_dvar(_mechanical ? &getMaterialProperty<std::vector<RealGradient>>(
91  "dPorousFlow_total_volumetric_strain_qp_dvar")
92  : nullptr),
93 
94  _pf(_fluid ? (_nodal_material
95  ? &getMaterialProperty<Real>("PorousFlow_effective_fluid_pressure_nodal")
96  : &getMaterialProperty<Real>("PorousFlow_effective_fluid_pressure_qp"))
97  : nullptr),
98  _dpf_dvar(_fluid ? (_nodal_material ? &getMaterialProperty<std::vector<Real>>(
99  "dPorousFlow_effective_fluid_pressure_nodal_dvar")
100  : &getMaterialProperty<std::vector<Real>>(
101  "dPorousFlow_effective_fluid_pressure_qp_dvar"))
102  : nullptr),
103 
105  ? (_nodal_material ? &getMaterialProperty<Real>("PorousFlow_temperature_nodal")
106  : &getMaterialProperty<Real>("PorousFlow_temperature_qp"))
107  : nullptr),
109  _thermal
110  ? (_nodal_material
111  ? &getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_nodal_dvar")
112  : &getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_qp_dvar"))
113  : nullptr),
114 
115  _mineral_conc_old(_chemical ? (_nodal_material ? &getMaterialPropertyOld<std::vector<Real>>(
116  "PorousFlow_mineral_concentration_nodal")
117  : &getMaterialPropertyOld<std::vector<Real>>(
118  "PorousFlow_mineral_concentration_qp"))
119  : nullptr),
120  _reaction_rate(_chemical ? (_nodal_material ? &getMaterialProperty<std::vector<Real>>(
121  "PorousFlow_mineral_reaction_rate_nodal")
122  : &getMaterialProperty<std::vector<Real>>(
123  "PorousFlow_mineral_reaction_rate_qp"))
124  : nullptr),
125  _dreaction_rate_dvar(_chemical ? (_nodal_material
126  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
127  "dPorousFlow_mineral_reaction_rate_nodal_dvar")
128  : &getMaterialProperty<std::vector<std::vector<Real>>>(
129  "dPorousFlow_mineral_reaction_rate_qp_dvar"))
130  : nullptr),
131  _aq_ph(_dictator.aqueousPhaseNumber()),
133  ? (_nodal_material
134  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_nodal")
135  : &getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp"))
136  : nullptr),
138  ? (_nodal_material ? &getMaterialProperty<std::vector<std::vector<Real>>>(
139  "dPorousFlow_saturation_nodal_dvar")
140  : &getMaterialProperty<std::vector<std::vector<Real>>>(
141  "dPorousFlow_saturation_qp_dvar"))
142  : nullptr)
143 {
144  if (_thermal && !isParamValid("thermal_expansion_coeff"))
145  mooseError("PorousFlowPorosity: When thermal=true you must provide a thermal_expansion_coeff");
146  if (_fluid && !isParamValid("solid_bulk"))
147  mooseError("PorousFlowPorosity: When fluid=true you must provide a solid_bulk");
148  if (_chemical && _num_c_ref != _dictator.numAqueousKinetic())
149  mooseError("PorousFlowPorosity: When chemical=true you must provide the reference_chemistry "
150  "values. The Dictator proclaims there should be ",
151  _dictator.numAqueousKinetic(),
152  " of these");
153  if (_chemical && _num_initial_c != _dictator.numAqueousKinetic())
154  mooseError("PorousFlowPorosity: When chemical=true you must provide the "
155  "initial_mineral_concentrations. "
156  "The Dictator proclaims there should be ",
157  _dictator.numAqueousKinetic(),
158  " of these");
159  if (_chemical && _c_weights.size() != _dictator.numAqueousKinetic())
160  mooseError(
161  "PorousFlowPorosity: When chemical=true you must provde the correct number of "
162  "chemical_weights (which the Dictator knows is ",
163  _dictator.numAqueousKinetic(),
164  ") or do not provide any chemical_weights and use the default value of 1 for each mineral");
165 
166  for (unsigned i = 0; i < _num_c_ref; ++i)
167  {
168  _c_reference[i] = (_nodal_material ? &coupledNodalValue("reference_chemistry", i)
169  : &coupledValue("reference_chemistry", i));
170  _initial_c[i] = (_nodal_material ? &coupledNodalValue("initial_mineral_concentrations", i)
171  : &coupledValue("initial_mineral_concentrations", i));
172  }
173 }
const Real _coeff
Short-hand number (biot-1)/solid_bulk.
const MaterialProperty< std::vector< Real > > *const _dtemperature_dvar
d(temperature)/(d porflow variable)
const Real _biot
Biot coefficient.
const VariableValue & _t_reference
Reference temperature.
const VariableValue & _phi0
Porosity at zero strain and zero porepressure and zero temperature.
const MaterialProperty< std::vector< Real > > *const _reaction_rate
Reaction rate of mineralisation.
const Real _solid_bulk
Drained bulk modulus of the porous skeleton.
const MaterialProperty< std::vector< Real > > *const _saturation
Saturation.
const MaterialProperty< std::vector< Real > > *const _mineral_conc_old
Old value of mineral concentration at the quadpoints or nodes.
const bool _thermal
Porosity is a function of temperature.
std::vector< Real > _c_weights
Weights for the mineral concentrations.
const bool _chemical
Porosity is a function of chemistry.
const MaterialProperty< std::vector< std::vector< Real > > > *const _dreaction_rate_dvar
d(reaction_rate_conc)/d(porflow variable)
const unsigned _num_c_ref
Number of reference mineral concentrations provided by user.
PorousFlowPorosityExponentialBase(const InputParameters &parameters)
const unsigned int _aq_ph
Aqueous phase number.
const MaterialProperty< Real > *const _pf
Effective porepressure at the quadpoints or nodes.
std::vector< const VariableValue * > _initial_c
Reference mineral concentrations.
const MaterialProperty< std::vector< std::vector< Real > > > *const _dsaturation_dvar
d(saturation)/d(PorousFlow var)
const MaterialProperty< std::vector< Real > > *const _dpf_dvar
d(effective porepressure)/(d porflow variable)
const MaterialProperty< Real > *const _temperature
Temperature at the quadpoints or nodes.
const Real _exp_coeff
Thermal expansion coefficient of the solid porous skeleton.
const VariableValue & _p_reference
Reference porepressure.
const unsigned _num_initial_c
Number of reference mineral concentrations provided by user.
const bool _fluid
Porosity is a function of effective porepressure.
std::vector< const VariableValue * > _c_reference
Reference mineral concentrations.
const bool _mechanical
Porosity is a function of volumetric strain.
const MaterialProperty< std::vector< RealGradient > > *const _dvol_strain_qp_dvar
d(strain)/(dvar) (first const means we never want to dereference and change the value, second means we&#39;ll always be pointing to the same address after initialization (like a reference))
const MaterialProperty< Real > & _porosity_old
Old value of porosity.
const MaterialProperty< Real > *const _vol_strain_qp
Strain (first const means we never want to dereference and change the value, second means we&#39;ll alway...

Member Function Documentation

◆ atNegInfinityQp()

Real PorousFlowPorosity::atNegInfinityQp ( ) const
overrideprotectedvirtual

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

Implements PorousFlowPorosityExponentialBase.

Definition at line 176 of file PorousFlowPorosity.C.

177 {
178  /*
179  *
180  * Note the use of the OLD value of porosity here.
181  * This strategy, which breaks the cyclic dependency between porosity
182  * and mineral concentration, is used in
183  * Kernel: PorousFlowPreDis
184  * Material: PorousFlowPorosity
185  * Material: PorousFlowAqueousPreDisChemistry
186  * Material: PorousFlowAqueousPreDisMineral
187  *
188  */
189  Real result = _biot;
190  if (_chemical)
191  {
192  if (_t_step == 0 && !_app.isRestarting())
193  for (unsigned i = 0; i < _num_c_ref; ++i)
194  result -= _c_weights[i] * (*_initial_c[i])[_qp];
195  else
196  for (unsigned i = 0; i < _num_c_ref; ++i)
197  result -= _c_weights[i] * ((*_mineral_conc_old)[_qp][i] + _dt * _porosity_old[_qp] *
198  (*_saturation)[_qp][_aq_ph] *
199  (*_reaction_rate)[_qp][i]);
200  }
201  return result;
202 }
const Real _biot
Biot coefficient.
const MaterialProperty< std::vector< Real > > *const _mineral_conc_old
Old value of mineral concentration at the quadpoints or nodes.
std::vector< Real > _c_weights
Weights for the mineral concentrations.
const bool _chemical
Porosity is a function of chemistry.
const unsigned _num_c_ref
Number of reference mineral concentrations provided by user.
const unsigned int _aq_ph
Aqueous phase number.
std::vector< const VariableValue * > _initial_c
Reference mineral concentrations.
const MaterialProperty< Real > & _porosity_old
Old value of porosity.

◆ atZeroQp()

Real PorousFlowPorosity::atZeroQp ( ) const
overrideprotectedvirtual

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

Implements PorousFlowPorosityExponentialBase.

Definition at line 217 of file PorousFlowPorosity.C.

218 {
219  // note the [0] below: _phi0 is a constant monomial and we use [0] regardless of _nodal_material
220  Real result = _phi0[0];
221  if (_chemical)
222  {
223  if (_t_step == 0 && !_app.isRestarting())
224  for (unsigned i = 0; i < _num_c_ref; ++i)
225  result -= _c_weights[i] * ((*_initial_c[i])[_qp] - (*_c_reference[i])[_qp]);
226  else
227  for (unsigned i = 0; i < _num_c_ref; ++i)
228  result -= _c_weights[i] * ((*_mineral_conc_old)[_qp][i] +
229  _dt * _porosity_old[_qp] * (*_saturation)[_qp][_aq_ph] *
230  (*_reaction_rate)[_qp][i] -
231  (*_c_reference[i])[_qp]);
232  }
233  return result;
234 }
const VariableValue & _phi0
Porosity at zero strain and zero porepressure and zero temperature.
const MaterialProperty< std::vector< Real > > *const _mineral_conc_old
Old value of mineral concentration at the quadpoints or nodes.
std::vector< Real > _c_weights
Weights for the mineral concentrations.
const bool _chemical
Porosity is a function of chemistry.
const unsigned _num_c_ref
Number of reference mineral concentrations provided by user.
const unsigned int _aq_ph
Aqueous phase number.
std::vector< const VariableValue * > _initial_c
Reference mineral concentrations.
std::vector< const VariableValue * > _c_reference
Reference mineral concentrations.
const MaterialProperty< Real > & _porosity_old
Old value of porosity.

◆ computeQpProperties()

void PorousFlowPorosityExponentialBase::computeQpProperties ( )
overrideprotectedvirtualinherited

Reimplemented in PorousFlowPorosityHMBiotModulus.

Definition at line 62 of file PorousFlowPorosityExponentialBase.C.

63 {
64  const Real a = atNegInfinityQp();
65  const Real b = atZeroQp();
66  const Real decay = decayQp();
67  Real exp_term = 1.0; // set appropriately below
68 
69  Real deriv = 0.0; // = d(porosity)/d(decay)
70  if (decay <= 0.0 || !_ensure_positive)
71  {
72  exp_term = std::exp(decay);
73  _porosity[_qp] = a + (b - a) * exp_term;
74  deriv = _porosity[_qp] - a;
75  }
76  else
77  {
78  const Real c = std::log(a / (a - b));
79  const Real expx = std::exp(-decay / c);
80  // note that at decay = 0, we have expx = 1, so porosity = a + b - a = b
81  // and at decay = infinity, expx = 0, so porosity = a + (b - a) * a / (a - b) = 0
82  exp_term = std::exp(c * (1.0 - expx));
83  _porosity[_qp] = a + (b - a) * exp_term;
84  deriv = (_porosity[_qp] - a) * expx;
85  }
86 
87  _dporosity_dvar[_qp].resize(_num_var);
88  _dporosity_dgradvar[_qp].resize(_num_var);
89  for (unsigned int v = 0; v < _num_var; ++v)
90  {
91  _dporosity_dvar[_qp][v] = ddecayQp_dvar(v) * deriv;
92  _dporosity_dgradvar[_qp][v] = ddecayQp_dgradvar(v) * deriv;
93 
94  const Real da = datNegInfinityQp(v);
95  const Real db = datZeroQp(v);
96  _dporosity_dvar[_qp][v] += da * (1 - exp_term) + db * exp_term;
97 
98  if (!(decay <= 0.0 || !_ensure_positive))
99  {
100  const Real c = std::log(a / (a - b));
101  const Real expx = std::exp(-decay / c);
102  const Real dc = (a - b) * (da * b / a - db) / std::pow(a, 2);
103  _dporosity_dvar[_qp][v] += (b - a) * exp_term * dc * (1 - expx - expx / c);
104  }
105  }
106 }
const bool _ensure_positive
for decayQp() > 0, porosity can be negative when using porosity = a + (b - a) * exp(decay).
virtual Real atZeroQp() const =0
Returns "b" 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 datZeroQp(unsigned pvar) const =0
d(a)/d(PorousFlow variable pvar)
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.
const unsigned int _num_var
Number of PorousFlow variables.
virtual Real atNegInfinityQp() const =0
Returns "a" at the quadpoint (porosity = a + (b - a) * exp(decay))
virtual RealGradient ddecayQp_dgradvar(unsigned pvar) const =0
d(decay)/d(grad(PorousFlow variable pvar))
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real datNegInfinityQp(unsigned pvar) const =0
d(a)/d(PorousFlow variable pvar)
virtual Real ddecayQp_dvar(unsigned pvar) const =0
d(decay)/d(PorousFlow variable pvar)

◆ datNegInfinityQp()

Real PorousFlowPorosity::datNegInfinityQp ( unsigned  pvar) const
overrideprotectedvirtual

d(a)/d(PorousFlow variable pvar)

Implements PorousFlowPorosityExponentialBase.

Definition at line 205 of file PorousFlowPorosity.C.

206 {
207  Real result = 0.0;
208  if (_chemical && (_t_step >= 1 || _app.isRestarting()))
209  for (unsigned i = 0; i < _num_c_ref; ++i)
210  result -= _c_weights[i] * _dt * _porosity_old[_qp] *
211  ((*_saturation)[_qp][_aq_ph] * (*_dreaction_rate_dvar)[_qp][i][pvar] +
212  (*_dsaturation_dvar)[_qp][_aq_ph][pvar] * (*_reaction_rate)[_qp][i]);
213  return result;
214 }
const MaterialProperty< std::vector< Real > > *const _saturation
Saturation.
std::vector< Real > _c_weights
Weights for the mineral concentrations.
const bool _chemical
Porosity is a function of chemistry.
const unsigned _num_c_ref
Number of reference mineral concentrations provided by user.
const unsigned int _aq_ph
Aqueous phase number.
const MaterialProperty< Real > & _porosity_old
Old value of porosity.

◆ datZeroQp()

Real PorousFlowPorosity::datZeroQp ( unsigned  pvar) const
overrideprotectedvirtual

d(a)/d(PorousFlow variable pvar)

Implements PorousFlowPorosityExponentialBase.

Definition at line 237 of file PorousFlowPorosity.C.

238 {
239  Real result = 0.0;
240  if (_chemical && (_t_step >= 1 || _app.isRestarting()))
241  for (unsigned i = 0; i < _num_c_ref; ++i)
242  result -= _c_weights[i] * _dt * _porosity_old[_qp] *
243  ((*_saturation)[_qp][_aq_ph] * (*_dreaction_rate_dvar)[_qp][i][pvar] +
244  (*_dsaturation_dvar)[_qp][_aq_ph][pvar] * (*_reaction_rate)[_qp][i]);
245  return result;
246 }
const MaterialProperty< std::vector< Real > > *const _saturation
Saturation.
std::vector< Real > _c_weights
Weights for the mineral concentrations.
const bool _chemical
Porosity is a function of chemistry.
const unsigned _num_c_ref
Number of reference mineral concentrations provided by user.
const unsigned int _aq_ph
Aqueous phase number.
const MaterialProperty< Real > & _porosity_old
Old value of porosity.

◆ ddecayQp_dgradvar()

RealGradient PorousFlowPorosity::ddecayQp_dgradvar ( unsigned  pvar) const
overrideprotectedvirtual

d(decay)/d(grad(PorousFlow variable pvar))

Implements PorousFlowPorosityExponentialBase.

Definition at line 288 of file PorousFlowPorosity.C.

289 {
290  RealGradient result;
291  if (_mechanical)
292  {
293  const unsigned qp_to_use =
294  (_nodal_material && (_bnd || _strain_at_nearest_qp) ? nearestQP(_qp) : _qp);
295  result += -(*_dvol_strain_qp_dvar)[qp_to_use][pvar];
296  }
297  return result;
298 }
const bool _strain_at_nearest_qp
When calculating nodal porosity, use the strain at the nearest quadpoint to the node.
const bool _mechanical
Porosity is a function of volumetric strain.

◆ ddecayQp_dvar()

Real PorousFlowPorosity::ddecayQp_dvar ( unsigned  pvar) const
overrideprotectedvirtual

d(decay)/d(PorousFlow variable pvar)

Implements PorousFlowPorosityExponentialBase.

Definition at line 274 of file PorousFlowPorosity.C.

275 {
276  Real result = 0.0;
277 
278  if (_thermal)
279  result += _exp_coeff * (*_dtemperature_dvar)[_qp][pvar];
280 
281  if (_fluid)
282  result += _coeff * (*_dpf_dvar)[_qp][pvar];
283 
284  return result;
285 }
const Real _coeff
Short-hand number (biot-1)/solid_bulk.
const bool _thermal
Porosity is a function of temperature.
const Real _exp_coeff
Thermal expansion coefficient of the solid porous skeleton.
const bool _fluid
Porosity is a function of effective porepressure.

◆ decayQp()

Real PorousFlowPorosity::decayQp ( ) const
overrideprotectedvirtual

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

Implements PorousFlowPorosityExponentialBase.

Definition at line 249 of file PorousFlowPorosity.C.

250 {
251  Real result = 0.0;
252 
253  if (_thermal)
254  result += _exp_coeff * ((*_temperature)[_qp] - _t_reference[_qp]);
255 
256  if (_fluid)
257  result += _coeff * ((*_pf)[_qp] - _p_reference[_qp]);
258 
259  if (_mechanical)
260  {
261  // Note that in the following _strain[_qp] is evaluated at q quadpoint
262  // So _porosity_nodal[_qp], which should be the nodal value of porosity
263  // actually uses the strain at a quadpoint. This
264  // is OK for LINEAR elements, as strain is constant over the element anyway.
265  const unsigned qp_to_use =
266  (_nodal_material && (_bnd || _strain_at_nearest_qp) ? nearestQP(_qp) : _qp);
267  result += -(*_vol_strain_qp)[qp_to_use];
268  }
269 
270  return result;
271 }
const Real _coeff
Short-hand number (biot-1)/solid_bulk.
const VariableValue & _t_reference
Reference temperature.
const bool _strain_at_nearest_qp
When calculating nodal porosity, use the strain at the nearest quadpoint to the node.
const bool _thermal
Porosity is a function of temperature.
const Real _exp_coeff
Thermal expansion coefficient of the solid porous skeleton.
const VariableValue & _p_reference
Reference porepressure.
const bool _fluid
Porosity is a function of effective porepressure.
const bool _mechanical
Porosity is a function of volumetric strain.

◆ initQpStatefulProperties()

void PorousFlowPorosityExponentialBase::initQpStatefulProperties ( )
overrideprotectedvirtualinherited

Definition at line 44 of file PorousFlowPorosityExponentialBase.C.

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

Member Data Documentation

◆ _aq_ph

const unsigned int PorousFlowPorosity::_aq_ph
protected

Aqueous phase number.

Definition at line 119 of file PorousFlowPorosity.h.

Referenced by atNegInfinityQp(), atZeroQp(), datNegInfinityQp(), and datZeroQp().

◆ _biot

const Real PorousFlowPorosity::_biot
protected

Biot coefficient.

Definition at line 56 of file PorousFlowPorosity.h.

Referenced by atNegInfinityQp(), and PorousFlowPorosityHMBiotModulus::computeQpProperties().

◆ _c_reference

std::vector<const VariableValue *> PorousFlowPorosity::_c_reference
protected

Reference mineral concentrations.

Definition at line 77 of file PorousFlowPorosity.h.

Referenced by atZeroQp(), and PorousFlowPorosity().

◆ _c_weights

std::vector<Real> PorousFlowPorosity::_c_weights
protected

Weights for the mineral concentrations.

Definition at line 86 of file PorousFlowPorosity.h.

Referenced by atNegInfinityQp(), atZeroQp(), datNegInfinityQp(), datZeroQp(), and PorousFlowPorosity().

◆ _chemical

const bool PorousFlowPorosity::_chemical
protected

Porosity is a function of chemistry.

Definition at line 50 of file PorousFlowPorosity.h.

Referenced by atNegInfinityQp(), atZeroQp(), datNegInfinityQp(), datZeroQp(), and PorousFlowPorosity().

◆ _coeff

const Real PorousFlowPorosity::_coeff
protected

Short-hand number (biot-1)/solid_bulk.

Definition at line 65 of file PorousFlowPorosity.h.

Referenced by ddecayQp_dvar(), and decayQp().

◆ _dpf_dvar

const MaterialProperty<std::vector<Real> >* const PorousFlowPorosity::_dpf_dvar
protected

d(effective porepressure)/(d porflow variable)

Definition at line 101 of file PorousFlowPorosity.h.

Referenced by PorousFlowPorosityHMBiotModulus::computeQpProperties().

◆ _dporosity_dgradvar

MaterialProperty<std::vector<RealGradient> >& PorousFlowPorosityBase::_dporosity_dgradvar
protectedinherited

◆ _dporosity_dvar

MaterialProperty<std::vector<Real> >& PorousFlowPorosityBase::_dporosity_dvar
protectedinherited

◆ _dreaction_rate_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowPorosity::_dreaction_rate_dvar
protected

d(reaction_rate_conc)/d(porflow variable)

Definition at line 116 of file PorousFlowPorosity.h.

◆ _dsaturation_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowPorosity::_dsaturation_dvar
protected

d(saturation)/d(PorousFlow var)

Definition at line 125 of file PorousFlowPorosity.h.

◆ _dtemperature_dvar

const MaterialProperty<std::vector<Real> >* const PorousFlowPorosity::_dtemperature_dvar
protected

d(temperature)/(d porflow variable)

Definition at line 107 of file PorousFlowPorosity.h.

◆ _dvol_strain_qp_dvar

const MaterialProperty<std::vector<RealGradient> >* const PorousFlowPorosity::_dvol_strain_qp_dvar
protected

d(strain)/(dvar) (first const means we never want to dereference and change the value, second means we'll always be pointing to the same address after initialization (like a reference))

Definition at line 95 of file PorousFlowPorosity.h.

Referenced by PorousFlowPorosityHMBiotModulus::computeQpProperties().

◆ _ensure_positive

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 77 of file PorousFlowPorosityExponentialBase.h.

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

◆ _exp_coeff

const Real PorousFlowPorosity::_exp_coeff
protected

Thermal expansion coefficient of the solid porous skeleton.

Definition at line 59 of file PorousFlowPorosity.h.

Referenced by ddecayQp_dvar(), and decayQp().

◆ _fluid

const bool PorousFlowPorosity::_fluid
protected

Porosity is a function of effective porepressure.

Definition at line 44 of file PorousFlowPorosity.h.

Referenced by ddecayQp_dvar(), decayQp(), and PorousFlowPorosity().

◆ _initial_c

std::vector<const VariableValue *> PorousFlowPorosity::_initial_c
protected

Reference mineral concentrations.

Definition at line 83 of file PorousFlowPorosity.h.

Referenced by atNegInfinityQp(), atZeroQp(), and PorousFlowPorosity().

◆ _mechanical

const bool PorousFlowPorosity::_mechanical
protected

Porosity is a function of volumetric strain.

Definition at line 41 of file PorousFlowPorosity.h.

Referenced by ddecayQp_dgradvar(), and decayQp().

◆ _mineral_conc_old

const MaterialProperty<std::vector<Real> >* const PorousFlowPorosity::_mineral_conc_old
protected

Old value of mineral concentration at the quadpoints or nodes.

Definition at line 110 of file PorousFlowPorosity.h.

Referenced by atNegInfinityQp(), and atZeroQp().

◆ _num_c_ref

const unsigned PorousFlowPorosity::_num_c_ref
protected

Number of reference mineral concentrations provided by user.

Definition at line 74 of file PorousFlowPorosity.h.

Referenced by atNegInfinityQp(), atZeroQp(), datNegInfinityQp(), datZeroQp(), and PorousFlowPorosity().

◆ _num_components

const unsigned int PorousFlowMaterialVectorBase::_num_components
protectedinherited

◆ _num_initial_c

const unsigned PorousFlowPorosity::_num_initial_c
protected

Number of reference mineral concentrations provided by user.

Definition at line 80 of file PorousFlowPorosity.h.

Referenced by PorousFlowPorosity().

◆ _num_phases

const unsigned int PorousFlowMaterialVectorBase::_num_phases
protectedinherited

◆ _num_var

const unsigned int PorousFlowMaterialVectorBase::_num_var
protectedinherited

◆ _p_reference

const VariableValue& PorousFlowPorosity::_p_reference
protected

Reference porepressure.

Definition at line 71 of file PorousFlowPorosity.h.

Referenced by decayQp().

◆ _pf

const MaterialProperty<Real>* const PorousFlowPorosity::_pf
protected

Effective porepressure at the quadpoints or nodes.

Definition at line 98 of file PorousFlowPorosity.h.

Referenced by PorousFlowPorosityHMBiotModulus::computeQpProperties().

◆ _phi0

const VariableValue& PorousFlowPorosity::_phi0
protected

Porosity at zero strain and zero porepressure and zero temperature.

Definition at line 53 of file PorousFlowPorosity.h.

Referenced by atZeroQp().

◆ _porosity

MaterialProperty<Real>& PorousFlowPorosityBase::_porosity
protectedinherited

◆ _porosity_old

const MaterialProperty<Real>& PorousFlowPorosity::_porosity_old
protected

Old value of porosity.

Definition at line 89 of file PorousFlowPorosity.h.

Referenced by atNegInfinityQp(), atZeroQp(), datNegInfinityQp(), and datZeroQp().

◆ _reaction_rate

const MaterialProperty<std::vector<Real> >* const PorousFlowPorosity::_reaction_rate
protected

Reaction rate of mineralisation.

Definition at line 113 of file PorousFlowPorosity.h.

◆ _saturation

const MaterialProperty<std::vector<Real> >* const PorousFlowPorosity::_saturation
protected

Saturation.

Definition at line 122 of file PorousFlowPorosity.h.

Referenced by datNegInfinityQp(), and datZeroQp().

◆ _solid_bulk

const Real PorousFlowPorosity::_solid_bulk
protected

Drained bulk modulus of the porous skeleton.

Definition at line 62 of file PorousFlowPorosity.h.

◆ _strain_at_nearest_qp

const bool PorousFlowPorosityExponentialBase::_strain_at_nearest_qp
protectedinherited

When calculating nodal porosity, use the strain at the nearest quadpoint to the node.

Definition at line 68 of file PorousFlowPorosityExponentialBase.h.

Referenced by PorousFlowPorosityHMBiotModulus::computeQpProperties(), ddecayQp_dgradvar(), and decayQp().

◆ _t_reference

const VariableValue& PorousFlowPorosity::_t_reference
protected

Reference temperature.

Definition at line 68 of file PorousFlowPorosity.h.

Referenced by decayQp().

◆ _temperature

const MaterialProperty<Real>* const PorousFlowPorosity::_temperature
protected

Temperature at the quadpoints or nodes.

Definition at line 104 of file PorousFlowPorosity.h.

◆ _thermal

const bool PorousFlowPorosity::_thermal
protected

Porosity is a function of temperature.

Definition at line 47 of file PorousFlowPorosity.h.

Referenced by ddecayQp_dvar(), decayQp(), and PorousFlowPorosity().

◆ _vol_strain_qp

const MaterialProperty<Real>* const PorousFlowPorosity::_vol_strain_qp
protected

Strain (first const means we never want to dereference and change the value, second means we'll always be pointing to the same address after initialization (like a reference))

Definition at line 92 of file PorousFlowPorosity.h.

Referenced by PorousFlowPorosityHMBiotModulus::computeQpProperties().


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