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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "solidParticleCloud.H"
28 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
30 bool Foam::solidParticle::move(solidParticle::trackData& td)
32 td.switchProcessor = false;
33 td.keepParticle = true;
35 const polyMesh& mesh = cloud().pMesh();
36 const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
38 scalar deltaT = mesh.time().deltaT().value();
39 scalar tEnd = (1.0 - stepFraction())*deltaT;
42 while (td.keepParticle && !td.switchProcessor && tEnd > SMALL)
46 Info<< "Time = " << mesh.time().timeName()
47 << " deltaT = " << deltaT
49 << " steptFraction() = " << stepFraction() << endl;
52 // set the lagrangian time-step
53 scalar dt = min(dtMax, tEnd);
55 // remember which cell the parcel is in
56 // since this will change if a face is hit
59 dt *= trackToFace(position() + dt*U_, td);
62 stepFraction() = 1.0 - tEnd/deltaT;
64 cellPointWeight cpw(mesh, position(), celli, face());
65 scalar rhoc = td.rhoInterp().interpolate(cpw);
66 vector Uc = td.UInterp().interpolate(cpw);
67 scalar nuc = td.nuInterp().interpolate(cpw);
69 scalar rhop = td.spc().rhop();
70 scalar magUr = mag(Uc - U_);
73 scalar Re = magUr*d_/nuc;
77 ReFunc += 0.15*pow(Re, 0.687);
80 scalar Dc = (24.0*nuc/d_)*ReFunc*(3.0/4.0)*(rhoc/(d_*rhop));
82 U_ = (U_ + dt*(Dc*Uc + (1.0 - rhoc/rhop)*td.g()))/(1.0 + dt*Dc);
84 if (onBoundary() && td.keepParticle)
86 // Bug fix. HJ, 25/Aug/2010
89 if (isType<processorPolyPatch>(pbMesh[patch(face())]))
91 td.switchProcessor = true;
97 return td.keepParticle;
101 bool Foam::solidParticle::hitPatch
104 solidParticle::trackData&,
112 bool Foam::solidParticle::hitPatch
123 void Foam::solidParticle::hitProcessorPatch
125 const processorPolyPatch&,
126 solidParticle::trackData& td
129 td.switchProcessor = true;
133 void Foam::solidParticle::hitProcessorPatch
135 const processorPolyPatch&,
141 void Foam::solidParticle::hitWallPatch
143 const wallPolyPatch& wpp,
144 solidParticle::trackData& td
147 vector nw = wpp.faceAreas()[wpp.whichFace(face())];
151 vector Ut = U_ - Un*nw;
155 U_ -= (1.0 + td.spc().e())*Un*nw;
158 U_ -= td.spc().mu()*Ut;
162 void Foam::solidParticle::hitWallPatch
164 const wallPolyPatch&,
170 void Foam::solidParticle::hitPatch
173 solidParticle::trackData& td
176 td.keepParticle = false;
180 void Foam::solidParticle::hitPatch
188 void Foam::solidParticle::transformProperties(const tensor& T)
190 Particle<solidParticle>::transformProperties(T);
191 U_ = transform(T, U_);
195 void Foam::solidParticle::transformProperties(const vector& separation)
197 Particle<solidParticle>::transformProperties(separation);
201 // ************************************************************************* //