thermophysicalFunction.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) 2011-2018 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  dictionary,
67  (const dictionary& dict),
68  (dict)
69  );
70 
71 
72  // Constructors
73 
74  //- Construct null
76  {}
77 
78  //- Return pointer to new thermophysicalFunction created from dict
80 
81 
82  //- Destructor
83  virtual ~thermophysicalFunction()
84  {}
85 
86 
87  // Member Functions
88 
89  //- Evaluate the function and return the result
90  virtual scalar f(scalar p, scalar T) const = 0;
91 
92  //- Write the function coefficients
93  virtual void writeData(Ostream& os) const = 0;
94 
95 
96  // Ostream Operator
97 
99  {
100  f.writeData(os);
101  return os;
102  }
103 };
104 
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 } // End namespace Foam
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
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...
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(const dictionary &dict)
Return pointer to new thermophysicalFunction created from dict.
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:52
Macros to ease declaration of run-time selection tables.
volScalarField & p
declareRunTimeSelectionTable(autoPtr, thermophysicalFunction, dictionary,(const dictionary &dict),(dict))
Namespace for OpenFOAM.