www.mooseframework.org
InternalEnergyAux.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 #include "InternalEnergyAux.h"
12 #include "NS.h"
13 
14 registerMooseObject("NavierStokesApp", InternalEnergyAux);
15 
18 {
20  params.addRequiredCoupledVar("density", "Density (conserved form)");
21  params.addRequiredCoupledVar(NS::pressure, "Pressure");
22  params.addRequiredParam<UserObjectName>("fp", "The name of the equation of state user object");
23  params.addClassDescription("This AuxKernel computes the internal energy based on the equation "
24  "of state / fluid properties and the local pressure and density.");
25 
26  return params;
27 }
28 
30  : AuxKernel(parameters),
31  _pressure(coupledValue(NS::pressure)),
32  _rho(coupledValue("density")),
33  _fp(getUserObject<SinglePhaseFluidProperties>("fp"))
34 {
35 }
36 
37 Real
39 {
40  return _fp.e_from_p_rho(_pressure[_qp], _rho[_qp]);
41 }
Compute internal energy given equation of state pressure and density.
registerMooseObject("NavierStokesApp", InternalEnergyAux)
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
const SinglePhaseFluidProperties & _fp
virtual Real computeValue()
const VariableValue & _rho
Common class for single phase fluid properties.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableValue & _pressure
static const std::string pressure
Definition: NS.h:56
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
InternalEnergyAux(const InputParameters &parameters)