00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef janafThermo2_H
00039 #define janafThermo2_H
00040
00041 #include "scalar.H"
00042
00043
00044
00045 namespace Foam
00046 {
00047
00048
00049
00050 template<class equationOfState> class janafThermo;
00051
00052 template<class equationOfState>
00053 inline janafThermo<equationOfState> operator+
00054 (
00055 const janafThermo<equationOfState>&,
00056 const janafThermo<equationOfState>&
00057 );
00058
00059 template<class equationOfState>
00060 inline janafThermo<equationOfState> operator-
00061 (
00062 const janafThermo<equationOfState>&,
00063 const janafThermo<equationOfState>&
00064 );
00065
00066 template<class equationOfState>
00067 inline janafThermo<equationOfState> operator*
00068 (
00069 const scalar,
00070 const janafThermo<equationOfState>&
00071 );
00072
00073 template<class equationOfState>
00074 inline janafThermo<equationOfState> operator==
00075 (
00076 const janafThermo<equationOfState>&,
00077 const janafThermo<equationOfState>&
00078 );
00079
00080 template<class equationOfState>
00081 Ostream& operator<<
00082 (
00083 Ostream&,
00084 const janafThermo<equationOfState>&
00085 );
00086
00087
00088 #ifdef __GNUC__
00089 typedef scalar coeffArray2[7];
00090 #endif
00091
00092
00093
00094
00095
00096
00097 template<class equationOfState>
00098 class janafThermo
00099 :
00100 public equationOfState
00101 {
00102
00103 public:
00104
00105 static const int nCoeffs_ = 7;
00106 typedef scalar coeffArray[7];
00107
00108 private:
00109
00110
00111
00112
00113 scalar Tlow_, Thigh_, Tcommon_;
00114
00115 coeffArray highCpCoeffs_;
00116 coeffArray lowCpCoeffs_;
00117
00118
00119
00120
00121
00122 inline void checkT(const scalar T) const;
00123
00124
00125 inline const
00126 # ifdef __GNUC__
00127 coeffArray2&
00128 # else
00129 coeffArray&
00130 # endif
00131 coeffs(const scalar T) const;
00132
00133
00134 public:
00135
00136
00137
00138
00139 inline janafThermo
00140 (
00141 const equationOfState& st,
00142 const scalar Tlow,
00143 const scalar Thigh,
00144 const scalar Tcommon,
00145 const coeffArray& highCpCoeffs,
00146 const coeffArray& lowCpCoeffs
00147 );
00148
00149
00150 janafThermo(Istream&);
00151
00152
00153 inline janafThermo(const word&, const janafThermo&);
00154
00155
00156
00157
00158
00159 inline scalar cp(const scalar T) const;
00160
00161
00162 inline scalar h(const scalar T) const;
00163
00164
00165 inline scalar s(const scalar T) const;
00166
00167
00168
00169
00170 inline void operator+=(const janafThermo&);
00171 inline void operator-=(const janafThermo&);
00172
00173 inline void operator*=(const scalar);
00174
00175
00176
00177
00178 friend janafThermo operator+ <equationOfState>
00179 (
00180 const janafThermo&,
00181 const janafThermo&
00182 );
00183
00184 friend janafThermo operator- <equationOfState>
00185 (
00186 const janafThermo&,
00187 const janafThermo&
00188 );
00189
00190 friend janafThermo operator* <equationOfState>
00191 (
00192 const scalar,
00193 const janafThermo&
00194 );
00195
00196 friend janafThermo operator== <equationOfState>
00197 (
00198 const janafThermo&,
00199 const janafThermo&
00200 );
00201
00202
00203
00204
00205 friend Ostream& operator<< <equationOfState>
00206 (
00207 Ostream&,
00208 const janafThermo&
00209 );
00210 };
00211
00212
00213
00214
00215 }
00216
00217
00218
00219 #include "janafThermoI.H"
00220
00221 #ifdef NoRepository
00222 # include "janafThermo.C"
00223 #endif
00224
00225
00226
00227 #endif
00228
00229