Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "GeneralUserObject.h" 13 : 14 : class CavityPressureUserObject : public GeneralUserObject 15 : { 16 : public: 17 : static InputParameters validParams(); 18 : 19 : CavityPressureUserObject(const InputParameters & parameters); 20 : 21 : virtual void execute() override; 22 : virtual void initialize() override; 23 0 : virtual void finalize() override {} 24 : 25 : virtual Real computeCavityVolume(); 26 : 27 : Real getValue(const MooseEnum & quantity) const; 28 : 29 : protected: 30 : enum CAVITY_PRESSURE_USEROBJECT_QUANTITY 31 : { 32 : INITIAL_MOLES, 33 : CAVITY_PRESSURE 34 : }; 35 : 36 : /// The pressure within the cavity. 37 : Real & _cavity_pressure; 38 : 39 : /// Initial number of moles of gas. 40 : Real & _n0; 41 : 42 : const Real _initial_pressure; 43 : 44 : /// Postprocessors containing additional material released to the cavity. 45 : std::vector<const PostprocessorValue *> _material_input; 46 : 47 : /// Postprocessors whose sum equal the meshed cavity volume. 48 : std::vector<const PostprocessorValue *> _volume; 49 : 50 : /// The ideal gas constant. 51 : const Real _R; 52 : 53 : /// Reference to a postprocessor that contains the cavity temperature. 54 : const Real & _temperature; 55 : 56 : /// Whether or not an initial temperature is given. 57 : const bool _init_temp_given; 58 : 59 : /// The initial temperature. 60 : const Real _init_temp; 61 : 62 : /// The total time to ramp up the pressure to its initial value. 63 : const Real _startup_time; 64 : 65 : bool & _initialized; 66 : 67 : /// Additional volume that communicates with the cavity volume but is not meshed. 68 : std::vector<const PostprocessorValue *> _additional_volumes; 69 : 70 : /// The temperature of the additional volume. 71 : std::vector<const PostprocessorValue *> _temperature_of_additional_volumes; 72 : 73 : /// The time at which the pressure is at its maximum values 74 : Real _start_time; 75 : };