https://mooseframework.inl.gov
SCMPowerPostprocessor.C
Go to the documentation of this file.
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 #include "SCMPowerPostprocessor.h"
11 #include "FEProblemBase.h"
12 #include "MooseMesh.h"
13 #include "SCM.h"
15 
17 
20 {
22  params.addClassDescription(
23  "Calculates the total power of the assembly based on the distribution of variable q_prime");
24  return params;
25 }
26 
28  : GeneralPostprocessor(parameters),
29  _mesh(SCM::getConstMesh<SubChannelMesh>(_fe_problem.mesh())),
30  _value(0)
31 {
32 }
33 
34 void
36 {
37  const auto scm_problem = dynamic_cast<SubChannel1PhaseProblem *>(&_fe_problem);
38  const auto nz = _mesh.getNumOfAxialCells();
39  const auto n_channels = _mesh.getNumOfChannels();
40  if (!scm_problem)
41  mooseError("SCMPowerPostprocessor can only be used within a subchannel 1phase problem.");
42  auto power = 0.0;
43  for (unsigned int iz = 1; iz < nz + 1; iz++)
44  for (unsigned int i_ch = 0; i_ch < n_channels; i_ch++)
45  power += scm_problem->computeAddedHeatPin(i_ch, iz);
46  _value = power;
47 }
48 
49 Real
51 {
52  return _value;
53 }
virtual const unsigned int & getNumOfChannels() const =0
Return the number of channels per layer.
Calculates the total power of the subchannel assmbly based on the variable q_prime.
SCMPowerPostprocessor(const InputParameters &params)
const SubChannelMesh & _mesh
geometric information
MeshBase & mesh
registerMooseObject("SubChannelApp", SCMPowerPostprocessor)
static InputParameters validParams()
virtual Real getValue() const override
const T & getConstMesh(const MooseMesh &mesh)
function to cast const mesh
Definition: SCM.h:21
Base class for the 1-phase steady-state/transient subchannel solver.
virtual void execute() override
virtual const unsigned int & getNumOfAxialCells() const
Return the number of axial cells.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
Base class for subchannel meshes.
static InputParameters validParams()
Definition: SCM.h:16
Real _value
value we want to calculate