From 0ebea8d8090de1e453d64b74fe0ca78552af205a Mon Sep 17 00:00:00 2001 From: graham Date: Mon, 21 Sep 2009 20:11:28 +0100 Subject: [PATCH] Added generalised, parallel wall interactions for normal wall touches only so far. Wall force model hard-coded. --- .../PairCollision/PairCollision.C | 132 +++++++++++++++++- 1 file changed, 128 insertions(+), 4 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C index ca10ee8ea7..0f2fd94588 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C @@ -229,10 +229,134 @@ void Foam::PairCollision::collide() } } - Info<< " ADD COLLISIONS WITH WALLS HERE" << endl; - // << " DOES NOT NEED TO BE A TRACKING OPERATION." - // << " CALCULATE DISTANCE TO SURFACES OF WALL TYPE AND APPLY " - // << "WALL FORCE MODEL" << endl; + DynamicList allWallInteractionSites; + DynamicList flatWallInteractionSites; + DynamicList sharpWallInteractionSites; + + forAll(dil, realCellI) + { + // The real wall faces in range of this real cell + const labelList& realWallFaces = dil.wallFaces()[realCellI]; + + // The labels of referred cells in range of this real cell + const labelList& referredCellsInRange = + dil.referredCellsForInteraction()[realCellI]; + + // Loop over all Parcels in cell + forAll(cellOccupancy_[realCellI], cellParticleI) + { + allWallInteractionSites.clear(); + flatWallInteractionSites.clear(); + sharpWallInteractionSites.clear(); + + typename CloudType::parcelType& p = + *cellOccupancy_[realCellI][cellParticleI]; + + const point& pt = p.position(); + + // real wallFace interactions + + forAll(realWallFaces, realWallFaceI) + { + label realFaceI = realWallFaces[realWallFaceI]; + + pointHit nearest = mesh.faces()[realFaceI].nearestPoint + ( + pt, + mesh.points() + ); + + if (nearest.distance() < p.r()) + { + vector normal = mesh.faceAreas()[realFaceI]; + + normal /= mag(normal); + + vector pW = nearest.rawPoint() - pt; + + scalar normalAlignment = normal & pW/mag(pW); + + allWallInteractionSites.append(nearest.rawPoint()); + + if (normalAlignment > 1 - SMALL) + { + flatWallInteractionSites.append(nearest.rawPoint()); + } + } + } + + // referred wallFace interactions + + forAll(referredCellsInRange, refCellInRangeI) + { + ReferredCell& refCell = + ril[referredCellsInRange[refCellInRangeI]]; + + const labelList& refWallFaces = refCell.wallFaces(); + + forAll(refWallFaces, refWallFaceI) + { + label refFaceI = refWallFaces[refWallFaceI]; + + pointHit nearest = refCell.faces()[refFaceI].nearestPoint + ( + pt, + refCell.points() + ); + + if (nearest.distance() < p.r()) + { + vector normal = refCell.faceAreas()[refFaceI]; + + normal /= mag(normal); + + vector pW = nearest.rawPoint() - pt; + + scalar normalAlignment = normal & pW/mag(pW); + + allWallInteractionSites.append(nearest.rawPoint()); + + if (normalAlignment > 1 - SMALL) + { + flatWallInteractionSites.append(nearest.rawPoint()); + } + } + } + } + + Pout<< flatWallInteractionSites << endl; + + forAll(flatWallInteractionSites, siteI) + { + + scalar nu = this->owner().constProps().poissonsRatio(); + + scalar E = this->owner().constProps().youngsModulus(); + + scalar b = 1.5; + + scalar alpha = 0.52; + + vector r_PW = pt - flatWallInteractionSites[siteI]; + + scalar normalOverlapMag = p.r() - mag(r_PW); + + vector rHat_PW = r_PW/(mag(r_PW) + VSMALL); + + scalar kN = (4.0/3.0)*sqrt(p.r())*E/(2.0*(1.0 - sqr(nu))); + + scalar etaN = alpha*sqrt(p.mass()*kN)*pow025(normalOverlapMag); + + vector fN_PW = + rHat_PW + *(kN*pow(normalOverlapMag, b) - etaN*(p.U() & rHat_PW)); + + p.f() += fN_PW; + + Pout<< "Wall force " << fN_PW << endl; + } + } + } // Delete any collision records where no collision occurred this step