https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NSInternalEnergyAux.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
18
21{
23
24 params.addClassDescription("Auxiliary kernel for computing the internal energy of the fluid.");
25 params.addRequiredCoupledVar(NS::density, "density");
26 params.addRequiredCoupledVar(NS::velocity_x, "x-velocity");
27 params.addCoupledVar(NS::velocity_y, "y-velocity"); // Only required in >= 2D
28 params.addCoupledVar(NS::velocity_z, "z-velocity"); // Only required in 3D...
29 params.addRequiredCoupledVar(NS::total_energy_density, "total energy");
30
31 return params;
32}
33
35 : AuxKernel(parameters),
36 _rho(coupledValue(NS::density)),
37 _u_vel(coupledValue(NS::velocity_x)),
38 _v_vel(_mesh.dimension() >= 2 ? coupledValue(NS::velocity_y) : _zero),
39 _w_vel(_mesh.dimension() == 3 ? coupledValue(NS::velocity_z) : _zero),
40 _rho_et(coupledValue(NS::total_energy_density))
41{
42}
43
44Real
46{
47 const RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
48
49 return _rho_et[_qp] / _rho[_qp] - 0.5 * vel.norm_sq();
50}
registerMooseObject("NavierStokesApp", NSInternalEnergyAux)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
Auxiliary kernel for computing the internal energy of the fluid.
const VariableValue & _w_vel
const VariableValue & _u_vel
virtual Real computeValue()
NSInternalEnergyAux(const InputParameters &parameters)
const VariableValue & _rho_et
static InputParameters validParams()
const VariableValue & _rho
const VariableValue & _v_vel
static const std::string density
Definition NS.h:34
static const std::string velocity_y
Definition NS.h:48
static const std::string total_energy_density
Definition NS.h:66
static const std::string velocity_z
Definition NS.h:49
static const std::string velocity_x
Definition NS.h:47