www.mooseframework.org
NSEnthalpyAux.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 "NSEnthalpyAux.h"
12 #include "NS.h"
13 
14 registerMooseObject("NavierStokesApp", NSEnthalpyAux);
15 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<AuxKernel>();
21 
22  params.addClassDescription("Nodal auxiliary variable, for computing enthalpy at the nodes.");
23  // Mark variables as required
24  params.addRequiredCoupledVar(NS::density, "density");
25  params.addRequiredCoupledVar(NS::total_energy, "total energy");
26  params.addRequiredCoupledVar(NS::pressure, "pressure");
27 
28  return params;
29 }
30 
31 NSEnthalpyAux::NSEnthalpyAux(const InputParameters & parameters)
32  : AuxKernel(parameters),
33  _rho(coupledValue(NS::density)),
34  _rhoE(coupledValue(NS::total_energy)),
35  _pressure(coupledValue(NS::pressure))
36 {
37 }
38 
39 Real
41 {
42  // H = (rho*E + P) / rho
43  return (_rhoE[_qp] + _pressure[_qp]) / _rho[_qp];
44 }
NSEnthalpyAux
Nodal auxiliary variable, for computing enthalpy at the nodes.
Definition: NSEnthalpyAux.h:31
validParams< NSEnthalpyAux >
InputParameters validParams< NSEnthalpyAux >()
Definition: NSEnthalpyAux.C:18
registerMooseObject
registerMooseObject("NavierStokesApp", NSEnthalpyAux)
NSEnthalpyAux::_pressure
const VariableValue & _pressure
Definition: NSEnthalpyAux.h:41
NSEnthalpyAux::_rho
const VariableValue & _rho
Definition: NSEnthalpyAux.h:39
NSEnthalpyAux::computeValue
virtual Real computeValue()
Definition: NSEnthalpyAux.C:40
NSEnthalpyAux::NSEnthalpyAux
NSEnthalpyAux(const InputParameters &parameters)
Definition: NSEnthalpyAux.C:31
NSEnthalpyAux::_rhoE
const VariableValue & _rhoE
Definition: NSEnthalpyAux.h:40
NS
Definition: NS.h:14
NS::density
const std::string density
Definition: NS.h:16
NSEnthalpyAux.h
NS.h
NS::total_energy
const std::string total_energy
Definition: NS.h:20
NS::pressure
const std::string pressure
Definition: NS.h:25