// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template template bool Foam::KinematicParcel::move ( TrackData& td, const scalar trackTime ) { typename TrackData::cloudType::parcelType& p = static_cast(*this); td.switchProcessor = false; td.keepParticle = true; const polyMesh& mesh = td.cloud().pMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); const scalarField& cellLengthScale = td.cloud().cellLengthScale(); const scalar maxCo = td.cloud().solution().maxCo(); bool mmove = true; while ( mmove && td.keepParticle && !td.switchProcessor && p.stepFraction() < 1) { // Apply correction to position for reduced-D cases p.constrainToMeshCentre(); // Cache the current position, cell and step-fraction const point start = p.position(); const label celli = p.cell(); const scalar sfrac = p.stepFraction(); // Total displacement over the time-step const vector s = trackTime*U_; // Cell length scale const scalar l = cellLengthScale[p.cell()]; // Fraction of the displacement to track in this loop. This is limited // to ensure that the both the time and distance tracked is less than // maxCo times the total value. scalar f = 1 - p.stepFraction(); f = min(f, maxCo); f = min(f, maxCo*l/max(SMALL*l, mag(s))); if (p.active()) { // Track to the next face p.trackToFace(f*s, f, td); } else { // At present the only thing that sets active_ to false is a stick // wall interaction. We want the position of the particle to remain // the same relative to the face that it is on. The local // coordinates therefore do not change. We still advance in time and // perform the relevant interactions with the fixed particle. p.stepFraction() += f; } const scalar dt = (p.stepFraction() - sfrac)*trackTime; // Avoid problems with extremely small timesteps if (dt > ROOTVSMALL) { // Update cell based properties p.setCellValues(td, dt, celli); if (td.cloud().solution().cellValueSourceCorrection()) { p.cellValueSourceCorrection(td, dt, celli); } p.calc(td, dt, celli); } if (p.onBoundaryFace() && td.keepParticle) { if (isA(pbMesh[p.patch()])) { td.switchProcessor = true; } } p.age() += dt; td.cloud().functions().postMove(p, celli, dt, start, td.keepParticle); } td.cloud().correctalpha1() = 0; return td.keepParticle; } //********************************calcDistance*******************************// template template const Foam::vector Foam::KinematicParcel::calcDistance ( TrackData& td, const scalar dt, const label celli, const scalar Re, const scalar mu, const scalar rhoc ) const { scalar probex=0; scalar probey=0; scalar probez=0; scalar Distance=pow((pow((p.position()[0]-probe1x),2)+pow((p.position()[1]-probe1y),2)+pow((p.position()[2]-probe1z),2)),0.5); return scalar Distance; } //***************************************************************************//