https://mooseframework.inl.gov
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FlowModelSetup1Phase Class Reference

Helper class to set up some objects for 1-phase flow. More...

#include <FlowModelSetup1Phase.h>

Inheritance diagram for FlowModelSetup1Phase:
[legend]

Public Member Functions

 FlowModelSetup1Phase (const InputParameters &params)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void addInitialConditions () override
 
virtual void addSolutionVariables () override
 
virtual void addNonConstantAuxVariables () override
 
virtual void addMaterials () override
 
virtual void addUserObjects () override
 
void addSolutionVariable (const VariableName &var_name, const Real &scaling=1.0)
 Adds a solution variable. More...
 
void addAuxVariable (const VariableName &var_name)
 Adds an aux variable. More...
 
void addFunctionIC (const VariableName &var_name, const FunctionName &function_name)
 Adds a function initial condition. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieves a parameter. More...
 

Protected Attributes

const FunctionName _p_fn
 Pressure function name. More...
 
const FunctionName _T_fn
 Temperature function name. More...
 
const FunctionName _vel_fn
 Velocity function name. More...
 
const FunctionName _A_fn
 Area function name. More...
 
const FunctionName _D_h_fn
 Hydraulic diameter function name. More...
 
const UserObjectName _fp_1phase_name
 Single-phase fluid properties object name. More...
 
const VariableName _unity_name
 Name of unity. More...
 
const VariableName _A_name
 Name of area variable. More...
 
const VariableName _D_h_name
 Name of the hydraulic diameter. More...
 
const VariableName _rhoA_name
 Name of rho*A variable. More...
 
const VariableName _rhouA_name
 Name of rho*u*A variable. More...
 
const VariableName _rhoEA_name
 Name of rho*E*A variable. More...
 
const VariableName _rho_name
 Name of rho variable. More...
 
const VariableName _vel_name
 Name of velocity variable. More...
 
const VariableName _p_name
 Name of pressure variable. More...
 
const VariableName _T_name
 Name of temperature variable. More...
 
const VariableName _v_name
 Name of specific volume variable. More...
 
const VariableName _e_name
 Name of specific internal energy variable. More...
 
const VariableName _H_name
 Name of specific total enthalpy variable. More...
 
const VariableName _mu_name
 Name of dynamic viscosity variable. More...
 
const bool & _ad
 True for setting up testing with AD, false otherwise. More...
 
const InputParameters_this_params
 
MooseApp_this_app
 
ActionFactory_this_action_factory
 
ActionWarehouse_this_action_warehouse
 
MooseEnum _fe_family
 
MooseEnum _fe_order
 
const Real_gravity_magnitude
 Gravitational acceleration magnitude. More...
 

Detailed Description

Helper class to set up some objects for 1-phase flow.

Definition at line 17 of file FlowModelSetup1Phase.h.

Constructor & Destructor Documentation

◆ FlowModelSetup1Phase()

FlowModelSetup1Phase::FlowModelSetup1Phase ( const InputParameters params)

Definition at line 33 of file FlowModelSetup1Phase.C.

34  : FlowModelSetup(params),
35 
36  _p_fn(getParam<FunctionName>("p")),
37  _T_fn(getParam<FunctionName>("T")),
38  _vel_fn(getParam<FunctionName>("vel")),
39  _A_fn(getParam<FunctionName>("A")),
40  _D_h_fn(getParam<FunctionName>("D_h")),
41 
42  _fp_1phase_name(getParam<UserObjectName>("fp_1phase")),
43 
44  _unity_name("unity"),
45  _A_name("A"),
46  _D_h_name("D_h"),
47  _rhoA_name("rhoA"),
48  _rhouA_name("rhouA"),
49  _rhoEA_name("rhoEA"),
50  _rho_name("rho"),
51  _vel_name("vel"),
52  _p_name("p"),
53  _T_name("T"),
54  _v_name("v"),
55  _e_name("e"),
56  _H_name("H"),
57  _mu_name("mu"),
58  _ad(getParam<bool>("ad"))
59 {
60 }
const FunctionName _p_fn
Pressure function name.
const VariableName _rhoA_name
Name of rho*A variable.
const VariableName _A_name
Name of area variable.
const FunctionName _T_fn
Temperature function name.
const FunctionName _D_h_fn
Hydraulic diameter function name.
const VariableName _p_name
Name of pressure variable.
const VariableName _v_name
Name of specific volume variable.
const VariableName _rho_name
Name of rho variable.
const VariableName _rhouA_name
Name of rho*u*A variable.
const UserObjectName _fp_1phase_name
Single-phase fluid properties object name.
const VariableName _e_name
Name of specific internal energy variable.
const FunctionName _A_fn
Area function name.
const FunctionName _vel_fn
Velocity function name.
const bool & _ad
True for setting up testing with AD, false otherwise.
const VariableName _rhoEA_name
Name of rho*E*A variable.
FlowModelSetup(const InputParameters &params)
const VariableName _H_name
Name of specific total enthalpy variable.
const VariableName _vel_name
Name of velocity variable.
const VariableName _D_h_name
Name of the hydraulic diameter.
const VariableName _mu_name
Name of dynamic viscosity variable.
const VariableName _T_name
Name of temperature variable.
const VariableName _unity_name
Name of unity.

