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 "FunctorClosures.h" 11 : #include "FlowChannelBase.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", FunctorClosures); 14 : 15 : InputParameters 16 54 : FunctorClosures::validParams() 17 : { 18 54 : InputParameters params = ClosuresBase::validParams(); 19 : 20 108 : params.addRequiredParam<std::vector<MooseFunctorName>>( 21 : "functors", 22 : "The functors defining each material property. Each entry is paired with the corresponding " 23 : "entry in 'properties'."); 24 108 : params.addRequiredParam<std::vector<MaterialPropertyName>>("properties", 25 : "The material properties to create"); 26 : 27 54 : params.addClassDescription("Creates arbitrary closures from functors."); 28 : 29 54 : return params; 30 0 : } 31 : 32 27 : FunctorClosures::FunctorClosures(const InputParameters & params) : ClosuresBase(params) {} 33 : 34 : void 35 27 : FunctorClosures::addMooseObjectsFlowChannel(const FlowChannelBase & flow_channel) 36 : { 37 27 : const auto & functor_names = getParam<std::vector<MooseFunctorName>>("functors"); 38 54 : const auto & property_names = getParam<std::vector<MaterialPropertyName>>("properties"); 39 : 40 27 : if (functor_names.size() != property_names.size()) 41 0 : mooseError("The parameters 'functors' and 'properties' must have the same size."); 42 : 43 27 : const std::string class_name = "MaterialFunctorConverter"; 44 27 : InputParameters params = _factory.getValidParams(class_name); 45 27 : params.set<std::vector<SubdomainName>>("block") = flow_channel.getSubdomainNames(); 46 27 : params.set<std::vector<MooseFunctorName>>("functors_in") = functor_names; 47 27 : params.set<std::vector<MaterialPropertyName>>("ad_props_out") = property_names; 48 27 : _sim.addMaterial(class_name, genName(flow_channel.name(), name()), params); 49 54 : } 50 : 51 : void 52 36 : FunctorClosures::addMooseObjectsHeatTransfer(const HeatTransferBase & /*heat_transfer*/, 53 : const FlowChannelBase & /*flow_channel*/) 54 : { 55 36 : }