polynomial.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2015 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::polynomial
26 
27 Description
28  Polynomial equation for the saturation vapour temperature in terms of
29  the vapour pressure (in Pa).
30 
31  \f[
32  T_sat = \sum_i C_i p^i
33  \f]
34 
35  where \f$p\f$ is the pressure in Pa and \f$C\f$ are the coefficients.
36 
37  Currently this class only provides \f$T_sat\f$, the inverse function to
38  return the vapour pressure for a given temperature are not implemented.
39 
40 SourceFiles
41  polynomial.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef polynomial_H
46 #define polynomial_H
47 
48 #include "saturationModel.H"
49 #include "Polynomial.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 namespace saturationModels
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class polynomial Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class polynomial
63 :
64  public saturationModel
65 {
66  // Private data
67 
68  //- Polynomial coefficients
69  Polynomial<8> C_;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("polynomial");
76 
77  // Constructors
78 
79  //- Construct from a dictionary
80  polynomial(const dictionary& dict);
81 
82 
83  //- Destructor
84  virtual ~polynomial();
85 
86 
87  // Member Functions
88 
89  //- Saturation pressure
90  virtual tmp<volScalarField> pSat(const volScalarField& T) const;
91 
92  //- Saturation pressure derivetive w.r.t. temperature
93  virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
94 
95  //- Natural log of the saturation pressure
96  virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
97 
98  //- Saturation temperature
99  virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
100 };
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 } // End namespace saturationModels
106 } // End namespace Foam
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 #endif
111 
112 // ************************************************************************* //
virtual tmp< volScalarField > Tsat(const volScalarField &p) const
Saturation temperature.
dictionary dict
virtual ~polynomial()
Destructor.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
TypeName("polynomial")
Runtime type information.
virtual tmp< volScalarField > pSat(const volScalarField &T) const
Saturation pressure.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
polynomial(const dictionary &dict)
Construct from a dictionary.
virtual tmp< volScalarField > lnPSat(const volScalarField &T) const
Natural log of the saturation pressure.
Polynomial equation for the saturation vapour temperature in terms of the vapour pressure (in Pa)...
Definition: polynomial.H:61
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volScalarField > pSatPrime(const volScalarField &T) const
Saturation pressure derivetive w.r.t. temperature.
Namespace for OpenFOAM.