saturationPressureModel.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::saturationPressureModel
26 
27 Description
28  Model to describe the dependence of saturation pressure on temperature
29 
30 SourceFiles
31  saturationPressureModel.C
32  saturationPressureModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef saturationPressureModel_H
37 #define saturationPressureModel_H
38 
39 #include "volFields.H"
40 #include "dictionary.H"
41 #include "runTimeSelectionTables.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 #define DEFINE_PSAT(FieldType, Modifier) \
46  \
47  virtual tmp<FieldType> pSat(const FieldType& T) const Modifier; \
48  \
49  virtual tmp<FieldType> pSatPrime(const FieldType& T) const Modifier; \
50  \
51  virtual tmp<FieldType> lnPSat(const FieldType& T) const Modifier;
52 
53 
54 #define IMPLEMENT_PSAT(ModelType, FieldType) \
55  \
56  Foam::tmp<Foam::FieldType> \
57  Foam::ModelType::pSat(const FieldType& T) const \
58  { \
59  return pSat<FieldType>(T); \
60  } \
61  \
62  Foam::tmp<Foam::FieldType> \
63  Foam::ModelType::pSatPrime(const FieldType& T) const \
64  { \
65  return pSatPrime<FieldType>(T); \
66  } \
67  \
68  Foam::tmp<Foam::FieldType> \
69  Foam::ModelType::lnPSat(const FieldType& T) const \
70  { \
71  return lnPSat<FieldType>(T); \
72  }
73 
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class saturationPressureModel Declaration
82 \*---------------------------------------------------------------------------*/
83 
85 {
86 private:
87 
88  // Private Member Functions
89 
90  //- Saturation pressure
91  template<class FieldType>
92  tmp<FieldType> pSat(const FieldType& T) const;
93 
94  //- Saturation pressure derivative w.r.t. temperature
95  template<class FieldType>
96  tmp<FieldType> pSatPrime(const FieldType& T) const;
97 
98  //- Natural log of the saturation pressure
99  template<class FieldType>
100  tmp<FieldType> lnPSat(const FieldType& T) const;
101 
102 
103 public:
104 
105  //- Runtime type information
106  TypeName("saturationPressureModel");
107 
108 
109  //- Declare runtime construction
111  (
112  autoPtr,
114  dictionary,
115  (const dictionary& dict),
116  (dict)
117  );
118 
119 
120  // Constructors
121 
122  //- Default construct
124 
125 
126  // Selectors
127 
128  //- Select with dictionary
130  (
131  const dictionary& dict
132  );
133 
134  //- Select with name within a dictionary
136  (
137  const word& name,
138  const dictionary& dict
139  );
140 
141 
142  //- Destructor
143  virtual ~saturationPressureModel();
144 
145 
146  // Member Functions
147 
148  //- Saturation temperature for scalarField
149  DEFINE_PSAT(scalarField, = 0);
150 
151  //- Saturation pressure for volScalarField::Internal
153 
154  //- Saturation pressure for volScalarField
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
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 pressure on temperature.
declareRunTimeSelectionTable(autoPtr, saturationPressureModel, dictionary,(const dictionary &dict),(dict))
Declare runtime construction.
saturationPressureModel()
Default construct.
TypeName("saturationPressureModel")
Runtime type information.
static autoPtr< saturationPressureModel > New(const dictionary &dict)
Select with dictionary.
virtual ~saturationPressureModel()
Destructor.
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.
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
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_PSAT(FieldType, Modifier)
dictionary dict