FreeFOAM The Cross-Platform CFD Toolkit
reitzDiwakar.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 <OpenFOAM/error.H>
27 
28 #include "reitzDiwakar.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 
37 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38 
39 defineTypeNameAndDebug(reitzDiwakar, 0);
40 
42 (
43  breakupModel,
44  reitzDiwakar,
45  dictionary
46 );
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
50 // Construct from components
52 (
53  const dictionary& dict,
54  spray& sm
55 )
56 :
57  breakupModel(dict, sm),
58  coeffsDict_(dict.subDict(typeName + "Coeffs")),
59  Cbag_(readScalar(coeffsDict_.lookup("Cbag"))),
60  Cb_(readScalar(coeffsDict_.lookup("Cb"))),
61  Cstrip_(readScalar(coeffsDict_.lookup("Cstrip"))),
62  Cs_(readScalar(coeffsDict_.lookup("Cs")))
63 {}
64 
65 
66 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
67 
69 {}
70 
71 
72 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
73 
75 (
76  parcel& p,
77  const scalar deltaT,
78  const vector& vel,
79  const liquidMixture& fuels
80 ) const
81 {
82  /*
83  These are the default values for this model...
84  static const scalar Cbag = 6.0;
85  static const scalar Cb = 0.785;
86  static const scalar Cstrip = 0.5;
87  static const scalar Cs = 10.0;
88  */
89 
90  const PtrList<volScalarField>& Y = spray_.composition().Y();
91 
92  label Ns = Y.size();
93  label cellI = p.cell();
94  scalar pressure = spray_.p()[cellI];
95  scalar temperature = spray_.T()[cellI];
96  scalar Taverage = p.T() + (temperature - p.T())/3.0;
97 
98  scalar muAverage = 0.0;
99  scalar Winv = 0.0;
100  for(label i=0; i<Ns; i++)
101  {
102  Winv += Y[i][cellI]/spray_.gasProperties()[i].W();
103  muAverage += Y[i][cellI]*spray_.gasProperties()[i].mu(Taverage);
104  }
105  scalar R = specie::RR*Winv;
106 
107  // ideal gas law to evaluate density
108  scalar rhoAverage = pressure/R/Taverage;
109  scalar nuAverage = muAverage/rhoAverage;
110  scalar sigma = fuels.sigma(pressure, p.T(), p.X());
111 
112  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113  // The We and Re numbers are to be evaluated using the 1/3 rule.
114  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116  scalar WeberNumber = p.We(vel, rhoAverage, sigma);
117  scalar ReynoldsNumber = p.Re(vel, nuAverage);
118 
119  scalar sqRey = sqrt(ReynoldsNumber);
120 
121  if (WeberNumber > Cbag_)
122  {
123  if (WeberNumber > Cstrip_*sqRey)
124  {
125  scalar dStrip =
126  pow(2.0*Cstrip_*sigma, 2.0)/
127  (
128  rhoAverage
129  * pow(mag(p.Urel(vel)), 3.0)
130  * muAverage
131  );
132 
133  scalar tauStrip =
134  Cs_ * p.d()
135  * sqrt
136  (
137  fuels.rho(pressure, p.T(), p.X())
138  / rhoAverage
139  )
140  / mag(p.Urel(vel));
141 
142  scalar fraction = deltaT/tauStrip;
143 
144  // new droplet diameter, implicit calculation
145  p.d() = (fraction*dStrip + p.d())/(1.0 + fraction);
146  }
147  else
148  {
149  scalar dBag =
150  2.0 * Cbag_ * sigma
151  / (
152  rhoAverage
153  * pow(mag(p.Urel(vel)), 2.0)
154  );
155 
156  scalar tauBag =
157  Cb_ * p.d()
158  * sqrt
159  (
160  fuels.rho(pressure, p.T(), p.X())
161  * p.d()
162  / sigma
163  );
164 
165  scalar fraction = deltaT/tauBag;
166 
167  // new droplet diameter, implicit calculation
168  p.d() = (fraction*dBag + p.d())/(1.0 + fraction);
169  }
170 
171  }
172 
173 }
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // ************************ vim: set sw=4 sts=4 et: ************************ //