CFDEMcoupling  2.4
 All Classes
cfdemCloudI.H
1 /*---------------------------------------------------------------------------*\
2  CFDEMcoupling - Open Source CFD-DEM coupling
3 
4  CFDEMcoupling is part of the CFDEMproject
5  www.cfdem.com
6  Christoph Goniva, christoph.goniva@cfdem.com
7  Copyright 2009-2012 JKU Linz
8  Copyright 2012- DCS Computing GmbH, Linz
9 -------------------------------------------------------------------------------
10 License
11  This file is part of CFDEMcoupling.
12 
13  CFDEMcoupling is free software; you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by the
15  Free Software Foundation; either version 3 of the License, or (at your
16  option) any later version.
17 
18  CFDEMcoupling is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with CFDEMcoupling; if not, write to the Free Software Foundation,
25  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 
27 Description
28  This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
29  and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
30 
31 \*---------------------------------------------------------------------------*/
32 
33 #include "momCoupleModel.H"
34 #include "smoothingModel.H"
35 #include "meshMotionModel.H"
36 #include "averagingModel.H"
37 #include "clockModel.H"
38 #include "IOModel.H"
39 #include "voidFractionModel.H"
40 #include "locateModel.H"
41 #include "probeModel.H"
42 
43 namespace Foam
44 {
45 
46 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
47 inline void cfdemCloud::setCG(double cg) const
48 {
49  cg_ = cg;
50  Info << "cg is set to: " << cg_ << endl;
51 };
52 
53 inline const bool& cfdemCloud::impDEMdrag() const
54 {
55  return impDEMdrag_;
56 };
57 
58 inline const bool& cfdemCloud::impDEMdragAcc() const
59 {
60  return impDEMdragAcc_;
61 };
62 
63 inline const scalar& cfdemCloud::imExSplitFactor() const
64 {
65  return imExSplitFactor_;
66 };
67 
68 inline const bool& cfdemCloud::treatVoidCellsAsExplicitForce() const
69 {
70  return treatVoidCellsAsExplicitForce_;
71 }
72 
73 inline const scalar& cfdemCloud::cg() const
74 {
75  return cg_;
76 };
77 
78 inline const bool& cfdemCloud::ignore() const
79 {
80  return ignore_;
81 }
82 
83 inline const fvMesh& cfdemCloud::mesh() const
84 {
85  return mesh_;
86 }
87 
88 inline bool cfdemCloud::solveFlow() const
89 {
90  return bool(solveFlow_);
91 }
92 
93 inline bool cfdemCloud::verbose() const
94 {
95  return verbose_;
96 }
97 
98 inline const IOdictionary& cfdemCloud::couplingProperties() const
99 {
100  return couplingProperties_;
101 }
102 
103 inline double ** cfdemCloud::positions() const
104 {
105  return positions_;
106 }
107 
108 inline double ** cfdemCloud::velocities() const
109 {
110  return velocities_;
111 }
112 
113 inline double ** cfdemCloud::fluidVels() const
114 {
115  return fluidVel_;
116 }
117 
118 inline double ** cfdemCloud::fAccs() const
119 {
120  return fAcc_;
121 }
122 
123 inline double ** cfdemCloud::impForces() const
124 {
125  return impForces_;
126 }
127 
128 inline double ** cfdemCloud::expForces() const
129 {
130  return expForces_;
131 }
132 
133 inline double ** cfdemCloud::DEMForces() const
134 {
135  return DEMForces_;
136 }
137 
138 inline double ** cfdemCloud::Cds() const
139 {
140  return Cds_;
141 }
142 
143 inline double ** cfdemCloud::radii() const
144 {
145  return radii_;
146 }
147 
148 inline double ** cfdemCloud::voidfractions() const
149 {
150  return voidfractions_;
151 }
152 
153 inline void cfdemCloud::get_radii(double **& values) const
154 {
155 // Info << "set_radii level=" << numberOfParticles_ << endl;
156  // make a copy of the array entries
157 // for (int i=0;i<numberOfParticles_;i++)
158 // radii_[0][i]=values[0][i];
159  values=radii_;
160 }
161 
162 inline double ** cfdemCloud::cellIDs() const
163 {
164  return cellIDs_;
165 }
166 
167 inline void cfdemCloud::get_cellIDs(double **& values) const
168 {
169 // // make a copy of the array entries
170 // for (int i=0;i<numberOfParticles_;i++)
171 // cellIDs_[0][i]=values[0][i];
172  values=cellIDs_;
173 }
174 
175 inline double ** cfdemCloud::particleWeights() const
176 {
177  return particleWeights_;
178 }
179 
180 inline label Foam::cfdemCloud::body(int index)
181 {
182  return index;
183 }
184 
185 inline double cfdemCloud::particleVolume(int index)
186 {
187  return particleV_[index][0];
188 }
189 
190 inline scalar cfdemCloud::radius(int index)
191 {
192  return radii_[index][0];
193 }
194 
195 inline double cfdemCloud::d(int index)
196 {
197  return 2*radii_[index][0];
198 }
199 
200 inline double cfdemCloud::d32(bool recalc)
201 {
202  if(d32_<0 || recalc)
203  {
204  scalar Ntot(0);
205  scalar Dtot(0);
206  scalar r(0);
207  for(int index = 0;index < numberOfParticles(); ++index)
208  {
209  r=radii_[index][0];
210  Ntot+=2*r*r*r;
211  Dtot+=r*r;
212  }
213  d32_=Ntot/Dtot;
214  }
215 
216  return d32_;
217 }
218 
219 inline int cfdemCloud::numberOfParticles() const
220 {
221  return numberOfParticles_;
222 }
223 
224 inline bool cfdemCloud::numberOfParticlesChanged() const
225 {
226  return numberOfParticlesChanged_;
227 }
228 
229 inline int cfdemCloud::numberOfClumps() const
230 {
231  Warning << "cfdemCloud::numberOfClumps() is not called correctly!" << endl;
232  return -1;
233 }
234 
235 inline bool cfdemCloud::arraysReallocated() const
236 {
237  return arraysReallocated_;
238 }
239 
240 inline const wordList& cfdemCloud::forceModels()
241 {
242  return forceModels_;
243 }
244 
245 inline const locateModel& cfdemCloud::locateM() const
246 {
247  return locateModel_;
248 }
249 
250 inline const momCoupleModel& cfdemCloud::momCoupleM(int i) const
251 {
252  return momCoupleModel_[i];
253 }
254 
255 inline const dataExchangeModel& cfdemCloud::dataExchangeM() const
256 {
257  return dataExchangeModel_;
258 }
259 
260 inline const IOModel& cfdemCloud::IOM() const
261 {
262  return IOModel_;
263 }
264 
265 inline const probeModel& cfdemCloud::probeM() const
266 {
267  return probeModel_;
268 }
269 
270 inline const voidFractionModel& cfdemCloud::voidFractionM() const
271 {
272  return voidFractionModel_;
273 }
274 
275 inline const averagingModel& cfdemCloud::averagingM() const
276 {
277  return averagingModel_;
278 }
279 
280 inline const clockModel& cfdemCloud::clockM() const
281 {
282  return clockModel_;
283 }
284 
285 inline const smoothingModel& cfdemCloud::smoothingM() const
286 {
287  return smoothingModel_;
288 }
289 
290 inline const meshMotionModel& cfdemCloud::meshMotionM() const
291 {
292  return meshMotionModel_;
293 }
294 
295 inline const wordList& cfdemCloud::liggghtsCommandModelList() const
296 {
297  return liggghtsCommandModelList_;
298 }
299 
300 inline autoPtr<liggghtsCommandModel>* cfdemCloud::liggghtsCommand() const
301 {
302  return liggghtsCommand_;
303 }
304 
305 #if defined(version21) || defined(version16ext)
306  #ifdef compre
307  inline const compressible::turbulenceModel& cfdemCloud::turbulence() const
308  #else
309  inline const incompressible::turbulenceModel& cfdemCloud::turbulence() const
310  #endif
311 #elif defined(version15)
312  inline const incompressible::RASModel& cfdemCloud::turbulence() const
313 #endif
314 {
315  return turbulence_;
316 }
317 
318 }
319 // ************************************************************************* //