Member Function Documentation

◆ addAuxVariable()

void FlowModelSetup::addAuxVariable ( const VariableName &  var_name)
protectedinherited

Adds an aux variable.

Parameters
[in]var_namename of the variable to add

Definition at line 56 of file FlowModelSetup.C.

Referenced by ClosureTest1PhaseAction::addAuxVariables(), and addNonConstantAuxVariables().

57 {
58  const std::string class_name = "AddAuxVariableAction";
60 
61  std::shared_ptr<Action> action =
62  std::static_pointer_cast<Action>(_this_action_factory.create(class_name, var_name, params));
63 
65 }
InputParameters getValidParams(const std::string &name)
void addActionBlock(std::shared_ptr< Action > blk)
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters &parameters)
ActionWarehouse & _this_action_warehouse
ActionFactory & _this_action_factory

◆ addFunctionIC()

void FlowModelSetup::addFunctionIC ( const VariableName &  var_name,
const FunctionName &  function_name 
)
protectedinherited

Adds a function initial condition.

Parameters
[in]var_namename of the variable for which to add initial condition
[in]function_namenames of the IC function

Definition at line 68 of file FlowModelSetup.C.

Referenced by addInitialConditions().

69 {
70  const std::string class_name = "AddInitialConditionAction";
72  params.set<std::string>("type") = "FunctionIC";
73 
74  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
75  _this_action_factory.create(class_name, var_name + "_IC", params));
76 
77  action->getObjectParams().set<VariableName>("variable") = var_name;
78  action->getObjectParams().set<FunctionName>("function") = function_name;
79 
81 }
InputParameters getValidParams(const std::string &name)
T & set(const std::string &name, bool quiet_mode=false)
void addActionBlock(std::shared_ptr< Action > blk)
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters &parameters)
InputParameters & getObjectParams()
ActionWarehouse & _this_action_warehouse
ActionFactory & _this_action_factory

◆ addInitialConditions()

void FlowModelSetup1Phase::addInitialConditions ( )
overrideprotectedvirtual

Implements FlowModelSetup.

Reimplemented in ClosureTest1PhaseAction, and JacobianTest1PhaseAction.

Definition at line 63 of file FlowModelSetup1Phase.C.

Referenced by ClosureTest1PhaseAction::addInitialConditions(), and JacobianTest1PhaseAction::addInitialConditions().

