www.mooseframework.org
NSAction.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 // Navier-Stokes includes
9 #include "NSAction.h"
10 #include "NS.h"
11 
12 // MOOSE includes
13 #include "MooseMesh.h"
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<Action>();
20 
21  params.addClassDescription("This is a base Action class for the Navier-Stokes module which is "
22  "responsible for building lists of names that other Actions can "
23  "subsequently use. Subclasses should call its act() function prior "
24  "to doing their own work.");
25  return params;
26 }
27 
28 NSAction::NSAction(InputParameters parameters) : Action(parameters), _dim(0) {}
29 
31 
32 void
34 {
35  _vars.clear();
36  _auxs.clear();
37 
38  _dim = _mesh->dimension();
39 
40  // Build up the vector of variable names for the user, depending on
41  // the mesh dimension.
42  _vars.push_back(NS::density);
43  _vars.push_back(NS::momentum_x);
44  if (_dim >= 2)
45  _vars.push_back(NS::momentum_y);
46  if (_dim >= 3)
47  _vars.push_back(NS::momentum_z);
48  _vars.push_back(NS::total_energy);
49 
50  // Add Aux variables. These are all required in order for the code
51  // to run, so they should not be independently selectable by the
52  // user.
53  _auxs.push_back(NS::velocity_x);
54  if (_dim >= 2)
55  _auxs.push_back(NS::velocity_y);
56  if (_dim >= 3)
57  _auxs.push_back(NS::velocity_z);
58 
59  _auxs.push_back(NS::pressure);
60  _auxs.push_back(NS::temperature);
61  _auxs.push_back(NS::enthalpy);
62  _auxs.push_back(NS::mach_number);
63 
64  // Needed for FluidProperties calculations
65  _auxs.push_back(NS::internal_energy);
66  _auxs.push_back(NS::specific_volume);
67 }
const std::string momentum_x
Definition: NS.h:16
const std::string mach_number
Definition: NS.h:27
std::vector< std::string > _auxs
Definition: NSAction.h:33
const std::string velocity_z
Definition: NS.h:23
const std::string density
Definition: NS.h:15
const std::string velocity_x
Definition: NS.h:21
const std::string temperature
Definition: NS.h:25
const std::string enthalpy
Definition: NS.h:26
unsigned int _dim
Definition: NSAction.h:37
std::vector< std::string > _vars
Definition: NSAction.h:32
InputParameters validParams< NSAction >()
Definition: NSAction.C:17
const std::string specific_volume
Definition: NS.h:29
const std::string velocity_y
Definition: NS.h:22
const std::string momentum_y
Definition: NS.h:17
virtual void act()
Definition: NSAction.C:33
const std::string pressure
Definition: NS.h:24
const std::string total_energy
Definition: NS.h:19
const std::string internal_energy
Definition: NS.h:28
const std::string momentum_z
Definition: NS.h:18
NSAction(InputParameters parameters)
Definition: NSAction.C:28
virtual ~NSAction()
Definition: NSAction.C:30