1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
25 Foam::thermophysicalFunction
28 Abstract base class for thermo-physical functions
30 \*---------------------------------------------------------------------------*/
32 #ifndef thermophysicalFunction_H
33 #define thermophysicalFunction_H
36 #include "IOstreams.H"
39 #include "runTimeSelectionTables.H"
40 #include "dictionary.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class thermophysicalFunction Declaration
49 \*---------------------------------------------------------------------------*/
51 class thermophysicalFunction
56 //- Runtime type information
57 TypeName("thermophysicalFunction");
60 // Declare run-time constructor selection tables
62 declareRunTimeSelectionTable
65 thermophysicalFunction,
71 declareRunTimeSelectionTable
74 thermophysicalFunction,
76 (const dictionary& dict),
84 thermophysicalFunction()
87 //- Return pointer to new thermophysicalFunction created from input
88 static autoPtr<thermophysicalFunction> New(Istream& is);
90 //- Return pointer to new thermophysicalFunction created from dict
91 static autoPtr<thermophysicalFunction> New(const dictionary& dict);
95 virtual ~thermophysicalFunction()
101 //- Evaluate the function and return the result
102 virtual scalar f(scalar p, scalar T) const = 0;
104 //- Write the function coefficients
105 virtual void writeData(Ostream& os) const = 0;
110 friend Ostream& operator<<(Ostream& os, const thermophysicalFunction& f)
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 } // End namespace Foam
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 // ************************************************************************* //