20 params.addClassDescription(
"Uses the ideal gas law to compute internal pressure "
21 "and an initial moles of gas quantity.");
22 params.addRangeCheckedParam<Real>(
25 "initial_pressure >= 0.0",
26 "The initial pressure in the cavity. If not given, a zero initial pressure will be used.");
27 params.addParam<std::vector<PostprocessorName>>(
"material_input",
28 "The name of the postprocessor(s) that holds the "
29 "amount of material injected into the cavity.");
30 params.addRequiredRangeCheckedParam<Real>(
31 "R",
"R > 0.0",
"The universal gas constant for the units used.");
32 params.addRequiredParam<PostprocessorName>(
33 "temperature",
"The name of the average temperature postprocessor value.");
34 params.addRangeCheckedParam<Real>(
35 "initial_temperature",
"initial_temperature > 0.0",
"Initial temperature (optional)");
36 params.addRequiredParam<std::vector<PostprocessorName>>(
38 "The name of the postprocessor(s) that holds the value of the internal volume in the cavity");
39 params.addParam<Real>(
42 "The amount of time during which the pressure will ramp from zero to its true value.");
43 params.set<
bool>(
"use_displaced_mesh") =
true;
49 : GeneralUserObject(params),
50 _cavity_pressure(declareRestartableData<Real>(
"cavity_pressure", 0.0)),
51 _n0(declareRestartableData<Real>(
"initial_moles", 0.0)),
52 _initial_pressure(getParam<Real>(
"initial_pressure")),
53 _material_input(params.get<std::vector<PostprocessorName>>(
"material_input").size()),
54 _volume(params.get<std::vector<PostprocessorName>>(
"volume").size()),
55 _R(getParam<Real>(
"R")),
56 _temperature(getPostprocessorValue(
"temperature")),
57 _init_temp_given(isParamValid(
"initial_temperature")),
58 _init_temp(_init_temp_given ? getParam<Real>(
"initial_temperature") : 0.0),
59 _startup_time(getParam<Real>(
"startup_time")),
60 _initialized(declareRestartableData<bool>(
"initialized", false)),
63 auto material_names = params.get<std::vector<PostprocessorName>>(
"material_input");
67 auto volume_names = params.get<std::vector<PostprocessorName>>(
"volume");
68 for (
unsigned int i = 0; i < volume_names.size(); ++i)
69 _volume[i] = &getPostprocessorValueByName(volume_names[i]);
81 ": Negative number of moles calculated as an input for the cavity pressure");
88 mooseError(
"In ", _name,
": Unknown quantity.");
103 if (MooseUtils::absoluteFuzzyLessEqual(init_temp, 0.0))
104 mooseError(
"Cannot have initial temperature of zero when initializing cavity pressure. "
105 "Does the supplied Postprocessor for temperature execute at initial?");
134 for (
unsigned int i = 0; i <
_volume.size(); ++i)