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 "HSBoundaryRadiation.h" 11 : #include "HeatConductionModel.h" 12 : #include "HeatStructureInterface.h" 13 : #include "HeatStructureCylindricalBase.h" 14 : 15 : registerMooseObject("ThermalHydraulicsApp", HSBoundaryRadiation); 16 : 17 : InputParameters 18 44 : HSBoundaryRadiation::validParams() 19 : { 20 44 : InputParameters params = HSBoundary::validParams(); 21 : 22 88 : params.addRequiredParam<MooseFunctorName>("emissivity", "Emissivity functor [-]"); 23 88 : params.addParam<MooseFunctorName>("view_factor", 1.0, "View factor functor [-]"); 24 88 : params.addRequiredParam<MooseFunctorName>("T_ambient", "Ambient temperature functor [K]"); 25 88 : params.addParam<MooseFunctorName>( 26 88 : "scale", 1.0, "Functor by which to scale the boundary condition"); 27 88 : params.addParam<bool>( 28 : "scale_heat_rate_pp", 29 88 : true, 30 : "If true, the scaling function is applied to the heat rate post-processor."); 31 : 32 44 : params.addClassDescription("Radiative heat transfer boundary condition for heat structure"); 33 : 34 44 : return params; 35 0 : } 36 : 37 22 : HSBoundaryRadiation::HSBoundaryRadiation(const InputParameters & params) : HSBoundary(params) {} 38 : 39 : void 40 22 : HSBoundaryRadiation::addMooseObjects() 41 : { 42 22 : const HeatStructureInterface & hs = getComponent<HeatStructureInterface>("hs"); 43 : const HeatStructureCylindricalBase * hs_cyl = 44 22 : dynamic_cast<const HeatStructureCylindricalBase *>(&hs); 45 : const bool is_cylindrical = hs_cyl != nullptr; 46 : 47 : { 48 : const std::string class_name = 49 36 : is_cylindrical ? "ADRadiativeHeatFluxRZBC" : "ADRadiativeHeatFluxBC"; 50 22 : InputParameters pars = _factory.getValidParams(class_name); 51 44 : pars.set<NonlinearVariableName>("variable") = HeatConductionModel::TEMPERATURE; 52 22 : pars.set<std::vector<BoundaryName>>("boundary") = _boundary; 53 66 : pars.set<MooseFunctorName>("emissivity") = getParam<MooseFunctorName>("emissivity"); 54 66 : pars.set<MooseFunctorName>("T_ambient") = getParam<MooseFunctorName>("T_ambient"); 55 66 : pars.set<MooseFunctorName>("view_factor") = getParam<MooseFunctorName>("view_factor"); 56 22 : if (is_cylindrical) 57 : { 58 8 : pars.set<Point>("axis_point") = hs_cyl->getPosition(); 59 8 : pars.set<RealVectorValue>("axis_dir") = hs_cyl->getDirection(); 60 : } 61 66 : pars.set<MooseFunctorName>("scale") = getParam<MooseFunctorName>("scale"); 62 : 63 44 : getTHMProblem().addBoundaryCondition(class_name, genName(name(), "bc"), pars); 64 22 : } 65 : 66 : // Create integral PP for cylindrical heat structures 67 22 : if (is_cylindrical) 68 : { 69 8 : const std::string class_name = "HeatRateRadiationRZ"; 70 8 : InputParameters pars = _factory.getValidParams(class_name); 71 16 : pars.set<std::vector<BoundaryName>>("boundary") = _boundary; 72 24 : pars.set<std::vector<VariableName>>("T") = {HeatConductionModel::TEMPERATURE}; 73 24 : pars.set<MooseFunctorName>("T_ambient") = getParam<MooseFunctorName>("T_ambient"); 74 24 : pars.set<MooseFunctorName>("emissivity") = getParam<MooseFunctorName>("emissivity"); 75 24 : pars.set<MooseFunctorName>("view_factor") = getParam<MooseFunctorName>("view_factor"); 76 8 : pars.set<Point>("axis_point") = hs_cyl->getPosition(); 77 8 : pars.set<RealVectorValue>("axis_dir") = hs_cyl->getDirection(); 78 16 : if (getParam<bool>("scale_heat_rate_pp")) 79 24 : pars.set<MooseFunctorName>("scale") = getParam<MooseFunctorName>("scale"); 80 32 : pars.set<ExecFlagEnum>("execute_on") = {EXEC_INITIAL, EXEC_TIMESTEP_END}; 81 16 : getTHMProblem().addPostprocessor(class_name, genSafeName(name(), "integral"), pars); 82 8 : } 83 30 : }