www.mooseframework.org
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
AddNavierStokesBCsAction Class Reference

This class allows us to have a section of the input file like the following which adds BC objects for each requested boundary condition. More...

#include <AddNavierStokesBCsAction.h>

Inheritance diagram for AddNavierStokesBCsAction:
[legend]

Public Member Functions

 AddNavierStokesBCsAction (InputParameters parameters)
 
virtual ~AddNavierStokesBCsAction ()
 
virtual void act ()
 

Protected Types

typedef std::vector< VariableName > CoupledName
 

Protected Member Functions

void addNSMassWeakStagnationBC ()
 
void addNSEnergyWeakStagnationBC ()
 
void addNSMomentumWeakStagnationBC (unsigned int component)
 
void addNoPenetrationBC (unsigned int component)
 
void addNSMassUnspecifiedNormalFlowBC ()
 
void addNSEnergyInviscidSpecifiedPressureBC ()
 
void addNSMomentumInviscidSpecifiedPressureBC (unsigned int component)
 
void setCommonParams (InputParameters &params)
 
void coupleVelocities (InputParameters &params)
 
void coupleMomentums (InputParameters &params)
 

Protected Attributes

unsigned int _dim
 

Detailed Description

This class allows us to have a section of the input file like the following which adds BC objects for each requested boundary condition.

[NavierStokes] [./BCs] [./inlet] type = NSWeakStagnationInletBC boundary = 'inlet' stagnation_pressure = 120192.995549849 stagnation_temperature = 315 sx = 1. sy = 0. fluid_properties = ideal_gas [../]

[./solid_walls] type = NSNoPenetrationBC boundary = '3 4' fluid_properties = ideal_gas [../]

[./outlet] type = NSStaticPressureOutletBC boundary = '2' # 'Outflow' specified_pressure = 101325 # Pa fluid_properties = ideal_gas [../] [../] []

Definition at line 51 of file AddNavierStokesBCsAction.h.

Member Typedef Documentation

◆ CoupledName

typedef std::vector<VariableName> AddNavierStokesBCsAction::CoupledName
protected

Definition at line 84 of file AddNavierStokesBCsAction.h.

Constructor & Destructor Documentation

◆ AddNavierStokesBCsAction()

AddNavierStokesBCsAction::AddNavierStokesBCsAction ( InputParameters  parameters)

Definition at line 31 of file AddNavierStokesBCsAction.C.

32  : MooseObjectAction(parameters)
33 {
34 }

◆ ~AddNavierStokesBCsAction()

AddNavierStokesBCsAction::~AddNavierStokesBCsAction ( )
virtual

Definition at line 36 of file AddNavierStokesBCsAction.C.

36 {}

Member Function Documentation

◆ act()

void AddNavierStokesBCsAction::act ( )
virtual

Definition at line 39 of file AddNavierStokesBCsAction.C.

40 {
41  // The Mesh dimension tells us how many momentum BCs to add.
42  _dim = _mesh->dimension();
43 
44  if (_type == "NSWeakStagnationInletBC")
45  {
48  for (unsigned int component = 0; component < _dim; ++component)
50  }
51 
52  else if (_type == "NSNoPenetrationBC")
53  {
54  for (unsigned int component = 0; component < _dim; ++component)
56  }
57 
58  else if (_type == "NSStaticPressureOutletBC")
59  {
62  for (unsigned int component = 0; component < _dim; ++component)
64  }
65 }
void addNSMomentumWeakStagnationBC(unsigned int component)
Real component(const SymmTensor &symm_tensor, unsigned int index)
void addNoPenetrationBC(unsigned int component)
void addNSMomentumInviscidSpecifiedPressureBC(unsigned int component)

◆ addNoPenetrationBC()

void AddNavierStokesBCsAction::addNoPenetrationBC ( unsigned int  component)
protected

Definition at line 136 of file AddNavierStokesBCsAction.C.

Referenced by act().

137 {
138  const static std::string momentums[3] = {NS::momentum_x, NS::momentum_y, NS::momentum_z};
139  const std::string kernel_type = "NSPressureNeumannBC";
140  InputParameters params = _factory.getValidParams(kernel_type);
141  params.set<NonlinearVariableName>("variable") = momentums[component];
142  setCommonParams(params);
143  params += _moose_object_pars;
144 
145  // These BCs also need the component and couping to the pressure.
146  params.set<unsigned int>("component") = component;
147  params.set<CoupledName>(NS::pressure) = {NS::pressure};
148 
149  _problem->addBoundaryCondition(
150  kernel_type, momentums[component] + std::string("_no_penetration"), params);
151 }
const std::string momentum_x
Definition: NS.h:18
void setCommonParams(InputParameters &params)
Real component(const SymmTensor &symm_tensor, unsigned int index)
const std::string momentum_y
Definition: NS.h:19
std::vector< VariableName > CoupledName
const std::string pressure
Definition: NS.h:26
const std::string momentum_z
Definition: NS.h:20

