https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
13
16{
18 params.addRequiredParam<FunctionName>("K_prime",
19 "Form loss coefficient per unit length function [1/m]");
20
22 "Prescribe a form loss over a 1-phase flow channel given by a function");
23
24 return params;
25}
26
31
32void
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}
registerMooseObject("ThermalHydraulicsApp", FormLossFromFunction1Phase)
const std::string name
Definition Setup.h:21
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition Component.C:135
Factory & _factory
The Factory associated with the MooseApp.
Definition Component.h:497
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
InputParameters getValidParams(const std::string &name) const
Base class for prescribing a form loss over a 1-phase flow channel.
virtual void addMooseObjects() override
std::vector< SubdomainName > _flow_channel_subdomains
Subdomains corresponding to the connected flow channel.
static InputParameters validParams()
Component for prescribing a form loss over a 1-phase flow channel given by a function.
virtual void addMooseObjects() override
static InputParameters validParams()
FormLossFromFunction1Phase(const InputParameters &params)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
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.