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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::saturationModels::polynomial
28 
29 Description
30  Polynomial equation for the saturation vapour temperature in terms of
31  the vapour pressure (in Pa).
32 
33  \f[
34  T_sat = \sum_i C_i p^i
35  \f]
36 
37  where \f$p\f$ is the pressure in Pa and \f$C\f$ are the coefficients.
38 
39  Currently this class only provides \f$T_sat\f$, the inverse function to
40  return the vapour pressure for a given temperature are not implemented.
41 
42 SourceFiles
43  polynomial.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef saturationModels_polynomial_H
48 #define saturationModels_polynomial_H
49 
50 #include "saturationModel.H"
51 #include "Polynomial.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace saturationModels
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class polynomial Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class polynomial
65 :
66  public saturationModel
67 {
68  // Private data
69 
70  //- Polynomial coefficients
71  Polynomial<8> C_;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("polynomial");
78 
79  // Constructors
80 
81  //- Construct from a dictionary
82  polynomial(const dictionary& dict, const objectRegistry& db);
83 
84 
85  //- Destructor
86  virtual ~polynomial();
87 
88 
89  // Member Functions
90 
91  //- Saturation pressure
92  virtual tmp<volScalarField> pSat(const volScalarField& T) const;
93 
94  //- Saturation pressure derivetive w.r.t. temperature
95  virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
96 
97  //- Natural log of the saturation pressure
98  virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
99 
100  //- Saturation temperature
101  virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
102 };
103 
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 } // End namespace saturationModels
108 } // End namespace Foam
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::saturationModels::polynomial::~polynomial
virtual ~polynomial()
Destructor.
Definition: polynomial.C:58
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::saturationModels::polynomial
Polynomial equation for the saturation vapour temperature in terms of the vapour pressure (in Pa).
Definition: polynomial.H:63
Foam::saturationModel
Definition: saturationModel.H:53
Foam::saturationModels::polynomial::pSatPrime
virtual tmp< volScalarField > pSatPrime(const volScalarField &T) const
Saturation pressure derivetive w.r.t. temperature.
Definition: polynomial.C:77
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::saturationModels::polynomial::polynomial
polynomial(const dictionary &dict, const objectRegistry &db)
Construct from a dictionary.
Definition: polynomial.C:46
Foam::saturationModels::polynomial::pSat
virtual tmp< volScalarField > pSat(const volScalarField &T) const
Saturation pressure.
Definition: polynomial.C:66
saturationModel.H
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::saturationModels::polynomial::lnPSat
virtual tmp< volScalarField > lnPSat(const volScalarField &T) const
Natural log of the saturation pressure.
Definition: polynomial.C:88
Polynomial.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Polynomial< 8 >
Foam::saturationModels::polynomial::Tsat
virtual tmp< volScalarField > Tsat(const volScalarField &p) const
Saturation temperature.
Definition: polynomial.C:99
Foam::saturationModels::polynomial::TypeName
TypeName("polynomial")
Runtime type information.
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::IOobject::db
const objectRegistry & db() const noexcept
Return the local objectRegistry.
Definition: IOobject.C:487