https://mooseframework.inl.gov
FormLossFromFunction1Phase.C
Go to the documentation of this file.
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 
11 
12 registerMooseObject("ThermalHydraulicsApp", FormLossFromFunction1Phase);
13 
16 {
18  params.addRequiredParam<FunctionName>("K_prime",
19  "Form loss coefficient per unit length function [1/m]");
20 
21  params.addClassDescription(
22  "Prescribe a form loss over a 1-phase flow channel given by a function");
23 
24  return params;
25 }
26 
28  : FormLoss1PhaseBase(params)
29 {
30 }
31 
32 void
34 {
36 
37  {
38  const std::string class_name = "ADGenericFunctionMaterial";
39  InputParameters params = _factory.getValidParams(class_name);
40  params.set<std::vector<SubdomainName>>("block") = _flow_channel_subdomains;
41  params.set<std::vector<std::string>>("prop_names") = {"K_prime"};
42  params.set<std::vector<FunctionName>>("prop_values") = {getParam<FunctionName>("K_prime")};
43  getTHMProblem().addMaterial(class_name, genName(name(), "k_prime_material"), params);
44  }
45 }
std::string genName(const std::string &prefix, unsigned int id, const std::string &suffix="") const
Build a name from a prefix, number and possible suffix.
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
Component for prescribing a form loss over a 1-phase flow channel given by a function.
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
virtual void addMooseObjects() override
Base class for prescribing a form loss over a 1-phase flow channel.
static InputParameters validParams()
virtual const std::string & name() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("ThermalHydraulicsApp", FormLossFromFunction1Phase)
std::vector< SubdomainName > _flow_channel_subdomains
Subdomains corresponding to the connected flow channel.
FormLossFromFunction1Phase(const InputParameters &params)
virtual void addMooseObjects() override
Factory & _factory
The Factory associated with the MooseApp.
Definition: Component.h:446
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)