64 {
65  const std::string class_name = "AddInitialConditionAction";
66 
71 
72  // rho
73  {
75  params.set<std::string>("type") = "RhoFromPressureTemperatureIC";
76 
77  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
78  _this_action_factory.create(class_name, _rho_name + "_ic", params));
79 
80  action->getObjectParams().set<VariableName>("variable") = _rho_name;
81  action->getObjectParams().set<UserObjectName>("fp") = _fp_1phase_name;
82  action->getObjectParams().set<std::vector<VariableName>>("p") = {_p_name};
83  action->getObjectParams().set<std::vector<VariableName>>("T") = {_T_name};
84 
86  }
87 
88  // rho*A
89  {
91  params.set<std::string>("type") = "VariableProductIC";
92 
93  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
94  _this_action_factory.create(class_name, _rhoA_name + "_ic", params));
95 
96  action->getObjectParams().set<VariableName>("variable") = _rhoA_name;
97  action->getObjectParams().set<std::vector<VariableName>>("values") = {_rho_name, _A_name};
98 
100  }
101  // rho*u*A
102  {
104  params.set<std::string>("type") = "VariableProductIC";
105 
106  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
107  _this_action_factory.create(class_name, _rhouA_name + "_ic", params));
108 
109  action->getObjectParams().set<VariableName>("variable") = _rhouA_name;
110  action->getObjectParams().set<std::vector<VariableName>>("values") = {
112 
114  }
115  // rho*E*A
116  {
118  params.set<std::string>("type") = "RhoEAFromPressureTemperatureVelocityIC";
119 
120  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
121  _this_action_factory.create(class_name, _rhoEA_name + "_ic", params));
122 
123  action->getObjectParams().set<VariableName>("variable") = _rhoEA_name;
124  action->getObjectParams().set<UserObjectName>("fp") = _fp_1phase_name;
125  action->getObjectParams().set<std::vector<VariableName>>("p") = {_p_name};
126  action->getObjectParams().set<std::vector<VariableName>>("T") = {_T_name};
127  action->getObjectParams().set<std::vector<VariableName>>("vel") = {_vel_name};
128  action->getObjectParams().set<std::vector<VariableName>>("A") = {_A_name};
129 
131  }
132 
133  // specific volume
134  {
136  params.set<std::string>("type") = "SpecificVolumeIC";
137 
138  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
139  _this_action_factory.create(class_name, _v_name + "_ic", params));
140 
141  action->getObjectParams().set<VariableName>("variable") = _v_name;
142  action->getObjectParams().set<std::vector<VariableName>>("rhoA") = {_rhoA_name};
143  action->getObjectParams().set<std::vector<VariableName>>("A") = {_A_name};
144 
146  }
147  // specific internal energy
148  {
150  params.set<std::string>("type") = "SpecificInternalEnergyIC";
151 
152  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
153  _this_action_factory.create(class_name, _e_name + "_ic", params));
154 
155  action->getObjectParams().set<VariableName>("variable") = _e_name;
156  action->getObjectParams().set<std::vector<VariableName>>("rhoA") = {_rhoA_name};
157  action->getObjectParams().set<std::vector<VariableName>>("rhouA") = {_rhouA_name};
158  action->getObjectParams().set<std::vector<VariableName>>("rhoEA") = {_rhoEA_name};
159 
161  }
162  // total specific enthalpy
163  {
165  params.set<std::string>("type") = "SpecificTotalEnthalpyIC";
166 
167  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
168  _this_action_factory.create(class_name, _H_name + "_ic", params));
169 
170  action->getObjectParams().set<VariableName>("variable") = _H_name;
171  action->getObjectParams().set<std::vector<VariableName>>("p") = {_p_name};
172  action->getObjectParams().set<std::vector<VariableName>>("rhoA") = {_rhoA_name};
173  action->getObjectParams().set<std::vector<VariableName>>("rhoEA") = {_rhoEA_name};
174  action->getObjectParams().set<std::vector<VariableName>>("A") = {_A_name};
175 
177  }
178 }
const FunctionName _p_fn
Pressure function name.
const VariableName _rhoA_name
Name of rho*A variable.
const VariableName _A_name
Name of area variable.
InputParameters getValidParams(const std::string &name)
const FunctionName _T_fn
Temperature function name.
T & set(const std::string &name, bool quiet_mode=false)
const VariableName _p_name
Name of pressure variable.
void addActionBlock(std::shared_ptr< Action > blk)
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters &parameters)
InputParameters & getObjectParams()
const VariableName _v_name
Name of specific volume variable.
void addFunctionIC(const VariableName &var_name, const FunctionName &function_name)
Adds a function initial condition.
const VariableName _rho_name
Name of rho variable.
const VariableName _rhouA_name
Name of rho*u*A variable.
const UserObjectName _fp_1phase_name
Single-phase fluid properties object name.
const VariableName _e_name
Name of specific internal energy variable.
const FunctionName _A_fn
Area function name.
const FunctionName _vel_fn
Velocity function name.
ActionWarehouse & _this_action_warehouse
ActionFactory & _this_action_factory
const VariableName _rhoEA_name
Name of rho*E*A variable.
const VariableName _H_name
Name of specific total enthalpy variable.
const VariableName _vel_name
Name of velocity variable.
const VariableName _T_name
Name of temperature variable.

