https://mooseframework.inl.gov
FormLossFromExternalApp1Phase.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", FormLossFromExternalApp1Phase);
13 
16 {
18 
19  params.addClassDescription("Apply a distributed form loss over a 1-phase flow channel computed "
20  "by an external application.");
21 
22  return params;
23 }
24 
26  : FormLoss1PhaseBase(params), _K_prime_var_name("K_prime")
27 {
28 }
29 
30 void
32 {
35 }
36 
37 void
39 {
41 
42  {
43  const std::string class_name = "ADCoupledVariableValueMaterial";
44  InputParameters params = _factory.getValidParams(class_name);
45  params.set<std::vector<SubdomainName>>("block") = _flow_channel_subdomains;
46  params.set<MaterialPropertyName>("prop_name") = "K_prime";
47  params.set<std::vector<VariableName>>("coupled_variable") = {_K_prime_var_name};
48  getTHMProblem().addMaterial(class_name, genName(name(), "k_prime_material"), params);
49  }
50 }
LAGRANGE
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
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
FIRST
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 addSimVariable(bool nl, const VariableName &name, libMesh::FEType fe_type, Real scaling_factor=1.0)
Queues a variable of type MooseVariableScalar to be added to the nonlinear or aux system...
Definition: Simulation.C:271
FormLossFromExternalApp1Phase(const InputParameters &params)
VariableName _K_prime_var_name
Name of the variable that stores the distributed form loss coefficient.
registerMooseObject("ThermalHydraulicsApp", FormLossFromExternalApp1Phase)
std::vector< SubdomainName > _flow_channel_subdomains
Subdomains corresponding to the connected flow channel.
Factory & _factory
The Factory associated with the MooseApp.
Definition: Component.h:446
A component for prescribing a form loss computed by an external application.
void addClassDescription(const std::string &doc_string)