14 #include "libmesh/quadrature.h" 24 params.
addParam<
bool>(
"strain_at_nearest_qp",
26 "When calculating nodal porosity that depends on strain, use the strain at " 27 "the nearest quadpoint. This adds a small extra computational burden, and " 28 "is not necessary for simulations involving only linear lagrange elements. " 29 " If you set this to true, you will also want to set the same parameter to " 30 "true for related Kernels and Materials");
32 "fluid_component", 0,
"The index corresponding to the fluid component for this kernel");
34 "The decay rate (units 1/time) for the fluid component");
36 "PorousFlowDictator",
"The UserObject that holds the list of PorousFlow variable names.");
43 _decay_rate(getParam<
Real>(
"decay_rate")),
44 _fluid_component(getParam<unsigned
int>(
"fluid_component")),
46 _var_is_porflow_var(_dictator.isPorousFlowVariable(_var.number())),
47 _num_phases(_dictator.numPhases()),
48 _strain_at_nearest_qp(getParam<bool>(
"strain_at_nearest_qp")),
49 _porosity(getMaterialProperty<
Real>(
"PorousFlow_porosity_nodal")),
50 _dporosity_dvar(getMaterialProperty<
std::vector<
Real>>(
"dPorousFlow_porosity_nodal_dvar")),
52 getMaterialProperty<
std::vector<
RealGradient>>(
"dPorousFlow_porosity_nodal_dgradvar")),
53 _nearest_qp(_strain_at_nearest_qp
54 ? &getMaterialProperty<unsigned
int>(
"PorousFlow_nearestqp_nodal")
56 _fluid_density(getMaterialProperty<
std::vector<
Real>>(
"PorousFlow_fluid_phase_density_nodal")),
57 _dfluid_density_dvar(getMaterialProperty<
std::vector<
std::vector<
Real>>>(
58 "dPorousFlow_fluid_phase_density_nodal_dvar")),
59 _fluid_saturation_nodal(getMaterialProperty<
std::vector<
Real>>(
"PorousFlow_saturation_nodal")),
60 _dfluid_saturation_nodal_dvar(
61 getMaterialProperty<
std::vector<
std::vector<
Real>>>(
"dPorousFlow_saturation_nodal_dvar")),
62 _mass_frac(getMaterialProperty<
std::vector<
std::vector<
Real>>>(
"PorousFlow_mass_frac_nodal")),
63 _dmass_frac_dvar(getMaterialProperty<
std::vector<
std::vector<
std::vector<
Real>>>>(
64 "dPorousFlow_mass_frac_nodal_dvar"))
69 "The Dictator proclaims that the maximum fluid component index in this simulation is ",
71 " whereas you have used ",
73 ". Remember that indexing starts at 0. The Dictator does not take such mistakes lightly.");
const MaterialProperty< std::vector< std::vector< std::vector< Real > > > > & _dmass_frac_dvar
d(nodal mass fraction)/d(PorousFlow variable)
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.
const MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(PorousFlow variable) - these derivatives will be wrt variables at the nodes ...
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const unsigned int _fluid_component
The fluid component index.
unsigned int number() const
const unsigned int _num_phases
Number of fluid phases.
const Real _decay_rate
The decay rate.
const VariablePhiGradient & _grad_phi
registerMooseObject("PorousFlowApp", PorousFlowMassRadioactiveDecay)
const MaterialProperty< std::vector< std::vector< Real > > > & _mass_frac
Nodal mass fraction.
unsigned int numComponents() const
The number of fluid components.
const bool _strain_at_nearest_qp
Whether the porosity uses the volumetric strain at the closest quadpoint.
const MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad PorousFlow variable) - remember these derivatives will be wrt grad(vars) at qps ...
static InputParameters validParams()
const MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_density_dvar
d(nodal fluid density)/d(PorousFlow variable)
virtual Real computeQpResidual() override
const VariableTestValue & _test
const MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_saturation_nodal_dvar
d(nodal fluid saturation)/d(PorousFlow variable)
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
void paramError(const std::string ¶m, Args... args) const
const MaterialProperty< std::vector< Real > > & _fluid_density
Nodal fluid density.
PorousFlowMassRadioactiveDecay(const InputParameters ¶meters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
const MaterialProperty< std::vector< Real > > & _fluid_saturation_nodal
Nodal fluid saturation.
virtual Real computeQpJacobian() override
Kernel = _decay_rate * masscomponent where mass_component = porosity*sum_phases(density_phase*saturat...
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.
Real computeQpJac(unsigned int pvar)
Derivative of residual with respect to PorousFlow variable number pvar This is used by both computeQp...
static InputParameters validParams()
const bool _var_is_porflow_var
Whether the Variable for this Kernel is a PorousFlow variable according to the Dictator.
void ErrorVector unsigned int
const MaterialProperty< Real > & _porosity
Porosity at the nodes, but it can depend on grad(variables) which are actually evaluated at the qps...