14 #include "libmesh/quadrature.h" 23 "PorousFlowDictator",
"The UserObject that holds the list of PorousFlow variable names.");
25 "include_porous_skeleton",
true,
"Include the heat energy of the porous skeleton");
26 params.
addParam<std::vector<unsigned int>>(
"phase",
28 "The index(es) of the fluid phase that this " 29 "Postprocessor is restricted to. Multiple " 30 "indices can be entered.");
33 "For non-mechanically-coupled systems with no TensorMechanics strain calculators, base_name " 34 "need not be set. For mechanically-coupled systems, base_name should be the same base_name " 35 "as given to the TensorMechanics object that computes strain, so that this Postprocessor can " 36 "correctly account for changes in mesh volume. For non-mechanically-coupled systems, " 37 "base_name should not be the base_name of any TensorMechanics strain calculators.");
38 params.
set<
bool>(
"use_displaced_mesh") =
false;
40 params.
addParam<
unsigned int>(
"kernel_variable_number",
42 "The PorousFlow variable number (according to the dictatory) of " 43 "the heat-energy kernel. This is required only in the unusual " 44 "situation where a variety of different finite-element " 45 "interpolation schemes are employed in the simulation");
46 params.
addClassDescription(
"Calculates the sum of heat energy of fluid phase(s) and/or the " 47 "porous skeleton in a region");
54 _num_phases(_dictator.numPhases()),
55 _base_name(isParamValid(
"base_name") ? getParam<
std::string>(
"base_name") +
"_" :
""),
56 _has_total_strain(hasMaterialProperty<
RankTwoTensor>(_base_name +
"total_strain")),
57 _total_strain(_has_total_strain
58 ? &getMaterialProperty<
RankTwoTensor>(_base_name +
"total_strain")
60 _fluid_present(_num_phases > 0),
61 _include_porous_skeleton(getParam<bool>(
"include_porous_skeleton")),
62 _phase_index(getParam<
std::vector<unsigned
int>>(
"phase")),
63 _porosity(getMaterialProperty<
Real>(
"PorousFlow_porosity_nodal")),
64 _rock_energy_nodal(getMaterialProperty<
Real>(
"PorousFlow_matrix_internal_energy_nodal")),
65 _fluid_density(_fluid_present ? &getMaterialProperty<
std::vector<
Real>>(
66 "PorousFlow_fluid_phase_density_nodal")
68 _fluid_saturation_nodal(
69 _fluid_present ? &getMaterialProperty<
std::vector<
Real>>(
"PorousFlow_saturation_nodal")
71 _energy_nodal(_fluid_present ? &getMaterialProperty<
std::vector<
Real>>(
72 "PorousFlow_fluid_phase_internal_energy_nodal")
74 _var(getParam<unsigned>(
"kernel_variable_number") < _dictator.numVariables()
75 ? &_fe_problem.getStandardVariable(
78 .getCoupledStandardMooseVars()[getParam<unsigned>(
"kernel_variable_number")]
88 "The Dictator proclaims that the phase index ",
90 " is greater than the largest phase index possible, which is ",
97 "The Dictator pronounces that the number of PorousFlow variables is ",
99 ", however you have used ",
100 getParam<unsigned>(
"kernel_variable_number"),
101 ". This is an error");
121 for (
unsigned node = 0; node < test.size(); ++node)
123 Real nodal_volume = 0.0;
128 nodal_volume += n_v * (1.0 + (*_total_strain)[
_qp].trace());
138 energy += (*_fluid_density)[node][ph] * (*_fluid_saturation_nodal)[node][ph] *
139 (*_energy_nodal)[node][ph] *
_porosity[node];
141 sum += nodal_volume * energy;
const MooseArray< Real > & _coord
virtual Real computeQpIntegral() override
const MaterialProperty< Real > & _porosity
Porosity.
const MaterialProperty< Real > & _rock_energy_nodal
Nodal rock energy density.
Postprocessor produces the sum of heat energy of the porous skeleton and/or fluid components in a reg...
static InputParameters validParams()
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const unsigned int _num_phases
Number of fluid phases.
OutputTools< Real >::VariableTestValue VariableTestValue
const FieldVariablePhiValue & phi() const override
void paramError(const std::string ¶m, Args... args) const
unsigned int numVariables() const
The number of PorousFlow variables.
void addMooseVariableDependency(MooseVariableFieldBase *var)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseVariable *const _var
The variable for the corresponding PorousFlowEnergyTimeDerivative Kernel: this provides test function...
const QBase *const & _qrule
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
std::vector< unsigned int > _phase_index
The phase indices that this Postprocessor is restricted to.
const MooseArray< Real > & _JxW
registerMooseObject("PorousFlowApp", PorousFlowHeatEnergy)
const bool _include_porous_skeleton
Whether to include the heat energy of the porous skeleton in the calculations.
virtual Real computeIntegral() override
PorousFlowHeatEnergy(const InputParameters ¶meters)
void ErrorVector unsigned int
const bool _has_total_strain
Whether there is a Material called _base_name_total_strain.
static InputParameters validParams()