19 "and an initial moles of gas quantity.");
23 "initial_pressure >= 0.0",
24 "The initial pressure in the cavity. If not given, a zero initial pressure will be used.");
25 params.
addParam<std::vector<PostprocessorName>>(
"material_input",
26 "The name of the postprocessor(s) that holds the " 27 "amount of material injected into the cavity.");
29 "R",
"R > 0.0",
"The universal gas constant for the units used.");
31 "temperature",
"The name of the average temperature postprocessor value.");
33 "initial_temperature",
"initial_temperature > 0.0",
"Initial temperature (optional)");
36 "The name of the postprocessor(s) that holds the value of the internal volume in the cavity");
38 params.
addParam<std::vector<PostprocessorName>>(
40 "The name of the postprocessor(s) that hold additional volumes that are connected to the " 41 "cavity but not meshed.");
42 params.
addParam<std::vector<PostprocessorName>>(
43 "temperature_of_additional_volumes",
44 "The name of the postprocessor(s) that hold the temperatures of the additional volumes.");
48 "The amount of time during which the pressure will ramp from zero to its true value.");
49 params.
set<
bool>(
"use_displaced_mesh") =
true;
56 _cavity_pressure(declareRestartableData<
Real>(
"cavity_pressure", 0.0)),
57 _n0(declareRestartableData<
Real>(
"initial_moles", 0.0)),
58 _initial_pressure(getParam<
Real>(
"initial_pressure")),
59 _material_input(params.
get<
std::vector<PostprocessorName>>(
"material_input").size()),
60 _volume(params.
get<
std::vector<PostprocessorName>>(
"volume").size()),
61 _R(getParam<
Real>(
"R")),
62 _temperature(getPostprocessorValue(
"temperature")),
63 _init_temp_given(isParamValid(
"initial_temperature")),
64 _init_temp(_init_temp_given ? getParam<
Real>(
"initial_temperature") : 0.0),
65 _startup_time(getParam<
Real>(
"startup_time")),
66 _initialized(declareRestartableData<bool>(
"initialized", false)),
68 isParamValid(
"additional_volumes")
69 ? params.
get<
std::vector<PostprocessorName>>(
"additional_volumes").size()
71 _temperature_of_additional_volumes(
72 isParamValid(
"temperature_of_additional_volumes")
73 ? params.
get<
std::vector<PostprocessorName>>(
"temperature_of_additional_volumes").size()
77 auto material_names = params.
get<std::vector<PostprocessorName>>(
"material_input");
81 auto volume_names = params.
get<std::vector<PostprocessorName>>(
"volume");
82 for (
unsigned int i = 0; i < volume_names.size(); ++i)
86 mooseError(
"Both additional volumes and their corresponding temperatures must be specified");
90 "The number of additional volumes and temperatures of additional volumes musts be equal.");
92 auto additional_volume_names = params.
get<std::vector<PostprocessorName>>(
"additional_volumes");
96 auto temperature_of_additional_volume_names =
97 params.
get<std::vector<PostprocessorName>>(
"temperature_of_additional_volumes");
112 ": Negative number of moles calculated as an input for the cavity pressure");
136 mooseError(
"Cannot have initial temperature of zero when initializing cavity pressure. " 137 "Does the supplied Postprocessor for temperature execute at initial?");
139 Real volume_temp_ratio = cavity_volume / init_temp;
178 for (
unsigned int i = 0; i <
_volume.size(); ++i)
Real & _cavity_pressure
The pressure within the cavity.
Real getValue(const MooseEnum &quantity) const
static InputParameters validParams()
CavityPressureUserObject(const InputParameters ¶meters)
const Real _init_temp
The initial temperature.
std::vector< const PostprocessorValue * > _volume
Postprocessors whose sum equal the meshed cavity volume.
const Real _initial_pressure
virtual void initialize() override
std::vector< const PostprocessorValue * > _material_input
Postprocessors containing additional material released to the cavity.
virtual void execute() override
const Real _R
The ideal gas constant.
bool isParamValid(const std::string &name) const
const bool _init_temp_given
Whether or not an initial temperature is given.
std::vector< const PostprocessorValue * > _temperature_of_additional_volumes
The temperature of the additional volume.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
static InputParameters validParams()
registerMooseObject("SolidMechanicsApp", CavityPressureUserObject)
virtual Real computeCavityVolume()
const Real & _temperature
Reference to a postprocessor that contains the cavity temperature.
virtual const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name) const
const Real _startup_time
The total time to ramp up the pressure to its initial value.
Real & _n0
Initial number of moles of gas.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _start_time
The time at which the pressure is at its maximum values.
std::vector< const PostprocessorValue * > _additional_volumes
Additional volume that communicates with the cavity volume but is not meshed.
bool absoluteFuzzyLessEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
static const std::string pressure
void mooseError(Args &&... args) const
const Elem & get(const ElemType type_in)