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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::thermophysicalFunction
29
30Description
31 Abstract base class for thermo-physical functions
32
33\*---------------------------------------------------------------------------*/
34
35#ifndef thermophysicalFunction_H
36#define thermophysicalFunction_H
37
38#include "scalar.H"
39#include "IOstreams.H"
40#include "typeInfo.H"
41#include "autoPtr.H"
43#include "dictionary.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class thermophysicalFunction Declaration
52\*---------------------------------------------------------------------------*/
55{
56
57public:
58
59 //- Runtime type information
60 TypeName("thermophysicalFunction");
61
62
63 // Declare run-time constructor selection tables
66 (
67 autoPtr,
69 Istream,
70 (Istream& is),
71 (is)
72 );
75 (
76 autoPtr,
79 (const dictionary& dict),
80 (dict)
81 );
82
83
84 // Constructors
85
86 //- Construct null
88 {}
89
90 //- Return pointer to new thermophysicalFunction created from input
92
93 //- Return pointer to new thermophysicalFunction created from dict
95
96
97 //- Destructor
98 virtual ~thermophysicalFunction() = default;
99
100
101 // Member Functions
102
103 //- Evaluate the function and return the result
104 virtual scalar f(scalar p, scalar T) const = 0;
105
106 //- Write the function coefficients
107 virtual void writeData(Ostream& os) const = 0;
108
109
110 // Ostream Operator
113 {
114 f.writeData(os);
115 return os;
116 }
117};
118
119
120// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121
122} // End namespace Foam
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126#endif
127
128// ************************************************************************* //
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Abstract base class for thermo-physical functions.
declareRunTimeSelectionTable(autoPtr, thermophysicalFunction, dictionary,(const dictionary &dict),(dict))
declareRunTimeSelectionTable(autoPtr, thermophysicalFunction, Istream,(Istream &is),(is))
friend Ostream & operator<<(Ostream &os, const thermophysicalFunction &f)
TypeName("thermophysicalFunction")
Runtime type information.
virtual ~thermophysicalFunction()=default
Destructor.
virtual scalar f(scalar p, scalar T) const =0
Evaluate the function and return the result.
virtual void writeData(Ostream &os) const =0
Write the function coefficients.
static autoPtr< thermophysicalFunction > New(Istream &is)
Return pointer to new thermophysicalFunction created from input.
volScalarField & p
const volScalarField & T
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73