https://mooseframework.inl.gov
Loading...
Searching...
No Matches
InternalEnergyAux.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#include "InternalEnergyAux.h"
12#include "NS.h"
13
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
37Real
39{
40 return _fp.e_from_p_rho(_pressure[_qp], _rho[_qp]);
41}
registerMooseObject("NavierStokesApp", InternalEnergyAux)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Compute internal energy given equation of state pressure and density.
const SinglePhaseFluidProperties & _fp
const VariableValue & _rho
static InputParameters validParams()
InternalEnergyAux(const InputParameters &parameters)
virtual Real computeValue()
const VariableValue & _pressure
Common class for single phase fluid properties.
static const std::string pressure
Definition NS.h:57