◆ addMaterials()

void FlowModelSetup1Phase::addMaterials ( )
overrideprotectedvirtual

Reimplemented from FlowModelSetup.

Reimplemented in JacobianTest1PhaseAction, and ClosureTest1PhaseAction.

Definition at line 344 of file FlowModelSetup1Phase.C.

Referenced by ClosureTest1PhaseAction::addMaterials(), and JacobianTest1PhaseAction::addMaterials().

345 {
347 
348  const std::string class_name = "AddMaterialAction";
349 
350  // unity
351  {
353  params.set<std::string>("type") = "ConstantMaterial";
354 
355  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
356  _this_action_factory.create(class_name, "unity_material", params));
357 
358  action->getObjectParams().set<std::string>("property_name") = _unity_name;
359  action->getObjectParams().set<Real>("value") = 1.0;
360  action->getObjectParams().set<std::vector<VariableName>>("derivative_vars") = {
362 
364  }
365 
366  // fluid properties
367  {
369  if (_ad)
370  params.set<std::string>("type") = "ADFluidProperties3EqnMaterial";
371  else
372  params.set<std::string>("type") = "FluidProperties3EqnMaterial";
373 
374  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
375  _this_action_factory.create(class_name, "fluid_properties_material", params));
376 
377  action->getObjectParams().set<std::vector<VariableName>>("A") = {_A_name};
378  action->getObjectParams().set<std::vector<VariableName>>("rhoA") = {_rhoA_name};
379  action->getObjectParams().set<std::vector<VariableName>>("rhouA") = {_rhouA_name};
380  action->getObjectParams().set<std::vector<VariableName>>("rhoEA") = {_rhoEA_name};
381 
382  action->getObjectParams().set<UserObjectName>("fp") = _fp_1phase_name;
383 
385  }
386 
387  // dynamic viscosity
388  {
389  const std::string class_name = "AddMaterialAction";
390 
392  if (_ad)
393  params.set<std::string>("type") = "ADDynamicViscosityMaterial";
394  else
395  params.set<std::string>("type") = "DynamicViscosityMaterial";
396 
397  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
398  _this_action_factory.create(class_name, "mu_material", params));
399 
400  if (!_ad)
401  {
402  action->getObjectParams().set<std::vector<VariableName>>("arhoA") = {_rhoA_name};
403  action->getObjectParams().set<std::vector<VariableName>>("arhouA") = {_rhouA_name};
404  action->getObjectParams().set<std::vector<VariableName>>("arhoEA") = {_rhoEA_name};
405  }
406 
407  action->getObjectParams().set<MaterialPropertyName>("mu") = {_mu_name};
408  action->getObjectParams().set<MaterialPropertyName>("v") = {_v_name};
409  action->getObjectParams().set<MaterialPropertyName>("e") = {_e_name};
410  action->getObjectParams().set<UserObjectName>("fp_1phase") = _fp_1phase_name;
411 
413  }
414 
415  // hydraulic diameter
416  {
418  if (_ad)
419  params.set<std::string>("type") = "ADGenericFunctionMaterial";
420  else
421  params.set<std::string>("type") = "GenericFunctionMaterial";
422 
423  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
424  _this_action_factory.create(class_name, "D_h_material", params));
425 
426  action->getObjectParams().set<std::vector<std::string>>("prop_names") = {_D_h_name};
427  action->getObjectParams().set<std::vector<FunctionName>>("prop_values") = {_D_h_fn};
428 
430  }
431 }
const VariableName _rhoA_name
Name of rho*A variable.
const VariableName _A_name
Name of area variable.
InputParameters getValidParams(const std::string &name)
const FunctionName _D_h_fn
Hydraulic diameter function name.
virtual void addMaterials()
T & set(const std::string &name, bool quiet_mode=false)
void addActionBlock(std::shared_ptr< Action > blk)
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters &parameters)
InputParameters & getObjectParams()
const VariableName _v_name
Name of specific volume variable.
const VariableName _rhouA_name
Name of rho*u*A variable.
const UserObjectName _fp_1phase_name
Single-phase fluid properties object name.
const VariableName _e_name
Name of specific internal energy variable.
ActionWarehouse & _this_action_warehouse
ActionFactory & _this_action_factory
const bool & _ad
True for setting up testing with AD, false otherwise.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableName _rhoEA_name
Name of rho*E*A variable.
const VariableName _D_h_name
Name of the hydraulic diameter.
const VariableName _mu_name
Name of dynamic viscosity variable.
const VariableName _unity_name
Name of unity.

