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 #ifndef chemistryModel_H
00037 #define chemistryModel_H
00038
00039 #include "hCombustionThermo.H"
00040 #include "reactingMixture.H"
00041 #include "Matrix.H"
00042 #include "ODE.H"
00043
00044
00045
00046 namespace Foam
00047 {
00048
00049 class chemistrySolver;
00050
00051
00052
00053
00054
00055 class chemistryModel
00056 :
00057 public ODE
00058 {
00059
00060 public:
00061
00062 typedef reactingMixture::reaction reaction;
00063 typedef reactingMixture::reactionThermo reactionThermo;
00064
00065
00066 private:
00067
00068
00069
00070 const hCombustionThermo& thermo_;
00071
00072 PtrList<volScalarField>& Y_;
00073 const volScalarField& rho_;
00074
00075 IOdictionary chemistryProperties_;
00076
00077
00078 Switch chemistry_;
00079
00080
00081 const PtrList<reaction>& reactions_;
00082
00083
00084 const PtrList<reactionThermo>& specieThermo_;
00085
00086
00087 label Ns_;
00088
00089
00090 label Nr_;
00091
00092
00093 autoPtr<chemistrySolver> solver_;
00094
00095
00096 PtrList<scalarField> RR_;
00097
00098
00099 scalarField deltaTChem_;
00100
00101
00102
00103
00104
00105 void operator=(const chemistryModel&);
00106
00107
00108 public:
00109
00110
00111
00112
00113 chemistryModel
00114 (
00115 hCombustionThermo& thermo,
00116 const volScalarField& rho
00117 );
00118
00119
00120
00121
00122 virtual ~chemistryModel();
00123
00124
00125
00126
00127
00128 const hCombustionThermo& thermo() const
00129 {
00130 return thermo_;
00131 }
00132
00133
00134 const PtrList<volScalarField>& Y() const
00135 {
00136 return Y_;
00137 }
00138
00139
00140 const volScalarField& rho() const
00141 {
00142 return rho_;
00143 }
00144
00145
00146 inline const IOdictionary& chemistryProperties() const
00147 {
00148 return chemistryProperties_;
00149 }
00150
00151
00152 inline Switch chemistry() const
00153 {
00154 return chemistry_;
00155 }
00156
00157 inline const PtrList<reaction>& reactions() const
00158 {
00159 return reactions_;
00160 }
00161
00162 inline const PtrList<reactionThermo>& specieThermo() const
00163 {
00164 return specieThermo_;
00165 }
00166
00167
00168 inline label Ns() const
00169 {
00170 return Ns_;
00171 }
00172
00173
00174 inline label Nr() const
00175 {
00176 return Nr_;
00177 }
00178
00179
00180 inline const chemistrySolver& solver() const
00181 {
00182 return solver_;
00183 }
00184
00185
00186 inline tmp<volScalarField> RR(const label i) const;
00187
00188
00189 const scalarField& deltaTChem() const
00190 {
00191 return deltaTChem_;
00192 }
00193
00194
00195 tmp<volScalarField> tc() const;
00196
00197
00198 scalarField omega
00199 (
00200 const scalarField& c,
00201 const scalar T,
00202 const scalar p
00203 ) const;
00204
00205
00206
00207 scalar omega
00208 (
00209 const reaction& r,
00210 const scalarField& c,
00211 const scalar T,
00212 const scalar p,
00213 scalar& pf,
00214 scalar& cf,
00215 label& lRef,
00216 scalar& pr,
00217 scalar& cr,
00218 label& rRef
00219 ) const;
00220
00221
00222 label nEqns() const;
00223
00224 void derivatives
00225 (
00226 const scalar t,
00227 const scalarField& c,
00228 scalarField& dcdt
00229 ) const;
00230
00231 void jacobian
00232 (
00233 const scalar t,
00234 const scalarField& c,
00235 scalarField& dcdt,
00236 Matrix<scalar>& dfdc
00237 ) const;
00238
00239
00240 void calculate();
00241
00242
00243
00244 scalar solve
00245 (
00246 const scalar t0,
00247 const scalar deltaT
00248 );
00249 };
00250
00251
00252
00253
00254 }
00255
00256
00257
00258 #include "chemistryModelI.H"
00259
00260
00261
00262 #endif
00263
00264
Copyright © 2000-2007 OpenCFD Ltd