35 template<
class CloudType>
42 occupancy[iter().cell()]++;
54 pInCell(iter().
cell(), occupancy[iter().
cell()]++) = &iter();
57 for (
label celli=0; celli<this->owner().mesh().nCells(); celli++)
61 if (pInCelli.
size() >= 2)
70 scalar m1 = p1.nParticle()*p1.mass();
71 scalar m2 = p2.nParticle()*p2.mass();
73 bool massChanged = collideParcels(dt, p1, p2, m1, m2);
80 p1.rho() = liquids_.rho(p1.pc(), p1.T(), X);
81 p1.Cp() = liquids_.Cp(p1.pc(), p1.T(), X);
82 p1.sigma() = liquids_.sigma(p1.pc(), p1.T(), X);
83 p1.mu() = liquids_.mu(p1.pc(), p1.T(), X);
84 p1.d() =
cbrt(6.0*m1/(p1.nParticle()*p1.rho()*
pi));
90 p2.rho() = liquids_.rho(p2.pc(), p2.T(), X);
91 p2.Cp() = liquids_.Cp(p2.pc(), p2.T(), X);
92 p2.sigma() = liquids_.sigma(p2.pc(), p2.T(), X);
93 p2.mu() = liquids_.mu(p2.pc(), p2.T(), X);
94 p2.d() =
cbrt(6.0*m2/(p2.nParticle()*p2.rho()*
pi));
106 scalar mass = p.nParticle()*p.mass();
108 if (mass < this->owner().constProps().minParcelMass())
110 this->owner().deleteParticle(p);
116 template<
class CloudType>
127 if ((m1 < ROOTVSMALL) || (m2 < ROOTVSMALL))
132 const scalar Vc = this->owner().mesh().V()[p1.cell()];
133 const scalar d1 = p1.d();
134 const scalar d2 = p2.d();
136 scalar magUrel =
mag(p1.U() - p2.U());
137 scalar sumD = d1 + d2;
139 scalar nMin =
min(p1.nParticle(), p2.nParticle());
140 scalar
nu = nMin*nu0;
141 scalar collProb =
exp(-nu);
142 scalar xx = this->owner().rndGen().template sample01<scalar>();
149 return collideSorted(dt, p1, p2, m1, m2);
153 return collideSorted(dt, p2, p1, m2, m1);
163 template<
class CloudType>
173 const scalar nP1 = p1.nParticle();
174 const scalar nP2 = p2.nParticle();
176 const scalar sigma1 = p1.sigma();
177 const scalar sigma2 = p2.sigma();
179 const scalar d1 = p1.d();
180 const scalar d2 = p2.d();
182 const scalar T1 = p1.T();
183 const scalar T2 = p2.T();
185 const scalar
rho1 = p1.rho();
186 const scalar
rho2 = p2.rho();
193 scalar magURel =
mag(URel);
195 scalar
mTot = m1 + m2;
197 scalar gamma = d1/
max(ROOTVSMALL, d2);
198 scalar
f =
pow3(gamma) + 2.7*gamma - 2.4*
sqr(gamma);
201 scalar Tave = (T1*m1 + T2*m2)/mTot;
204 scalar sigmaAve = sigma1;
205 if (
mag(T2 - T1) > SMALL)
207 sigmaAve += (sigma2 - sigma1)*(Tave - T1)/(T2 - T1);
210 scalar Vtot = m1/rho1 + m2/
rho2;
211 scalar rhoAve = mTot/Vtot;
213 scalar dAve =
sqrt(d1*d2);
214 scalar WeColl = 0.5*rhoAve*
sqr(magURel)*dAve/
max(ROOTVSMALL, sigmaAve);
216 scalar coalesceProb =
min(1.0, 2.4*f/
max(ROOTVSMALL, WeColl));
218 scalar prob = this->owner().rndGen().template sample01<scalar>();
221 if (coalescence_ && prob < coalesceProb)
224 scalar nProb = prob*nP2/nP1;
230 scalar dm = nP1*nProb*m2/scalar(nP2);
235 p1.T() = (Tave*mTot - m2*T2)/m1;
237 p1.U() = (m1*U1 + (1.0 - m2/m2Org)*m2*U2)/m1;
239 p1.Y() = (m1Org*p1.Y() + dm*p2.Y())/m1;
241 p2.nParticle() = m2/(rho2*p2.volume());
248 scalar gf =
sqrt(prob) -
sqrt(coalesceProb);
249 scalar denom = 1.0 -
sqrt(coalesceProb);
264 vector v1p = (mr + m2*gf*URel)/mTot;
265 vector v2p = (mr - m1*gf*URel)/mTot;
270 p2.U() = (nP1*v2p + (nP2 - nP1)*U2)/nP2;
274 p1.U() = (nP2*v1p + (nP1 - nP2)*U1)/nP1;
285 template<
class CloudType>
290 const word& modelName
296 owner.db().template lookupObject<SLGThermo>(
"SLGThermo").liquids()
298 coalescence_(this->coeffDict().lookup(
"coalescence"))
302 template<
class CloudType>
316 template<
class CloudType>
ORourkeCollision(const dictionary &dict, CloudType &cloud, const word &modelName=typeName)
Construct from dictionary.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
dimensionedScalar sqrt(const dimensionedScalar &ds)
virtual ~ORourkeCollision()
Destructor.
dimensionedScalar exp(const dimensionedScalar &ds)
A class for handling words, derived from string.
dimensionedScalar cbrt(const dimensionedScalar &ds)
virtual bool collideParcels(const scalar dt, parcelType &p1, parcelType &p2, scalar &m1, scalar &m2)
Collide parcels and return true if mass has changed.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A packed storage unstructured matrix of objects of type <T> using an offset table for access...
virtual void collide(const scalar dt)
Main collision routine.
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
virtual bool collideSorted(const scalar dt, parcelType &p1, parcelType &p2, scalar &m1, scalar &m2)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const liquidMixtureProperties & liquids_
label size() const
Return the number of elements in the UList.
Collision model by P.J. O'Rourke.
dimensionedScalar pow3(const dimensionedScalar &ds)
A cell is defined as a list of faces with extra functionality.
Templated stochastic collision model class.
dimensioned< scalar > mag(const dimensioned< Type > &)
Templated base class for dsmc cloud.
Switch coalescence_
Coalescence activation switch.