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 48 of file AddNavierStokesBCsAction.h.

Member Typedef Documentation

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

Definition at line 81 of file AddNavierStokesBCsAction.h.

Constructor & Destructor Documentation

AddNavierStokesBCsAction::AddNavierStokesBCsAction ( InputParameters  parameters)

Definition at line 27 of file AddNavierStokesBCsAction.C.

28  : MooseObjectAction(parameters)
29 {
30 }
AddNavierStokesBCsAction::~AddNavierStokesBCsAction ( )
virtual

Definition at line 32 of file AddNavierStokesBCsAction.C.

32 {}

Member Function Documentation

void AddNavierStokesBCsAction::act ( )
virtual

Definition at line 35 of file AddNavierStokesBCsAction.C.

36 {
37  // The Mesh dimension tells us how many momentum BCs to add.
38  _dim = _mesh->dimension();
39 
40  if (_type == "NSWeakStagnationInletBC")
41  {
44  for (unsigned int component = 0; component < _dim; ++component)
46  }
47 
48  else if (_type == "NSNoPenetrationBC")
49  {
50  for (unsigned int component = 0; component < _dim; ++component)
52  }
53 
54  else if (_type == "NSStaticPressureOutletBC")
55  {
58  for (unsigned int component = 0; component < _dim; ++component)
60  }
61 }
void addNSMomentumWeakStagnationBC(unsigned int component)
Real component(const SymmTensor &symm_tensor, unsigned int index)
void addNoPenetrationBC(unsigned int component)
void addNSMomentumInviscidSpecifiedPressureBC(unsigned int component)
void AddNavierStokesBCsAction::addNoPenetrationBC ( unsigned int  component)
protected

Definition at line 132 of file AddNavierStokesBCsAction.C.

Referenced by act().

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

Definition at line 178 of file AddNavierStokesBCsAction.C.

Referenced by act().

179 {
180  const std::string kernel_type = "NSEnergyInviscidSpecifiedPressureBC";
181  InputParameters params = _factory.getValidParams(kernel_type);
182  params.set<NonlinearVariableName>("variable") = NS::total_energy;
183  setCommonParams(params);
184  params += _moose_object_pars;
185  // This BC also requires the current value of the temperature.
187  _problem->addBoundaryCondition(kernel_type, "rhoE_specified_pressure_outflow", params);
188 }
void setCommonParams(InputParameters &params)
const std::string temperature
Definition: NS.h:25
std::vector< VariableName > CoupledName
const std::string total_energy
Definition: NS.h:19
void AddNavierStokesBCsAction::addNSEnergyWeakStagnationBC ( )
protected

Definition at line 81 of file AddNavierStokesBCsAction.C.

Referenced by act().

82 {
83  const std::string kernel_type = "NSEnergyWeakStagnationBC";
84  InputParameters params = _factory.getValidParams(kernel_type);
85  params.set<NonlinearVariableName>("variable") = NS::total_energy;
86  setCommonParams(params);
87  params += _moose_object_pars;
88  _problem->addBoundaryCondition(kernel_type, "weak_stagnation_energy_inflow", params);
89 }
void setCommonParams(InputParameters &params)
const std::string total_energy
Definition: NS.h:19
void AddNavierStokesBCsAction::addNSMassUnspecifiedNormalFlowBC ( )
protected

Definition at line 150 of file AddNavierStokesBCsAction.C.

Referenced by act().

151 {
152  const std::string kernel_type = "NSMassUnspecifiedNormalFlowBC";
153  InputParameters params = _factory.getValidParams(kernel_type);
154  params.set<NonlinearVariableName>("variable") = NS::density;
155  setCommonParams(params);
156  params += _moose_object_pars;
157  _problem->addBoundaryCondition(kernel_type, "mass_outflow", params);
158 }
void setCommonParams(InputParameters &params)
const std::string density
Definition: NS.h:15
void AddNavierStokesBCsAction::addNSMassWeakStagnationBC ( )
protected

Definition at line 64 of file AddNavierStokesBCsAction.C.

Referenced by act().

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

Definition at line 161 of file AddNavierStokesBCsAction.C.

Referenced by act().

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

Definition at line 92 of file AddNavierStokesBCsAction.C.

Referenced by act().

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

Definition at line 215 of file AddNavierStokesBCsAction.C.

Referenced by setCommonParams().

216 {
217  params.set<CoupledName>(NS::momentum_x) = {NS::momentum_x};
218 
219  if (_dim >= 2)
220  params.set<CoupledName>(NS::momentum_y) = {NS::momentum_y};
221 
222  if (_dim >= 3)
223  params.set<CoupledName>(NS::momentum_z) = {NS::momentum_z};
224 }
const std::string momentum_x
Definition: NS.h:16
const std::string momentum_y
Definition: NS.h:17
std::vector< VariableName > CoupledName
const std::string momentum_z
Definition: NS.h:18
void AddNavierStokesBCsAction::coupleVelocities ( InputParameters &  params)
protected

Definition at line 203 of file AddNavierStokesBCsAction.C.

Referenced by setCommonParams().

204 {
205  params.set<CoupledName>(NS::velocity_x) = {NS::velocity_x};
206 
207  if (_dim >= 2)
208  params.set<CoupledName>(NS::velocity_y) = {NS::velocity_y};
209 
210  if (_dim >= 3)
211  params.set<CoupledName>(NS::velocity_z) = {NS::velocity_z};
212 }
const std::string velocity_z
Definition: NS.h:23
const std::string velocity_x
Definition: NS.h:21
const std::string velocity_y
Definition: NS.h:22
std::vector< VariableName > CoupledName
void AddNavierStokesBCsAction::setCommonParams ( InputParameters &  params)
protected

Definition at line 191 of file AddNavierStokesBCsAction.C.

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

192 {
193  // coupled variables
194  params.set<CoupledName>(NS::density) = {NS::density};
196 
197  // Couple the appropriate number of velocities
198  coupleVelocities(params);
199  coupleMomentums(params);
200 }
void coupleMomentums(InputParameters &params)
const std::string density
Definition: NS.h:15
std::vector< VariableName > CoupledName
const std::string total_energy
Definition: NS.h:19
void coupleVelocities(InputParameters &params)

Member Data Documentation

unsigned int AddNavierStokesBCsAction::_dim
protected

Definition at line 57 of file AddNavierStokesBCsAction.h.

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


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