www.mooseframework.org
NSInternalEnergyAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 // Navier-Stokes includes
11 #include "NSInternalEnergyAux.h"
12 #include "NS.h"
13 
14 // MOOSE includes
15 #include "MooseMesh.h"
16 
17 registerMooseObject("NavierStokesApp", NSInternalEnergyAux);
18 
19 template <>
20 InputParameters
22 {
23  InputParameters params = validParams<AuxKernel>();
24 
25  params.addClassDescription("Auxiliary kernel for computing the internal energy of the fluid.");
26  params.addRequiredCoupledVar(NS::density, "density");
27  params.addRequiredCoupledVar(NS::velocity_x, "x-velocity");
28  params.addCoupledVar(NS::velocity_y, "y-velocity"); // Only required in >= 2D
29  params.addCoupledVar(NS::velocity_z, "z-velocity"); // Only required in 3D...
30  params.addRequiredCoupledVar(NS::total_energy, "total energy");
31 
32  return params;
33 }
34 
35 NSInternalEnergyAux::NSInternalEnergyAux(const InputParameters & parameters)
36  : AuxKernel(parameters),
37  _rho(coupledValue(NS::density)),
38  _u_vel(coupledValue(NS::velocity_x)),
39  _v_vel(_mesh.dimension() >= 2 ? coupledValue(NS::velocity_y) : _zero),
40  _w_vel(_mesh.dimension() == 3 ? coupledValue(NS::velocity_z) : _zero),
41  _rhoE(coupledValue(NS::total_energy))
42 {
43 }
44 
45 Real
47 {
48  const RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
49 
50  return _rhoE[_qp] / _rho[_qp] - 0.5 * vel.norm_sq();
51 }
NS::velocity_x
const std::string velocity_x
Definition: NS.h:22
registerMooseObject
registerMooseObject("NavierStokesApp", NSInternalEnergyAux)
NSInternalEnergyAux::computeValue
virtual Real computeValue()
Definition: NSInternalEnergyAux.C:46
NSInternalEnergyAux::_rhoE
const VariableValue & _rhoE
Definition: NSInternalEnergyAux.h:37
NS::velocity_y
const std::string velocity_y
Definition: NS.h:23
NSInternalEnergyAux::_rho
const VariableValue & _rho
Definition: NSInternalEnergyAux.h:33
NS::velocity_z
const std::string velocity_z
Definition: NS.h:24
NSInternalEnergyAux.h
NSInternalEnergyAux::_w_vel
const VariableValue & _w_vel
Definition: NSInternalEnergyAux.h:36
NS
Definition: NS.h:14
NSInternalEnergyAux
Auxiliary kernel for computing the internal energy of the fluid.
Definition: NSInternalEnergyAux.h:23
NS::density
const std::string density
Definition: NS.h:16
NSInternalEnergyAux::_v_vel
const VariableValue & _v_vel
Definition: NSInternalEnergyAux.h:35
NSInternalEnergyAux::NSInternalEnergyAux
NSInternalEnergyAux(const InputParameters &parameters)
Definition: NSInternalEnergyAux.C:35
NS.h
NSInternalEnergyAux::_u_vel
const VariableValue & _u_vel
Definition: NSInternalEnergyAux.h:34
validParams< NSInternalEnergyAux >
InputParameters validParams< NSInternalEnergyAux >()
Definition: NSInternalEnergyAux.C:21
NS::total_energy
const std::string total_energy
Definition: NS.h:20