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 "FormLossFromFunction1Phase.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", FormLossFromFunction1Phase); 13 : 14 : InputParameters 15 52 : FormLossFromFunction1Phase::validParams() 16 : { 17 52 : InputParameters params = FormLoss1PhaseBase::validParams(); 18 104 : params.addRequiredParam<FunctionName>("K_prime", 19 : "Form loss coefficient per unit length function [1/m]"); 20 : 21 52 : params.addClassDescription( 22 : "Prescribe a form loss over a 1-phase flow channel given by a function"); 23 : 24 52 : return params; 25 0 : } 26 : 27 26 : FormLossFromFunction1Phase::FormLossFromFunction1Phase(const InputParameters & params) 28 26 : : FormLoss1PhaseBase(params) 29 : { 30 26 : } 31 : 32 : void 33 26 : FormLossFromFunction1Phase::addMooseObjects() 34 : { 35 26 : FormLoss1PhaseBase::addMooseObjects(); 36 : 37 : { 38 26 : const std::string class_name = "ADGenericFunctionMaterial"; 39 26 : InputParameters params = _factory.getValidParams(class_name); 40 26 : params.set<std::vector<SubdomainName>>("block") = _flow_channel_subdomains; 41 78 : params.set<std::vector<std::string>>("prop_names") = {"K_prime"}; 42 78 : params.set<std::vector<FunctionName>>("prop_values") = {getParam<FunctionName>("K_prime")}; 43 52 : getTHMProblem().addMaterial(class_name, genName(name(), "k_prime_material"), params); 44 26 : } 45 104 : }