FreeFOAM The Cross-Platform CFD Toolkit
eConstThermo.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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::eConstThermo
26 
27 Description
28  Constant properties thermodynamics package templated on an equation of
29  state
30 
31 SourceFiles
32  eConstThermoI.H
33  eConstThermo.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef eConstThermo_H
38 #define eConstThermo_H
39 
40 #include <specie/specieThermo.H>
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of friend functions and operators
48 
49 template<class equationOfState> class eConstThermo;
50 
51 template<class equationOfState>
52 inline eConstThermo<equationOfState> operator+
53 (
54  const eConstThermo<equationOfState>&,
55  const eConstThermo<equationOfState>&
56 );
57 
58 template<class equationOfState>
59 inline eConstThermo<equationOfState> operator-
60 (
61  const eConstThermo<equationOfState>&,
62  const eConstThermo<equationOfState>&
63 );
64 
65 template<class equationOfState>
66 inline eConstThermo<equationOfState> operator*
67 (
68  const scalar,
69  const eConstThermo<equationOfState>&
70 );
71 
72 template<class equationOfState>
73 inline eConstThermo<equationOfState> operator==
74 (
75  const eConstThermo<equationOfState>&,
76  const eConstThermo<equationOfState>&
77 );
78 
79 template<class equationOfState>
80 Ostream& operator<<
81 (
82  Ostream&,
83  const eConstThermo<equationOfState>&
84 );
85 
86 
87 /*---------------------------------------------------------------------------*\
88  Class eConstThermo Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 template<class equationOfState>
93 :
94  public equationOfState
95 {
96  // Private data
97 
98  scalar Cv_;
99  scalar Hf_;
100 
101 
102  // Private member functions
103 
104  //- Construct from components
105  inline eConstThermo
106  (
107  const equationOfState& st,
108  const scalar cv,
109  const scalar hf
110  );
111 
112 
113 public:
114 
115  // Constructors
116 
117  //- Construct from Istream
119 
120  //- Construct as named copy
121  inline eConstThermo(const word&, const eConstThermo&);
122 
123  //- Construct and return a clone
124  inline autoPtr<eConstThermo> clone() const;
125 
126  // Selector from Istream
127  inline static autoPtr<eConstThermo> New(Istream& is);
128 
129 
130  // Member Functions
131 
132  // Fundamaental properties
133 
134  //- Heat capacity at constant pressure [J/(kmol K)]
135  inline scalar cp(const scalar T) const;
136 
137  //- Enthalpy [J/kmol]
138  inline scalar h(const scalar T) const;
139 
140  //- Sensible Enthalpy [J/kmol]
141  inline scalar hs(const scalar T) const;
142 
143  //- Chemical enthalpy [J/kmol]
144  inline scalar hc() const;
145 
146  //- Entropy [J/(kmol K)]
147  inline scalar s(const scalar T) const;
148 
149 
150  // Member operators
151 
152  inline void operator+=(const eConstThermo&);
153  inline void operator-=(const eConstThermo&);
154 
155 
156  // Friend operators
157 
158  friend eConstThermo operator+ <equationOfState>
159  (
160  const eConstThermo&,
161  const eConstThermo&
162  );
163 
164  friend eConstThermo operator- <equationOfState>
165  (
166  const eConstThermo&,
167  const eConstThermo&
168  );
169 
170  friend eConstThermo operator* <equationOfState>
171  (
172  const scalar,
173  const eConstThermo&
174  );
175 
176  friend eConstThermo operator== <equationOfState>
177  (
178  const eConstThermo&,
179  const eConstThermo&
180  );
181 
182 
183  // IOstream Operators
184 
185  friend Ostream& operator<< <equationOfState>
186  (
187  Ostream&,
188  const eConstThermo&
189  );
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #include <specie/eConstThermoI.H>
200 
201 #ifdef NoRepository
202 # include "eConstThermo.C"
203 #endif
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************ vim: set sw=4 sts=4 et: ************************ //