FreeFOAM The Cross-Platform CFD Toolkit
DispersionModel.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::DispersionModel
26 
27 Description
28 
29 \*---------------------------------------------------------------------------*/
30 
31 #ifndef DispersionModel_H
32 #define DispersionModel_H
33 
34 #include <OpenFOAM/IOdictionary.H>
35 #include <OpenFOAM/autoPtr.H>
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 namespace Foam
41 {
42 
43 /*---------------------------------------------------------------------------*\
44  Class DispersionModel Declaration
45 \*---------------------------------------------------------------------------*/
46 
47 template<class CloudType>
49 {
50 
51  // Private data
52 
53  //- Cloud dictionary
54  const dictionary& dict_;
55 
56  //- Reference to the owner cloud class
57  CloudType& owner_;
58 
59 
60 public:
61 
62  //- Runtime type information
63  TypeName("DispersionModel");
64 
65 
66  // Declare runtime constructor selection table
67 
69  (
70  autoPtr,
72  dictionary,
73  (
74  const dictionary& dict,
75  CloudType& owner
76  ),
77  (dict, owner)
78  );
79 
80 
81  // Constructors
82 
83  //- Construct null from owner
84  DispersionModel(CloudType& owner);
85 
86  //- Construct from components
88  (
89  const dictionary& dict,
90  CloudType& owner
91  );
92 
93 
94  //- Destructor
95  virtual ~DispersionModel();
96 
97 
98  //- Selector
100  (
101  const dictionary& dict,
102  CloudType& owner
103  );
104 
105 
106  // Access
107 
108  //- Return the owner cloud object
109  const CloudType& owner() const;
110 
111  //- Return the owner cloud object
112  CloudType& owner();
113 
114  //- Return the dictionary
115  const dictionary& dict() const;
116 
117 
118  // Member Functions
119 
120  //- Flag to indicate whether model activates injection model
121  virtual bool active() const = 0;
122 
123  //- Cache carrier fields
124  virtual void cacheFields(const bool store) = 0;
125 
126  //- Update (disperse particles)
127  virtual vector update
128  (
129  const scalar dt,
130  const label celli,
131  const vector& U,
132  const vector& Uc,
133  vector& UTurb,
134  scalar& tTurb
135  ) = 0;
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #define makeDispersionModel(CloudType) \
146  \
147  defineNamedTemplateTypeNameAndDebug(DispersionModel<CloudType>, 0); \
148  \
149  defineTemplateRunTimeSelectionTable \
150  ( \
151  DispersionModel<CloudType>, \
152  dictionary \
153  );
154 
155 
156 #define makeDispersionModelType(SS, CloudType, ParcelType) \
157  \
158  defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \
159  \
160  DispersionModel<CloudType<ParcelType> >:: \
161  adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \
162  add##SS##CloudType##ParcelType##ConstructorToTable_;
163 
164 
165 #define makeDispersionModelThermoType(SS, CloudType, ParcelType, ThermoType) \
166  \
167  defineNamedTemplateTypeNameAndDebug \
168  ( \
169  SS<CloudType<ParcelType<ThermoType> > >, \
170  0 \
171  ); \
172  \
173  DispersionModel<CloudType<ParcelType<ThermoType> > >:: \
174  adddictionaryConstructorToTable \
175  <SS<CloudType<ParcelType<ThermoType> > > > \
176  add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************ vim: set sw=4 sts=4 et: ************************ //