FreeFOAM The Cross-Platform CFD Toolkit
SurfaceReactionModel.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::SurfaceReactionModel
26 
27 Description
28  Templated surface reaction model class
29 
30 SourceFiles
31  SurfaceReactionModel.C
32  NewSurfaceReactionModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef SurfaceReactionModel_H
37 #define SurfaceReactionModel_H
38 
39 #include <OpenFOAM/IOdictionary.H>
40 #include <OpenFOAM/autoPtr.H>
42 
43 #include <OpenFOAM/scalarField.H>
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class SurfaceReactionModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class CloudType>
56 {
57  // Private data
58 
59  //- The cloud dictionary
60  const dictionary& dict_;
61 
62  //- Reference to the owner cloud class
63  CloudType& owner_;
64 
65  //- The coefficients dictionary
66  const dictionary coeffDict_;
67 
68 
69 public:
70 
71  //-Runtime type information
72  TypeName("SurfaceReactionModel");
73 
74 
75  //- Declare runtime constructor selection table
77  (
78  autoPtr,
80  dictionary,
81  (
82  const dictionary& dict,
83  CloudType& cloud
84  ),
85  (dict, cloud)
86  );
87 
88 
89  // Constructors
90 
91  //- Construct null from owner
92  SurfaceReactionModel(CloudType& owner);
93 
94  //- Construct from dictionary
96  (
97  const dictionary& dict,
98  CloudType& cloud,
99  const word& type
100  );
101 
102 
103  //- Destructor
104  virtual ~SurfaceReactionModel();
105 
106 
107  //- Selector
109  (
110  const dictionary& dict,
111  CloudType& cloud
112  );
113 
114 
115  // Access
116 
117  //- Return the owner cloud object
118  const CloudType& owner() const;
119 
120  //- Return the cloud dictionary
121  const dictionary& dict() const;
122 
123  //- Return the coefficients dictionary
124  const dictionary& coeffDict() const;
125 
126 
127  // Member Functions
128 
129  //- Flag to indicate whether model activates surface reaction model
130  virtual bool active() const = 0;
131 
132  //- Update surface reactions
133  // Returns the heat of reaction
134  virtual scalar calculate
135  (
136  const scalar dt,
137  const label cellI,
138  const scalar d,
139  const scalar T,
140  const scalar Tc,
141  const scalar pc,
142  const scalar rhoc,
143  const scalar mass,
144  const scalarField& YGas,
145  const scalarField& YLiquid,
146  const scalarField& YSolid,
147  const scalarField& YMixture,
148  const scalar N,
149  scalarField& dMassGas,
150  scalarField& dMassLiquid,
151  scalarField& dMassSolid,
152  scalarField& dMassSRCarrier
153  ) const = 0;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #define makeSurfaceReactionModel(CloudType) \
164  \
165  defineNamedTemplateTypeNameAndDebug(SurfaceReactionModel<CloudType>, 0); \
166  \
167  defineTemplateRunTimeSelectionTable \
168  ( \
169  SurfaceReactionModel<CloudType>, \
170  dictionary \
171  );
172 
173 
174 #define makeSurfaceReactionModelThermoType(SS, CloudType, ParcelType, ThermoType)\
175  \
176  defineNamedTemplateTypeNameAndDebug \
177  ( \
178  SS<CloudType<ParcelType<ThermoType> > >, \
179  0 \
180  ); \
181  \
182  SurfaceReactionModel<CloudType<ParcelType<ThermoType> > >:: \
183  adddictionaryConstructorToTable \
184  <SS<CloudType<ParcelType<ThermoType> > > > \
185  add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #ifdef NoRepository
192 #endif
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************ vim: set sw=4 sts=4 et: ************************ //