FreeFOAM The Cross-Platform CFD Toolkit
breakupModel.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 #include "breakupModel.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 defineTypeNameAndDebug(breakupModel, 0);
37 
38 defineRunTimeSelectionTable(breakupModel, dictionary);
39 
40 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
41 
42 // Construct from components
44 (
45  const dictionary& dict,
46  spray& sm
47 )
48 :
49  dict_(dict),
50  spray_(sm),
51  rndGen_(sm.rndGen()),
52  includeOscillation_(dict_.lookup("includeOscillation")),
53  TABcoeffsDict_(dict.subDict("TABCoeffs")),
54  y0_(0.0),
55  yDot0_(0.0),
56  TABComega_(0.0),
57  TABCmu_(0.0),
58  TABWeCrit_(0.0)
59 {
60  if (includeOscillation_)
61  {
62  y0_ = readScalar(TABcoeffsDict_.lookup("y0"));
63  yDot0_ = readScalar(TABcoeffsDict_.lookup("yDot0"));
64  TABComega_ = readScalar(TABcoeffsDict_.lookup("Comega"));
65  TABCmu_ = readScalar(TABcoeffsDict_.lookup("Cmu"));
66  TABWeCrit_ = readScalar(TABcoeffsDict_.lookup("WeCrit"));
67  }
68 }
69 
70 
71 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
72 
74 {}
75 
76 // * * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * //
77 
79 (
80  parcel& p,
81  const scalar deltaT,
82  const vector& Ug,
83  const liquidMixture& fuels
84 ) const
85 {
86 
87  if(includeOscillation_)
88  {
89 
90  scalar T = p.T();
91  scalar pc = spray_.p()[p.cell()];
92  scalar r = 0.5 * p.d();
93  scalar r2 = r*r;
94  scalar r3 = r*r2;
95 
96  scalar rho = fuels.rho(pc, T, p.X());
97  scalar sigma = fuels.sigma(pc, T, p.X());
98  scalar mu = fuels.mu(pc, T, p.X());
99 
100  // inverse of characteristic viscous damping time
101  scalar rtd = 0.5*TABCmu_*mu/(rho*r2);
102 
103  // oscillation frequency (squared)
104  scalar omega2 = TABComega_ * sigma /(rho*r3) - rtd*rtd;
105 
106  if(omega2 > 0)
107  {
108 
109  scalar omega = sqrt(omega2);
110  scalar rhog = spray_.rho()[p.cell()];
111  scalar We = p.We(Ug, rhog, sigma);
112  scalar Wetmp = We/TABWeCrit_;
113 
114  scalar y1 = p.dev() - Wetmp;
115  scalar y2 = p.ddev()/omega;
116 
117  // update distortion parameters
118  scalar c = cos(omega*deltaT);
119  scalar s = sin(omega*deltaT);
120  scalar e = exp(-rtd*deltaT);
121  y2 = (p.ddev() + y1*rtd)/omega;
122 
123  p.dev() = Wetmp + e*(y1*c + y2*s);
124  if (p.dev() < 0)
125  {
126  p.dev() = 0.0;
127  p.ddev() = 0.0;
128  }
129  else
130  {
131  p.ddev() = (Wetmp-p.dev())*rtd + e*omega*(y2*c - y1*s);
132  }
133  }
134  else
135  {
136  // reset droplet distortion parameters
137  p.dev() = 0;
138  p.ddev() = 0;
139  }
140 
141  }
142 
143 }
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // ************************ vim: set sw=4 sts=4 et: ************************ //