20 params.
addParam<
bool>(
"strain_at_nearest_qp",
22 "When calculating nodal porosity that depends on strain, use the strain at "
23 "the nearest quadpoint. This adds a small extra computational burden, and "
24 "is not necessary for simulations involving only linear lagrange elements. "
25 " If you set this to true, you will also want to set the same parameter to "
26 "true for related Kernels and Materials");
28 "multiply_by_density",
30 "If true, then this Kernel represents component_mass*rate_of_solid_volumetric_expansion. If "
31 "flase, then this Kernel represents component_volume*rate_of_solid_volumetric_expansion "
32 "(care must then be taken when using other PorousFlow objects, such as the "
33 "PorousFlowFluidMass postprocessor).");
35 "fluid_component", 0,
"The index corresponding to the component for this kernel");
37 "PorousFlowDictator",
"The UserObject that holds the list of PorousFlow variable names.");
38 params.
set<
bool>(
"use_displaced_mesh") =
false;
40 params.
addClassDescription(
"Component_mass*rate_of_solid_volumetric_expansion. This Kernel "
41 "lumps the component mass to the nodes.");
48 _fluid_component(getParam<unsigned
int>(
"fluid_component")),
50 _var_is_porflow_var(!_dictator.notPorousFlowVariable(_var.number())),
51 _num_phases(_dictator.numPhases()),
52 _strain_at_nearest_qp(getParam<bool>(
"strain_at_nearest_qp")),
53 _multiply_by_density(getParam<bool>(
"multiply_by_density")),
54 _porosity(getMaterialProperty<Real>(
"PorousFlow_porosity_nodal")),
55 _dporosity_dvar(getMaterialProperty<
std::vector<Real>>(
"dPorousFlow_porosity_nodal_dvar")),
57 getMaterialProperty<
std::vector<RealGradient>>(
"dPorousFlow_porosity_nodal_dgradvar")),
58 _nearest_qp(_strain_at_nearest_qp
59 ? &getMaterialProperty<unsigned
int>(
"PorousFlow_nearestqp_nodal")
61 _fluid_density(_multiply_by_density ? &getMaterialProperty<
std::vector<Real>>(
62 "PorousFlow_fluid_phase_density_nodal")
64 _dfluid_density_dvar(_multiply_by_density
65 ? &getMaterialProperty<
std::vector<
std::vector<Real>>>(
66 "dPorousFlow_fluid_phase_density_nodal_dvar")
68 _fluid_saturation(getMaterialProperty<
std::vector<Real>>(
"PorousFlow_saturation_nodal")),
69 _dfluid_saturation_dvar(
70 getMaterialProperty<
std::vector<
std::vector<Real>>>(
"dPorousFlow_saturation_nodal_dvar")),
71 _mass_frac(getMaterialProperty<
std::vector<
std::vector<Real>>>(
"PorousFlow_mass_frac_nodal")),
72 _dmass_frac_dvar(getMaterialProperty<
std::vector<
std::vector<
std::vector<Real>>>>(
73 "dPorousFlow_mass_frac_nodal_dvar")),
74 _strain_rate_qp(getMaterialProperty<Real>(
"PorousFlow_volumetric_strain_rate_qp")),
75 _dstrain_rate_qp_dvar(getMaterialProperty<
std::vector<RealGradient>>(
76 "dPorousFlow_volumetric_strain_rate_qp_dvar"))
79 mooseError(
"The Dictator proclaims that the number of components in this simulation is ",
81 " whereas you have used the Kernel PorousFlowComponetMassVolumetricExpansion with "
84 ". The Dictator is watching you");
registerMooseObject("PorousFlowApp", PorousFlowMassVolumetricExpansion)
void ErrorVector unsigned int
const VariableTestValue & _test
const VariablePhiGradient & _grad_phi
void mooseError(Args &&... args) const
unsigned int number() const
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
unsigned int numComponents() const
The number of fluid components.
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.
Kernel = mass_component * d(volumetric_strain)/dt where mass_component = porosity*sum_phases(density_...
const MaterialProperty< std::vector< Real > > & _fluid_saturation
Fluid saturation.
virtual Real computeQpResidual() override
const MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(PorousFlow variable)
const bool _multiply_by_density
Whether to multiply by density: if true then this Kernel involves the fluid mass, otherwise it involv...
const unsigned int _fluid_component
The fluid component index.
Real computedVolQpJac(unsigned int jvar) const
Derivative of volumetric-strain part of the residual with respect to the Variable with variable numbe...
const MaterialProperty< std::vector< std::vector< Real > > > & _mass_frac
Mass fraction.
virtual Real computeQpJacobian() override
const MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_saturation_dvar
d(fluid saturation)/d(PorousFlow variable)
Real computedMassQpJac(unsigned int jvar) const
Derivative of mass part of the residual with respect to the Variable with variable number jvar.
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const unsigned int _num_phases
Number of fluid phases.
const bool _strain_at_nearest_qp
Whether the porosity uses the volumetric strain at the closest quadpoint.
const MaterialProperty< std::vector< RealGradient > > & _dstrain_rate_qp_dvar
d(strain rate)/d(PorousFlow variable)
const MaterialProperty< Real > & _porosity
Porosity.
const MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad PorousFlow variable)
static InputParameters validParams()
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const MaterialProperty< Real > & _strain_rate_qp
Strain rate.
PorousFlowMassVolumetricExpansion(const InputParameters ¶meters)
const MaterialProperty< std::vector< std::vector< std::vector< Real > > > > & _dmass_frac_dvar
d(mass fraction)/d(PorousFlow variable)
static InputParameters validParams()