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 "SoundSpeedAux.h" 11 : #include "SinglePhaseFluidProperties.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", SoundSpeedAux); 14 : 15 : InputParameters 16 41 : SoundSpeedAux::validParams() 17 : { 18 41 : InputParameters params = AuxKernel::validParams(); 19 82 : params.addRequiredCoupledVar("v", "specific volume"); 20 82 : params.addRequiredCoupledVar("e", "specific internal energy"); 21 82 : params.addRequiredParam<UserObjectName>("fp", "The name of fluid properties object to use."); 22 41 : params.addClassDescription("Computes the speed of sound."); 23 : 24 41 : return params; 25 0 : } 26 : 27 22 : SoundSpeedAux::SoundSpeedAux(const InputParameters & parameters) 28 : : AuxKernel(parameters), 29 22 : _v(coupledValue("v")), 30 22 : _e(coupledValue("e")), 31 44 : _fp(getUserObject<SinglePhaseFluidProperties>("fp")) 32 : { 33 22 : } 34 : 35 : Real 36 9 : SoundSpeedAux::computeValue() 37 : { 38 9 : return _fp.c_from_v_e(_v[_qp], _e[_qp]); 39 : }