All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
polynomial.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-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::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 
78  // Constructors
79 
80  //- Construct from a dictionary and an interface
82  (
83  const dictionary& dict,
85  );
86 
87 
88  //- Destructor
89  virtual ~polynomial();
90 
91 
92  // Member Functions
93 
94  //- Saturation pressure
95  virtual tmp<volScalarField> pSat(const volScalarField& T) const;
96 
97  //- Saturation pressure derivative w.r.t. temperature
98  virtual tmp<volScalarField> pSatPrime(const volScalarField& T) const;
99 
100  //- Natural log of the saturation pressure
101  virtual tmp<volScalarField> lnPSat(const volScalarField& T) const;
102 
103  //- Saturation temperature
104  virtual tmp<volScalarField> Tsat(const volScalarField& p) const;
105 };
106 
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 } // End namespace saturationModels
111 } // End namespace Foam
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #endif
116 
117 // ************************************************************************* //
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:156
TypeName("polynomial")
Runtime type information.
Class to represent an interface between phases. Derivations can further specify the configuration of ...
const phaseInterface & interface() const
Access the interface.
virtual tmp< volScalarField > pSat(const volScalarField &T) const
Saturation pressure.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Model to describe the dependence of saturation pressure on temperature, and vice versa.
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
polynomial(const dictionary &dict, const phaseInterface &interface)
Construct from a dictionary and an interface.
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volScalarField > pSatPrime(const volScalarField &T) const
Saturation pressure derivative w.r.t. temperature.
Namespace for OpenFOAM.