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 "THMSpecificInternalEnergyAux.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", THMSpecificInternalEnergyAux); 13 : 14 : InputParameters 15 9018 : THMSpecificInternalEnergyAux::validParams() 16 : { 17 9018 : InputParameters params = AuxKernel::validParams(); 18 18036 : params.addRequiredCoupledVar("rhoA", "Conserved density"); 19 18036 : params.addRequiredCoupledVar("rhouA", "Conserved momentum"); 20 18036 : params.addRequiredCoupledVar("rhoEA", "Conserved total energy"); 21 9018 : params.addClassDescription("Computed the specific internal energy."); 22 9018 : return params; 23 0 : } 24 : 25 4920 : THMSpecificInternalEnergyAux::THMSpecificInternalEnergyAux(const InputParameters & parameters) 26 : : AuxKernel(parameters), 27 4920 : _rho(coupledValue("rhoA")), 28 4920 : _rhou(coupledValue("rhouA")), 29 9840 : _rhoE(coupledValue("rhoEA")) 30 : { 31 4920 : } 32 : 33 : Real 34 816185 : THMSpecificInternalEnergyAux::computeValue() 35 : { 36 816185 : return (_rhoE[_qp] - 0.5 * _rhou[_qp] * _rhou[_qp] / _rho[_qp]) / _rho[_qp]; 37 : }