BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / lagrangian / dieselSpray / spraySubModels / breakupModel / reitzDiwakar / reitzDiwakar.C
blobdb664140b410c5e71791d7f311f8d4035bf5233f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "error.H"
28 #include "reitzDiwakar.H"
29 #include "addToRunTimeSelectionTable.H"
30 #include "basicMultiComponentMixture.H"
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 namespace Foam
36     defineTypeNameAndDebug(reitzDiwakar, 0);
38     addToRunTimeSelectionTable
39     (
40         breakupModel,
41         reitzDiwakar,
42         dictionary
43     );
46 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
48 Foam::reitzDiwakar::reitzDiwakar
50     const dictionary& dict,
51     spray& sm
54     breakupModel(dict, sm),
55     coeffsDict_(dict.subDict(typeName + "Coeffs")),
56     Cbag_(readScalar(coeffsDict_.lookup("Cbag"))),
57     Cb_(readScalar(coeffsDict_.lookup("Cb"))),
58     Cstrip_(readScalar(coeffsDict_.lookup("Cstrip"))),
59     Cs_(readScalar(coeffsDict_.lookup("Cs")))
63 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
65 Foam::reitzDiwakar::~reitzDiwakar()
69 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
71 void Foam::reitzDiwakar::breakupParcel
73     parcel& p,
74     const scalar deltaT,
75     const vector& vel,
76     const liquidMixtureProperties& fuels
77 ) const
79     const PtrList<volScalarField>& Y = spray_.composition().Y();
81     label cellI = p.cell();
82     scalar pressure = spray_.p()[cellI];
83     scalar temperature = spray_.T()[cellI];
84     scalar Taverage = p.T() + (temperature - p.T())/3.0;
86     scalar muAverage = 0.0;
87     scalar Winv = 0.0;
88     forAll(Y, i)
89     {
90         Winv += Y[i][cellI]/spray_.gasProperties()[i].W();
91         muAverage += Y[i][cellI]*spray_.gasProperties()[i].mu(Taverage);
92     }
93     scalar R = specie::RR*Winv;
95     // ideal gas law to evaluate density
96     scalar rhoAverage = pressure/R/Taverage;
97     scalar nuAverage = muAverage/rhoAverage;
98     scalar sigma = fuels.sigma(pressure, p.T(), p.X());
101     // The We and Re numbers are to be evaluated using the 1/3 rule.
103     scalar WeberNumber = p.We(vel, rhoAverage, sigma);
104     scalar ReynoldsNumber = p.Re(vel, nuAverage);
106     scalar sqRey = sqrt(ReynoldsNumber);
108     if (WeberNumber > Cbag_)
109     {
110         if (WeberNumber > Cstrip_*sqRey)
111         {
112             scalar dStrip =
113                 sqr(2.0*Cstrip_*sigma)
114                /(
115                     rhoAverage
116                    *pow3(mag(p.Urel(vel)))
117                    *muAverage
118                 );
120             scalar tauStrip =
121                 Cs_*p.d()
122                *sqrt(fuels.rho(pressure, p.T(), p.X())/rhoAverage)
123                /mag(p.Urel(vel));
125             scalar fraction = deltaT/tauStrip;
127             // new droplet diameter, implicit calculation
128             p.d() = (fraction*dStrip + p.d())/(1.0 + fraction);
129         }
130         else
131         {
132             scalar dBag = 2.0*Cbag_*sigma/(rhoAverage*sqr(mag(p.Urel(vel))));
134             scalar tauBag =
135                 Cb_*p.d()*sqrt(fuels.rho(pressure, p.T(), p.X())*p.d()/sigma);
137             scalar fraction = deltaT/tauBag;
139             // new droplet diameter, implicit calculation
140             p.d() = (fraction*dBag + p.d())/(1.0 + fraction);
141         }
142     }
146 // ************************************************************************* //