www.mooseframework.org
INSDivergenceAux.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 #include "INSDivergenceAux.h"
9 #include "MooseMesh.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<AuxKernel>();
16 
17  params.addClassDescription("Computes h_min / |u|.");
18  // Coupled variables
19  params.addRequiredCoupledVar("u", "x-velocity");
20  params.addCoupledVar("v", "y-velocity"); // only required in 2D and 3D
21  params.addCoupledVar("w", "z-velocity"); // only required in 3D
22 
23  return params;
24 }
25 
26 INSDivergenceAux::INSDivergenceAux(const InputParameters & parameters)
27  : AuxKernel(parameters),
28  _grad_u_vel(coupledGradient("u")),
29  _grad_v_vel(_mesh.dimension() >= 2 ? coupledGradient("v") : _grad_zero),
30  _grad_w_vel(_mesh.dimension() == 3 ? coupledGradient("w") : _grad_zero)
31 {
32 }
33 
34 Real
36 {
37  // div U = du/dx + dv/dy + dw/dz
38  return _grad_u_vel[_qp](0) + _grad_v_vel[_qp](1) + _grad_w_vel[_qp](2);
39 }
InputParameters validParams< INSDivergenceAux >()
INSDivergenceAux(const InputParameters &parameters)
const VariableGradient & _grad_u_vel
const VariableGradient & _grad_w_vel
const VariableGradient & _grad_v_vel
virtual Real computeValue()