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 "HSBoundaryExternalAppTemperature.h" 11 : #include "HeatConductionModel.h" 12 : #include "HeatStructureInterface.h" 13 : #include "GeometricalComponent.h" 14 : 15 : registerMooseObject("ThermalHydraulicsApp", HSBoundaryExternalAppTemperature); 16 : 17 : InputParameters 18 36 : HSBoundaryExternalAppTemperature::validParams() 19 : { 20 36 : InputParameters params = HSBoundary::validParams(); 21 72 : params.addParam<VariableName>( 22 : "T_ext", 23 : "T_ext", 24 : "Name of the variable that will store the values computed by the external application"); 25 36 : params.addClassDescription("Heat structure boundary condition to set temperature values computed " 26 : "by an external application"); 27 36 : return params; 28 0 : } 29 : 30 18 : HSBoundaryExternalAppTemperature::HSBoundaryExternalAppTemperature(const InputParameters & params) 31 36 : : HSBoundary(params), _T_ext_var_name(getParam<VariableName>("T_ext")) 32 : { 33 18 : } 34 : 35 : void 36 18 : HSBoundaryExternalAppTemperature::addVariables() 37 : { 38 36 : const HeatStructureInterface & hs = getComponent<HeatStructureInterface>("hs"); 39 : const std::vector<SubdomainName> & subdomain_names = 40 18 : hs.getGeometricalComponent().getSubdomainNames(); 41 : 42 18 : getTHMProblem().addSimVariable( 43 : false, _T_ext_var_name, HeatConductionModel::feType(), subdomain_names); 44 18 : } 45 : 46 : void 47 18 : HSBoundaryExternalAppTemperature::addMooseObjects() 48 : { 49 : { 50 18 : std::string class_name = "ADMatchedValueBC"; 51 18 : InputParameters pars = _factory.getValidParams(class_name); 52 36 : pars.set<NonlinearVariableName>("variable") = HeatConductionModel::TEMPERATURE; 53 18 : pars.set<std::vector<BoundaryName>>("boundary") = _boundary; 54 54 : pars.set<std::vector<VariableName>>("v") = {_T_ext_var_name}; 55 36 : getTHMProblem().addBoundaryCondition(class_name, genName(name(), "bc"), pars); 56 18 : } 57 36 : }