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 "RhoFromPressureTemperatureIC.h" 11 : #include "SinglePhaseFluidProperties.h" 12 : 13 : registerMooseObject("FluidPropertiesApp", RhoFromPressureTemperatureIC); 14 : 15 : InputParameters 16 41 : RhoFromPressureTemperatureIC::validParams() 17 : { 18 41 : InputParameters params = InitialCondition::validParams(); 19 82 : params.addRequiredParam<UserObjectName>("fp", "The name of fluid properties user object."); 20 82 : params.addRequiredCoupledVar("p", "The pressure [Pa]"); 21 82 : params.addRequiredCoupledVar("T", "The temperature [K]"); 22 41 : params.addClassDescription("Computes the density from pressure and temperature."); 23 41 : return params; 24 0 : } 25 : 26 22 : RhoFromPressureTemperatureIC::RhoFromPressureTemperatureIC(const InputParameters & parameters) 27 : : InitialCondition(parameters), 28 22 : _spfp(getUserObject<SinglePhaseFluidProperties>("fp")), 29 22 : _p(coupledValue("p")), 30 44 : _T(coupledValue("T")) 31 : { 32 22 : } 33 : 34 : Real 35 18 : RhoFromPressureTemperatureIC::value(const Point & /*p*/) 36 : { 37 18 : return _spfp.rho_from_p_T(_p[_qp], _T[_qp]); 38 : }