thermophysicalFunction.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) 2011 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::thermophysicalFunction
26 
27 Description
28  Abstract base class for thermo-physical functions
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef thermophysicalFunction_H
33 #define thermophysicalFunction_H
34 
35 #include "scalar.H"
36 #include "IOstreams.H"
37 #include "typeInfo.H"
38 #include "autoPtr.H"
39 #include "runTimeSelectionTables.H"
40 #include "dictionary.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class thermophysicalFunction Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 {
53 
54 public:
55 
56  //- Runtime type information
57  TypeName("thermophysicalFunction");
58 
59 
60  // Declare run-time constructor selection tables
61 
63  (
64  autoPtr,
66  Istream,
67  (Istream& is),
68  (is)
69  );
70 
72  (
73  autoPtr,
75  dictionary,
76  (const dictionary& dict),
77  (dict)
78  );
79 
80 
81  // Constructors
82 
83  //- Construct null
85  {}
86 
87  //- Return pointer to new thermophysicalFunction created from input
89 
90  //- Return pointer to new thermophysicalFunction created from dict
92 
93 
94  //- Destructor
95  virtual ~thermophysicalFunction()
96  {}
97 
98 
99  // Member Functions
100 
101  //- Evaluate the function and return the result
102  virtual scalar f(scalar p, scalar T) const = 0;
103 
104  //- Write the function coefficients
105  virtual void writeData(Ostream& os) const = 0;
106 
107 
108  // Ostream Operator
110  friend Ostream& operator<<(Ostream& os, const thermophysicalFunction& f)
111  {
112  f.writeData(os);
113  return os;
114  }
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace Foam
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual ~thermophysicalFunction()
Destructor.
virtual void writeData(Ostream &os) const =0
Write the function coefficients.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
declareRunTimeSelectionTable(autoPtr, thermophysicalFunction, Istream,(Istream &is),(is))
Abstract base class for thermo-physical functions.
friend Ostream & operator<<(Ostream &os, const thermophysicalFunction &f)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual scalar f(scalar p, scalar T) const =0
Evaluate the function and return the result.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static autoPtr< thermophysicalFunction > New(Istream &is)
Return pointer to new thermophysicalFunction created from input.
TypeName("thermophysicalFunction")
Runtime type information.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Macros to ease declaration of run-time selection tables.
volScalarField & p
Namespace for OpenFOAM.