BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / lagrangian / dieselSpray / spray / sprayOps.C
blob83f7612100aeec6fa0c648fd2e13146c7b15626b
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 "spray.H"
27 #include "atomizationModel.H"
28 #include "breakupModel.H"
29 #include "collisionModel.H"
30 #include "dispersionModel.H"
31 #include "interpolation.H"
32 #include "processorPolyPatch.H"
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 void Foam::spray::evolve()
38     sms_.setSize(rho_.size());
39     shs_.setSize(rho_.size());
40     forAll(srhos_, i)
41     {
42         srhos_[i].setSize(rho_.size());
43     }
45     UInterpolator_ = interpolation<vector>::New(interpolationSchemes_, U_);
47     rhoInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, rho_);
49     pInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, p_);
51     TInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, T_);
53     calculateAmbientPressure();
54     calculateAmbientTemperature();
55     collisions().collideParcels(runTime_.deltaTValue());
56     move();
57     dispersion().disperseParcels();
58     inject();
59     atomizationLoop();
60     breakupLoop();
62     UInterpolator_.clear();
63     rhoInterpolator_.clear();
64     pInterpolator_.clear();
65     TInterpolator_.clear();
69 void Foam::spray::move()
71     // Reset Spray Source Terms
72     sms_ = vector::zero;
73     shs_ = 0.0;
74     forAll(srhos_, i)
75     {
76         srhos_[i] = 0.0;
77     }
79     parcel::trackingData td(*this);
80     Cloud<parcel>::move(td, runTime_.deltaTValue());
84 void Foam::spray::breakupLoop()
86     forAllIter(spray, *this, elmnt)
87     {
88         // interpolate...
89         vector velocity = UInterpolator().interpolate
90         (
91             elmnt().position(),
92             elmnt().currentTetIndices()
93         );
95         // liquidCore < 0.5 indicates discrete drops
96         if (elmnt().liquidCore() <= 0.5)
97         {
98             breakup().updateParcelProperties
99             (
100                 elmnt(),
101                 runTime_.deltaTValue(),
102                 velocity,
103                 fuels_
104             );
106             breakup().breakupParcel
107             (
108                 elmnt(),
109                 runTime_.deltaTValue(),
110                 velocity,
111                 fuels_
112             );
113         }
114     }
118 void Foam::spray::atomizationLoop()
120     forAllIter(spray, *this, elmnt)
121     {
122         // interpolate...
123         vector velocity = UInterpolator().interpolate
124         (
125             elmnt().position(),
126             elmnt().currentTetIndices()
127         );
129         // liquidCore > 0.5 indicates a liquid core
130         if (elmnt().liquidCore() > 0.5)
131         {
132             atomization().atomizeParcel
133             (
134                 elmnt(),
135                 runTime_.deltaTValue(),
136                 velocity,
137                 fuels_
138             );
139         }
140     }
144 // ************************************************************************* //