https://mooseframework.inl.gov
Closures1PhaseBase.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 
10 #include "Closures1PhaseBase.h"
11 #include "FlowModelSinglePhase.h"
12 #include "FlowChannel1Phase.h"
13 
16 {
18  return params;
19 }
20 
22 
23 void
25 {
26  const FunctionName & f_D_fn_name = flow_channel.getParam<FunctionName>("f");
27  flow_channel.makeFunctionControllableIfConstant(f_D_fn_name, "f");
28 
29  const std::string class_name = "ADWallFrictionFunctionMaterial";
30  InputParameters params = _factory.getValidParams(class_name);
31  params.set<std::vector<SubdomainName>>("block") = flow_channel.getSubdomainNames();
32  params.set<MaterialPropertyName>("f_D") = FlowModelSinglePhase::FRICTION_FACTOR_DARCY;
33  params.set<FunctionName>("function") = f_D_fn_name;
34  _sim.addMaterial(class_name, genName(flow_channel.name(), "f_wall_fn_mat"), params);
35 }
36 
37 void
39 {
40  const std::string class_name = "ADAverageWallTemperature3EqnMaterial";
41  InputParameters params = _factory.getValidParams(class_name);
42  params.set<std::vector<SubdomainName>>("block") = flow_channel.getSubdomainNames();
43  params.set<std::vector<VariableName>>("T_wall_sources") = flow_channel.getWallTemperatureNames();
44  params.set<std::vector<MaterialPropertyName>>("Hw_sources") =
45  flow_channel.getWallHTCNames1Phase();
46  params.set<std::vector<VariableName>>("P_hf_sources") = flow_channel.getHeatedPerimeterNames();
47  params.set<std::vector<VariableName>>("P_hf_total") = {FlowModel::HEAT_FLUX_PERIMETER};
48  params.set<std::vector<VariableName>>("T_fluid") = {FlowModelSinglePhase::TEMPERATURE};
49  _sim.addMaterial(class_name, genName(flow_channel.name(), "avg_T_wall_3eqn_mat"), params);
50 }
THMProblem & _sim
Simulation.
Definition: ClosuresBase.h:100
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.
std::vector< VariableName > getHeatedPerimeterNames() const
Gets heated perimeter names for connected heat transfers.
static const std::string TEMPERATURE
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
T & set(const std::string &name, bool quiet_mode=false)
static InputParameters validParams()
InputParameters getValidParams(const std::string &name) const
std::vector< VariableName > getWallTemperatureNames() const
Gets wall temperature names for connected heat transfers.
static InputParameters validParams()
Definition: ClosuresBase.C:14
void addAverageWallTemperatureMaterial(const FlowChannel1Phase &flow_channel) const
Adds average wall temperature material.
void makeFunctionControllableIfConstant(const FunctionName &fn_name, const std::string &control_name, const std::string &param="value") const
Makes a function controllable if it is constant.
Definition: Component.C:141
virtual const std::string & name() const
Base class for closures implementations.
Definition: ClosuresBase.h:28
Single-component, single-phase flow channel.
const T & getParam(const std::string &name) const
static const std::string FRICTION_FACTOR_DARCY
std::vector< MaterialPropertyName > getWallHTCNames1Phase() const
Gets 1-phase wall heat transfer coefficient names for connected heat transfers.
Factory & _factory
Factory associated with the MooseApp.
Definition: ClosuresBase.h:103
static const std::string HEAT_FLUX_PERIMETER
Definition: FlowModel.h:105
Closures1PhaseBase(const InputParameters &params)
void addWallFrictionFunctionMaterial(const FlowChannel1Phase &flow_channel) const
Adds material that computes wall friction factor from a specified function.
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
Definition: Component.C:307