1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
30 \*---------------------------------------------------------------------------*/
36 #include "contiguous.H"
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class parcel Declaration
47 \*---------------------------------------------------------------------------*/
51 public Particle<parcel>
53 // Private member data
55 // Reference to the names of the liquid components
56 List<word> liquidComponents_;
58 // Defining data (read and written to field files)
60 //- Diameter of droplets in parcel
63 //- Temperature of droplets in parcel
69 //- Spherical deviation of droplets in parcel
72 //- Rate of change of spherical deviation of droplets in parcel
75 //- Characteristic time of droplets in parcel
78 //- Stripped mass of droplets in parcel
81 //- Time spent in turbulent eddy
84 //- Part of liquid core (1-fully liquid, 0-droplet)
87 //- injected from injector
88 // Should really be a label, but is scalar due to
89 // post-processing reasons
92 //- Velocity of parcel
95 //- Turbulent velocity fluctuation
98 //- Normal n_ and axis describe the 2D plane
99 // in which the particle moves
102 //- Liquid components molar fractions
105 // Derived state information (not read or written)
107 //- Momentum relaxation time of droplets in parcel
111 // Private member functions
113 //- Set the relaxation times
114 void setRelaxationTimes
118 scalarField& tauEvaporation,
119 scalar& tauHeatTransfer,
120 scalarField& tauBoiling,
121 const spray& sprayDatabase,
124 const scalar temperature,
125 const scalar pressure,
126 const scalarField& Yf,
127 const scalarField& m0,
132 void updateParcelProperties
143 friend class Cloud<parcel>;
148 //- Construct from components
151 const Cloud<parcel>& cloud,
152 const vector& position,
163 const scalar liquidCore,
164 const scalar injector,
167 const scalarField& X,
168 const List<word>& liquidNames
171 //- Construct from Istream reading field values if required
174 const Cloud<parcel>& cloud,
176 bool readFields = true
184 //- Return the names of the liquid components
185 inline const List<word>& liquidNames() const;
187 //- Return the names of the liquid fuel components - identical with liquidNames
188 inline const List<word>& fuelNames() const;
190 //- Return diameter of droplets in parcel
191 inline scalar d() const;
193 //- Return diameter of droplets in parcel
196 //- Return temperature of droplets in parcel
197 inline scalar T() const;
199 //- Return temperature of droplets in parcel
202 //- Return total parcel mass
203 inline scalar m() const;
205 //- Return total parcel mass
208 //- Return spherical deviation of droplets in parcel
209 inline scalar dev() const;
211 //- Return spherical deviation of droplets in parcel
212 inline scalar& dev();
214 //- Return rate of change of spherical deviation of
215 // droplets in parcel
216 inline scalar ddev() const;
218 //- Return rate of change of spherical deviation of
219 // droplets in parcel
220 inline scalar& ddev();
222 //- Return characteristic time of droplets in parcel
223 inline scalar ct() const;
225 //- Return characteristic time of droplets in parcel
228 //- Return stripped mass of droplets in parcel
231 //- Return stripped mass of droplets in parcel
232 inline scalar ms() const;
234 //- Return time spent in turbulent eddy
235 inline scalar& tTurb();
237 //- Return time spent in turbulent eddy
238 inline scalar tTurb() const;
240 //- Return part of liquid liquidCore
241 inline scalar& liquidCore();
243 //- Return part of liquid liquidCore
244 inline scalar liquidCore() const;
246 //- Return the injector from which is injected
247 inline scalar& injector();
249 //- Return the injector from which is injected
250 inline scalar injector() const;
252 //- Return velocity of parcel
253 inline const vector& U() const;
255 //- Return velocity of parcel
258 //- Return turbulent velocity fluctuation
259 inline const vector& Uturb() const;
261 //- Return turbulent velocity fluctuation
262 inline vector& Uturb();
264 //- Return the normal used for 2D purposes
265 inline const vector& n() const;
267 //- Return the normal used for 2D purposes
270 //- Return the liquid components molar fractions
271 inline const scalarField& X() const;
273 //- Return the liquid components molar fractions
274 inline scalarField& X();
276 //- Return the momentum relaxation time of droplets in parcel
277 inline scalar& tMom();
279 //- Return the momentum relaxation time of droplets in parcel
280 inline scalar tMom() const;
283 // Derived information
285 //- Return statistical number of drops in parcel
286 scalar N(const scalar rho) const;
288 //- Return relative velocity between given vector and parcel
289 inline vector Urel(const vector&) const;
292 // Dimensionless Numbers
294 //- Reynolds number based on rho an dynamic viscosity
302 //- Reynolds number based on kinematic viscosity
317 //- Schmidt number based on dynamic viscosity and rho
322 const scalar massDiffusion
325 //- Schmidt number based on kinematic viscosity
329 const scalar massDiffusion
340 //- Volume of one droplet in the parcel
343 //- Volume of all droplets in parcel
344 scalar V(const scalar rho) const;
349 bool move(spray& sprayData);
351 //- Transform the position and physical properties of the particle
352 // according to the given transformation tensor
353 void transformProperties(const tensor& T);
355 //- Transform the position and physical properties of the particle
356 // according to the given separation vector
357 void transformProperties(const vector& separation);
359 //- Fix the 2D plane normal,
360 // when particle hits a face it is slightly perturbed
361 // towards the face centre and n_ will no longer be valid
362 inline void correctNormal(const vector& sym);
367 static void readFields(Cloud<parcel>& c);
369 static void writeFields(const Cloud<parcel>& c);
374 friend Ostream& operator<<(Ostream&, const parcel&);
379 inline bool contiguous<parcel>()
385 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
387 } // End namespace Foam
389 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
393 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
397 // ************************************************************************* //