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 "HeatStructure2DCoupler.h" 11 : #include "HeatStructureCylindricalBase.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", HeatStructure2DCoupler); 14 : 15 : InputParameters 16 112 : HeatStructure2DCoupler::validParams() 17 : { 18 112 : InputParameters params = HeatStructure2DCouplerBase::validParams(); 19 : 20 224 : params.addRequiredParam<FunctionName>("heat_transfer_coefficient", 21 : "Heat transfer coefficient function [W/(m^2-K)]"); 22 : 23 112 : params.addClassDescription( 24 : "Couples boundaries of two 2D heat structures via a heat transfer coefficient"); 25 : 26 112 : return params; 27 0 : } 28 : 29 56 : HeatStructure2DCoupler::HeatStructure2DCoupler(const InputParameters & parameters) 30 56 : : HeatStructure2DCouplerBase(parameters) 31 : { 32 56 : } 33 : 34 : void 35 56 : HeatStructure2DCoupler::check() const 36 : { 37 56 : HeatStructure2DCouplerBase::check(); 38 : 39 56 : if (!_mesh_alignment.meshesAreAligned()) 40 6 : logError("The primary and secondary boundaries must be aligned."); 41 56 : } 42 : 43 : void 44 40 : HeatStructure2DCoupler::addMooseObjects() 45 : { 46 : HeatStructure2DCouplerBase::addMooseObjects(); 47 : 48 120 : for (unsigned int i = 0; i < 2; i++) 49 : { 50 80 : const HeatStructureBase & hs = getComponentByName<HeatStructureBase>(_hs_names[i]); 51 : 52 : const std::string class_name = 53 112 : _is_cylindrical[i] ? "HeatStructure2DCouplerRZBC" : "HeatStructure2DCouplerBC"; 54 80 : InputParameters params = _factory.getValidParams(class_name); 55 160 : params.set<NonlinearVariableName>("variable") = HeatConductionModel::TEMPERATURE; 56 160 : params.set<std::string>("coupled_variable") = HeatConductionModel::TEMPERATURE; 57 240 : params.set<std::vector<BoundaryName>>("boundary") = {_hs_boundaries[i]}; 58 80 : params.set<MeshAlignment *>("_mesh_alignment") = &_mesh_alignment; 59 160 : params.set<FunctionName>("heat_transfer_coefficient") = 60 160 : getParam<FunctionName>("heat_transfer_coefficient"); 61 80 : params.set<Real>("coupling_area_fraction") = _coupling_area_fractions[i]; 62 80 : if (_is_cylindrical[i]) 63 : { 64 48 : params.set<Point>("axis_point") = hs.getPosition(); 65 48 : params.set<RealVectorValue>("axis_dir") = hs.getDirection(); 66 : } 67 80 : getTHMProblem().addBoundaryCondition(class_name, genName(name(), class_name, i), params); 68 80 : } 69 40 : }