FreeFOAM The Cross-Platform CFD Toolkit
ReactingCloud_.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::ReactingCloud
26 
27 Description
28  Templated base class for reacting cloud
29 
30  - Adds to thermodynamic cloud
31  - Variable composition (single phase)
32  - Phase change
33 
34 SourceFiles
35  ReactingCloudI.H
36  ReactingCloud.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef ReactingCloud_H
41 #define ReactingCloud_H
42 
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward declaration of classes
53 
54 template<class CloudType>
55 class CompositionModel;
56 
57 template<class CloudType>
58 class PhaseChangeModel;
59 
60 /*---------------------------------------------------------------------------*\
61  Class ReactingCloud Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class ParcelType>
66 :
67  public ThermoCloud<ParcelType>,
68  public reactingCloud
69 {
70 public:
71 
72  //- Type of thermodynamics the cloud was instantiated for
73  typedef typename ParcelType::thermoType thermoType;
74 
75 
76 private:
77 
78  // Private Member Functions
79 
80  //- Disallow default bitwise copy construct
82 
83  //- Disallow default bitwise assignment
84  void operator=(const ReactingCloud&);
85 
86 
87 protected:
88 
89  // Protected data
90 
91  //- Parcel constant properties
92  typename ParcelType::constantProperties constProps_;
93 
94  //- Multi-component carrier phase thermo
96 
97 
98  // References to the cloud sub-models
99 
100  //- Reacting composition model
103 
104  //- Reacting phase change model
107 
108 
109  // Sources
110 
111  //- Mass transfer fields - one per carrier phase specie
113 
114 
115  // Check
116 
117  //- Total mass transferred to continuous phase via phase change
119 
120 
121  // Protected Member Functions
122 
123  // New parcel helper functions
124 
125  //- Check that size of a composition field is valid
127  (
128  const scalarField& YSupplied,
129  const scalarField& Y,
130  const word& YName
131  );
132 
133 
134  // Cloud evolution functions
135 
136  //- Pre-evolve
137  void preEvolve();
138 
139  //- Evolve the cloud
140  void evolveCloud();
141 
142  //- Post-evolve
143  void postEvolve();
144 
145 
146 public:
147 
148  // Constructors
149 
150  //- Construct given carrier gas fields
152  (
153  const word& cloudName,
154  const volScalarField& rho,
155  const volVectorField& U,
156  const dimensionedVector& g,
158  bool readFields = true
159  );
160 
161 
162  //- Destructor
163  virtual ~ReactingCloud();
164 
165 
166  //- Type of parcel the cloud was instantiated for
167  typedef ParcelType parcelType;
168 
169 
170  // Member Functions
171 
172  // Access
173 
174  //- Return the constant properties
175  inline const typename ParcelType::constantProperties&
176  constProps() const;
177 
178  //- Return const access to multi-component carrier phase thermo
180  mcCarrierThermo() const;
181 
182  //- Return access to multi-component carrier phase thermo
184 
185 
186  // Sub-models
187 
188  //- Return reference to reacting composition model
190  composition() const;
191 
192  //- Return reference to reacting phase change model
194  phaseChange() const;
195 
196 
197  // Sources
198 
199  //- Mass
200 
201  //- Return reference to mass source for field i
203  rhoTrans(const label i);
204 
205  //- Return reference to mass source fields
207  rhoTrans();
208 
209  //- Return tmp mass source for field i - fully explicit
211  Srho(const label i) const;
212 
213  //- Return tmp total mass source for carrier phase
214  // - fully explicit
216 
217 
218  // Check
219 
220  //- Print cloud information
221  void info() const;
222 
223  //- Add to cumulative phase change mass transfer
224  void addToMassPhaseChange(const scalar dMass);
225 
226 
227  // Cloud evolution functions
228 
229  //- Check parcel properties
231  (
232  ParcelType& parcel,
233  const scalar lagrangianDt,
234  const bool fullyDescribed
235  );
236 
237  //- Reset the spray source terms
238  void resetSourceTerms();
239 
240  //- Evolve the spray (inject, move)
241  void evolve();
242 };
243 
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 } // End namespace Foam
248 
249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250 
251 #include "ReactingCloudI_.H"
252 
253 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254 
255 #ifdef NoRepository
256 # include "ReactingCloud_.C"
257 #endif
258 
259 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260 
261 #endif
262 
263 // ************************ vim: set sw=4 sts=4 et: ************************ //