https://mooseframework.inl.gov
SaturationTemperatureFunction.C
Go to the documentation of this file.
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 
12 
14 
17 {
19 
20  params.addRequiredParam<FunctionName>("p", "Pressure function");
21  params.addRequiredParam<UserObjectName>("fp_2phase", "2-phase fluid properties");
22 
23  params.addClassDescription(
24  "Computes saturation temperature from pressure function and 2-phase fluid properties object");
25 
26  return params;
27 }
28 
30  : Function(parameters),
31  FunctionInterface(this),
32 
33  _p_fn(getFunction("p"))
34 {
35 }
36 
37 void
39 {
40  _fp_2phase = &getUserObject<TwoPhaseFluidProperties>("fp_2phase");
41 }
42 
43 Real
44 SaturationTemperatureFunction::value(Real t, const Point & point) const
45 {
46  return _fp_2phase->T_sat(_p_fn.value(t, point));
47 }
48 
50 SaturationTemperatureFunction::gradient(Real t, const Point & point) const
51 {
52  return _fp_2phase->dT_sat_dp(_p_fn.value(t, point)) * _p_fn.gradient(t, point);
53 }
SaturationTemperatureFunction(const InputParameters &parameters)
registerMooseObject("FluidPropertiesApp", SaturationTemperatureFunction)
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual Real value(Real t, const Point &p) const override
Computes saturation temperature from pressure function and 2-phase fluid properties object...
virtual RealVectorValue gradient(Real t, const Point &p) const override
virtual Real dT_sat_dp(Real p) const =0
Computes dT/dp along the saturation line.
virtual Real T_sat(Real p) const =0
Computes the saturation temperature at a pressure.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual RealGradient gradient(Real t, const Point &p) const
const Function & _p_fn
Pressure function.
void addClassDescription(const std::string &doc_string)
virtual Real value(Real t, const Point &p) const
static InputParameters validParams()
const TwoPhaseFluidProperties * _fp_2phase
2-phase fluid properties object