◆ addNonConstantAuxVariables()

void FlowModelSetup1Phase::addNonConstantAuxVariables ( )
overrideprotectedvirtual

Implements FlowModelSetup.

Definition at line 192 of file FlowModelSetup1Phase.C.

Referenced by ClosureTest1PhaseAction::addAuxVariables(), and JacobianTest1PhaseAction::addAuxVariables().

193 {
194  // area
196  {
197  const std::string class_name = "AddKernelAction";
199  params.set<std::string>("type") = "FunctionAux";
200  params.set<std::string>("task") = "add_aux_kernel";
201 
202  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
203  _this_action_factory.create(class_name, _A_name + "_aux", params));
204 
205  action->getObjectParams().set<AuxVariableName>("variable") = _A_name;
206  action->getObjectParams().set<FunctionName>("function") = _A_fn;
207 
209  }
210 
211  // rho
213  {
214  const std::string class_name = "AddKernelAction";
216  params.set<std::string>("type") = "QuotientAux";
217  params.set<std::string>("task") = "add_aux_kernel";
218 
219  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
220  _this_action_factory.create(class_name, _rho_name + "_aux", params));
221 
222  action->getObjectParams().set<AuxVariableName>("variable") = _rho_name;
223  action->getObjectParams().set<std::vector<VariableName>>("numerator") = {_rhoA_name};
224  action->getObjectParams().set<std::vector<VariableName>>("denominator") = {_A_name};
225 
227  }
228 
229  // velocity
231  {
232  const std::string class_name = "AddKernelAction";
234  params.set<std::string>("type") = "QuotientAux";
235  params.set<std::string>("task") = "add_aux_kernel";
236 
237  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
238  _this_action_factory.create(class_name, _vel_name + "_aux", params));
239 
240  action->getObjectParams().set<AuxVariableName>("variable") = _vel_name;
241  action->getObjectParams().set<std::vector<VariableName>>("numerator") = {_rhouA_name};
242  action->getObjectParams().set<std::vector<VariableName>>("denominator") = {_rhoA_name};
243 
245  }
246 
247  // pressure
249  {
250  const std::string class_name = "AddKernelAction";
252  params.set<std::string>("type") = "PressureAux";
253  params.set<std::string>("task") = "add_aux_kernel";
254 
255  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
256  _this_action_factory.create(class_name, _p_name + "_aux", params));
257 
258  action->getObjectParams().set<AuxVariableName>("variable") = _p_name;
259  action->getObjectParams().set<std::vector<VariableName>>("e") = {_e_name};
260  action->getObjectParams().set<std::vector<VariableName>>("v") = {_v_name};
261  action->getObjectParams().set<UserObjectName>("fp") = _fp_1phase_name;
262 
264  }
265 
266  // temperature
268  {
269  const std::string class_name = "AddKernelAction";
271  params.set<std::string>("type") = "TemperatureAux";
272  params.set<std::string>("task") = "add_aux_kernel";
273 
274  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
275  _this_action_factory.create(class_name, _T_name + "_aux", params));
276 
277  action->getObjectParams().set<AuxVariableName>("variable") = _T_name;
278  action->getObjectParams().set<std::vector<VariableName>>("e") = {_e_name};
279  action->getObjectParams().set<std::vector<VariableName>>("v") = {_v_name};
280  action->getObjectParams().set<UserObjectName>("fp") = _fp_1phase_name;
281 
283  }
284 
285  // specific volume
287  {
288  const std::string class_name = "AddKernelAction";
290  params.set<std::string>("type") = "THMSpecificVolumeAux";
291  params.set<std::string>("task") = "add_aux_kernel";
292 
293  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
294  _this_action_factory.create(class_name, _v_name + "_aux", params));
295 
296  action->getObjectParams().set<AuxVariableName>("variable") = _v_name;
297  action->getObjectParams().set<std::vector<VariableName>>("rhoA") = {_rhoA_name};
298  action->getObjectParams().set<std::vector<VariableName>>("A") = {_A_name};
299 
301  }
302 
303  // specific internal energy
305  {
306  const std::string class_name = "AddKernelAction";
308  params.set<std::string>("type") = "THMSpecificInternalEnergyAux";
309  params.set<std::string>("task") = "add_aux_kernel";
310 
311  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
312  _this_action_factory.create(class_name, _e_name + "_aux", params));
313 
314  action->getObjectParams().set<AuxVariableName>("variable") = _e_name;
315  action->getObjectParams().set<std::vector<VariableName>>("rhoA") = {_rhoA_name};
316  action->getObjectParams().set<std::vector<VariableName>>("rhouA") = {_rhouA_name};
317  action->getObjectParams().set<std::vector<VariableName>>("rhoEA") = {_rhoEA_name};
318 
320  }
321 
322  // specific total enthalpy
324  {
325  const std::string class_name = "AddKernelAction";
327  params.set<std::string>("type") = "SpecificTotalEnthalpyAux";
328  params.set<std::string>("task") = "add_aux_kernel";
329 
330  std::shared_ptr<MooseObjectAction> action = std::static_pointer_cast<MooseObjectAction>(
331  _this_action_factory.create(class_name, _H_name + "_aux", params));
332 
333  action->getObjectParams().set<AuxVariableName>("variable") = _H_name;
334  action->getObjectParams().set<std::vector<VariableName>>("rhoA") = {_rhoA_name};
335  action->getObjectParams().set<std::vector<VariableName>>("rhoEA") = {_rhoEA_name};
336  action->getObjectParams().set<std::vector<VariableName>>("p") = {_p_name};
337  action->getObjectParams().set<std::vector<VariableName>>("A") = {_A_name};
338 
340  }
341 }
const VariableName _rhoA_name
Name of rho*A variable.
const VariableName _A_name
Name of area variable.
InputParameters getValidParams(const std::string &name)
T & set(const std::string &name, bool quiet_mode=false)
void addAuxVariable(const VariableName &var_name)
Adds an aux variable.
const VariableName _p_name
Name of pressure variable.
void addActionBlock(std::shared_ptr< Action > blk)
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters &parameters)
InputParameters & getObjectParams()
const VariableName _v_name
Name of specific volume variable.
const VariableName _rho_name
Name of rho variable.
const VariableName _rhouA_name
Name of rho*u*A variable.
const UserObjectName _fp_1phase_name
Single-phase fluid properties object name.
const VariableName _e_name
Name of specific internal energy variable.
const FunctionName _A_fn
Area function name.
ActionWarehouse & _this_action_warehouse
ActionFactory & _this_action_factory
const VariableName _rhoEA_name
Name of rho*E*A variable.
const VariableName _H_name
Name of specific total enthalpy variable.
const VariableName _vel_name
Name of velocity variable.
const VariableName _T_name
Name of temperature variable.