◆ addNSEnergyInviscidSpecifiedPressureBC()

void AddNavierStokesBCsAction::addNSEnergyInviscidSpecifiedPressureBC ( )
protected

Definition at line 182 of file AddNavierStokesBCsAction.C.

Referenced by act().

183 {
184  const std::string kernel_type = "NSEnergyInviscidSpecifiedPressureBC";
185  InputParameters params = _factory.getValidParams(kernel_type);
186  params.set<NonlinearVariableName>("variable") = NS::total_energy;
187  setCommonParams(params);
188  params += _moose_object_pars;
189  // This BC also requires the current value of the temperature.
191  _problem->addBoundaryCondition(kernel_type, "rhoE_specified_pressure_outflow", params);
192 }
void setCommonParams(InputParameters &params)
const std::string temperature
Definition: NS.h:27
std::vector< VariableName > CoupledName
const std::string total_energy
Definition: NS.h:21

◆ addNSEnergyWeakStagnationBC()

void AddNavierStokesBCsAction::addNSEnergyWeakStagnationBC ( )
protected

Definition at line 85 of file AddNavierStokesBCsAction.C.

Referenced by act().

86 {
87  const std::string kernel_type = "NSEnergyWeakStagnationBC";
88  InputParameters params = _factory.getValidParams(kernel_type);
89  params.set<NonlinearVariableName>("variable") = NS::total_energy;
90  setCommonParams(params);
91  params += _moose_object_pars;
92  _problem->addBoundaryCondition(kernel_type, "weak_stagnation_energy_inflow", params);
93 }
void setCommonParams(InputParameters &params)
const std::string total_energy
Definition: NS.h:21

◆ addNSMassUnspecifiedNormalFlowBC()

void AddNavierStokesBCsAction::addNSMassUnspecifiedNormalFlowBC ( )
protected

Definition at line 154 of file AddNavierStokesBCsAction.C.

Referenced by act().

155 {
156  const std::string kernel_type = "NSMassUnspecifiedNormalFlowBC";
157  InputParameters params = _factory.getValidParams(kernel_type);
158  params.set<NonlinearVariableName>("variable") = NS::density;
159  setCommonParams(params);
160  params += _moose_object_pars;
161  _problem->addBoundaryCondition(kernel_type, "mass_outflow", params);
162 }
void setCommonParams(InputParameters &params)
const std::string density
Definition: NS.h:17

◆ addNSMassWeakStagnationBC()

void AddNavierStokesBCsAction::addNSMassWeakStagnationBC ( )
protected

Definition at line 68 of file AddNavierStokesBCsAction.C.

Referenced by act().

69 {
70  const std::string kernel_type = "NSMassWeakStagnationBC";
71  InputParameters params = _factory.getValidParams(kernel_type);
72  params.set<NonlinearVariableName>("variable") = NS::density;
73  setCommonParams(params);
74 
75  // Pick up values specific to this BC from the Action's params.
76  // This includes things like boundary, stagnation_pressure,
77  // stagnation_temperature, etc. This extra InputParameters object
78  // is provided by the MooseObjectAction base class.
79  params += _moose_object_pars;
80 
81  _problem->addBoundaryCondition(kernel_type, "weak_stagnation_mass_inflow", params);
82 }
void setCommonParams(InputParameters &params)
const std::string density
Definition: NS.h:17

◆ addNSMomentumInviscidSpecifiedPressureBC()

void AddNavierStokesBCsAction::addNSMomentumInviscidSpecifiedPressureBC ( unsigned int  component)
protected

Definition at line 165 of file AddNavierStokesBCsAction.C.

Referenced by act().

166 {
167  const static std::string momentums[3] = {NS::momentum_x, NS::momentum_y, NS::momentum_z};
168  const std::string kernel_type = "NSMomentumInviscidSpecifiedPressureBC";
169  InputParameters params = _factory.getValidParams(kernel_type);
170  params.set<NonlinearVariableName>("variable") = momentums[component];
171  setCommonParams(params);
172  params += _moose_object_pars;
173 
174  // These BCs also need the component.
175  params.set<unsigned int>("component") = component;
176 
177  _problem->addBoundaryCondition(
178  kernel_type, momentums[component] + std::string("_specified_pressure_outflow"), params);
179 }
const std::string momentum_x
Definition: NS.h:18
void setCommonParams(InputParameters &params)
Real component(const SymmTensor &symm_tensor, unsigned int index)
const std::string momentum_y
Definition: NS.h:19
const std::string momentum_z
Definition: NS.h:20

