FreeFOAM The Cross-Platform CFD Toolkit
ReactingMultiphaseCloud_.C
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) 2008-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 \*---------------------------------------------------------------------------*/
25 
27 
30 
31 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
32 
33 template<class ParcelType>
35 {
37 }
38 
39 
40 template<class ParcelType>
42 {
43  const volScalarField& T = this->carrierThermo().T();
44  const volScalarField cp = this->carrierThermo().Cp();
45  const volScalarField& p = this->carrierThermo().p();
46 
48  (
49  this->interpolationSchemes(),
50  this->rho()
51  );
52 
54  (
55  this->interpolationSchemes(),
56  this->U()
57  );
58 
60  (
61  this->interpolationSchemes(),
62  this->mu()
63  );
64 
66  (
67  this->interpolationSchemes(),
68  T
69  );
70 
72  (
73  this->interpolationSchemes(),
74  cp
75  );
76 
78  (
79  this->interpolationSchemes(),
80  p
81  );
82 
83  typename ParcelType::trackData td
84  (
85  *this,
86  constProps_,
87  rhoInterp(),
88  UInterp(),
89  muInterp(),
90  TInterp(),
91  cpInterp(),
92  pInterp(),
93  this->g().value()
94  );
95 
96  this->injection().inject(td);
97 
98  if (this->coupled())
99  {
100  resetSourceTerms();
101  }
102 
104 }
105 
106 
107 template<class ParcelType>
109 {
111 }
112 
113 
114 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
115 
116 template<class ParcelType>
118 (
119  const word& cloudName,
120  const volScalarField& rho,
121  const volVectorField& U,
122  const dimensionedVector& g,
124  bool readFields
125 )
126 :
129  constProps_(this->particleProperties()),
130  devolatilisationModel_
131  (
133  (
134  this->particleProperties(),
135  *this
136  )
137  ),
138  surfaceReactionModel_
139  (
141  (
142  this->particleProperties(),
143  *this
144  )
145  ),
146  dMassDevolatilisation_(0.0)
147 {
148  if (readFields)
149  {
150  ParcelType::readFields(*this);
151  }
152 }
153 
154 
155 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
156 
157 template<class ParcelType>
159 {}
160 
161 
162 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
163 
164 template<class ParcelType>
166 (
167  ParcelType& parcel,
168  const scalar lagrangianDt,
169  const bool fullyDescribed
170 )
171 {
173  (
174  parcel,
175  lagrangianDt,
176  fullyDescribed
177  );
178 
179  label idGas = this->composition().idGas();
180  label idLiquid = this->composition().idLiquid();
181  label idSolid = this->composition().idSolid();
182 
183  if (!fullyDescribed)
184  {
185  parcel.YGas() = this->composition().Y0(idGas);
186  parcel.YLiquid() = this->composition().Y0(idLiquid);
187  parcel.YSolid() = this->composition().Y0(idSolid);
188  }
189  else
190  {
191  this->checkSuppliedComposition
192  (
193  parcel.YGas(),
194  this->composition().Y0(idGas),
195  "YGas"
196  );
197  this->checkSuppliedComposition
198  (
199  parcel.YLiquid(),
200  this->composition().Y0(idLiquid),
201  "YLiquid"
202  );
203  this->checkSuppliedComposition
204  (
205  parcel.YSolid(),
206  this->composition().Y0(idSolid),
207  "YSolid"
208  );
209  }
210 }
211 
212 
213 template<class ParcelType>
215 {
217 }
218 
219 
220 template<class ParcelType>
222 {
223  if (this->active())
224  {
225  preEvolve();
226 
227  evolveCloud();
228 
229  postEvolve();
230 
231  info();
232  Info<< endl;
233  }
234 }
235 
236 
237 template<class ParcelType>
239 {
241  Info<< " Mass transfer devolatilisation = "
242  << returnReduce(dMassDevolatilisation_, sumOp<scalar>()) << nl;
243  Info<< " Mass transfer surface reaction = "
244  << returnReduce(dMassSurfaceReaction_, sumOp<scalar>()) << nl;
245 }
246 
247 
248 template<class ParcelType>
250 (
251  const scalar dMass
252 )
253 {
254  dMassDevolatilisation_ += dMass;
255 }
256 
257 
258 template<class ParcelType>
260 (
261  const scalar dMass
262 )
263 {
264  dMassSurfaceReaction_ += dMass;
265 }
266 
267 
268 // ************************ vim: set sw=4 sts=4 et: ************************ //