17 #include "libmesh/system.h" 27 "variable on a z-plane at a user defined height over all subchannels");
28 params.
addRequiredParam<AuxVariableName>(
"variable",
"Variable you want the mean of");
36 _variable(getParam<AuxVariableName>(
"variable")),
37 _height(getParam<
Real>(
"height")),
54 auto sum_sol_mass_flow = 0.0;
59 for (
unsigned int i_ch = 0; i_ch < n_channels; i_ch++)
62 mass_flow += mdot_soln(node_out);
63 sum_sol_mass_flow += Soln(node_out) * mdot_soln(node_out);
70 for (
unsigned int iz = 0; iz < nz; iz++)
74 for (
unsigned int i_ch = 0; i_ch < n_channels; i_ch++)
78 auto average_solution = Soln(node_in) + (Soln(node_out) - Soln(node_in)) *
80 (z_grid[iz + 1] - z_grid[iz]);
81 auto average_mass_flow = mdot_soln(node_in) + (mdot_soln(node_out) - mdot_soln(node_in)) *
83 (z_grid[iz + 1] - z_grid[iz]);
84 mass_flow += average_mass_flow;
85 sum_sol_mass_flow += average_solution * average_mass_flow;
const SubChannelMesh & _mesh
geometric information
SCMPlanarMean(const InputParameters ¶ms)
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
static InputParameters validParams()
FEProblemBase & _fe_problem
static InputParameters validParams()
virtual const Real & getHeatedLength() const
Return heated length.
virtual unsigned int getNumOfChannels() const =0
Return the number of channels per layer.
const T & getConstMesh(const MooseMesh &mesh)
function to cast const mesh
virtual Real getValue() const override
virtual Node * getChannelNode(unsigned int i_chan, unsigned int iz) const =0
Get the subchannel mesh node for a given channel index and elevation index.
virtual unsigned int getNumOfAxialCells() const
Return the number of axial cells.
const Real & _height
axial location [m]
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
AuxVariableName const & _variable
name of variable
Real _mean_value
average value we want to calculate
Base class for subchannel meshes.
virtual const Real & getHeatedLengthExit() const
Return unheated length at exit.
virtual const Real & getHeatedLengthEntry() const
Return unheated length at entry.
Calculates a mass flow averaged mean of a subchannel variable on a plane.