21 "and an initial moles of gas quantity.");
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.");
31 "R",
"R > 0.0",
"The universal gas constant for the units used.");
33 "temperature",
"The name of the average temperature postprocessor value.");
35 "initial_temperature",
"initial_temperature > 0.0",
"Initial temperature (optional)");
38 "The name of the postprocessor(s) that holds the value of the internal volume in the cavity");
40 params.
addParam<std::vector<PostprocessorName>>(
42 "The name of the postprocessor(s) that hold additional volumes that are connected to the " 43 "cavity but not meshed.");
44 params.
addParam<std::vector<PostprocessorName>>(
45 "temperature_of_additional_volumes",
46 "The name of the postprocessor(s) that hold the temperatures of the additional volumes.");
50 "The amount of time during which the pressure will ramp from zero to its true value.");
51 params.
set<
bool>(
"use_displaced_mesh") =
true;
58 _cavity_pressure(declareRestartableData<
Real>(
"cavity_pressure", 0.0)),
59 _n0(declareRestartableData<
Real>(
"initial_moles", 0.0)),
60 _initial_pressure(getParam<
Real>(
"initial_pressure")),
61 _material_input(params.
get<
std::vector<PostprocessorName>>(
"material_input").size()),
62 _volume(params.
get<
std::vector<PostprocessorName>>(
"volume").size()),
63 _R(getParam<
Real>(
"R")),
64 _temperature(getPostprocessorValue(
"temperature")),
65 _init_temp_given(isParamValid(
"initial_temperature")),
66 _init_temp(_init_temp_given ? getParam<
Real>(
"initial_temperature") : 0.0),
67 _startup_time(getParam<
Real>(
"startup_time")),
68 _initialized(declareRestartableData<bool>(
"initialized", false)),
70 isParamValid(
"additional_volumes")
71 ? params.
get<
std::vector<PostprocessorName>>(
"additional_volumes").size()
73 _temperature_of_additional_volumes(
74 isParamValid(
"temperature_of_additional_volumes")
75 ? params.
get<
std::vector<PostprocessorName>>(
"temperature_of_additional_volumes").size()
79 auto material_names = params.
get<std::vector<PostprocessorName>>(
"material_input");
83 auto volume_names = params.
get<std::vector<PostprocessorName>>(
"volume");
84 for (
unsigned int i = 0; i < volume_names.size(); ++i)
88 mooseError(
"Both additional volumes and their corresponding temperatures must be specified");
92 "The number of additional volumes and temperatures of additional volumes musts be equal.");
94 auto additional_volume_names = params.
get<std::vector<PostprocessorName>>(
"additional_volumes");
98 auto temperature_of_additional_volume_names =
99 params.
get<std::vector<PostprocessorName>>(
"temperature_of_additional_volumes");
114 ": Negative number of moles calculated as an input for the cavity pressure");
138 mooseError(
"Cannot have initial temperature of zero when initializing cavity pressure. " 139 "Does the supplied Postprocessor for temperature execute at initial?");
141 Real volume_temp_ratio = cavity_volume / init_temp;
180 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
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
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)