19 "mechanical",
false,
"If true, porosity will be a function of total volumetric strain");
21 "fluid",
false,
"If true, porosity will be a function of effective porepressure");
22 params.
addParam<
bool>(
"thermal",
false,
"If true, porosity will be a function of temperature");
23 params.
addParam<
bool>(
"chemical",
false,
"If true, porosity will be a function of precipitate");
25 "The porosity at zero volumetric strain and " 26 "reference temperature and reference effective " 27 "porepressure and reference chemistry. This must be a real number " 28 "or a constant monomial variable (not a linear lagrange or other " 31 "Volumetric thermal expansion coefficient of the drained porous solid " 32 "skeleton (only used if thermal=true)");
34 "biot_coefficient", 1,
"biot_coefficient>=0 & biot_coefficient<=1",
"Biot coefficient");
36 "Biot coefficient that appears in the term (biot_coefficient_prime - 1) * " 37 "(P - reference_porepressure) / solid_bulk. If not provided, this " 38 "defaults to the standard biot_coefficient");
40 "solid_bulk",
"Bulk modulus of the drained porous solid skeleton (only used if fluid=true)");
42 "reference_temperature", 0.0,
"Reference temperature (only used if thermal=true)");
44 "reference_porepressure", 0.0,
"Reference porepressure (only used if fluid=true)");
46 "Reference values of the solid mineral concentrations " 47 "(m^3(precipitate)/m^3(porous material)), entered as " 48 "a vector (one value per mineral). (Only used if chemical=true)");
50 "initial_mineral_concentrations",
51 "Initial mineral concentrations (m^3(precipitate)/m^3(porous material)), entered as " 52 "a vector (one value per mineral). (Only used if chemical=true)");
53 params.
addParam<std::vector<Real>>(
"chemical_weights",
54 "When chemical=true, porosity is a linear combination of the " 55 "solid mineral concentrations multiplied by these weights. " 56 "Default=1 for all minerals.");
64 _mechanical(getParam<bool>(
"mechanical")),
65 _fluid(getParam<bool>(
"fluid")),
66 _thermal(getParam<bool>(
"thermal")),
67 _chemical(getParam<bool>(
"chemical")),
68 _phi0(coupledValue(
"porosity_zero")),
69 _biot(getParam<
Real>(
"biot_coefficient")),
70 _exp_coeff(isParamValid(
"thermal_expansion_coeff") ? getParam<
Real>(
"thermal_expansion_coeff")
72 _solid_bulk(isParamValid(
"solid_bulk") ? &(getFunctor<
Real>(
"solid_bulk")) : nullptr),
73 _coeff(isParamValid(
"biot_coefficient_prime") ? (getParam<
Real>(
"biot_coefficient_prime") - 1.0)
76 _t_reference(_nodal_material ? coupledDofValues(
"reference_temperature")
77 : coupledValue(
"reference_temperature")),
78 _p_reference(_nodal_material ? coupledDofValues(
"reference_porepressure")
79 : coupledValue(
"reference_porepressure")),
80 _num_c_ref(coupledComponents(
"reference_chemistry")),
81 _c_reference(_num_c_ref),
82 _num_initial_c(coupledComponents(
"initial_mineral_concentrations")),
83 _initial_c(_num_initial_c),
84 _c_weights(isParamValid(
"chemical_weights") ? getParam<
std::vector<
Real>>(
"chemical_weights")
85 :
std::vector<
Real>(_num_c_ref, 1.0)),
87 _porosity_old(_chemical ? (_nodal_material
88 ? &getMaterialPropertyOld<
Real>(
"PorousFlow_porosity_nodal")
89 : &getMaterialPropertyOld<
Real>(
"PorousFlow_porosity_qp"))
91 _vol_strain_qp(_mechanical ? &getMaterialProperty<
Real>(
"PorousFlow_total_volumetric_strain_qp")
93 _dvol_strain_qp_dvar(_mechanical ? &getMaterialProperty<
std::vector<
RealGradient>>(
94 "dPorousFlow_total_volumetric_strain_qp_dvar")
97 _pf(_fluid ? (_nodal_material
98 ? &getMaterialProperty<
Real>(
"PorousFlow_effective_fluid_pressure_nodal")
99 : &getMaterialProperty<
Real>(
"PorousFlow_effective_fluid_pressure_qp"))
101 _dpf_dvar(_fluid ? (_nodal_material ? &getMaterialProperty<
std::vector<
Real>>(
102 "dPorousFlow_effective_fluid_pressure_nodal_dvar")
103 : &getMaterialProperty<
std::vector<
Real>>(
104 "dPorousFlow_effective_fluid_pressure_qp_dvar"))
107 _temperature(_thermal
108 ? (_nodal_material ? &getMaterialProperty<
Real>(
"PorousFlow_temperature_nodal")
109 : &getMaterialProperty<
Real>(
"PorousFlow_temperature_qp"))
114 ? &getMaterialProperty<
std::vector<
Real>>(
"dPorousFlow_temperature_nodal_dvar")
115 : &getMaterialProperty<
std::vector<
Real>>(
"dPorousFlow_temperature_qp_dvar"))
118 _mineral_conc_old(_chemical ? (_nodal_material ? &getMaterialPropertyOld<
std::vector<
Real>>(
119 "PorousFlow_mineral_concentration_nodal")
120 : &getMaterialPropertyOld<
std::vector<
Real>>(
121 "PorousFlow_mineral_concentration_qp"))
123 _reaction_rate(_chemical ? (_nodal_material ? &getMaterialProperty<
std::vector<
Real>>(
124 "PorousFlow_mineral_reaction_rate_nodal")
125 : &getMaterialProperty<
std::vector<
Real>>(
126 "PorousFlow_mineral_reaction_rate_qp"))
128 _dreaction_rate_dvar(_chemical ? (_nodal_material
129 ? &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
130 "dPorousFlow_mineral_reaction_rate_nodal_dvar")
131 : &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
132 "dPorousFlow_mineral_reaction_rate_qp_dvar"))
134 _aq_ph(_dictator.aqueousPhaseNumber()),
135 _saturation(_chemical
137 ? &getMaterialProperty<
std::vector<
Real>>(
"PorousFlow_saturation_nodal")
138 : &getMaterialProperty<
std::vector<
Real>>(
"PorousFlow_saturation_qp"))
140 _dsaturation_dvar(_chemical
141 ? (_nodal_material ? &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
142 "dPorousFlow_saturation_nodal_dvar")
143 : &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
144 "dPorousFlow_saturation_qp_dvar"))
147 if (
_thermal && !isParamValid(
"thermal_expansion_coeff"))
148 mooseError(
"PorousFlowPorosity: When thermal=true you must provide a thermal_expansion_coeff");
150 mooseError(
"PorousFlowPorosity: When fluid=true you must provide a solid_bulk");
152 mooseError(
"PorousFlowPorosity: When chemical=true you must provide the reference_chemistry " 153 "values. The Dictator proclaims there should be ",
154 _dictator.numAqueousKinetic(),
157 mooseError(
"PorousFlowPorosity: When chemical=true you must provide the " 158 "initial_mineral_concentrations. " 159 "The Dictator proclaims there should be ",
160 _dictator.numAqueousKinetic(),
164 "PorousFlowPorosity: When chemical=true you must provde the correct number of " 165 "chemical_weights (which the Dictator knows is ",
166 _dictator.numAqueousKinetic(),
167 ") or do not provide any chemical_weights and use the default value of 1 for each mineral");
171 _c_reference[i] = (_nodal_material ? &coupledDofValues(
"reference_chemistry", i)
172 : &coupledValue(
"reference_chemistry", i));
173 _initial_c[i] = (_nodal_material ? &coupledDofValues(
"initial_mineral_concentrations", i)
174 : &coupledValue(
"initial_mineral_concentrations", i));
195 if (_t_step == 0 && !_app.isRestarting())
201 (*_saturation)[_qp][
_aq_ph] *
202 (*_reaction_rate)[_qp][i]);
211 if (
_chemical && (_t_step >= 1 || _app.isRestarting()))
214 ((*_saturation)[_qp][
_aq_ph] * (*_dreaction_rate_dvar)[_qp][i][pvar] +
215 (*_dsaturation_dvar)[_qp][
_aq_ph][pvar] * (*_reaction_rate)[_qp][i]);
226 if (_t_step == 0 && !_app.isRestarting())
232 _dt * (*_porosity_old)[_qp] * (*_saturation)[_qp][
_aq_ph] *
233 (*_reaction_rate)[_qp][i] -
243 if (
_chemical && (_t_step >= 1 || _app.isRestarting()))
246 ((*_saturation)[_qp][
_aq_ph] * (*_dreaction_rate_dvar)[_qp][i][pvar] +
247 (*_dsaturation_dvar)[_qp][
_aq_ph][pvar] * (*_reaction_rate)[_qp][i]);
264 unsigned int qp_used = (_constant_option == ConstantTypeEnum::NONE) ? _qp : 0;
267 const std::set<SubdomainID> subdomain_set = {_current_elem->subdomain_id()};
268 const Moose::NodeArg space_arg = {_current_elem->node_ptr(qp_used), &subdomain_set};
274 _current_elem, _current_side, qp_used, _qrule, _q_point[qp_used]};
279 const Moose::ElemQpArg space_arg = {_current_elem, qp_used, _qrule, _q_point[qp_used]};
283 mooseError(
"PorousFlowPorosity: solid_bulk must be larger than Zero");
293 const unsigned qp_to_use =
295 result += -(*_vol_strain_qp)[qp_to_use];
307 result +=
_exp_coeff * (*_dtemperature_dvar)[_qp][pvar];
314 unsigned int qp_used = (_constant_option == ConstantTypeEnum::NONE) ? _qp : 0;
317 const std::set<SubdomainID> subdomain_set = {_current_elem->subdomain_id()};
318 const Moose::NodeArg space_arg = {_current_elem->node_ptr(qp_used), &subdomain_set};
324 _current_elem, _current_side, qp_used, _qrule, _q_point[qp_used]};
329 const Moose::ElemQpArg space_arg = {_current_elem, qp_used, _qrule, _q_point[qp_used]};
333 mooseError(
"PorousFlowPorosity: solid_bulk must be larger than Zero.");
334 result +=
_coeff / solid_bulk * (*_dpf_dvar)[_qp][pvar];
346 const unsigned qp_to_use =
348 result += -(*_dvol_strain_qp_dvar)[qp_to_use][pvar];
const Real _coeff
Short-hand number (biot-1). Please note: this variable is not yet divided by solid_bulk.
Base class Material designed to provide the porosity.
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 bool _strain_at_nearest_qp
When calculating nodal porosity, use the strain at the nearest quadpoint to the node.
void mooseError(Args &&... args)
virtual RealGradient ddecayQp_dgradvar(unsigned pvar) const override
d(decay)/d(grad(PorousFlow variable pvar))
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.
virtual Real datZeroQp(unsigned pvar) const override
d(a)/d(PorousFlow variable pvar)
const unsigned _num_c_ref
Number of reference mineral concentrations provided by user.
const MaterialProperty< Real > *const _porosity_old
Old value of porosity.
const unsigned int _aq_ph
Aqueous phase number.
registerMooseObject("PorousFlowApp", PorousFlowPorosity)
std::vector< const VariableValue * > _initial_c
Reference mineral concentrations.
const Real _exp_coeff
Thermal expansion coefficient of the solid porous skeleton.
const VariableValue & _p_reference
Reference porepressure.
static InputParameters validParams()
const unsigned _num_initial_c
Number of reference mineral concentrations provided by user.
const Moose::Functor< Real > * _solid_bulk
Drained bulk modulus of the porous skeleton (as a functor; can be variable, function, etc.) Only used if _fluid is True.
const bool _fluid
Porosity is a function of effective porepressure.
PorousFlowPorosity(const InputParameters ¶meters)
std::vector< const VariableValue * > _c_reference
Reference mineral concentrations.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Material designed to provide the porosity in PorousFlow simulations chemistry + biot + (phi0 - refere...
virtual Real atZeroQp() const override
Returns "b" at the quadpoint (porosity = a + (b - a) * exp(decay))
const bool _mechanical
Porosity is a function of volumetric strain.
virtual Real datNegInfinityQp(unsigned pvar) const override
d(a)/d(PorousFlow variable pvar)
virtual Real decayQp() const override
Returns "decay" at the quadpoint (porosity = a + (b - a) * exp(decay))
virtual Real atNegInfinityQp() const override
Returns "a" at the quadpoint (porosity = a + (b - a) * exp(decay))
virtual Real ddecayQp_dvar(unsigned pvar) const override
d(decay)/d(PorousFlow variable pvar)
static InputParameters validParams()