function1Temperature.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2017-2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::saturationModels::function1Temperature
26 
27 Description
28  Saturation vapour temperature in terms of the vapour pressure (in Pa). The
29  saturation temperature in Kelvins is specified as a Foam::Function1 type,
30  to enable use of, e.g. constant, polynomial, table values.
31 
32  Examples:
33 
34  \verbatim
35  type function1;
36  function polynomial
37  (
38  308.0422
39  0.0015096
40  -1.61589e-8
41  1.114106e-13
42  -4.52216e-19
43  1.05192e-24
44  -1.2953e-30
45  6.5365e-37
46  );
47  \endverbatim
48 
49  \verbatim
50  type function1;
51  function
52  {
53  type table;
54  file "filename.csv";
55  format csv;
56  nHeaderLine 1;
57  columns (0 1);
58  separator ",";
59  mergeSeparators no;
60  outOfBounds clamp;
61  interpolationScheme linear;
62  }
63  \endverbatim
64 
65 SourceFiles
66  function1Temperature.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef function1Temperature_H
71 #define function1Temperature_H
72 
74 #include "Function1.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 namespace saturationModels
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class function1Temperature Declaration
85 \*---------------------------------------------------------------------------*/
86 
88 :
90 {
91  // Private Data
92 
93  //- Saturation temperature as a function of pressure
94  autoPtr<Function1<scalar>> function_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("function1");
101 
102 
103  // Constructors
104 
105  //- Construct from a dictionary and an interface
107  (
108  const dictionary& dict
109  );
110 
111 
112  //- Destructor
113  virtual ~function1Temperature();
114 
115 
116  // Member Functions
117 
118  //- Saturation temperature for scalarField
119  virtual tmp<scalarField> Tsat(const scalarField& p) const;
120 
121  //- Saturation temperature derivative w.r.t. pressure for scalarField
122  virtual tmp<scalarField> TsatPrime(const scalarField& p) const;
123 };
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 } // End namespace saturationModels
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Saturation vapour temperature in terms of the vapour pressure (in Pa). The saturation temperature in ...
TypeName("function1")
Runtime type information.
virtual tmp< scalarField > Tsat(const scalarField &p) const
Saturation temperature for scalarField.
virtual tmp< scalarField > TsatPrime(const scalarField &p) const
Saturation temperature derivative w.r.t. pressure for scalarField.
function1Temperature(const dictionary &dict)
Construct from a dictionary and an interface.
Model to describe the dependence of saturation temperature on pressure.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
dictionary dict
volScalarField & p