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;
registerMooseObject("SubChannelApp", SCMPlanarMean)
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()
Calculates a mass flow averaged mean of a subchannel variable on a plane.
const Real & _height
axial location [m]
const SubChannelMesh & _mesh
geometric information
virtual void execute() override
AuxVariableName const & _variable
name of variable
SCMPlanarMean(const InputParameters ¶ms)
Real _mean_value
average value we want to calculate
virtual Real getValue() const override
static InputParameters validParams()
Provide a simple RAII interface for linear lagrange solution variables.
Base class for subchannel meshes.
virtual unsigned int getNumOfChannels() const =0
Return the number of channels per layer.
virtual const Real & getHeatedLength() const
Return heated length.
virtual const Real & getHeatedLengthExit() const
Return unheated length at exit.
virtual const Real & getHeatedLengthEntry() const
Return unheated length at entry.
virtual const std::vector< Real > & getZGrid() const
Get axial location of layers.
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.
FEProblemBase & _fe_problem