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 : // Navier-Stokes includes 11 : #include "SoundspeedMat.h" 12 : #include "NS.h" 13 : 14 : // FluidProperties includes 15 : #include "SinglePhaseFluidProperties.h" 16 : 17 : registerMooseObject("NavierStokesApp", SoundspeedMat); 18 : 19 : InputParameters 20 260 : SoundspeedMat::validParams() 21 : { 22 260 : auto params = Material::validParams(); 23 260 : params.addRequiredParam<UserObjectName>(NS::fluid, "fluid userobject"); 24 260 : params.addClassDescription("Computes the speed of sound"); 25 260 : return params; 26 0 : } 27 : 28 204 : SoundspeedMat::SoundspeedMat(const InputParameters & parameters) 29 : : Material(parameters), 30 204 : _sound_speed(declareADProperty<Real>(NS::sound_speed)), 31 204 : _pressure(getADMaterialProperty<Real>(NS::pressure)), 32 204 : _temperature(getADMaterialProperty<Real>(NS::T_fluid)), 33 408 : _fluid(getUserObject<SinglePhaseFluidProperties>(NS::fluid)) 34 : { 35 204 : } 36 : 37 : void 38 1449461 : SoundspeedMat::computeQpProperties() 39 : { 40 1449461 : _sound_speed[_qp] = _fluid.c_from_p_T(_pressure[_qp], _temperature[_qp]); 41 1449461 : }