◆ addSolutionVariable()

void FlowModelSetup::addSolutionVariable ( const VariableName &  var_name,
const Real scaling = 1.0 
)
protectedinherited

Adds a solution variable.

Parameters
[in]var_namename of the variable to add
[in]scalingscaling factor to apply to variable

Definition at line 41 of file FlowModelSetup.C.

Referenced by addSolutionVariables().

42 {
43  const std::string class_name = "AddVariableAction";
45  params.set<std::vector<Real>>("scaling") = {scaling};
46  params.set<MooseEnum>("family") = _fe_family;
47  params.set<MooseEnum>("order") = _fe_order;
48 
49  std::shared_ptr<Action> action =
50  std::static_pointer_cast<Action>(_this_action_factory.create(class_name, var_name, params));
51 
53 }
InputParameters getValidParams(const std::string &name)
T & set(const std::string &name, bool quiet_mode=false)
void addActionBlock(std::shared_ptr< Action > blk)
std::shared_ptr< Action > create(const std::string &action, const std::string &action_name, InputParameters &parameters)
ActionWarehouse & _this_action_warehouse
ActionFactory & _this_action_factory
MooseEnum _fe_order
MooseEnum _fe_family

◆ addSolutionVariables()

void FlowModelSetup1Phase::addSolutionVariables ( )
overrideprotectedvirtual

