icoTabulated.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) 2020 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::icoTabulated
28
29Description
30 Incompressible of equation of state using non-uniform tabulated
31 density vs temperature.
32
33Usage
34 \table
35 Property | Description
36 rho | Density vs temperature table
37 \endtable
38
39 Example of the specification of the equation of state:
40 \verbatim
41 equationOfState
42 {
43 rho
44 (
45 (200 1010)
46 (350 1000)
47 (400 980)
48 );
49 }
50 \endverbatim
51
52SourceFiles
53 icoTabulatedI.H
54 icoTabulated.C
55
56See also
57 Foam::thermophysicalFunctions::nonUniformTable
58
59\*---------------------------------------------------------------------------*/
60
61#ifndef icoTabulated_H
62#define icoTabulated_H
63
65
66// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67
68namespace Foam
69{
70
71// Forward Declarations
72
73template<class Specie> class icoTabulated;
74
75template<class Specie>
76Ostream& operator<<(Ostream& os, const icoTabulated<Specie>&);
77
78
79/*---------------------------------------------------------------------------*\
80 Class icoTabulated Declaration
81\*---------------------------------------------------------------------------*/
82
83template<class Specie>
84class icoTabulated
85:
86 public Specie
87{
88 // Private Data
90 //- Density table [kg/m^3]
91 nonUniformTable rho_;
92
93
94public:
95
96 // Constructors
97
98 //- Construct from components
99 inline icoTabulated
100 (
101 const Specie& sp,
102 const nonUniformTable& rho
103 );
104
105 //- Construct from dictionary
106 explicit icoTabulated(const dictionary& dict);
107
108 //- Construct as named copy
109 inline icoTabulated(const word& name, const icoTabulated&);
110
111 //- Construct and return a clone
112 inline autoPtr<icoTabulated> clone() const;
113
114 //- Selector from dictionary
115 inline static autoPtr<icoTabulated> New(const dictionary& dict);
116
117
118 // Member Functions
119
120 //- The instantiated type name
121 static word typeName()
122 {
123 return "icoTabulated<" + word(Specie::typeName_()) + '>';
124 }
125
127 // Fundamental Properties
128
129 //- Is the equation of state is incompressible i.e. rho != f(p)
130 static const bool incompressible = true;
131
132 //- Is the equation of state is isochoric i.e. rho = const
133 static const bool isochoric = false;
134
135 //- Return density [kg/m^3]
136 inline scalar rho(scalar p, scalar T) const;
137
138 //- Return enthalpy departure [J/kg]
139 inline scalar H(const scalar p, const scalar T) const;
140
141 //- Return Cp departure [J/(kg K]
142 inline scalar Cp(scalar p, scalar T) const;
143
144 //- Return internal energy departure [J/kg]
145 inline scalar E(const scalar p, const scalar T) const;
146
147 //- Return Cv departure [J/(kg K]
148 inline scalar Cv(scalar p, scalar T) const;
149
150 //- Return entropy departure to the integral of Cp/T [J/kg/K]
151 inline scalar S(const scalar p, const scalar T) const;
152
153 //- Return compressibility [s^2/m^2]
154 inline scalar psi(scalar p, scalar T) const;
155
156 //- Return compression factor []
157 inline scalar Z(scalar p, scalar T) const;
158
159 //- Return (Cp - Cv) [J/(kg K]
160 inline scalar CpMCv(scalar p, scalar T) const;
161
162
163 // IO
164
165 //- Write to Ostream
166 void write(Ostream& os) const;
167
168
169 // Ostream Operator
170
171 friend Ostream& operator<< <Specie>
172 (
173 Ostream&,
174 const icoTabulated&
175 );
177
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181} // End namespace Foam
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185#include "icoTabulatedI.H"
186
187// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188
189#ifdef NoRepository
190 #include "icoTabulated.C"
191#endif
192
193// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194
195#endif
196
197// ************************************************************************* //
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
Incompressible of equation of state using non-uniform tabulated density vs temperature.
Definition: icoTabulated.H:92
scalar E(const scalar p, const scalar T) const
Return internal energy departure [J/kg].
icoTabulated(const word &name, const icoTabulated &)
Construct as named copy.
scalar H(const scalar p, const scalar T) const
Return enthalpy departure [J/kg].
Definition: icoTabulatedI.H:90
static word typeName()
The instantiated type name.
Definition: icoTabulated.H:126
scalar S(const scalar p, const scalar T) const
Return entropy departure to the integral of Cp/T [J/kg/K].
scalar CpMCv(scalar p, scalar T) const
Return (Cp - Cv) [J/(kg K].
autoPtr< icoTabulated > clone() const
Construct and return a clone.
Definition: icoTabulatedI.H:61
static const bool isochoric
Is the equation of state is isochoric i.e. rho = const.
Definition: icoTabulated.H:138
static autoPtr< icoTabulated > New(const dictionary &dict)
Selector from dictionary.
Definition: icoTabulatedI.H:69
static const bool incompressible
Is the equation of state is incompressible i.e. rho != f(p)
Definition: icoTabulated.H:135
scalar Z(scalar p, scalar T) const
Return compression factor [].
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
const volScalarField & psi
const volScalarField & T
const volScalarField & Cv
Definition: EEqn.H:8
const volScalarField & Cp
Definition: EEqn.H:7
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
runTime write()
dictionary dict