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 "SaturationTemperatureFunction.h" 11 : #include "TwoPhaseFluidProperties.h" 12 : 13 : registerMooseObject("FluidPropertiesApp", SaturationTemperatureFunction); 14 : 15 : InputParameters 16 41 : SaturationTemperatureFunction::validParams() 17 : { 18 41 : InputParameters params = Function::validParams(); 19 : 20 82 : params.addRequiredParam<FunctionName>("p", "Pressure function"); 21 82 : params.addRequiredParam<UserObjectName>("fp_2phase", "2-phase fluid properties"); 22 : 23 41 : params.addClassDescription( 24 : "Computes saturation temperature from pressure function and 2-phase fluid properties object"); 25 : 26 41 : return params; 27 0 : } 28 : 29 22 : SaturationTemperatureFunction::SaturationTemperatureFunction(const InputParameters & parameters) 30 : : Function(parameters), 31 : FunctionInterface(this), 32 : 33 22 : _p_fn(getFunction("p")) 34 : { 35 22 : } 36 : 37 : void 38 22 : SaturationTemperatureFunction::initialSetup() 39 : { 40 22 : _fp_2phase = &getUserObject<TwoPhaseFluidProperties>("fp_2phase"); 41 22 : } 42 : 43 : Real 44 14 : SaturationTemperatureFunction::value(Real t, const Point & point) const 45 : { 46 14 : return _fp_2phase->T_sat(_p_fn.value(t, point)); 47 : } 48 : 49 : RealVectorValue 50 0 : SaturationTemperatureFunction::gradient(Real t, const Point & point) const 51 : { 52 0 : return _fp_2phase->dT_sat_dp(_p_fn.value(t, point)) * _p_fn.gradient(t, point); 53 : }