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 : #include "SCMDuctHeatRatePostprocessor.h" 11 : #include "FEProblemBase.h" 12 : #include "MooseMesh.h" 13 : #include "SCM.h" 14 : #include "SubChannel1PhaseProblem.h" 15 : 16 : registerMooseObject("SubChannelApp", SCMDuctHeatRatePostprocessor); 17 : 18 : InputParameters 19 14 : SCMDuctHeatRatePostprocessor::validParams() 20 : { 21 14 : InputParameters params = GeneralPostprocessor::validParams(); 22 14 : params.addClassDescription("Calculates the heat flow that goes into the coolant through the duct " 23 : "based on aux variable duct_heat_flux"); 24 14 : return params; 25 0 : } 26 : 27 7 : SCMDuctHeatRatePostprocessor::SCMDuctHeatRatePostprocessor(const InputParameters & parameters) 28 : : GeneralPostprocessor(parameters), 29 7 : _mesh(SCM::getConstMesh<SubChannelMesh>(_fe_problem.mesh())), 30 7 : _value(0) 31 : { 32 7 : } 33 : 34 : void 35 7 : SCMDuctHeatRatePostprocessor::execute() 36 : { 37 7 : const auto scm_problem = dynamic_cast<SubChannel1PhaseProblem *>(&_fe_problem); 38 7 : const auto nz = _mesh.getNumOfAxialCells(); 39 7 : const auto n_channels = _mesh.getNumOfChannels(); 40 7 : if (!scm_problem) 41 0 : mooseError("SCMDuctHeatRatePostprocessor can only be used within a subchannel 1phase problem."); 42 : auto power = 0.0; 43 32 : for (unsigned int iz = 1; iz < nz + 1; iz++) 44 1075 : for (unsigned int i_ch = 0; i_ch < n_channels; i_ch++) 45 1050 : power += scm_problem->getAddedHeatDuct(i_ch, iz); 46 7 : _value = power; 47 7 : } 48 : 49 : Real 50 7 : SCMDuctHeatRatePostprocessor::getValue() const 51 : { 52 7 : return _value; 53 : }