◆ addNSMomentumWeakStagnationBC()

void AddNavierStokesBCsAction::addNSMomentumWeakStagnationBC ( unsigned int  component)
protected

Definition at line 96 of file AddNavierStokesBCsAction.C.

Referenced by act().

97 {
98  const static std::string momentums[3] = {NS::momentum_x, NS::momentum_y, NS::momentum_z};
99 
100  // Convective part
101  {
102  const std::string kernel_type = "NSMomentumConvectiveWeakStagnationBC";
103  InputParameters params = _factory.getValidParams(kernel_type);
104  params.set<NonlinearVariableName>("variable") = momentums[component];
105  setCommonParams(params);
106  params += _moose_object_pars;
107 
108  // Momentum Kernels also need the component.
109  params.set<unsigned int>("component") = component;
110 
111  _problem->addBoundaryCondition(kernel_type,
112  std::string("weak_stagnation_") + momentums[component] +
113  std::string("_convective_inflow"),
114  params);
115  }
116 
117  // Pressure part
118  {
119  const std::string kernel_type = "NSMomentumPressureWeakStagnationBC";
120  InputParameters params = _factory.getValidParams(kernel_type);
121  params.set<NonlinearVariableName>("variable") = momentums[component];
122  setCommonParams(params);
123  params += _moose_object_pars;
124 
125  // Momentum Kernels also need the component.
126  params.set<unsigned int>("component") = component;
127 
128  _problem->addBoundaryCondition(kernel_type,
129  std::string("weak_stagnation_") + momentums[component] +
130  std::string("_pressure_inflow"),
131  params);
132  }
133 }
const std::string momentum_x
Definition: NS.h:18
void setCommonParams(InputParameters &params)
Real component(const SymmTensor &symm_tensor, unsigned int index)
const std::string momentum_y
Definition: NS.h:19
const std::string momentum_z
Definition: NS.h:20

◆ coupleMomentums()

void AddNavierStokesBCsAction::coupleMomentums ( InputParameters &  params)
protected

Definition at line 219 of file AddNavierStokesBCsAction.C.

Referenced by setCommonParams().

220 {
221  params.set<CoupledName>(NS::momentum_x) = {NS::momentum_x};
222 
223  if (_dim >= 2)
224  params.set<CoupledName>(NS::momentum_y) = {NS::momentum_y};
225 
226  if (_dim >= 3)
227  params.set<CoupledName>(NS::momentum_z) = {NS::momentum_z};
228 }
const std::string momentum_x
Definition: NS.h:18
const std::string momentum_y
Definition: NS.h:19
std::vector< VariableName > CoupledName
const std::string momentum_z
Definition: NS.h:20

◆ coupleVelocities()

void AddNavierStokesBCsAction::coupleVelocities ( InputParameters &  params)
protected

Definition at line 207 of file AddNavierStokesBCsAction.C.

Referenced by setCommonParams().

208 {
209  params.set<CoupledName>(NS::velocity_x) = {NS::velocity_x};
210 
211  if (_dim >= 2)
212  params.set<CoupledName>(NS::velocity_y) = {NS::velocity_y};
213 
214  if (_dim >= 3)
215  params.set<CoupledName>(NS::velocity_z) = {NS::velocity_z};
216 }
const std::string velocity_z
Definition: NS.h:25
const std::string velocity_x
Definition: NS.h:23
const std::string velocity_y
Definition: NS.h:24
std::vector< VariableName > CoupledName

◆ setCommonParams()

void AddNavierStokesBCsAction::setCommonParams ( InputParameters &  params)
protected

Definition at line 195 of file AddNavierStokesBCsAction.C.

Referenced by addNoPenetrationBC(), addNSEnergyInviscidSpecifiedPressureBC(), addNSEnergyWeakStagnationBC(), addNSMassUnspecifiedNormalFlowBC(), addNSMassWeakStagnationBC(), addNSMomentumInviscidSpecifiedPressureBC(), and addNSMomentumWeakStagnationBC().

196 {
197  // coupled variables
198  params.set<CoupledName>(NS::density) = {NS::density};
200 
201  // Couple the appropriate number of velocities
202  coupleVelocities(params);
203  coupleMomentums(params);
204 }
void coupleMomentums(InputParameters &params)
const std::string density
Definition: NS.h:17
std::vector< VariableName > CoupledName
const std::string total_energy
Definition: NS.h:21
void coupleVelocities(InputParameters &params)

Member Data Documentation

◆ _dim

unsigned int AddNavierStokesBCsAction::_dim
protected

Definition at line 60 of file AddNavierStokesBCsAction.h.

Referenced by act(), coupleMomentums(), and coupleVelocities().


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