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");
42 "Bulk modulus of the drained porous solid skeleton (only used if fluid=true)");
44 "reference_temperature", 0.0,
"Reference temperature (only used if thermal=true)");
46 "reference_porepressure", 0.0,
"Reference porepressure (only used if fluid=true)");
48 "Reference values of the solid mineral concentrations " 49 "(m^3(precipitate)/m^3(porous material)), entered as " 50 "a vector (one value per mineral). (Only used if chemical=true)");
52 "initial_mineral_concentrations",
53 "Initial mineral concentrations (m^3(precipitate)/m^3(porous material)), entered as " 54 "a vector (one value per mineral). (Only used if chemical=true)");
55 params.
addParam<std::vector<Real>>(
"chemical_weights",
56 "When chemical=true, porosity is a linear combination of the " 57 "solid mineral concentrations multiplied by these weights. " 58 "Default=1 for all minerals.");
66 _mechanical(getParam<bool>(
"mechanical")),
67 _fluid(getParam<bool>(
"fluid")),
68 _thermal(getParam<bool>(
"thermal")),
69 _chemical(getParam<bool>(
"chemical")),
70 _phi0(coupledValue(
"porosity_zero")),
71 _biot(getParam<
Real>(
"biot_coefficient")),
72 _exp_coeff(isParamValid(
"thermal_expansion_coeff") ? getParam<
Real>(
"thermal_expansion_coeff")
74 _solid_bulk(isParamValid(
"solid_bulk") ? getParam<
Real>(
"solid_bulk")
76 _coeff(isParamValid(
"biot_coefficient_prime")
77 ? (getParam<
Real>(
"biot_coefficient_prime") - 1.0) / _solid_bulk
78 : (_biot - 1.0) / _solid_bulk),
80 _t_reference(_nodal_material ? coupledDofValues(
"reference_temperature")
81 : coupledValue(
"reference_temperature")),
82 _p_reference(_nodal_material ? coupledDofValues(
"reference_porepressure")
83 : coupledValue(
"reference_porepressure")),
84 _num_c_ref(coupledComponents(
"reference_chemistry")),
85 _c_reference(_num_c_ref),
86 _num_initial_c(coupledComponents(
"initial_mineral_concentrations")),
87 _initial_c(_num_initial_c),
88 _c_weights(isParamValid(
"chemical_weights") ? getParam<
std::vector<
Real>>(
"chemical_weights")
89 :
std::vector<
Real>(_num_c_ref, 1.0)),
91 _porosity_old(_chemical ? (_nodal_material
92 ? &getMaterialPropertyOld<
Real>(
"PorousFlow_porosity_nodal")
93 : &getMaterialPropertyOld<
Real>(
"PorousFlow_porosity_qp"))
95 _vol_strain_qp(_mechanical ? &getMaterialProperty<
Real>(
"PorousFlow_total_volumetric_strain_qp")
97 _dvol_strain_qp_dvar(_mechanical ? &getMaterialProperty<
std::vector<
RealGradient>>(
98 "dPorousFlow_total_volumetric_strain_qp_dvar")
101 _pf(_fluid ? (_nodal_material
102 ? &getMaterialProperty<
Real>(
"PorousFlow_effective_fluid_pressure_nodal")
103 : &getMaterialProperty<
Real>(
"PorousFlow_effective_fluid_pressure_qp"))
105 _dpf_dvar(_fluid ? (_nodal_material ? &getMaterialProperty<
std::vector<
Real>>(
106 "dPorousFlow_effective_fluid_pressure_nodal_dvar")
107 : &getMaterialProperty<
std::vector<
Real>>(
108 "dPorousFlow_effective_fluid_pressure_qp_dvar"))
111 _temperature(_thermal
112 ? (_nodal_material ? &getMaterialProperty<
Real>(
"PorousFlow_temperature_nodal")
113 : &getMaterialProperty<
Real>(
"PorousFlow_temperature_qp"))
118 ? &getMaterialProperty<
std::vector<
Real>>(
"dPorousFlow_temperature_nodal_dvar")
119 : &getMaterialProperty<
std::vector<
Real>>(
"dPorousFlow_temperature_qp_dvar"))
122 _mineral_conc_old(_chemical ? (_nodal_material ? &getMaterialPropertyOld<
std::vector<
Real>>(
123 "PorousFlow_mineral_concentration_nodal")
124 : &getMaterialPropertyOld<
std::vector<
Real>>(
125 "PorousFlow_mineral_concentration_qp"))
127 _reaction_rate(_chemical ? (_nodal_material ? &getMaterialProperty<
std::vector<
Real>>(
128 "PorousFlow_mineral_reaction_rate_nodal")
129 : &getMaterialProperty<
std::vector<
Real>>(
130 "PorousFlow_mineral_reaction_rate_qp"))
132 _dreaction_rate_dvar(_chemical ? (_nodal_material
133 ? &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
134 "dPorousFlow_mineral_reaction_rate_nodal_dvar")
135 : &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
136 "dPorousFlow_mineral_reaction_rate_qp_dvar"))
138 _aq_ph(_dictator.aqueousPhaseNumber()),
139 _saturation(_chemical
141 ? &getMaterialProperty<
std::vector<
Real>>(
"PorousFlow_saturation_nodal")
142 : &getMaterialProperty<
std::vector<
Real>>(
"PorousFlow_saturation_qp"))
144 _dsaturation_dvar(_chemical
145 ? (_nodal_material ? &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
146 "dPorousFlow_saturation_nodal_dvar")
147 : &getMaterialProperty<
std::vector<
std::vector<
Real>>>(
148 "dPorousFlow_saturation_qp_dvar"))
151 if (
_thermal && !isParamValid(
"thermal_expansion_coeff"))
152 mooseError(
"PorousFlowPorosity: When thermal=true you must provide a thermal_expansion_coeff");
153 if (
_fluid && !isParamValid(
"solid_bulk"))
154 mooseError(
"PorousFlowPorosity: When fluid=true you must provide a solid_bulk");
156 mooseError(
"PorousFlowPorosity: When chemical=true you must provide the reference_chemistry " 157 "values. The Dictator proclaims there should be ",
158 _dictator.numAqueousKinetic(),
161 mooseError(
"PorousFlowPorosity: When chemical=true you must provide the " 162 "initial_mineral_concentrations. " 163 "The Dictator proclaims there should be ",
164 _dictator.numAqueousKinetic(),
168 "PorousFlowPorosity: When chemical=true you must provde the correct number of " 169 "chemical_weights (which the Dictator knows is ",
170 _dictator.numAqueousKinetic(),
171 ") or do not provide any chemical_weights and use the default value of 1 for each mineral");
175 _c_reference[i] = (_nodal_material ? &coupledDofValues(
"reference_chemistry", i)
176 : &coupledValue(
"reference_chemistry", i));
177 _initial_c[i] = (_nodal_material ? &coupledDofValues(
"initial_mineral_concentrations", i)
178 : &coupledValue(
"initial_mineral_concentrations", i));
199 if (_t_step == 0 && !_app.isRestarting())
205 (*_saturation)[_qp][
_aq_ph] *
206 (*_reaction_rate)[_qp][i]);
215 if (
_chemical && (_t_step >= 1 || _app.isRestarting()))
218 ((*_saturation)[_qp][
_aq_ph] * (*_dreaction_rate_dvar)[_qp][i][pvar] +
219 (*_dsaturation_dvar)[_qp][
_aq_ph][pvar] * (*_reaction_rate)[_qp][i]);
230 if (_t_step == 0 && !_app.isRestarting())
236 _dt * (*_porosity_old)[_qp] * (*_saturation)[_qp][
_aq_ph] *
237 (*_reaction_rate)[_qp][i] -
247 if (
_chemical && (_t_step >= 1 || _app.isRestarting()))
250 ((*_saturation)[_qp][
_aq_ph] * (*_dreaction_rate_dvar)[_qp][i][pvar] +
251 (*_dsaturation_dvar)[_qp][
_aq_ph][pvar] * (*_reaction_rate)[_qp][i]);
272 const unsigned qp_to_use =
274 result += -(*_vol_strain_qp)[qp_to_use];
286 result +=
_exp_coeff * (*_dtemperature_dvar)[_qp][pvar];
289 result +=
_coeff * (*_dpf_dvar)[_qp][pvar];
300 const unsigned qp_to_use =
302 result += -(*_dvol_strain_qp_dvar)[qp_to_use][pvar];
const Real _coeff
Short-hand number (biot-1)/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.
auto max(const L &left, const R &right)
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 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()