FreeFOAM The Cross-Platform CFD Toolkit
sprayOps.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) 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 \*---------------------------------------------------------------------------*/
25 
26 #include "spray.H"
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
43 {
44  sms_.setSize(rho_.size());
45  shs_.setSize(rho_.size());
46  forAll(srhos_, i)
47  {
48  srhos_[i].setSize(rho_.size());
49  }
50 
51  UInterpolator_ = interpolation<vector>::New(interpolationSchemes_, U_);
52 
53  rhoInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, rho_);
54 
55  pInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, p_);
56 
57  TInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, T_);
58 
61  collisions().collideParcels(runTime_.deltaT().value());
62  move();
64  inject();
66  breakupLoop();
67 
68  UInterpolator_.clear();
69  rhoInterpolator_.clear();
70  pInterpolator_.clear();
71  TInterpolator_.clear();
72 }
73 
74 
76 {
77  // Reset Spray Source Terms
78  sms_ = vector::zero;
79  shs_ = 0.0;
80  forAll(srhos_, i)
81  {
82  srhos_[i] = 0.0;
83  }
84 
85  Cloud<parcel>::move(*this);
86 }
87 
88 
90 {
91  forAllIter(spray, *this, elmnt)
92  {
93  // interpolate...
94  vector velocity = UInterpolator().interpolate
95  (
96  elmnt().position(),
97  elmnt().cell()
98  );
99 
100  // liquidCore < 0.5 indicates discrete drops
101  if (elmnt().liquidCore() <= 0.5)
102  {
104  (
105  elmnt(),
106  runTime_.deltaT().value(),
107  velocity,
108  fuels_
109  );
110 
112  (
113  elmnt(),
114  runTime_.deltaT().value(),
115  velocity,
116  fuels_
117  );
118  }
119  }
120 }
121 
122 
124 {
125  forAllIter(spray, *this, elmnt)
126  {
127  // interpolate...
128  vector velocity = UInterpolator().interpolate
129  (
130  elmnt().position(),
131  elmnt().cell()
132  );
133 
134  // liquidCore > 0.5 indicates a liquid core
135  if (elmnt().liquidCore() > 0.5)
136  {
138  (
139  elmnt(),
140  runTime_.deltaT().value(),
141  velocity,
142  fuels_
143  );
144  }
145  }
146 }
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // ************************ vim: set sw=4 sts=4 et: ************************ //