www.mooseframework.org
NavierStokesApp.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 #include "NavierStokesApp.h"
8 #include "Moose.h"
9 #include "AppFactory.h"
10 #include "MooseSyntax.h"
11 
12 #include "NSMassInviscidFlux.h"
13 #include "NSMomentumInviscidFlux.h"
14 #include "NSEnergyInviscidFlux.h"
15 #include "NSGravityPower.h"
16 #include "NSGravityForce.h"
17 #include "NSThermalBC.h"
18 #include "NSVelocityAux.h"
19 #include "NSMachAux.h"
20 #include "NSInternalEnergyAux.h"
21 #include "NSSpecificVolumeAux.h"
22 #include "NSImposedVelocityBC.h"
23 #include "NSTemperatureAux.h"
24 #include "NSTemperatureL2.h"
25 #include "NSPressureAux.h"
26 #include "NSEnthalpyAux.h"
27 #include "NSEnergyThermalFlux.h"
28 #include "NSMomentumViscousFlux.h"
29 #include "NSEnergyViscousFlux.h"
31 #include "NSSUPGMomentum.h"
32 #include "NSSUPGMass.h"
33 #include "NSSUPGEnergy.h"
36 #include "NSInflowThermalBC.h"
39 #include "NSMomentumViscousBC.h"
45 #include "NSEnergyViscousBC.h"
46 #include "NSStagnationPressureBC.h"
49 #include "NSMassWeakStagnationBC.h"
55 #include "NSPressureNeumannBC.h"
56 #include "NSEntropyError.h"
61 #include "NSInitialCondition.h"
63 #include "NSNoPenetrationBC.h"
65 
66 // So we can register objects from the fluid_properties module.
67 #include "FluidPropertiesApp.h"
68 
69 //
70 // Incompressible
71 //
72 
73 // Kernels
74 #include "INSMass.h"
75 #include "INSMassRZ.h"
79 #include "INSMomentumLaplaceForm.h"
82 #include "INSTemperature.h"
83 #include "INSSplitMomentum.h"
84 #include "INSProjection.h"
85 #include "INSPressurePoisson.h"
86 #include "INSChorinPredictor.h"
87 #include "INSChorinCorrector.h"
90 
91 // BCs
94 #include "INSTemperatureNoBCBC.h"
95 #include "ImplicitNeumannBC.h"
96 
97 // AuxKernels
98 #include "INSCourant.h"
99 #include "INSDivergenceAux.h"
100 
101 // Materials - this will eventually be replaced by FluidProperties stuff...
102 #include "Air.h"
103 
104 // Postprocessors
106 #include "VolumetricFlowRate.h"
107 
108 // Functions
109 #include "WedgeFunction.h"
110 
111 // CNSFV (Compressible Navier-Stokes by Finite Volume)
112 #include "CNSFVMachIC.h"
113 #include "CNSFVPressureIC.h"
114 
119 #include "CNSFVNoSlopeLimiting.h"
121 #include "CNSFVWENOSlopeLimiting.h"
122 #include "CNSFVSlopeLimitingOneD.h"
133 #include "CNSFVSlipBCUserObject.h"
134 
135 #include "CNSFVBC.h"
136 
137 #include "CNSFVKernel.h"
138 
139 #include "CNSFVMaterial.h"
140 
142 #include "CNSFVMachAux.h"
143 #include "CNSFVPressureAux.h"
145 
148 #include "CNSFVTimeStepLimit.h"
149 
150 template <>
151 InputParameters
153 {
154  InputParameters params = validParams<MooseApp>();
155  return params;
156 }
157 
158 NavierStokesApp::NavierStokesApp(InputParameters parameters) : MooseApp(parameters)
159 {
160  Moose::registerObjects(_factory);
163 
164  Moose::associateSyntax(_syntax, _action_factory);
165  NavierStokesApp::associateSyntaxDepends(_syntax, _action_factory);
166  NavierStokesApp::associateSyntax(_syntax, _action_factory);
167 }
168 
170 
171 // External entry point for dynamic application loading
172 extern "C" void
174 {
176 }
177 void
179 {
180  registerApp(NavierStokesApp);
181 }
182 
183 void
185 {
187 }
188 
189 // External entry point for dynamic object registration
190 extern "C" void
192 {
194 }
195 void
197 {
198  registerKernel(NSMassInviscidFlux);
199  registerKernel(NSMomentumInviscidFlux);
200  registerKernel(NSEnergyInviscidFlux);
201  registerKernel(NSGravityPower);
202  registerKernel(NSGravityForce);
203  registerKernel(NSTemperatureL2);
204  registerBoundaryCondition(NSThermalBC);
205  registerAux(NSVelocityAux);
206  registerAux(NSMachAux);
207  registerAux(NSInternalEnergyAux);
208  registerAux(NSSpecificVolumeAux);
209  registerBoundaryCondition(NSImposedVelocityBC);
210  registerAux(NSTemperatureAux);
211  registerAux(NSPressureAux);
212  registerAux(NSEnthalpyAux);
213  registerKernel(NSEnergyThermalFlux);
214  registerKernel(NSMomentumViscousFlux);
215  registerKernel(NSEnergyViscousFlux);
216  registerKernel(NSMomentumInviscidFluxWithGradP);
217  registerKernel(NSSUPGMomentum);
218  registerKernel(NSSUPGMass);
219  registerKernel(NSSUPGEnergy);
220  registerBoundaryCondition(NSMassSpecifiedNormalFlowBC);
221  registerBoundaryCondition(NSMassUnspecifiedNormalFlowBC);
222  registerBoundaryCondition(NSInflowThermalBC);
223  registerBoundaryCondition(NSMomentumInviscidSpecifiedPressureBC);
224  registerBoundaryCondition(NSMomentumInviscidSpecifiedNormalFlowBC);
225  registerBoundaryCondition(NSMomentumViscousBC);
226  registerBoundaryCondition(NSEnergyInviscidSpecifiedPressureBC);
227  registerBoundaryCondition(NSEnergyInviscidSpecifiedNormalFlowBC);
228  registerBoundaryCondition(NSEnergyInviscidUnspecifiedBC);
229  registerBoundaryCondition(NSEnergyInviscidSpecifiedBC);
230  registerBoundaryCondition(NSEnergyInviscidSpecifiedDensityAndVelocityBC);
231  registerBoundaryCondition(NSEnergyViscousBC);
232  registerBoundaryCondition(NSStagnationPressureBC);
233  registerBoundaryCondition(NSStagnationTemperatureBC);
234  registerBoundaryCondition(NSImposedVelocityDirectionBC);
235  registerBoundaryCondition(NSMassWeakStagnationBC);
236  registerBoundaryCondition(NSMomentumConvectiveWeakStagnationBC);
237  registerBoundaryCondition(NSMomentumPressureWeakStagnationBC);
238  registerBoundaryCondition(NSEnergyWeakStagnationBC);
239  registerBoundaryCondition(NSPenalizedNormalFlowBC);
240  registerBoundaryCondition(NSMomentumInviscidNoPressureImplicitFlowBC);
241  registerBoundaryCondition(NSPressureNeumannBC);
242  registerPostprocessor(NSEntropyError);
243  registerInitialCondition(NSInitialCondition);
244  // Boundary condition meta-objects
245  registerObject(NSWeakStagnationInletBC);
246  registerObject(NSNoPenetrationBC);
247  registerObject(NSStaticPressureOutletBC);
248 
249  //
250  // Incompressible
251  //
252 
253  // Kernels
254  registerKernel(INSMass);
255  registerKernel(INSMassRZ);
256  registerKernel(INSMomentumTimeDerivative);
257  registerKernel(INSMomentumTractionForm);
258  registerKernel(INSMomentumTractionFormRZ);
259  registerKernel(INSMomentumLaplaceForm);
260  registerKernel(INSMomentumLaplaceFormRZ);
261  registerKernel(INSTemperatureTimeDerivative);
262  registerKernel(INSTemperature);
263  registerKernel(INSSplitMomentum);
264  registerKernel(INSProjection);
265  registerKernel(INSPressurePoisson);
266  registerKernel(INSChorinPredictor);
267  registerKernel(INSChorinCorrector);
268  registerKernel(INSChorinPressurePoisson);
269  registerKernel(INSCompressibilityPenalty);
270 
271  // BCs
272  registerBoundaryCondition(INSMomentumNoBCBCTractionForm);
273  registerBoundaryCondition(INSMomentumNoBCBCLaplaceForm);
274  registerBoundaryCondition(INSTemperatureNoBCBC);
275  registerBoundaryCondition(ImplicitNeumannBC);
276 
277  // AuxKernels
278  registerAux(INSCourant);
279  registerAux(INSDivergenceAux);
280 
281  // Postprocessors
282  registerPostprocessor(INSExplicitTimestepSelector);
283  registerPostprocessor(VolumetricFlowRate);
284 
285  // Materials
286  registerMaterial(Air);
287 
288  // Functions
289  registerFunction(WedgeFunction);
290 
291  // CNSFV
292  registerInitialCondition(CNSFVMachIC);
293  registerInitialCondition(CNSFVPressureIC);
294 
295  registerUserObject(CNSFVNoSlopeReconstruction);
296  registerUserObject(CNSFVGreenGaussSlopeReconstruction);
297  registerUserObject(CNSFVLeastSquaresSlopeReconstruction);
298  registerUserObject(CNSFVSlopeReconstructionOneD);
299  registerUserObject(CNSFVNoSlopeLimiting);
300  registerUserObject(CNSFVMinmaxSlopeLimiting);
301  registerUserObject(CNSFVWENOSlopeLimiting);
302  registerUserObject(CNSFVSlopeLimitingOneD);
303  registerUserObject(CNSFVHLLCInternalSideFlux);
304  registerUserObject(CNSFVFreeInflowBoundaryFlux);
305  registerUserObject(CNSFVFreeOutflowBoundaryFlux);
306  registerUserObject(CNSFVRiemannInvariantBoundaryFlux);
307  registerUserObject(CNSFVHLLCInflowOutflowBoundaryFlux);
308  registerUserObject(CNSFVHLLCSlipBoundaryFlux);
309  registerUserObject(CNSFVFreeInflowBCUserObject);
310  registerUserObject(CNSFVFreeOutflowBCUserObject);
311  registerUserObject(CNSFVCharacteristicBCUserObject);
312  registerUserObject(CNSFVRiemannInvariantBCUserObject);
313  registerUserObject(CNSFVSlipBCUserObject);
314 
315  registerBoundaryCondition(CNSFVBC);
316 
317  registerKernel(CNSFVKernel);
318 
319  registerMaterial(CNSFVMaterial);
320 
321  registerAux(CNSFVEntropyProductionAux);
322  registerAux(CNSFVMachAux);
323  registerAux(CNSFVPressureAux);
324  registerAux(CNSFVSpecificTotalEnthalpyAux);
325 
326  registerPostprocessor(CNSFVIdealGasEntropyL2Error);
327  registerPostprocessor(CNSFVIdealGasTotalEnthalpyL2Error);
328  registerPostprocessor(CNSFVTimeStepLimit);
329 }
330 
331 void
332 NavierStokesApp::associateSyntaxDepends(Syntax & syntax, ActionFactory & action_factory)
333 {
334  FluidPropertiesApp::associateSyntax(syntax, action_factory);
335 }
336 
337 // External entry point for dynamic syntax association
338 extern "C" void
339 NavierStokesApp__associateSyntax(Syntax & syntax, ActionFactory & action_factory)
340 {
341  NavierStokesApp::associateSyntax(syntax, action_factory);
342 }
343 void
344 NavierStokesApp::associateSyntax(Syntax & syntax, ActionFactory & action_factory)
345 {
346 #undef registerAction
347 #define registerAction(type, action) \
348  action_factory.reg<type>(stringifyName(type), action, __FILE__, __LINE__)
349 
350  // Create the syntax
351  registerSyntax("AddNavierStokesVariablesAction", "Modules/NavierStokes/Variables");
352  registerSyntax("AddNavierStokesICsAction", "Modules/NavierStokes/ICs");
353  registerSyntax("AddNavierStokesKernelsAction", "Modules/NavierStokes/Kernels");
354  registerSyntax("AddNavierStokesBCsAction", "Modules/NavierStokes/BCs/*");
355 
356  // add variables action
357  registerTask("add_navier_stokes_variables", /*is_required=*/false);
358  addTaskDependency("add_navier_stokes_variables", "add_variable");
359  registerAction(AddNavierStokesVariablesAction, "add_navier_stokes_variables");
360 
361  // add ICs action
362  registerTask("add_navier_stokes_ics", /*is_required=*/false);
363  addTaskDependency("add_navier_stokes_ics", "add_ic");
364  registerAction(AddNavierStokesICsAction, "add_navier_stokes_ics");
365 
366  // add Kernels action
367  registerTask("add_navier_stokes_kernels", /*is_required=*/false);
368  addTaskDependency("add_navier_stokes_kernels", "add_kernel");
369  registerAction(AddNavierStokesKernelsAction, "add_navier_stokes_kernels");
370 
371  // add BCs actions
372  registerMooseObjectTask("add_navier_stokes_bcs", NSWeakStagnationInletBC, /*is_required=*/false);
373  appendMooseObjectTask("add_navier_stokes_bcs", NSNoPenetrationBC);
374  appendMooseObjectTask("add_navier_stokes_bcs", NSStaticPressureOutletBC);
375  addTaskDependency("add_navier_stokes_bcs", "add_bc");
376  registerAction(AddNavierStokesBCsAction, "add_navier_stokes_bcs");
377 
378 #undef registerAction
379 #define registerAction(type, action) action_factory.regLegacy<type>(stringifyName(type), action)
380 }
This class computes the time derivative for the incompressible Navier-Stokes momentum equation...
Nodal auxiliary variable, for computing pressure at the nodes.
Definition: NSPressureAux.h:22
A DGKernel for the CNS equations.
Definition: CNSFVKernel.h:41
This class implements a form of the Neumann boundary condition in which the boundary term is treated ...
The inviscid energy BC term with specified normal flow.
Viscous flux terms in energy equation.
The convective part (sans pressure term) of the momentum equation boundary integral evaluated at spec...
The inviscid energy BC term with specified density and velocity components.
NavierStokesApp(InputParameters parameters)
A PostProcessor object to calculate the L2 error of ideal gas total enthalpy for the CNS equations...
The inviscid energy BC term with specified normal flow.
Auxiliary kernel for computing the Mach number assuming an ideal gas.
Definition: NSMachAux.h:23
An aux kernel for calculating pressure.
This class penalizes the the value of u.n on the boundary so that it matches some desired value...
A user object that computes the ghost cell values based on the Riemann invariant boundary condition...
A user object that computes the ghost cell values based on the slip wall boundary condition...
This class computes the "Chorin" Predictor equation in fully-discrete (both time and space) form...
Auxiliary kernel for computing the internal energy of the fluid.
A boundary condition object for the CNS equations.
Definition: CNSFVBC.h:42
This class facilitates adding specified static pressure outlet BCs for the Euler equations.
An initial condition object for computing pressure from conserved variables.
A user object that performs WENO slope limiting to get the limited slopes of cell average variables i...
The inviscid energy BC term with specified normal flow.
This class was originally used to solve for the temperature using an L2-projection.
Auxiliary kernel for computing the specific volume (1/rho) of the fluid.
Momentum equation boundary condition used when pressure is not integrated by parts, i.e.
A user object that computes the ghost cell values based on the free outflow boundary condition...
A user object that computes the inflow boundary flux.
An aux kernel for calculating entropy production.
An aux kernel for calculating Mach number.
Definition: CNSFVMachAux.h:21
NSInitialCondition sets intial constant values for all variables given the: .) Initial pressure ...
Momentum equation boundary condition in which pressure is specified (given) and the value of the conv...
This class computes the pressure Poisson solve which is part of the "split" scheme used for solving t...
This class computes the "split" momentum equation residual.
A use object that serves as base class for slope limiting to get the limited slopes of cell average v...
This class computes the pressure Poisson solve which is part of the "split" scheme used for solving t...
virtual ~NavierStokesApp()
A user object that performs Green-Gauss slope reconstruction to get the slopes of the P0 primitive va...
A user object that computes the slip boundary flux using the HLLC approximate Riemann solver...
A user object that computes the outflow boundary flux.
This class allows us to have a section of the input file like the following which automatically adds ...
The penalty term may be used when Dirichlet boundary condition is applied to the entire boundary...
This class computes the mass equation residual and Jacobian contributions for the incompressible Navi...
Definition: INSMass.h:23
Velocity auxiliary value.
Definition: NSVelocityAux.h:21
A user object that does no slope limiting in multi-dimensions.
This Dirichlet condition imposes the condition T_0 = T_0_desired, where T_0 is the stagnation tempera...
This class is used on a boundary where the incoming flow values (rho, u, v, T) are all completely spe...
Computes h_min / |u|.
Definition: INSCourant.h:21
Function object for tests/ins/jeffery_hamel responsible for setting the exact value of the velocity a...
Definition: WedgeFunction.h:29
Nodal auxiliary variable, for computing enthalpy at the nodes.
Definition: NSEnthalpyAux.h:29
static void registerObjectDepends(Factory &factory)
A material kernel for the CNS equations.
Definition: CNSFVMaterial.h:42
This class facilitates adding solid wall "no penetration" BCs for the Euler equations.
static void registerObjects(Factory &factory)
An initial condition object for computing Mach number from conserved variables.
Definition: CNSFVMachIC.h:22
Compute residual and Jacobian terms form the SUPG terms in the momentum equation. ...
This class facilitates adding weak stagnation inlet BCs via an Action by setting up the required para...
The inviscid flux (convective + pressure terms) for the momentum conservation equations.
This Dirichlet condition imposes the condition p_0 = p_0_desired, where p_0 is the stagnation pressur...
A user object that performs piecewise linear slope reconstruction to get the slopes of cell average v...
An aux kernel for calculating specific total enthalpy.
Compute residual and Jacobian terms form the SUPG terms in the energy equation.
Definition: NSSUPGEnergy.h:22
A user object that computes inflow/outflow boundary flux using the HLLC approximate Riemann solver...
Compute residual and Jacobian terms form the SUPG terms in the mass equation.
Definition: NSSUPGMass.h:22
static void registerObjects(Factory &factory)
static void associateSyntax(Syntax &syntax, ActionFactory &action_factory)
This kernel is appropriate for use with a "zero normal flow" boundary condition in the context of the...
A PostProcessor object to calculate the L2 error of ideal gas entropy production for the CNS equation...
This class corresponds to the viscous part of the "natural" boundary condition for the momentum equat...
This class computes momentum equation residual and Jacobian viscous contributions for the "traction" ...
Postprocessor that computes the minimum value of h_min/|u|, where |u| is coupled in as an aux variabl...
Computes h_min / |u|.
This postprocessor computes the volumetric flow rate through a boundary.
The inviscid energy BC term with specified pressure.
This class implements the "No BC" boundary condition based on the "traction" form of the viscous stre...
This class implements the "No BC" boundary condition discussed by Griffiths, Papanastiou, and others.
This class computes the time derivative for the incompressible Navier-Stokes momentum equation...
A user object that performs the min-max slope limiting to get the limited slopes of cell average vari...
This class allows us to have a section of the input file like the following which automatically adds ...
This class computes additional momentum equation residual and Jacobian contributions for the incompre...
This class computes momentum equation residual and Jacobian viscous contributions for the "Laplacian"...
This class implements the mass equation boundary term with the rho*(u.n) boundary integral computed i...
This class computes the residual and Jacobian contributions for the incompressible Navier-Stokes temp...
A user object that does no slope reconstruction in multi-dimensions.
This class allows us to have a section of the input file like the following which adds BC objects for...
This class computes the "Chorin" Corrector equation in fully-discrete (both time and space) form...
A user object that computes the ghost cell values based on the free inflow boundary condition...
Derived instance of the NSViscousFluxBase class for the momentum equations.
Definition: Air.h:20
This class computes the mass equation residual and Jacobian contributions for the incompressible Navi...
Definition: INSMassRZ.h:25
Temperature is an auxiliary value computed from the total energy based on the FluidProperties.
This class allows us to have a section of the input file like the following which automatically adds ...
This class is responsible for computing residuals and Jacobian terms for the k * grad(T) * grad(phi) ...
static void registerApps()
A user object that computes the ghost cell values based on the characteristic boundary condition...
This class computes additional momentum equation residual and Jacobian contributions for the incompre...
This class computes the "projection" part of the "split" method for solving incompressible Navier-Sto...
Definition: INSProjection.h:25
This class implements the pressure term of the momentum equation boundary integral for use in weak st...
This class imposes a velocity direction component as a Dirichlet condition on the appropriate momentu...
A user object that computes internal side flux using the HLLC approximate Riemann solver...
This class implements the mass equation boundary term with a specified value of rho*(u.n) imposed weakly.
static void associateSyntaxDepends(Syntax &syntax, ActionFactory &action_factory)
Momentum equation boundary condition in which pressure is specified (given) and the value of the conv...
This class implements the "No BC" boundary condition based on the "Laplace" form of the viscous stres...
A user object that performs the least-squares slope reconstruction to get the slopes of the P0 primit...
static void associateSyntax(Syntax &syntax, ActionFactory &action_factory)
A user objec that computes the Riemann-invariant boundary flux.
A PostProcessor object to calculate the allowable time step size for the CNS equations.
This class corresponds to the viscous part of the "natural" boundary condition for the energy equatio...
The inviscid energy BC term with specified pressure.
The inviscid energy BC term with specified pressure.