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