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-2020 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 // Forward declaration of friend functions and operators
48 class thermophysicalFunction;
49 Ostream& operator<<(Ostream& os, const thermophysicalFunction& l);
50 
51 /*---------------------------------------------------------------------------*\
52  Class thermophysicalFunction Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57 
58 public:
59 
60  //- Runtime type information
61  TypeName("thermophysicalFunction");
62 
63 
64  // Declare run-time constructor selection tables
65 
67  (
68  autoPtr,
70  dictionary,
71  (const dictionary& dict),
72  (dict)
73  );
74 
75 
76  // Constructors
77 
78  //- Construct null
80  {}
81 
82  //- Return pointer to new thermophysicalFunction created from dict
84  (
85  const dictionary& dict,
86  const word& name
87  );
88 
89 
90  //- Destructor
91  virtual ~thermophysicalFunction()
92  {}
93 
94 
95  // Member Functions
96 
97  //- Evaluate the function and return the result
98  virtual scalar f(scalar p, scalar T) const = 0;
99 
100  //- Write the function coefficients
101  virtual void write(Ostream& os) const = 0;
102 
103  //- Write the function coefficients within the property sub-dictionary
104  virtual void write(Ostream& os, const word& name) const;
105 
106 
107  // Ostream Operator
108 
109  friend Ostream& operator<<
110  (
111  Ostream& os,
113  );
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
static autoPtr< thermophysicalFunction > New(const dictionary &dict, const word &name)
Return pointer to new thermophysicalFunction created from dict.
virtual ~thermophysicalFunction()
Destructor.
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.
A class for handling words, derived from string.
Definition: word.H:59
virtual void write(Ostream &os) const =0
Write the function coefficients.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
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)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Ostream & operator<<(Ostream &, const ensightPart &)
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.