saturationTemperatureModel.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) 2015-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::saturationTemperatureModel
26 
27 Description
28  Model to describe the dependence of saturation temperature on pressure
29 
30 SourceFiles
31  saturationTemperatureModel.C
32  saturationTemperatureModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef saturationTemperatureModel_H
37 #define saturationTemperatureModel_H
38 
39 #include "volFields.H"
40 #include "dictionary.H"
41 #include "runTimeSelectionTables.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 #define DEFINE_TSAT(FieldType, Modifier) \
46  \
47  virtual tmp<FieldType> Tsat(const FieldType& p) const Modifier; \
48  \
49  virtual tmp<FieldType> TsatPrime(const FieldType& p) const Modifier; \
50 
51 
52 #define IMPLEMENT_TSAT(ModelType, FieldType) \
53  \
54  Foam::tmp<Foam::FieldType> \
55  Foam::ModelType::Tsat(const FieldType& p) const \
56  { \
57  return Tsat<FieldType>(p); \
58  } \
59  \
60  Foam::tmp<Foam::FieldType> \
61  Foam::ModelType::TsatPrime(const FieldType& p) const \
62  { \
63  return TsatPrime<FieldType>(p); \
64  }
65 
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class saturationTemperatureModel Declaration
74 \*---------------------------------------------------------------------------*/
75 
77 {
78 private:
79 
80  // Private Member Functions
81 
82  //- Saturation temperature
83  template<class FieldType>
84  tmp<FieldType> Tsat(const FieldType& p) const;
85 
86  //- Saturation temperature derivative w.r.t. pressure
87  template<class FieldType>
88  tmp<FieldType> TsatPrime(const FieldType& p) const;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("saturationTemperatureModel");
95 
96 
97  //- Declare runtime construction
99  (
100  autoPtr,
102  dictionary,
103  (const dictionary& dict),
104  (dict)
105  );
106 
107 
108  // Constructors
109 
110  //- Default construct
112 
113 
114  // Selectors
115 
116  //- Select with dictionary
118  (
119  const dictionary& dict
120  );
121 
122  //- Select with name within a dictionary
124  (
125  const word& name,
126  const dictionary& dict
127  );
128 
129 
130  //- Destructor
131  virtual ~saturationTemperatureModel();
132 
133 
134  // Member Functions
135 
136  //- Saturation temperature for scalarField
137  DEFINE_TSAT(scalarField, = 0);
138 
139  //- Saturation temperature for volScalarField::Internal
141 
142  //- Saturation temperature for volScalarField
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
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
Model to describe the dependence of saturation temperature on pressure.
static autoPtr< saturationTemperatureModel > New(const dictionary &dict)
Select with dictionary.
TypeName("saturationTemperatureModel")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, saturationTemperatureModel, dictionary,(const dictionary &dict),(dict))
Declare runtime construction.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Macros to ease declaration of run-time selection tables.
#define DEFINE_TSAT(FieldType, Modifier)
dictionary dict
volScalarField & p