38template<
class CloudType>
49 occupancy[
p.cell()]++;
61 pInCell(
p.cell(), occupancy[
p.cell()]++) = &
p;
64 for (label celli=0; celli<this->owner().mesh().nCells(); celli++)
68 if (pInCelli.
size() >= 2)
72 for (label j=i+1; j<pInCelli.
size(); j++)
77 scalar m1 = p1.nParticle()*p1.mass();
78 scalar m2 = p2.nParticle()*p2.mass();
80 bool massChanged = collideParcels(dt, p1, p2, m1, m2);
87 p1.setCellValues(this->owner(), td);
88 p1.rho() = liquids_.rho(td.pc(), p1.T(), X);
89 p1.Cp() = liquids_.Cp(td.pc(), p1.T(), X);
90 p1.sigma() = liquids_.sigma(td.pc(), p1.T(), X);
91 p1.mu() = liquids_.mu(td.pc(), p1.T(), X);
92 p1.d() =
cbrt(6.0*m1/(p1.nParticle()*p1.rho()*
pi));
98 p2.setCellValues(this->owner(), td);
99 p2.rho() = liquids_.rho(td.pc(), p2.T(), X);
100 p2.Cp() = liquids_.Cp(td.pc(), p2.T(), X);
101 p2.sigma() = liquids_.sigma(td.pc(), p2.T(), X);
102 p2.mu() = liquids_.mu(td.pc(), p2.T(), X);
103 p2.d() =
cbrt(6.0*m2/(p2.nParticle()*p2.rho()*
pi));
114 scalar mass =
p.nParticle()*
p.mass();
116 if (mass < this->owner().constProps().minParcelMass())
118 this->owner().deleteParticle(
p);
124template<
class CloudType>
135 if ((m1 < ROOTVSMALL) || (m2 < ROOTVSMALL))
140 const scalar Vc = this->owner().mesh().V()[p1.cell()];
141 const scalar d1 = p1.d();
142 const scalar d2 = p2.d();
144 scalar magUrel =
mag(p1.U() - p2.U());
145 scalar sumD = d1 + d2;
146 scalar nu0 = 0.25*constant::mathematical::pi*
sqr(sumD)*magUrel*dt/Vc;
147 scalar nMin =
min(p1.nParticle(), p2.nParticle());
148 scalar
nu = nMin*nu0;
149 scalar collProb =
exp(-
nu);
150 scalar xx = this->owner().rndGen().template sample01<scalar>();
157 return collideSorted(dt, p1, p2, m1, m2);
161 return collideSorted(dt, p2, p1, m2, m1);
169template<
class CloudType>
179 const scalar nP1 = p1.nParticle();
180 const scalar nP2 = p2.nParticle();
182 const scalar sigma1 = p1.sigma();
183 const scalar sigma2 = p2.sigma();
185 const scalar d1 = p1.d();
186 const scalar d2 = p2.d();
188 const scalar T1 = p1.T();
189 const scalar T2 = p2.T();
191 const scalar
rho1 = p1.rho();
192 const scalar
rho2 = p2.rho();
199 scalar magURel =
mag(URel);
201 scalar
mTot = m1 + m2;
203 scalar
gamma = d1/
max(ROOTVSMALL, d2);
207 scalar Tave = (T1*m1 + T2*m2)/
mTot;
210 scalar sigmaAve = sigma1;
211 if (
mag(T2 - T1) > SMALL)
213 sigmaAve += (sigma2 - sigma1)*(Tave - T1)/(T2 - T1);
217 scalar rhoAve =
mTot/Vtot;
219 scalar dAve =
sqrt(d1*d2);
220 scalar WeColl = 0.5*rhoAve*
sqr(magURel)*dAve/
max(ROOTVSMALL, sigmaAve);
222 scalar coalesceProb =
min(1.0, 2.4*
f/
max(ROOTVSMALL, WeColl));
224 scalar prob = this->owner().rndGen().template sample01<scalar>();
227 if (coalescence_ && prob < coalesceProb)
230 scalar nProb = prob*nP2/nP1;
236 scalar dm = nP1*nProb*m2/scalar(nP2);
241 p1.T() = (Tave*
mTot - m2*T2)/m1;
243 p1.U() = (m1*
U1 + (1.0 - m2/m2Org)*m2*
U2)/m1;
245 p1.Y() = (m1Org*p1.Y() + dm*p2.Y())/m1;
247 p2.nParticle() = m2/(
rho2*p2.volume());
254 scalar gf =
sqrt(prob) -
sqrt(coalesceProb);
255 scalar denom = 1.0 -
sqrt(coalesceProb);
276 p2.U() = (nP1*v2p + (nP2 - nP1)*
U2)/nP2;
280 p1.U() = (nP2*v1p + (nP1 - nP2)*
U1)/nP1;
291template<
class CloudType>
296 const word& modelName
302 owner.db().template lookupObject<
SLGThermo>(
"SLGThermo").liquids()
306 this->coeffDict().template get<
bool>(
"coalescence")
311template<
class CloudType>
318 liquids_(cm.liquids_),
319 coalescence_(cm.coalescence_)
325template<
class CloudType>
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
Templated base class for dsmc cloud.
Collision model by P.J. O'Rourke.
virtual bool collideParcels(const scalar dt, parcelType &p1, parcelType &p2, scalar &m1, scalar &m2)
Collide parcels and return true if mass has changed.
virtual bool collideSorted(const scalar dt, parcelType &p1, parcelType &p2, scalar &m1, scalar &m2)
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
virtual ~ORourkeCollision()
Destructor.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Templated stochastic collision model class.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Class used to pass data into container.
A class for handling words, derived from Foam::string.
constexpr scalar pi(M_PI)
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensionedScalar cbrt(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.