www.mooseframework.org
NSInternalEnergyAux.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 // Navier-Stokes includes
9 #include "NSInternalEnergyAux.h"
10 #include "NS.h"
11 
12 // MOOSE includes
13 #include "MooseMesh.h"
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<AuxKernel>();
20 
21  params.addClassDescription("Auxiliary kernel for computing the internal energy of the fluid.");
22  params.addRequiredCoupledVar(NS::density, "density");
23  params.addRequiredCoupledVar(NS::velocity_x, "x-velocity");
24  params.addCoupledVar(NS::velocity_y, "y-velocity"); // Only required in >= 2D
25  params.addCoupledVar(NS::velocity_z, "z-velocity"); // Only required in 3D...
26  params.addRequiredCoupledVar(NS::total_energy, "total energy");
27 
28  return params;
29 }
30 
31 NSInternalEnergyAux::NSInternalEnergyAux(const InputParameters & parameters)
32  : AuxKernel(parameters),
33  _rho(coupledValue(NS::density)),
34  _u_vel(coupledValue(NS::velocity_x)),
35  _v_vel(_mesh.dimension() >= 2 ? coupledValue(NS::velocity_y) : _zero),
36  _w_vel(_mesh.dimension() == 3 ? coupledValue(NS::velocity_z) : _zero),
37  _rhoE(coupledValue(NS::total_energy))
38 {
39 }
40 
41 Real
43 {
44  const RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
45 
46  return _rhoE[_qp] / _rho[_qp] - 0.5 * vel.norm_sq();
47 }
Definition: NS.h:13
const std::string velocity_z
Definition: NS.h:23
const std::string density
Definition: NS.h:15
const VariableValue & _rho
const std::string velocity_x
Definition: NS.h:21
virtual Real computeValue()
const VariableValue & _u_vel
const VariableValue & _w_vel
const std::string velocity_y
Definition: NS.h:22
InputParameters validParams< NSInternalEnergyAux >()
const VariableValue & _v_vel
const std::string total_energy
Definition: NS.h:19
const VariableValue & _rhoE
NSInternalEnergyAux(const InputParameters &parameters)