17 #include "libmesh/system.h" 28 "variable on a z-plane at a user defined height over all subchannels");
29 params.
addRequiredParam<AuxVariableName>(
"variable",
"Variable you want the mean of");
37 _variable(getParam<AuxVariableName>(
"variable")),
38 _height(getParam<
Real>(
"height")),
55 auto sum_sol_mass_flow = 0.0;
60 for (
unsigned int i_ch = 0; i_ch < n_channels; i_ch++)
63 mass_flow += mdot_soln(node_out);
64 sum_sol_mass_flow += Soln(node_out) * mdot_soln(node_out);
71 for (
unsigned int iz = 0; iz < nz; iz++)
75 for (
unsigned int i_ch = 0; i_ch < n_channels; i_ch++)
79 auto average_solution = Soln(node_in) + (Soln(node_out) - Soln(node_in)) *
81 (z_grid[iz + 1] - z_grid[iz]);
82 auto average_mass_flow = mdot_soln(node_in) + (mdot_soln(node_out) - mdot_soln(node_in)) *
84 (z_grid[iz + 1] - z_grid[iz]);
85 mass_flow += average_mass_flow;
86 sum_sol_mass_flow += average_solution * average_mass_flow;
const SubChannelMesh & _mesh
geometric information
SCMPlanarMean(const InputParameters ¶ms)
virtual const unsigned int & getNumOfChannels() const =0
Return the number of channels per layer.
virtual const std::vector< Real > & getZGrid() const
Get axial location of layers.
registerMooseObject("SubChannelApp", SCMPlanarMean)
Provide a simple RAII interface for linear lagrange solution variables.
virtual void execute() override
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
virtual Node * getChannelNode(unsigned int i_chan, unsigned iz) const =0
Get the subchannel mesh node for a given channel index and elevation index.
static InputParameters validParams()
static InputParameters validParams()
virtual const Real & getHeatedLength() const
Return heated length.
const T & getConstMesh(const MooseMesh &mesh)
function to cast const mesh
virtual Real getValue() const override
const Real & _height
axial location [m]
virtual const unsigned int & getNumOfAxialCells() const
Return the number of axial cells.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
AuxVariableName const & _variable
name of variable
FEProblemBase & _fe_problem
Real _mean_value
average value we want to calculate
Base class for subchannel meshes.
virtual const Real & getHeatedLengthExit() const
Return unheated length at exit.
registerMooseObjectRenamed("SubChannelApp", PlanarMean, "06/30/2025 24:00", SCMPlanarMean)
virtual const Real & getHeatedLengthEntry() const
Return unheated length at entry.
Calculates a mass flow averaged mean of a subchannel variable on a plane.