Line data Source code
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" 11 : #include "SinglePhaseFluidProperties.h" 12 : #include "NS.h" 13 : 14 : registerMooseObject("NavierStokesApp", InternalEnergyAux); 15 : 16 : InputParameters 17 0 : InternalEnergyAux::validParams() 18 : { 19 0 : InputParameters params = AuxKernel::validParams(); 20 0 : params.addRequiredCoupledVar("density", "Density (conserved form)"); 21 0 : params.addRequiredCoupledVar(NS::pressure, "Pressure"); 22 0 : params.addRequiredParam<UserObjectName>("fp", "The name of the equation of state user object"); 23 0 : 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 0 : return params; 27 0 : } 28 : 29 0 : InternalEnergyAux::InternalEnergyAux(const InputParameters & parameters) 30 : : AuxKernel(parameters), 31 0 : _pressure(coupledValue(NS::pressure)), 32 0 : _rho(coupledValue("density")), 33 0 : _fp(getUserObject<SinglePhaseFluidProperties>("fp")) 34 : { 35 0 : } 36 : 37 : Real 38 0 : InternalEnergyAux::computeValue() 39 : { 40 0 : return _fp.e_from_p_rho(_pressure[_qp], _rho[_qp]); 41 : }