https://mooseframework.inl.gov
ThermalHydraulicsApp.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 "ThermalHydraulicsApp.h"
11 #include "THMSyntax.h"
12 #include "HeatTransferApp.h"
13 #include "FluidPropertiesApp.h"
14 #include "NavierStokesApp.h"
15 #include "RayTracingApp.h"
16 #include "RdgApp.h"
17 #include "SolidPropertiesApp.h"
18 #include "MiscApp.h"
19 
20 #include "AppFactory.h"
21 #include "Simulation.h"
22 
23 #include "FlowModelSinglePhase.h"
27 
28 std::map<THM::FlowModelID, std::string> ThermalHydraulicsApp::_flow_model_map;
29 
30 namespace THM
31 {
32 
35 {
36  static FlowModelID flow_model_id = 0;
37  flow_model_id++;
38  return flow_model_id;
39 }
40 
46 
47 } // namespace THM
48 
51 {
53  params.set<bool>("use_legacy_output_syntax") = false;
54  params.set<bool>("use_legacy_material_output") = false;
55  params.set<bool>("use_legacy_initial_residual_evaluation_behavior") = false;
56  return params;
57 }
58 
59 registerKnownLabel("ThermalHydraulicsApp");
60 
62  : MooseApp(parameters)
63 {
65 }
66 
68 
69 void
71 {
72  Registry::registerObjectsTo(f, {"ThermalHydraulicsApp"});
73  Registry::registerActionsTo(af, {"ThermalHydraulicsApp"});
74 
79  RdgApp::registerAll(f, af, s);
81  MiscApp::registerAll(f, af, s);
82 
85 
86  // flow models
87  registerFlowModel(THM::FM_SINGLE_PHASE, FlowModelSinglePhase);
88 
89  // Component variable ordering:
90  // Note that this particular order ({rhoA, rhoEA, rhouA}) corresponds to the
91  // the alphabetic ordering, which was the ordering used before this ordering
92  // feature was implemented. We preserve this order for ease of transition,
93  // but an order such as {rhoA, rhouA, rhoEA} may work as well.
102 }
103 
104 const std::string &
106 {
107  const auto it = _flow_model_map.find(flow_model_id);
108  if (it == _flow_model_map.end())
109  mooseError("Flow model with ID '" + Moose::stringify(flow_model_id) +
110  "' is not associated with any flow models class. Register your flow model class to "
111  "a flow model ID by calling registerFlowModel().");
112  return it->second;
113 }
114 
115 void
117 {
118  registerApp(ThermalHydraulicsApp);
119 
127 }
128 
129 //
130 // Dynamic Library Entry Points - DO NOT MODIFY
131 //
132 extern "C" void
134 {
136 }
137 
138 extern "C" void
140 {
142 }
static void registerApps()
unsigned int FlowModelID
static std::map< THM::FlowModelID, std::string > _flow_model_map
Map from flow model ID to flow model instance.
ThermalHydraulicsApp(const InputParameters &parameters)
static InputParameters validParams()
void mooseError(Args &&... args)
static void registerApps()
static void registerAll(Factory &f, ActionFactory &af, Syntax &s)
Definition: MiscApp.C:36
void registerActions(Syntax &syntax)
Definition: THMSyntax.C:43
T & set(const std::string &name, bool quiet_mode=false)
static void registerObjectsTo(Factory &f, const std::set< std::string > &labels)
Syntax _syntax
static void registerAll(Factory &f, ActionFactory &af, Syntax &s)
Definition: RayTracingApp.C:38
static InputParameters validParams()
void associateSyntax(Syntax &syntax)
Definition: THMSyntax.C:18
static void registerApps()
Definition: RayTracingApp.C:57
static void registerAll(Factory &f, ActionFactory &af, Syntax &s)
FlowModelID FM_TWO_PHASE
static void registerActionsTo(ActionFactory &f, const std::set< std::string > &labels)
FlowModelID registerFlowModelID()
Register a new flow mode type and return its ID.
void ThermalHydraulicsApp__registerApps()
Real f(Real x)
Test function for Brents method.
static const std::string RHOUA
FlowModelID FM_SINGLE_PHASE
ActionFactory _action_factory
static const std::string RHOA
FlowModelID FM_INVALID
static void registerApps()
Definition: RdgApp.C:44
static void registerApps()
Definition: MiscApp.C:43
std::string stringify(const T &t)
registerKnownLabel("ThermalHydraulicsApp")
FlowModelID FM_TWO_PHASE_NCG
static void registerApps()
static void registerAll(Factory &f, ActionFactory &af, Syntax &s)
Definition: RdgApp.C:37
static void registerApps()
static void setComponentVariableOrder(const VariableName &var, int index)
Sets a component variable order index.
Definition: Simulation.C:40
Factory _factory
Flow model for a single-component, single-phase fluid using the Euler equations.
static const std::string RHOEA
static void registerAll(Factory &f, ActionFactory &af, Syntax &s)
static void registerAll(Factory &f, ActionFactory &af, Syntax &s)
FlowModelID FM_GAS_MIX
static void registerAll(Factory &f, ActionFactory &af, Syntax &s)
const std::string & getFlowModelClassName(const THM::FlowModelID &flow_model_id)
Deprecated Methods.
void ThermalHydraulicsApp__registerAll(Factory &f, ActionFactory &af, Syntax &s)
static void registerAll(Factory &f, ActionFactory &af, Syntax &s)