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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::thermophysicalFunction
29 
30 Description
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"
42 #include "runTimeSelectionTables.H"
43 #include "dictionary.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class thermophysicalFunction Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56 
57 public:
58 
59  //- Runtime type information
60  TypeName("thermophysicalFunction");
61 
62 
63  // Declare run-time constructor selection tables
64 
66  (
67  autoPtr,
69  Istream,
70  (Istream& is),
71  (is)
72  );
73 
75  (
76  autoPtr,
78  dictionary,
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
111 
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 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
IOstreams.H
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
typeInfo.H
Foam::thermophysicalFunction
Abstract base class for thermo-physical functions.
Definition: thermophysicalFunction.H:53
Foam::thermophysicalFunction::writeData
virtual void writeData(Ostream &os) const =0
Write the function coefficients.
Foam::thermophysicalFunction::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, thermophysicalFunction, Istream,(Istream &is),(is))
Foam::thermophysicalFunction::thermophysicalFunction
thermophysicalFunction()
Construct null.
Definition: thermophysicalFunction.H:86
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
scalar.H
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::thermophysicalFunction::~thermophysicalFunction
virtual ~thermophysicalFunction()=default
Destructor.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::thermophysicalFunction::f
virtual scalar f(scalar p, scalar T) const =0
Evaluate the function and return the result.
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
dictionary.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::thermophysicalFunction::operator<<
friend Ostream & operator<<(Ostream &os, const thermophysicalFunction &f)
Definition: thermophysicalFunction.H:111
Foam::thermophysicalFunction::TypeName
TypeName("thermophysicalFunction")
Runtime type information.
Foam::thermophysicalFunction::New
static autoPtr< thermophysicalFunction > New(Istream &is)
Return pointer to new thermophysicalFunction created from input.
Definition: thermophysicalFunction.C:45
autoPtr.H