16 params.
addParam<
bool>(
"strain_at_nearest_qp",
18 "When calculating nodal porosity that depends on strain, use the strain at " 19 "the nearest quadpoint. This adds a small extra computational burden, and " 20 "is not necessary for simulations involving only linear lagrange elements. " 21 " If you set this to true, you will also want to set the same parameter to " 22 "true for related Kernels and Materials");
23 params.
addParam<
bool>(
"ensure_positive",
25 "Modify the usual exponential relationships that " 26 "governs porosity so that porosity is always " 28 params.
addClassDescription(
"Base class Material for porosity that is computed via an exponential " 29 "relationship with coupled variables (strain, porepressure, " 30 "temperature, chemistry)");
37 _strain_at_nearest_qp(getParam<bool>(
"strain_at_nearest_qp")),
38 _ensure_positive(getParam<bool>(
"ensure_positive"))
47 mooseAssert(
a >
b,
"PorousFlowPorosityExponentialBase a must be larger than b");
54 const Real c = std::log(
a / (
a -
b));
55 const Real expx = std::exp(-decay /
c);
71 exp_term = std::exp(decay);
77 const Real c = std::log(
a / (
a -
b));
78 const Real expx = std::exp(-decay /
c);
81 exp_term = std::exp(
c * (1.0 - expx));
86 (*_dporosity_dvar)[_qp].resize(
_num_var);
87 (*_dporosity_dgradvar)[_qp].resize(
_num_var);
95 (*_dporosity_dvar)[_qp][
v] += da * (1 - exp_term) +
db * exp_term;
99 const Real c = std::log(
a / (
a -
b));
100 const Real expx = std::exp(-decay /
c);
102 (*_dporosity_dvar)[_qp][
v] += (
b -
a) * exp_term * dc * (1 - expx - expx /
c);
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))
PorousFlowPorosityExponentialBase(const InputParameters ¶meters)
const GeochemicalDatabaseReader db("database/moose_testdb.json", true, true, false)
static InputParameters validParams()
virtual void computeQpProperties() override
static InputParameters validParams()
Real deriv(unsigned n, unsigned alpha, unsigned beta, Real x)
virtual Real datZeroQp(unsigned pvar) const =0
d(a)/d(PorousFlow variable pvar)
Base class Material designed to provide the porosity.
virtual Real decayQp() const =0
Returns "decay" at the quadpoint (porosity = a + (b - a) * exp(decay))
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))
GenericMaterialProperty< Real, is_ad > & _porosity
Computed porosity at the nodes or quadpoints.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string v
virtual void initQpStatefulProperties() override
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)
MooseUnits pow(const MooseUnits &, int)