From adb9389846a5559318f52fe038a9455eee7484a8 Mon Sep 17 00:00:00 2001 From: graham <g.macpherson@opencfd.co.uk> Date: Fri, 16 Apr 2010 19:04:06 +0100 Subject: [PATCH] ENH: InteractionLists/CollisionModel. Referring wall data, creating referredWallFace class to hold patch information was well as face and pointField. --- .../basic/InteractionLists/InteractionLists.C | 101 ++++++++---- .../basic/InteractionLists/InteractionLists.H | 22 ++- .../InteractionLists/InteractionListsI.H | 10 +- .../referredWallFace/referredWallFace.C | 144 ++++++++++++++++++ .../referredWallFace/referredWallFace.H | 139 +++++++++++++++++ .../referredWallFace/referredWallFaceI.H | 54 +++++++ src/lagrangian/basic/Make/files | 1 + .../PairCollision/PairCollision.C | 10 +- .../WallModel/WallModel/WallModel.H | 2 +- .../WallSpringSliderDashpot.C | 56 +++---- .../WallSpringSliderDashpot.H | 14 +- 11 files changed, 487 insertions(+), 66 deletions(-) create mode 100644 src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFace.C create mode 100644 src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFace.H create mode 100644 src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFaceI.H diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C index a12e3392583..1dcfed86c3c 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.C +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C @@ -372,7 +372,8 @@ void Foam::InteractionLists<ParticleType>::fillReferredParticleCloud() { forAll(referredParticles_, refCellI) { - const IDLList<ParticleType>& refCell = referredParticles_[refCellI]; + const IDLList<ParticleType>& refCell = + referredParticles_[refCellI]; forAllConstIter(typename IDLList<ParticleType>, refCell, iter) { @@ -383,6 +384,43 @@ void Foam::InteractionLists<ParticleType>::fillReferredParticleCloud() } +template<class ParticleType> +void Foam::InteractionLists<ParticleType>::prepareWallDataToRefer() +{ + referredWallData_.setSize + ( + wallFaceIndexAndTransformToDistribute_.size() + ); + + const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_); + + forAll(referredWallData_, rWVI) + { + const labelPair& wfiat = wallFaceIndexAndTransformToDistribute_[rWVI]; + + label wallFaceIndex = globalTransforms_.index(wfiat); + + // const vector& transform = globalTransforms_.transform + // ( + // globalTransforms_.transformIndex(wfiat) + // ); + + label patchI = mesh_.boundaryMesh().patchID() + [ + wallFaceIndex - mesh_.nInternalFaces() + ]; + + label patchFaceI = + wallFaceIndex + - mesh_.boundaryMesh()[patchI].start(); + + // Need to transform velocity when tensor transforms are + // supported + referredWallData_[rWVI] = U.boundaryField()[patchI][patchFaceI]; + } +} + + template<class ParticleType> void Foam::InteractionLists<ParticleType>::writeReferredWallFaces() const { @@ -394,27 +432,23 @@ void Foam::InteractionLists<ParticleType>::writeReferredWallFaces() const forAll(referredWallFaces_, rWFI) { - const Tuple2<face, pointField>& rwf = referredWallFaces_[rWFI]; + const referredWallFace& rwf = referredWallFaces_[rWFI]; - forAll(rwf.first(), fPtI) + forAll(rwf, fPtI) { - meshTools::writeOBJ - ( - str, - rwf.second()[rwf.first()[fPtI]] - ); + meshTools::writeOBJ(str, rwf.points()[rwf[fPtI]]); } str<< 'f'; - forAll(rwf.first(), fPtI) + forAll(rwf, fPtI) { str<< ' ' << fPtI + offset; } str<< nl; - offset += rwf.first().size(); + offset += rwf.size(); } } @@ -426,7 +460,8 @@ Foam::InteractionLists<ParticleType>::InteractionLists ( const polyMesh& mesh, scalar maxDistance, - Switch writeCloud + Switch writeCloud, + const word& UName ) : mesh_(mesh), @@ -443,9 +478,12 @@ Foam::InteractionLists<ParticleType>::InteractionLists cellIndexAndTransformToDistribute_(), wallFaceIndexAndTransformToDistribute_(), referredWallFaces_(), + UName_(UName), + referredWallData_(), referredParticles_() { - Info<< "Building InteractionLists" << endl; + Info<< "Building InteractionLists with interaction distance " + << maxDistance_ << endl; Random rndGen(419715); @@ -704,6 +742,10 @@ Foam::InteractionLists<ParticleType>::InteractionLists // Determine which wall faces to refer + // The referring of wall patch data relies on patches having the same + // index on each processor. + mesh_.boundaryMesh().checkParallelSync(true); + // Determine the index of all of the wall faces on this processor DynamicList<label> localWallFaces; @@ -913,9 +955,9 @@ Foam::InteractionLists<ParticleType>::InteractionLists // Refer wall faces to the appropriate processor referredWallFaces_.setSize(wallFaceIndexAndTransformToDistribute_.size()); - forAll(referredWallFaces_, rwfI) + forAll(referredWallFaces_, rWFI) { - const labelPair& wfiat = wallFaceIndexAndTransformToDistribute_[rwfI]; + const labelPair& wfiat = wallFaceIndexAndTransformToDistribute_[rWFI]; label wallFaceIndex = globalTransforms_.index(wfiat); @@ -924,18 +966,19 @@ Foam::InteractionLists<ParticleType>::InteractionLists globalTransforms_.transformIndex(wfiat) ); - Tuple2<face, pointField>& rwf = referredWallFaces_[rwfI]; - - const labelList& facePts = mesh_.faces()[wallFaceIndex]; + const face& f = mesh_.faces()[wallFaceIndex]; - rwf.first() = face(identity(facePts.size())); + label patchI = mesh_.boundaryMesh().patchID() + [ + wallFaceIndex - mesh_.nInternalFaces() + ]; - rwf.second().setSize(facePts.size()); - - forAll(facePts, fPtI) - { - rwf.second()[fPtI] = mesh_.points()[facePts[fPtI]] - transform; - } + referredWallFaces_[rWFI] = referredWallFace + ( + face(identity(f.size())), + f.points(mesh_.points()) - transform, + patchI + ); } wallFaceMap().distribute(referredWallFaces_); @@ -1034,6 +1077,8 @@ void Foam::InteractionLists<ParticleType>::sendReferredData PstreamBuffers& pBufs ) { + prepareWallDataToRefer(); + prepareParticlesToRefer(cellOccupancy); for (label domain = 0; domain < Pstream::nProcs(); domain++) @@ -1057,8 +1102,10 @@ void Foam::InteractionLists<ParticleType>::sendReferredData } } - // Start sending and receiving but do not block. - pBufs.finishedSends(false); + // Using the mapDistribute to start sending and receiving the + // buffer but not block, i.e. it is calling + // pBufs.finishedSends(false); + wallFaceMap().send(pBufs, referredWallData_); }; @@ -1092,6 +1139,8 @@ void Foam::InteractionLists<ParticleType>::receiveReferredData } fillReferredParticleCloud(); + + wallFaceMap().receive(pBufs, referredWallData_); } diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.H b/src/lagrangian/basic/InteractionLists/InteractionLists.H index 7c7e405e136..fea63c4c216 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.H +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.H @@ -61,6 +61,7 @@ SourceFiles #include "polyMesh.H" #include "globalIndexAndTransform.H" +#include "referredWallFace.H" #include "indexedOctree.H" #include "Tuple2.H" #include "treeDataCell.H" @@ -142,7 +143,13 @@ class InteractionLists List<labelPair> wallFaceIndexAndTransformToDistribute_; //- Referred wall faces - List<Tuple2<face, pointField> > referredWallFaces_; + List<referredWallFace> referredWallFaces_; + + //- Velocity field name, default to "U" + const word UName_; + + //- Referred wall face velocity field values; + List<vector> referredWallData_; //- Referred particle container List<IDLList<ParticleType> > referredParticles_; @@ -187,6 +194,10 @@ class InteractionLists //- Fill the referredParticles so that it will be written out void fillReferredParticleCloud(); + //- Populate the referredWallData container with data that + // will be referred. + void prepareWallDataToRefer(); + //- Write the referred wall faces out for debug void writeReferredWallFaces() const; @@ -206,7 +217,8 @@ public: ( const polyMesh& mesh, scalar maxDistance, - Switch writeCloud = false + Switch writeCloud = false, + const word& UName = "U" ); // Destructor @@ -270,7 +282,10 @@ public: wallFaceIndexAndTransformToDistribute() const; //- Return access to the referred wall faces - const List<Tuple2<face, pointField> >& referredWallFaces() const; + const List<referredWallFace>& referredWallFaces() const; + + //- Return access to the referred wall data + const List<vector>& referredWallData() const; //- Return access to the referred particle container inline const List<IDLList<ParticleType> >& @@ -278,7 +293,6 @@ public: //- Return non-const access to the referred particle container inline List<IDLList<ParticleType> >& referredParticles(); - }; diff --git a/src/lagrangian/basic/InteractionLists/InteractionListsI.H b/src/lagrangian/basic/InteractionLists/InteractionListsI.H index 5175ecdb465..ad28f696c5b 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionListsI.H +++ b/src/lagrangian/basic/InteractionLists/InteractionListsI.H @@ -121,13 +121,21 @@ wallFaceIndexAndTransformToDistribute() const template<class ParticleType> -const Foam::List<Foam::Tuple2<Foam::face, Foam::pointField> >& +const Foam::List<Foam::referredWallFace>& Foam::InteractionLists<ParticleType>::referredWallFaces() const { return referredWallFaces_; } +template<class ParticleType> +const Foam::List<Foam::vector>& +Foam::InteractionLists<ParticleType>::referredWallData() const +{ + return referredWallData_; +} + + template<class ParticleType> const Foam::List<Foam::IDLList<ParticleType> >& Foam::InteractionLists<ParticleType>::referredParticles() const diff --git a/src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFace.C b/src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFace.C new file mode 100644 index 00000000000..8b836e0ad8a --- /dev/null +++ b/src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFace.C @@ -0,0 +1,144 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "referredWallFace.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::referredWallFace::referredWallFace() +: + face(), + pts_(), + patchI_() +{} + + +Foam::referredWallFace::referredWallFace +( + const face& f, + const pointField& pts, + label patchI +) +: + face(f), + pts_(pts), + patchI_(patchI) +{ + if (this->size() != pts_.size()) + { + FatalErrorIn + ( + "Foam::referredWallFace::referredWallFace" + "(" + "const face& f, " + "const pointField& pts, " + "label patchI" + ")" + ) << "Face and pointField are not the same size. " << nl << (*this) + << abort(FatalError); + } +} + + +Foam::referredWallFace::referredWallFace(const referredWallFace& rWF) +: + face(rWF), + pts_(rWF.pts_), + patchI_(rWF.patchI_) +{ + if (this->size() != pts_.size()) + { + FatalErrorIn + ( + "Foam::referredWallFace::referredWallFace" + "(" + "const referredWallFace& rWF" + ")" + ) << "Face and pointField are not the same size. " << nl << (*this) + << abort(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::referredWallFace::~referredWallFace() +{} + + +// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // + +bool Foam::referredWallFace::operator==(const referredWallFace& rhs) const +{ + return + ( + static_cast<const face&>(rhs) == static_cast<face>(*this) + && rhs.pts_ == pts_ + && rhs.patchI_ == patchI_ + ); +} + + +bool Foam::referredWallFace::operator!=(const referredWallFace& rhs) const +{ + return !(*this == rhs); +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +Foam::Istream& Foam::operator>>(Istream& is, referredWallFace& rWF) +{ + is >> static_cast<face&>(rWF) >> rWF.pts_ >> rWF.patchI_; + + // Check state of Istream + is.check + ( + "Foam::Istream& " + "Foam::operator>>(Foam::Istream&, Foam::referredWallFace&)" + ); + + return is; +} + + +Foam::Ostream& Foam::operator<<(Ostream& os, const referredWallFace& rWF) +{ + os << static_cast<const face&>(rWF) << token::SPACE + << rWF.pts_ << token::SPACE + << rWF.patchI_; + + // Check state of Ostream + os.check + ( + "Foam::Ostream& Foam::operator<<(Foam::Ostream&, " + "const Foam::referredWallFace&)" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFace.H b/src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFace.H new file mode 100644 index 00000000000..4806be711f5 --- /dev/null +++ b/src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFace.H @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::referredWallFace + +Description + Storage for referred wall faces. Stores patch index, face and + associated points + +SourceFiles + referredWallFaceI.H + referredWallFace.C + +\*---------------------------------------------------------------------------*/ + +#ifndef referredWallFace_H +#define referredWallFace_H + +#include "face.H" +#include "pointField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class Istream; +class Ostream; + +// Forward declaration of friend functions and operators +class referredWallFace; +Istream& operator>>(Istream&, referredWallFace&); +Ostream& operator<<(Ostream&, const referredWallFace&); + + +/*---------------------------------------------------------------------------*\ + Class referredWallFace Declaration +\*---------------------------------------------------------------------------*/ + +class referredWallFace +: + public face +{ + // Private data + + //- Points of face + pointField pts_; + + //- Index of originating patch + label patchI_; + + +public: + + // Constructors + + //- Construct null + referredWallFace(); + + //- Construct from components + referredWallFace + ( + const face& f, + const pointField& pts, + label patchI + ); + + //- Construct as copy + referredWallFace(const referredWallFace&); + + + //- Destructor + ~referredWallFace(); + + + // Member Functions + + // Access + + //- Return access to the stored points + inline const pointField& points() const; + + //- Return non-const access to the stored points + inline pointField& points(); + + //- Return access to the patch index + inline label patchIndex() const; + + //- Return non-const access to the patch index + inline label& patchIndex(); + + + // Member Operators + + bool operator==(const referredWallFace&) const; + bool operator!=(const referredWallFace&) const; + + // IOstream Operators + + friend Istream& operator>>(Istream&, referredWallFace&); + friend Ostream& operator<<(Ostream&, const referredWallFace&); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "referredWallFaceI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFaceI.H b/src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFaceI.H new file mode 100644 index 00000000000..3cf42d8eb8b --- /dev/null +++ b/src/lagrangian/basic/InteractionLists/referredWallFace/referredWallFaceI.H @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const Foam::pointField& Foam::referredWallFace::points() const +{ + return pts_; +} + + +Foam::pointField& Foam::referredWallFace::points() +{ + return pts_; +} + + +Foam::label Foam::referredWallFace::patchIndex() const +{ + return patchI_; +} + + +Foam::label& Foam::referredWallFace::patchIndex() +{ + return patchI_; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/basic/Make/files b/src/lagrangian/basic/Make/files index 79f19bf4803..574adb603c9 100644 --- a/src/lagrangian/basic/Make/files +++ b/src/lagrangian/basic/Make/files @@ -5,5 +5,6 @@ $(passiveParticle)/passiveParticleCloud.C $(indexedParticle)/indexedParticleCloud.C InteractionLists/globalIndexAndTransform/globalIndexAndTransform.C +InteractionLists/referredWallFace/referredWallFace.C LIB = $(FOAM_LIBBIN)/liblagrangian diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C index e4c4c299e3f..967acf06401 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C @@ -269,18 +269,16 @@ void Foam::PairCollision<CloudType>::wallInteraction() forAll(cellRefWallFaces, rWFI) { - const Tuple2<face, pointField>& rwf = + const referredWallFace& rwf = il_.referredWallFaces()[cellRefWallFaces[rWFI]]; - const face& f = rwf.first(); + const pointField& pts = rwf.points(); - const pointField& pts = rwf.second(); - - pointHit nearest = f.nearestPoint(pos, pts); + pointHit nearest = rwf.nearestPoint(pos, pts); if (nearest.distance() < r) { - vector normal = f.normal(pts); + vector normal = rwf.normal(pts); normal /= mag(normal); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H index e0ccd6c9b15..7088c4df051 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H @@ -129,7 +129,7 @@ public: // allowable timestep virtual label nSubCycles() const = 0; - //- Calculate the wall interaction between parcels + //- Calculate the wall interaction for a parcel virtual void evaluateWall ( typename CloudType::parcelType& p, diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.C index 207e6578267..ba22ef38429 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.C @@ -61,6 +61,32 @@ void Foam::WallSpringSliderDashpot<CloudType>::findMinMaxProperties rMin /= 2.0; } +template <class CloudType> +void Foam::WallSpringSliderDashpot<CloudType>::evaluateWall +( + typename CloudType::parcelType& p, + const point& site, + scalar pNu, + scalar pE, + scalar Estar, + scalar kN +) const +{ + vector r_PW = p.position() - site; + + scalar normalOverlapMag = p.d()/2 - mag(r_PW); + + vector rHat_PW = r_PW/(mag(r_PW) + VSMALL); + + 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; +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -152,38 +178,14 @@ void Foam::WallSpringSliderDashpot<CloudType>::evaluateWall forAll(flatSites, siteI) { - vector r_PW = p.position() - flatSites[siteI]; - - scalar normalOverlapMag = p.d()/2 - mag(r_PW); - - vector rHat_PW = r_PW/(mag(r_PW) + VSMALL); - - 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; + evaluateWall(p, flatSites[siteI], pNu, pE, Estar, kN); } - // Treating sharp sites like flat sites - forAll(sharpSites, siteI) { - vector r_PW = p.position() - sharpSites[siteI]; - - scalar normalOverlapMag = p.d()/2 - mag(r_PW); - - vector rHat_PW = r_PW/(mag(r_PW) + VSMALL); - - scalar etaN = alpha_*sqrt(p.mass()*kN)*pow025(normalOverlapMag); - - vector fN_PW = - rHat_PW - *(kN*pow(normalOverlapMag, b_) - etaN*(p.U() & rHat_PW)); + // Treating sharp sites like flat sites - p.f() += fN_PW; + evaluateWall(p, sharpSites[siteI], pNu, pE, Estar, kN); } } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.H index e01ae072eea..fcc83e22e6c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.H @@ -81,6 +81,18 @@ class WallSpringSliderDashpot scalar& vMagMax ) const; + //- Calculate the wall interaction for a parcel at a given site + void evaluateWall + ( + typename CloudType::parcelType& p, + const point& site, + scalar pNu, + scalar pE, + scalar Estar, + scalar kN + ) const; + + public: //- Runtime type information @@ -108,7 +120,7 @@ public: // allowable timestep virtual label nSubCycles() const; - //- Calculate the wall interaction between parcels + //- Calculate the wall interaction for a parcel virtual void evaluateWall ( typename CloudType::parcelType& p, -- GitLab