function1.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-2022 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::function1
26 
27 Description
28  Saturation vapour temperature in terms of
29  the vapour pressure (in Pa). The saturation temperature in Kelvins is
30  specified as a Foam::Function1 type, to enable use of, e.g. constant,
31  polynomial, table values.
32 
33  Currently this class only provides \f$T_sat\f$, the inverse function to
34  return the vapour pressure for a given temperature are not implemented.
35 
36  Examples:
37 
38  \verbatim
39  type function1;
40  function polynomial
41  (
42  (308.0422 0)
43  (0.0015096 1)
44  (-1.61589e-8 2)
45  (1.114106e-13 3)
46  (-4.52216e-19 4)
47  (1.05192e-24 5)
48  (-1.2953e-30 6)
49  (6.5365e-37 7)
50  )
51  \endverbatim
52 
53  \verbatim
54  type function1;
55  function table;
56  functionCoeffs
57  {
58  file "filename.csv";
59  format csv;
60  nHeaderLine 1;
61  refColumn 0;
62  componentColumns (1);
63  separator ",";
64  mergeSeparators no;
65  outOfBounds clamp;
66  interpolationScheme linear;
67  };
68  \endverbatim
69 
70 SourceFiles
71  function1.C
72 
73 \*---------------------------------------------------------------------------*/
74 
75 #ifndef function1_H
76 #define function1_H
77 
78 #include "saturationModel.H"
79 #include "Function1.H"
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 namespace saturationModels
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class function1 Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class function1
93 :
94  public saturationModel
95 {
96  // Private Data
97 
98  //- Saturation temperature as a function of pressure
99  autoPtr<Function1<scalar>> function_;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("function1");
106 
107 
108  // Constructors
109 
110  //- Construct from a dictionary and an interface
111  function1
112  (
113  const dictionary& dict,
115  );
116 
117 
118  //- Destructor
119  virtual ~function1();
120 
121 
122  // Member Functions
123 
124  //- Saturation pressure
125  virtual tmp<volScalarField> pSat(const volScalarField& T) const;
126 
127  //- Saturation pressure derivative w.r.t. temperature
128  virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
129 
130  //- Natural log of the saturation pressure
131  virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
132 
133  //- Saturation temperature
134  virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace saturationModels
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
dictionary dict
virtual tmp< volScalarField > pSatPrime(const volScalarField &T) const
Saturation pressure derivative w.r.t. temperature.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
function1(const dictionary &dict, const phaseInterface &interface)
Construct from a dictionary and an interface.
virtual tmp< volScalarField > Tsat(const volScalarField &p) const
Saturation temperature.
Class to represent an interface between phases. Derivations can further specify the configuration of ...
TypeName("function1")
Runtime type information.
virtual ~function1()
Destructor.
virtual tmp< volScalarField > pSat(const volScalarField &T) const
Saturation pressure.
const phaseInterface & interface() const
Access the interface.
Saturation vapour temperature in terms of the vapour pressure (in Pa). The saturation temperature in ...
Definition: function1.H:91
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Model to describe the dependence of saturation pressure on temperature, and vice versa.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volScalarField > lnPSat(const volScalarField &T) const
Natural log of the saturation pressure.
Namespace for OpenFOAM.