30 template<
class CloudType>
33 typename CloudType::parcelType::trackingData& td,
41 template<
class CloudType>
51 bool coalescence =
false;
53 const vector& pos1 = p1.position();
54 const vector& pos2 = p2.position();
64 scalar vAlign = URel & (d/(magd + rootVSmall));
68 const scalar d1 = p1.d();
69 const scalar d2 = p2.d();
71 scalar sumD = d1 + d2;
73 if (vAlign*dt > magd - 0.5*sumD)
75 scalar magU1 =
mag(U1) + rootVSmall;
76 scalar magU2 =
mag(U2) + rootVSmall;
80 scalar n1n2 = n1 & n2;
84 scalar
det = 1.0 -
sqr(n1n2);
89 if (
mag(det) > 1.0
e-4)
91 beta = -(n2d - n1n2*n1d)/det;
92 alpha = n1d + n1n2*beta;
99 if ((alpha > 0) && (alpha < 1.0) && (beta > 0) && (beta < 1.0))
101 vector p1c = pos1 + alpha*U1*dt;
102 vector p2c = pos2 + beta*U2*dt;
104 scalar closestDist =
mag(p1c - p2c);
107 pow(0.5*sumD/
max(0.5*sumD, closestDist), cSpace_)
108 *
exp(-cTime_*
mag(alpha - beta));
110 scalar xx = this->owner().rndGen().template sample01<scalar>();
117 coalescence = this->collideSorted(dt, p1, p2, m1, m2);
121 coalescence = this->collideSorted(dt, p2, p1, m2, m1);
134 template<
class CloudType>
142 cSpace_(this->coeffDict().template lookup<scalar>(
"cSpace")),
143 cTime_(this->coeffDict().
template lookup<scalar>(
"cTime"))
147 template<
class CloudType>
161 template<
class CloudType>
virtual ~TrajectoryCollision()
Destructor.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
scalar cSpace_
Space coefficient.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensionedScalar exp(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.
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
Trajectory collision model by N. Nordin, based on O'Rourke's collision model.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Collision model by P.J. O'Rourke.
virtual void collide(typename CloudType::parcelType::trackingData &td, const scalar dt)
Main collision routine.
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar cTime_
Time coefficient.
Templated base class for dsmc cloud.
const dimensionedScalar e
Elementary charge.
TrajectoryCollision(const dictionary &dict, CloudType &cloud)
Construct from dictionary.