Implements FlowModelSetup.

Reimplemented in JacobianTest1PhaseAction.

Definition at line 181 of file FlowModelSetup1Phase.C.

Referenced by JacobianTest1PhaseAction::addSolutionVariables().

182 {
183  std::vector<VariableName> var_names{_rhoA_name, _rhouA_name, _rhoEA_name};
184  for (const VariableName & var_name : var_names)
185  {
186  const Real scaling_factor = getParam<Real>("scaling_" + var_name);
187  addSolutionVariable(var_name, scaling_factor);
188  }
189 }
const VariableName _rhoA_name
Name of rho*A variable.
const VariableName _rhouA_name
Name of rho*u*A variable.
void addSolutionVariable(const VariableName &var_name, const Real &scaling=1.0)
Adds a solution variable.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableName _rhoEA_name
Name of rho*E*A variable.

◆ addUserObjects()

void FlowModelSetup1Phase::addUserObjects ( )
overrideprotectedvirtual

◆ getParam()

template<typename T >
const T & FlowModelSetup::getParam ( const std::string &  name) const
protectedinherited

Retrieves a parameter.

Parameters
[in]namename of the parameter
Returns
value of the parameter

Definition at line 82 of file FlowModelSetup.h.

83 {
84  return InputParameters::getParamHelper(name, _this_params, static_cast<T *>(0));
85 }
const std::string name
Definition: Setup.h:20
const InputParameters & _this_params
const MooseEnum & getParamHelper(const std::string &name, const InputParameters &pars, const MooseEnum *, const MooseBase *moose_base)

◆ validParams()

InputParameters FlowModelSetup1Phase::validParams ( )
static

Definition at line 14 of file FlowModelSetup1Phase.C.

Referenced by ClosureTest1PhaseAction::validParams(), and JacobianTest1PhaseAction::validParams().

