ODEChemistryModel.H
Go to the documentation of this file.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
00039 #ifndef ODEChemistryModel_H
00040 #define ODEChemistryModel_H
00041
00042 #include "hCombustionThermo.H"
00043 #include "Reaction.H"
00044 #include "ODE.H"
00045
00046
00047
00048 namespace Foam
00049 {
00050
00051
00052 template<class CompType, class ThermoType>
00053 class chemistrySolver;
00054
00055
00056
00057
00058
00059 template<class CompType, class ThermoType>
00060 class ODEChemistryModel
00061 :
00062 public CompType,
00063 public ODE
00064 {
00065
00066
00067
00068 void operator=(const ODEChemistryModel&);
00069
00070
00071 protected:
00072
00073
00074
00075
00076 PtrList<volScalarField>& Y_;
00077
00078
00079 const PtrList<Reaction<ThermoType> >& reactions_;
00080
00081
00082 const PtrList<ThermoType>& specieThermo_;
00083
00084
00085 label nSpecie_;
00086
00087
00088 label nReaction_;
00089
00090
00091 autoPtr<chemistrySolver<CompType, ThermoType> > solver_;
00092
00093
00094 PtrList<scalarField> RR_;
00095
00096
00097
00098
00099
00100
00101 inline PtrList<scalarField>& RR();
00102
00103
00104 public:
00105
00106
00107 TypeName("ODEChemistryModel");
00108
00109
00110
00111
00112
00113 ODEChemistryModel
00114 (
00115 const fvMesh& mesh,
00116 const word& compTypeName,
00117 const word& thermoTypeName
00118 );
00119
00120
00121
00122 virtual ~ODEChemistryModel();
00123
00124
00125
00126
00127
00128 inline const PtrList<Reaction<ThermoType> >& reactions() const;
00129
00130
00131 inline const PtrList<ThermoType>& specieThermo() const;
00132
00133
00134 inline label nSpecie() const;
00135
00136
00137 inline label nReaction() const;
00138
00139
00140 inline const chemistrySolver<CompType, ThermoType>& solver() const;
00141
00142
00143 virtual scalarField omega
00144 (
00145 const scalarField& c,
00146 const scalar T,
00147 const scalar p
00148 ) const;
00149
00150
00151
00152 virtual scalar omega
00153 (
00154 const Reaction<ThermoType>& r,
00155 const scalarField& c,
00156 const scalar T,
00157 const scalar p,
00158 scalar& pf,
00159 scalar& cf,
00160 label& lRef,
00161 scalar& pr,
00162 scalar& cr,
00163 label& rRef
00164 ) const;
00165
00166
00167 virtual void calculate();
00168
00169
00170
00171
00172
00173
00174 inline tmp<volScalarField> RR(const label i) const;
00175
00176
00177
00178 virtual scalar solve(const scalar t0, const scalar deltaT);
00179
00180
00181 virtual tmp<volScalarField> tc() const;
00182
00183
00184 virtual tmp<volScalarField> dQ() const;
00185
00186
00187
00188
00189
00190 virtual label nEqns() const;
00191
00192 virtual void derivatives
00193 (
00194 const scalar t,
00195 const scalarField& c,
00196 scalarField& dcdt
00197 ) const;
00198
00199 virtual void jacobian
00200 (
00201 const scalar t,
00202 const scalarField& c,
00203 scalarField& dcdt,
00204 scalarSquareMatrix& dfdc
00205 ) const;
00206 };
00207
00208
00209
00210
00211 }
00212
00213
00214
00215 #include "ODEChemistryModelI.H"
00216
00217
00218
00219 #ifdef NoRepository
00220 # include "ODEChemistryModel.C"
00221 #endif
00222
00223
00224
00225 #endif
00226
00227
Copyright © 2000-2009 OpenCFD Ltd