15 {
17 
18  params.addRequiredParam<FunctionName>("p", "Initial pressure function");
19  params.addRequiredParam<FunctionName>("T", "Initial temperature function");
20  params.addRequiredParam<FunctionName>("vel", "Initial velocity function");
21  params.addRequiredParam<FunctionName>("A", "Area function");
22  params.addParam<FunctionName>("D_h", 0, "Hydraulic diameter function");
23 
24  params.addParam<Real>("scaling_rhoA", 1.0, "Scaling factor for rho*A");
25  params.addParam<Real>("scaling_rhouA", 1.0, "Scaling factor for rho*u*A");
26  params.addParam<Real>("scaling_rhoEA", 1.0, "Scaling factor for rho*E*A");
27 
28  params.addRequiredParam<UserObjectName>("fp_1phase", "Single-phase fluid properties object name");
29 
30  return params;
31 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()

Member Data Documentation

◆ _A_fn

const FunctionName FlowModelSetup1Phase::_A_fn
protected

Area function name.

Definition at line 36 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions(), and addNonConstantAuxVariables().

◆ _A_name

const VariableName FlowModelSetup1Phase::_A_name
protected

Name of area variable.

Definition at line 46 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions(), addMaterials(), and addNonConstantAuxVariables().

◆ _ad

const bool& FlowModelSetup1Phase::_ad
protected

True for setting up testing with AD, false otherwise.

Definition at line 73 of file FlowModelSetup1Phase.h.

Referenced by addMaterials().

◆ _D_h_fn

const FunctionName FlowModelSetup1Phase::_D_h_fn
protected

Hydraulic diameter function name.

Definition at line 38 of file FlowModelSetup1Phase.h.

Referenced by addMaterials().

◆ _D_h_name

const VariableName FlowModelSetup1Phase::_D_h_name
protected

Name of the hydraulic diameter.

Definition at line 48 of file FlowModelSetup1Phase.h.

Referenced by addMaterials().

◆ _e_name

const VariableName FlowModelSetup1Phase::_e_name
protected

Name of specific internal energy variable.

Definition at line 66 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions(), addMaterials(), and addNonConstantAuxVariables().

◆ _fe_family

MooseEnum FlowModelSetup::_fe_family
protectedinherited

Definition at line 70 of file FlowModelSetup.h.

Referenced by FlowModelSetup::addSolutionVariable().

◆ _fe_order

MooseEnum FlowModelSetup::_fe_order
protectedinherited

◆ _fp_1phase_name

const UserObjectName FlowModelSetup1Phase::_fp_1phase_name
protected

Single-phase fluid properties object name.

Definition at line 41 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions(), addMaterials(), and addNonConstantAuxVariables().

◆ _gravity_magnitude

const Real& FlowModelSetup::_gravity_magnitude
protectedinherited

Gravitational acceleration magnitude.

Definition at line 74 of file FlowModelSetup.h.

◆ _H_name

const VariableName FlowModelSetup1Phase::_H_name
protected

Name of specific total enthalpy variable.

Definition at line 68 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions(), and addNonConstantAuxVariables().

◆ _mu_name

const VariableName FlowModelSetup1Phase::_mu_name
protected

Name of dynamic viscosity variable.

Definition at line 70 of file FlowModelSetup1Phase.h.

Referenced by addMaterials().

◆ _p_fn

const FunctionName FlowModelSetup1Phase::_p_fn
protected

Pressure function name.

Definition at line 30 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions().

◆ _p_name

const VariableName FlowModelSetup1Phase::_p_name
protected

Name of pressure variable.

Definition at line 60 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions(), and addNonConstantAuxVariables().

◆ _rho_name

const VariableName FlowModelSetup1Phase::_rho_name
protected

Name of rho variable.

Definition at line 56 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions(), and addNonConstantAuxVariables().

◆ _rhoA_name

const VariableName FlowModelSetup1Phase::_rhoA_name
protected

◆ _rhoEA_name

const VariableName FlowModelSetup1Phase::_rhoEA_name
protected

◆ _rhouA_name

const VariableName FlowModelSetup1Phase::_rhouA_name
protected

◆ _T_fn

const FunctionName FlowModelSetup1Phase::_T_fn
protected

Temperature function name.

Definition at line 32 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions().

◆ _T_name

const VariableName FlowModelSetup1Phase::_T_name
protected

Name of temperature variable.

Definition at line 62 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions(), and addNonConstantAuxVariables().

◆ _this_action_factory

ActionFactory& FlowModelSetup::_this_action_factory
protectedinherited

◆ _this_action_warehouse

ActionWarehouse& FlowModelSetup::_this_action_warehouse
protectedinherited

◆ _this_app

MooseApp& FlowModelSetup::_this_app
protectedinherited

Definition at line 66 of file FlowModelSetup.h.

◆ _this_params

const InputParameters& FlowModelSetup::_this_params
protectedinherited

Definition at line 65 of file FlowModelSetup.h.

Referenced by FlowModelSetup::getParam().

◆ _unity_name

const VariableName FlowModelSetup1Phase::_unity_name
protected

Name of unity.

Definition at line 44 of file FlowModelSetup1Phase.h.

Referenced by addMaterials().

◆ _v_name

const VariableName FlowModelSetup1Phase::_v_name
protected

Name of specific volume variable.

Definition at line 64 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions(), addMaterials(), and addNonConstantAuxVariables().

◆ _vel_fn

const FunctionName FlowModelSetup1Phase::_vel_fn
protected

Velocity function name.

Definition at line 34 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions().

◆ _vel_name

const VariableName FlowModelSetup1Phase::_vel_name
protected

Name of velocity variable.

Definition at line 58 of file FlowModelSetup1Phase.h.

Referenced by addInitialConditions(), and addNonConstantAuxVariables().


The documentation for this class was generated from the following files: