diff --git a/src/functionObjects/field/nearWallFields/findCellParticle.C b/src/functionObjects/field/nearWallFields/findCellParticle.C index b23c78ac3d..7c0bd7f7c9 100644 --- a/src/functionObjects/field/nearWallFields/findCellParticle.C +++ b/src/functionObjects/field/nearWallFields/findCellParticle.C @@ -121,12 +121,7 @@ bool Foam::findCellParticle::move } -bool Foam::findCellParticle::hitPatch -( - const polyPatch&, - Cloud& cloud, - trackingData& td -) +bool Foam::findCellParticle::hitPatch(Cloud&, trackingData&) { return false; } @@ -134,8 +129,7 @@ bool Foam::findCellParticle::hitPatch void Foam::findCellParticle::hitWedgePatch ( - const wedgePolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td ) { @@ -146,8 +140,7 @@ void Foam::findCellParticle::hitWedgePatch void Foam::findCellParticle::hitSymmetryPlanePatch ( - const symmetryPlanePolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td ) { @@ -158,8 +151,7 @@ void Foam::findCellParticle::hitSymmetryPlanePatch void Foam::findCellParticle::hitSymmetryPatch ( - const symmetryPolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td ) { @@ -170,8 +162,7 @@ void Foam::findCellParticle::hitSymmetryPatch void Foam::findCellParticle::hitCyclicPatch ( - const cyclicPolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td ) { @@ -182,8 +173,7 @@ void Foam::findCellParticle::hitCyclicPatch void Foam::findCellParticle::hitCyclicAMIPatch ( - const cyclicAMIPolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td, const vector& ) @@ -195,8 +185,7 @@ void Foam::findCellParticle::hitCyclicAMIPatch void Foam::findCellParticle::hitCyclicACMIPatch ( - const cyclicACMIPolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td, const vector& ) @@ -208,8 +197,7 @@ void Foam::findCellParticle::hitCyclicACMIPatch void Foam::findCellParticle::hitProcessorPatch ( - const processorPolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td ) { @@ -220,8 +208,7 @@ void Foam::findCellParticle::hitProcessorPatch void Foam::findCellParticle::hitWallPatch ( - const wallPolyPatch& wpp, - Cloud& cloud, + Cloud&, trackingData& td ) { diff --git a/src/functionObjects/field/nearWallFields/findCellParticle.H b/src/functionObjects/field/nearWallFields/findCellParticle.H index 0fc4bfe028..077335b2fe 100644 --- a/src/functionObjects/field/nearWallFields/findCellParticle.H +++ b/src/functionObjects/field/nearWallFields/findCellParticle.H @@ -222,84 +222,46 @@ public: //- Track all particles to their end point bool move(Cloud&, trackingData&, const scalar); - //- Overridable function to handle the particle hitting a patch // Executed before other patch-hitting functions - bool hitPatch - ( - const polyPatch&, - Cloud&, - trackingData& td - ); + bool hitPatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a wedge - void hitWedgePatch - ( - const wedgePolyPatch&, - Cloud&, - trackingData& td - ); + void hitWedgePatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a // symmetry plane - void hitSymmetryPlanePatch - ( - const symmetryPlanePolyPatch&, - Cloud&, - trackingData& td - ); + void hitSymmetryPlanePatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a // symmetry patch - void hitSymmetryPatch - ( - const symmetryPolyPatch&, - Cloud&, - trackingData& td - ); + void hitSymmetryPatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a cyclic - void hitCyclicPatch - ( - const cyclicPolyPatch&, - Cloud&, - trackingData& td - ); + void hitCyclicPatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a cyclicAMI void hitCyclicAMIPatch ( - const cyclicAMIPolyPatch&, - Cloud& cloud, - trackingData& td, + Cloud&, + trackingData&, const vector& ); //- Overridable function to handle the particle hitting a cyclicACMI void hitCyclicACMIPatch ( - const cyclicACMIPolyPatch&, - Cloud& cloud, - trackingData& td, + Cloud&, + trackingData&, const vector& ); //- Overridable function to handle the particle hitting a //- processorPatch - void hitProcessorPatch - ( - const processorPolyPatch&, - Cloud&, - trackingData& td - ); + void hitProcessorPatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a wallPatch - void hitWallPatch - ( - const wallPolyPatch&, - Cloud&, - trackingData& td - ); + void hitWallPatch(Cloud&, trackingData&); // Ostream Operator diff --git a/src/functionObjects/field/streamLine/streamLineParticle.C b/src/functionObjects/field/streamLine/streamLineParticle.C index c585c6f84c..8a222b2dcf 100644 --- a/src/functionObjects/field/streamLine/streamLineParticle.C +++ b/src/functionObjects/field/streamLine/streamLineParticle.C @@ -265,12 +265,7 @@ bool Foam::streamLineParticle::move } -bool Foam::streamLineParticle::hitPatch -( - const polyPatch&, - streamLineParticleCloud& cloud, - trackingData& td -) +bool Foam::streamLineParticle::hitPatch(streamLineParticleCloud&, trackingData&) { // Disable generic patch interaction return false; @@ -279,8 +274,7 @@ bool Foam::streamLineParticle::hitPatch void Foam::streamLineParticle::hitWedgePatch ( - const wedgePolyPatch& pp, - streamLineParticleCloud& cloud, + streamLineParticleCloud&, trackingData& td ) { @@ -291,8 +285,7 @@ void Foam::streamLineParticle::hitWedgePatch void Foam::streamLineParticle::hitSymmetryPlanePatch ( - const symmetryPlanePolyPatch& pp, - streamLineParticleCloud& cloud, + streamLineParticleCloud&, trackingData& td ) { @@ -303,8 +296,7 @@ void Foam::streamLineParticle::hitSymmetryPlanePatch void Foam::streamLineParticle::hitSymmetryPatch ( - const symmetryPolyPatch& pp, - streamLineParticleCloud& cloud, + streamLineParticleCloud&, trackingData& td ) { @@ -315,8 +307,7 @@ void Foam::streamLineParticle::hitSymmetryPatch void Foam::streamLineParticle::hitCyclicPatch ( - const cyclicPolyPatch& pp, - streamLineParticleCloud& cloud, + streamLineParticleCloud&, trackingData& td ) { @@ -327,8 +318,7 @@ void Foam::streamLineParticle::hitCyclicPatch void Foam::streamLineParticle::hitCyclicAMIPatch ( - const cyclicAMIPolyPatch&, - streamLineParticleCloud& cloud, + streamLineParticleCloud&, trackingData& td, const vector& ) @@ -340,8 +330,7 @@ void Foam::streamLineParticle::hitCyclicAMIPatch void Foam::streamLineParticle::hitCyclicACMIPatch ( - const cyclicACMIPolyPatch&, - streamLineParticleCloud& cloud, + streamLineParticleCloud&, trackingData& td, const vector& ) @@ -353,8 +342,7 @@ void Foam::streamLineParticle::hitCyclicACMIPatch void Foam::streamLineParticle::hitProcessorPatch ( - const processorPolyPatch&, - streamLineParticleCloud& cloud, + streamLineParticleCloud&, trackingData& td ) { @@ -365,8 +353,7 @@ void Foam::streamLineParticle::hitProcessorPatch void Foam::streamLineParticle::hitWallPatch ( - const wallPolyPatch& wpp, - streamLineParticleCloud& cloud, + streamLineParticleCloud&, trackingData& td ) { diff --git a/src/functionObjects/field/streamLine/streamLineParticle.H b/src/functionObjects/field/streamLine/streamLineParticle.H index 0fe31679b1..c19a188e4c 100644 --- a/src/functionObjects/field/streamLine/streamLineParticle.H +++ b/src/functionObjects/field/streamLine/streamLineParticle.H @@ -207,63 +207,32 @@ public: // Tracking //- Track all particles to their end point - bool move - ( - streamLineParticleCloud& cloud, - trackingData&, - const scalar - ); + bool move(streamLineParticleCloud&, trackingData&, const scalar); //- Overridable function to handle the particle hitting a patch // Executed before other patch-hitting functions - bool hitPatch - ( - const polyPatch&, - streamLineParticleCloud& cloud, - trackingData& td - ); + bool hitPatch(streamLineParticleCloud&, trackingData&); //- Overridable function to handle the particle hitting a wedge - void hitWedgePatch - ( - const wedgePolyPatch&, - streamLineParticleCloud& cloud, - trackingData& td - ); + void hitWedgePatch(streamLineParticleCloud&, trackingData&); //- Overridable function to handle the particle hitting a // symmetry plane - void hitSymmetryPlanePatch - ( - const symmetryPlanePolyPatch&, - streamLineParticleCloud& cloud, - trackingData& td - ); + void hitSymmetryPlanePatch(streamLineParticleCloud&, trackingData&); //- Overridable function to handle the particle hitting a // symmetry patch - void hitSymmetryPatch - ( - const symmetryPolyPatch&, - streamLineParticleCloud& cloud, - trackingData& td - ); + void hitSymmetryPatch(streamLineParticleCloud&, trackingData&); //- Overridable function to handle the particle hitting a cyclic - void hitCyclicPatch - ( - const cyclicPolyPatch&, - streamLineParticleCloud& cloud, - trackingData& td - ); + void hitCyclicPatch(streamLineParticleCloud&, trackingData&); //- Overridable function to handle the particle hitting a // cyclicAMIPatch void hitCyclicAMIPatch ( - const cyclicAMIPolyPatch&, - streamLineParticleCloud& cloud, - trackingData& td, + streamLineParticleCloud&, + trackingData&, const vector& direction ); @@ -271,28 +240,17 @@ public: // cyclicACMIPatch void hitCyclicACMIPatch ( - const cyclicACMIPolyPatch&, - streamLineParticleCloud& cloud, - trackingData& td, + streamLineParticleCloud&, + trackingData&, const vector& direction ); //- Overridable function to handle the particle hitting a //- processorPatch - void hitProcessorPatch - ( - const processorPolyPatch&, - streamLineParticleCloud& cloud, - trackingData& td - ); + void hitProcessorPatch(streamLineParticleCloud&, trackingData&); //- Overridable function to handle the particle hitting a wallPatch - void hitWallPatch - ( - const wallPolyPatch&, - streamLineParticleCloud& cloud, - trackingData& td - ); + void hitWallPatch(streamLineParticleCloud&, trackingData&); // I-O diff --git a/src/lagrangian/DSMC/parcels/Templates/DSMCParcel/DSMCParcel.C b/src/lagrangian/DSMC/parcels/Templates/DSMCParcel/DSMCParcel.C index 6e21609853..11604d6488 100644 --- a/src/lagrangian/DSMC/parcels/Templates/DSMCParcel/DSMCParcel.C +++ b/src/lagrangian/DSMC/parcels/Templates/DSMCParcel/DSMCParcel.C @@ -81,12 +81,7 @@ bool Foam::DSMCParcel::move template template -bool Foam::DSMCParcel::hitPatch -( - const polyPatch&, - TrackCloudType& cloud, - trackingData& td -) +bool Foam::DSMCParcel::hitPatch(TrackCloudType&, trackingData&) { return false; } @@ -96,8 +91,7 @@ template template void Foam::DSMCParcel::hitProcessorPatch ( - const processorPolyPatch&, - TrackCloudType& cloud, + TrackCloudType&, trackingData& td ) { @@ -109,14 +103,19 @@ template template void Foam::DSMCParcel::hitWallPatch ( - const wallPolyPatch& wpp, TrackCloudType& cloud, - trackingData& td + trackingData& ) { - label wppIndex = wpp.index(); + const label wppIndex = this->patch(); - label wppLocalFace = wpp.whichFace(this->face()); + const wallPolyPatch& wpp = + static_cast + ( + this->mesh().boundaryMesh()[wppIndex] + ); + + const label wppLocalFace = wpp.whichFace(this->face()); const scalar fA = mag(wpp.faceAreas()[wppLocalFace]); @@ -155,11 +154,7 @@ void Foam::DSMCParcel::hitWallPatch // pre-interaction momentum vector preIMom = m*U_; - cloud.wallInteraction().correct - ( - static_cast &>(*this), - wpp - ); + cloud.wallInteraction().correct(*this); U_dot_nw = U_ & nw; @@ -194,7 +189,6 @@ void Foam::DSMCParcel::hitWallPatch cloud.qBF()[wppIndex][wppLocalFace] += deltaQ; cloud.fDBF()[wppIndex][wppLocalFace] += deltaFD; - } diff --git a/src/lagrangian/DSMC/parcels/Templates/DSMCParcel/DSMCParcel.H b/src/lagrangian/DSMC/parcels/Templates/DSMCParcel/DSMCParcel.H index 1a1c530f48..3e1cad4338 100644 --- a/src/lagrangian/DSMC/parcels/Templates/DSMCParcel/DSMCParcel.H +++ b/src/lagrangian/DSMC/parcels/Templates/DSMCParcel/DSMCParcel.H @@ -260,31 +260,16 @@ public: //- Overridable function to handle the particle hitting a patch // Executed before other patch-hitting functions template - bool hitPatch - ( - const polyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + bool hitPatch(TrackCloudType&, trackingData&); //- Overridable function to handle the particle hitting a // processorPatch template - void hitProcessorPatch - ( - const processorPolyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + void hitProcessorPatch(TrackCloudType&, trackingData&); //- Overridable function to handle the particle hitting a wallPatch template - void hitWallPatch - ( - const wallPolyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + void hitWallPatch(TrackCloudType&, trackingData&); //- Transform the physical properties of the particle // according to the given transformation tensor diff --git a/src/lagrangian/DSMC/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C b/src/lagrangian/DSMC/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C index 9f4ff92bde..dd145c62e1 100644 --- a/src/lagrangian/DSMC/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C +++ b/src/lagrangian/DSMC/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,8 +53,7 @@ Foam::MaxwellianThermal::~MaxwellianThermal() template void Foam::MaxwellianThermal::correct ( - typename CloudType::parcelType& p, - const wallPolyPatch& wpp + typename CloudType::parcelType& p ) { vector& U = p.U(); @@ -63,7 +62,9 @@ void Foam::MaxwellianThermal::correct label typeId = p.typeId(); - label wppIndex = wpp.index(); + const label wppIndex = p.patch(); + + const polyPatch& wpp = p.mesh().boundaryMesh()[wppIndex]; label wppLocalFace = wpp.whichFace(p.face()); diff --git a/src/lagrangian/DSMC/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H b/src/lagrangian/DSMC/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H index 7cb6d28654..dc2d464a80 100644 --- a/src/lagrangian/DSMC/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H +++ b/src/lagrangian/DSMC/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,11 +72,7 @@ public: // Member Functions //- Apply wall correction - virtual void correct - ( - typename CloudType::parcelType& p, - const wallPolyPatch& wpp - ); + virtual void correct(typename CloudType::parcelType& p); }; diff --git a/src/lagrangian/DSMC/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C b/src/lagrangian/DSMC/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C index 056251c533..21c2cd73a8 100644 --- a/src/lagrangian/DSMC/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C +++ b/src/lagrangian/DSMC/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,8 +51,7 @@ Foam::MixedDiffuseSpecular::~MixedDiffuseSpecular() template void Foam::MixedDiffuseSpecular::correct ( - typename CloudType::parcelType& p, - const wallPolyPatch& wpp + typename CloudType::parcelType& p ) { vector& U = p.U(); @@ -61,7 +60,9 @@ void Foam::MixedDiffuseSpecular::correct label typeId = p.typeId(); - label wppIndex = wpp.index(); + const label wppIndex = p.patch(); + + const polyPatch& wpp = p.mesh().boundaryMesh()[wppIndex]; label wppLocalFace = wpp.whichFace(p.face()); diff --git a/src/lagrangian/DSMC/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.H b/src/lagrangian/DSMC/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.H index db3999a6bd..38695d55af 100644 --- a/src/lagrangian/DSMC/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.H +++ b/src/lagrangian/DSMC/submodels/WallInteractionModel/MixedDiffuseSpecular/MixedDiffuseSpecular.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,11 +80,7 @@ public: // Member Functions //- Apply wall correction - virtual void correct - ( - typename CloudType::parcelType& p, - const wallPolyPatch& wpp - ); + virtual void correct(typename CloudType::parcelType& p); }; diff --git a/src/lagrangian/DSMC/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C b/src/lagrangian/DSMC/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C index 6a7e7fa610..a3d182d07b 100644 --- a/src/lagrangian/DSMC/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C +++ b/src/lagrangian/DSMC/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,8 +52,7 @@ Foam::SpecularReflection::~SpecularReflection() template void Foam::SpecularReflection::correct ( - typename CloudType::parcelType& p, - const wallPolyPatch& wpp + typename CloudType::parcelType& p ) { vector& U = p.U(); diff --git a/src/lagrangian/DSMC/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.H b/src/lagrangian/DSMC/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.H index 91f256d432..8f3caace78 100644 --- a/src/lagrangian/DSMC/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.H +++ b/src/lagrangian/DSMC/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,11 +70,7 @@ public: // Member Functions //- Apply wall correction - virtual void correct - ( - typename CloudType::parcelType& p, - const wallPolyPatch& wpp - ); + virtual void correct(typename CloudType::parcelType& p); }; diff --git a/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H b/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H index 8befbaeb6a..b2356bae33 100644 --- a/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H +++ b/src/lagrangian/DSMC/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -127,11 +127,7 @@ public: // Member Functions //- Apply wall correction - virtual void correct - ( - typename CloudType::parcelType& p, - const wallPolyPatch& wpp - ) = 0; + virtual void correct(typename CloudType::parcelType& p) = 0; }; diff --git a/src/lagrangian/basic/particle/particle.H b/src/lagrangian/basic/particle/particle.H index 7d617aa8d9..514cf4e21d 100644 --- a/src/lagrangian/basic/particle/particle.H +++ b/src/lagrangian/basic/particle/particle.H @@ -282,93 +282,44 @@ protected: // Patch interactions - //- Overridable function to handle the particle hitting a - // patch. Executed before other patch-hitting functions. + //- Overridable function to handle the particle hitting a patch. + // Executed before other patch-hitting functions. template - bool hitPatch - ( - const polyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + bool hitPatch(TrackCloudType&, trackingData&); //- Overridable function to handle the particle hitting a wedgePatch template - void hitWedgePatch - ( - const wedgePolyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + void hitWedgePatch(TrackCloudType&, trackingData&); //- Overridable function to handle the particle hitting a // symmetryPlanePatch template - void hitSymmetryPlanePatch - ( - const symmetryPlanePolyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + void hitSymmetryPlanePatch(TrackCloudType&, trackingData&); - //- Overridable function to handle the particle hitting a - // symmetryPatch + //- Overridable function to handle the particle hitting a symmetryPatch template - void hitSymmetryPatch - ( - const symmetryPolyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + void hitSymmetryPatch(TrackCloudType&, trackingData&); //- Overridable function to handle the particle hitting a cyclicPatch template - void hitCyclicPatch - ( - const cyclicPolyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + void hitCyclicPatch(TrackCloudType&, trackingData&); //- Overridable function to handle the particle hitting a cyclicAMIPatch template - void hitCyclicAMIPatch - ( - const cyclicAMIPolyPatch&, - TrackCloudType& cloud, - trackingData& td, - const vector& direction - ); + void hitCyclicAMIPatch(TrackCloudType&, trackingData&, const vector&); //- Overridable function to handle the particle hitting a // cyclicACMIPatch template - void hitCyclicACMIPatch - ( - const cyclicACMIPolyPatch&, - TrackCloudType& cloud, - trackingData& td, - const vector& direction - ); + void hitCyclicACMIPatch(TrackCloudType&, trackingData&, const vector&); - //- Overridable function to handle the particle hitting a - // processorPatch + //- Overridable function to handle the particle hitting a processorPatch template - void hitProcessorPatch - ( - const processorPolyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + void hitProcessorPatch(TrackCloudType&, trackingData&); //- Overridable function to handle the particle hitting a wallPatch template - void hitWallPatch - ( - const wallPolyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + void hitWallPatch(TrackCloudType&, trackingData&); public: diff --git a/src/lagrangian/basic/particle/particleTemplates.C b/src/lagrangian/basic/particle/particleTemplates.C index 4d1a213bb9..f78706aa62 100644 --- a/src/lagrangian/basic/particle/particleTemplates.C +++ b/src/lagrangian/basic/particle/particleTemplates.C @@ -140,73 +140,41 @@ void Foam::particle::hitFace } else if (onBoundaryFace()) { - if(!p.hitPatch(mesh_.boundaryMesh()[p.patch()], cloud, ttd)) + if(!p.hitPatch(cloud, ttd)) { const polyPatch& patch = mesh_.boundaryMesh()[p.patch()]; if (isA(patch)) { - p.hitWedgePatch - ( - static_cast(patch), cloud, ttd - ); + p.hitWedgePatch(cloud, ttd); } else if (isA(patch)) { - p.hitSymmetryPlanePatch - ( - static_cast(patch), - cloud, - ttd - ); + p.hitSymmetryPlanePatch(cloud, ttd); } else if (isA(patch)) { - p.hitSymmetryPatch - ( - static_cast(patch), cloud, ttd - ); + p.hitSymmetryPatch(cloud, ttd); } else if (isA(patch)) { - p.hitCyclicPatch - ( - static_cast(patch), cloud, ttd - ); + p.hitCyclicPatch(cloud, ttd); } else if (isA(patch)) { - p.hitCyclicACMIPatch - ( - static_cast(patch), - cloud, - ttd, - direction - ); + p.hitCyclicACMIPatch(cloud, ttd, direction); } else if (isA(patch)) { - p.hitCyclicAMIPatch - ( - static_cast(patch), - cloud, - ttd, - direction - ); + p.hitCyclicAMIPatch(cloud, ttd, direction); } else if (isA(patch)) { - p.hitProcessorPatch - ( - static_cast(patch), cloud, ttd - ); + p.hitProcessorPatch(cloud, ttd); } else if (isA(patch)) { - p.hitWallPatch - ( - static_cast(patch), cloud, ttd - ); + p.hitWallPatch(cloud, ttd); } else { @@ -238,43 +206,36 @@ void Foam::particle::trackToAndHitFace template -bool Foam::particle::hitPatch -( - const polyPatch&, - TrackCloudType&, - trackingData& -) +bool Foam::particle::hitPatch(TrackCloudType&, trackingData&) { return false; } template -void Foam::particle::hitWedgePatch -( - const wedgePolyPatch& wpp, - TrackCloudType&, - trackingData& -) +void Foam::particle::hitWedgePatch(TrackCloudType& cloud, trackingData& td) { FatalErrorInFunction << "Hitting a wedge patch should not be possible." << abort(FatalError); - vector nf = normal(); - nf /= mag(nf); - - transformProperties(I - 2.0*nf*nf); + hitSymmetryPatch(cloud, td); } template void Foam::particle::hitSymmetryPlanePatch ( - const symmetryPlanePolyPatch& spp, - TrackCloudType&, - trackingData& + TrackCloudType& cloud, + trackingData& td ) +{ + hitSymmetryPatch(cloud, td); +} + + +template +void Foam::particle::hitSymmetryPatch(TrackCloudType&, trackingData&) { vector nf = normal(); nf /= mag(nf); @@ -284,28 +245,10 @@ void Foam::particle::hitSymmetryPlanePatch template -void Foam::particle::hitSymmetryPatch -( - const symmetryPolyPatch& spp, - TrackCloudType&, - trackingData& -) -{ - vector nf = normal(); - nf /= mag(nf); - - transformProperties(I - 2.0*nf*nf); -} - - -template -void Foam::particle::hitCyclicPatch -( - const cyclicPolyPatch& cpp, - TrackCloudType&, - trackingData& -) +void Foam::particle::hitCyclicPatch(TrackCloudType&, trackingData&) { + const cyclicPolyPatch& cpp = + static_cast(mesh_.boundaryMesh()[patch()]); const cyclicPolyPatch& receiveCpp = cpp.neighbPatch(); const label receiveFacei = receiveCpp.whichFace(facei_); @@ -345,14 +288,15 @@ void Foam::particle::hitCyclicPatch template void Foam::particle::hitCyclicAMIPatch ( - const cyclicAMIPolyPatch& cpp, - TrackCloudType& cloud, + TrackCloudType&, trackingData& td, const vector& direction ) { vector pos = position(); + const cyclicAMIPolyPatch& cpp = + static_cast(mesh_.boundaryMesh()[patch()]); const cyclicAMIPolyPatch& receiveCpp = cpp.neighbPatch(); const label sendFacei = cpp.whichFace(facei_); const label receiveFacei = cpp.pointFace(sendFacei, direction, pos); @@ -416,12 +360,14 @@ void Foam::particle::hitCyclicAMIPatch template void Foam::particle::hitCyclicACMIPatch ( - const cyclicACMIPolyPatch& cpp, TrackCloudType& cloud, trackingData& td, const vector& direction ) { + const cyclicACMIPolyPatch& cpp = + static_cast(mesh_.boundaryMesh()[patch()]); + const label localFacei = cpp.whichFace(facei_); // If the mask is within the patch tolerance at either end, then we can @@ -442,7 +388,7 @@ void Foam::particle::hitCyclicACMIPatch if (couple) { - hitCyclicAMIPatch(cpp, cloud, td, direction); + hitCyclicAMIPatch(cloud, td, direction); } else { @@ -455,22 +401,12 @@ void Foam::particle::hitCyclicACMIPatch template -void Foam::particle::hitProcessorPatch -( - const processorPolyPatch&, - TrackCloudType&, - trackingData& -) +void Foam::particle::hitProcessorPatch(TrackCloudType&, trackingData&) {} template -void Foam::particle::hitWallPatch -( - const wallPolyPatch&, - TrackCloudType&, - trackingData& -) +void Foam::particle::hitWallPatch(TrackCloudType&, trackingData&) {} diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index e2ecba800c..9ac6a66007 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -354,7 +354,6 @@ template template bool Foam::KinematicParcel::hitPatch ( - const polyPatch& pp, TrackCloudType& cloud, trackingData& td ) @@ -362,6 +361,8 @@ bool Foam::KinematicParcel::hitPatch typename TrackCloudType::parcelType& p = static_cast(*this); + const polyPatch& pp = p.mesh().boundaryMesh()[p.patch()]; + // Invoke post-processing model cloud.functions().postPatch(p, pp, td.keepParticle); @@ -393,8 +394,7 @@ template template void Foam::KinematicParcel::hitProcessorPatch ( - const processorPolyPatch&, - TrackCloudType& cloud, + TrackCloudType&, trackingData& td ) { @@ -406,12 +406,11 @@ template template void Foam::KinematicParcel::hitWallPatch ( - const wallPolyPatch& wpp, - TrackCloudType& cloud, - trackingData& td + TrackCloudType&, + trackingData& ) { - // Wall interactions handled by generic hitPatch function + // wall interactions are handled by the generic hitPatch method } diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index f586d952c0..cae2a69b21 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -605,31 +605,16 @@ public: //- Overridable function to handle the particle hitting a patch // Executed before other patch-hitting functions template - bool hitPatch - ( - const polyPatch& p, - TrackCloudType& cloud, - trackingData& td - ); + bool hitPatch(TrackCloudType& cloud, trackingData& td); //- Overridable function to handle the particle hitting a // processorPatch template - void hitProcessorPatch - ( - const processorPolyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + void hitProcessorPatch(TrackCloudType& cloud, trackingData& td); //- Overridable function to handle the particle hitting a wallPatch template - void hitWallPatch - ( - const wallPolyPatch&, - TrackCloudType& cloud, - trackingData& td - ); + void hitWallPatch(TrackCloudType& cloud, trackingData& td); //- Transform the physical properties of the particle // according to the given transformation tensor diff --git a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C index 3ad4ca8cdb..d93a6985c9 100644 --- a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C @@ -235,34 +235,19 @@ void Foam::molecule::setSiteSizes(label size) } -bool Foam::molecule::hitPatch -( - const polyPatch&, - moleculeCloud&, - trackingData& -) +bool Foam::molecule::hitPatch(moleculeCloud&, trackingData&) { return false; } -void Foam::molecule::hitProcessorPatch -( - const processorPolyPatch&, - moleculeCloud&, - trackingData& td -) +void Foam::molecule::hitProcessorPatch(moleculeCloud&, trackingData& td) { td.switchProcessor = true; } -void Foam::molecule::hitWallPatch -( - const wallPolyPatch& wpp, - moleculeCloud& cloud, - trackingData& td -) +void Foam::molecule::hitWallPatch(moleculeCloud&, trackingData&) { vector nw = normal(); nw /= mag(nw); diff --git a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H index 185ade2adf..f7af9ec6f3 100644 --- a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H @@ -363,28 +363,13 @@ public: //- Overridable function to handle the particle hitting a patch // Executed before other patch-hitting functions - bool hitPatch - ( - const polyPatch&, - moleculeCloud& cloud, - trackingData& td - ); + bool hitPatch(moleculeCloud& cloud, trackingData& td); //- Overridable function to handle the particle hitting a processorPatch - void hitProcessorPatch - ( - const processorPolyPatch&, - moleculeCloud& cloud, - trackingData& td - ); + void hitProcessorPatch(moleculeCloud& cloud, trackingData& td); //- Overridable function to handle the particle hitting a wallPatch - void hitWallPatch - ( - const wallPolyPatch&, - moleculeCloud& cloud, - trackingData& td - ); + void hitWallPatch(moleculeCloud& cloud, trackingData& td); // I-O diff --git a/src/lagrangian/solidParticle/solidParticle.C b/src/lagrangian/solidParticle/solidParticle.C index 5a7be02f2b..9ad200dbee 100644 --- a/src/lagrangian/solidParticle/solidParticle.C +++ b/src/lagrangian/solidParticle/solidParticle.C @@ -96,12 +96,7 @@ bool Foam::solidParticle::move } -bool Foam::solidParticle::hitPatch -( - const polyPatch&, - solidParticleCloud& cloud, - trackingData& -) +bool Foam::solidParticle::hitPatch(solidParticleCloud&, trackingData&) { return false; } @@ -109,8 +104,7 @@ bool Foam::solidParticle::hitPatch void Foam::solidParticle::hitProcessorPatch ( - const processorPolyPatch&, - solidParticleCloud& cloud, + solidParticleCloud&, trackingData& td ) { @@ -118,12 +112,7 @@ void Foam::solidParticle::hitProcessorPatch } -void Foam::solidParticle::hitWallPatch -( - const wallPolyPatch& wpp, - solidParticleCloud& cloud, - trackingData& td -) +void Foam::solidParticle::hitWallPatch(solidParticleCloud& cloud, trackingData&) { vector nw = normal(); nw /= mag(nw); @@ -140,7 +129,7 @@ void Foam::solidParticle::hitWallPatch } -void Foam::solidParticle::transformProperties (const tensor& T) +void Foam::solidParticle::transformProperties(const tensor& T) { particle::transformProperties(T); U_ = transform(T, U_); diff --git a/src/lagrangian/solidParticle/solidParticle.H b/src/lagrangian/solidParticle/solidParticle.H index 75685b4461..c86c98dcfd 100644 --- a/src/lagrangian/solidParticle/solidParticle.H +++ b/src/lagrangian/solidParticle/solidParticle.H @@ -199,29 +199,14 @@ public: //- Overridable function to handle the particle hitting a patch // Executed before other patch-hitting functions - bool hitPatch - ( - const polyPatch&, - solidParticleCloud& cloud, - trackingData& td - ); + bool hitPatch(solidParticleCloud& cloud, trackingData& td); //- Overridable function to handle the particle hitting a // processorPatch - void hitProcessorPatch - ( - const processorPolyPatch&, - solidParticleCloud& cloud, - trackingData& td - ); + void hitProcessorPatch(solidParticleCloud& cloud, trackingData& td); //- Overridable function to handle the particle hitting a wallPatch - void hitWallPatch - ( - const wallPolyPatch&, - solidParticleCloud& cloud, - trackingData& td - ); + void hitWallPatch(solidParticleCloud& cloud, trackingData& td); //- Transform the physical properties of the particle // according to the given transformation tensor diff --git a/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.C b/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.C index 0e69d01cc1..7bc85fc137 100644 --- a/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.C +++ b/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.C @@ -149,12 +149,7 @@ bool Foam::trackedParticle::move } -bool Foam::trackedParticle::hitPatch -( - const polyPatch&, - Cloud& cloud, - trackingData& td -) +bool Foam::trackedParticle::hitPatch(Cloud&, trackingData&) { return false; } @@ -162,8 +157,7 @@ bool Foam::trackedParticle::hitPatch void Foam::trackedParticle::hitWedgePatch ( - const wedgePolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td ) { @@ -174,8 +168,7 @@ void Foam::trackedParticle::hitWedgePatch void Foam::trackedParticle::hitSymmetryPlanePatch ( - const symmetryPlanePolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td ) { @@ -186,8 +179,7 @@ void Foam::trackedParticle::hitSymmetryPlanePatch void Foam::trackedParticle::hitSymmetryPatch ( - const symmetryPolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td ) { @@ -198,8 +190,7 @@ void Foam::trackedParticle::hitSymmetryPatch void Foam::trackedParticle::hitCyclicPatch ( - const cyclicPolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td ) { @@ -210,10 +201,9 @@ void Foam::trackedParticle::hitCyclicPatch void Foam::trackedParticle::hitCyclicAMIPatch ( - const cyclicAMIPolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td, - const vector& + const vector& direction ) { // Remove particle @@ -223,8 +213,7 @@ void Foam::trackedParticle::hitCyclicAMIPatch void Foam::trackedParticle::hitCyclicACMIPatch ( - const cyclicACMIPolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td, const vector& ) @@ -236,8 +225,7 @@ void Foam::trackedParticle::hitCyclicACMIPatch void Foam::trackedParticle::hitProcessorPatch ( - const processorPolyPatch&, - Cloud& cloud, + Cloud&, trackingData& td ) { @@ -248,8 +236,7 @@ void Foam::trackedParticle::hitProcessorPatch void Foam::trackedParticle::hitWallPatch ( - const wallPolyPatch& wpp, - Cloud& cloud, + Cloud&, trackingData& td ) { diff --git a/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.H b/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.H index da66a11c2d..1718db8c53 100644 --- a/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.H +++ b/src/mesh/snappyHexMesh/trackedParticle/trackedParticle.H @@ -242,88 +242,50 @@ public: //- Track all particles to their end point bool move(Cloud&, trackingData&, const scalar); - //- Overridable function to handle the particle hitting a patch // Executed before other patch-hitting functions - bool hitPatch - ( - const polyPatch&, - Cloud& cloud, - trackingData& td - ); + bool hitPatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a wedge - void hitWedgePatch - ( - const wedgePolyPatch&, - Cloud& cloud, - trackingData& td - ); + void hitWedgePatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a // symmetry plane - void hitSymmetryPlanePatch - ( - const symmetryPlanePolyPatch&, - Cloud& cloud, - trackingData& td - ); + void hitSymmetryPlanePatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a // symmetry patch - void hitSymmetryPatch - ( - const symmetryPolyPatch&, - Cloud& cloud, - trackingData& td - ); + void hitSymmetryPatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a cyclic - void hitCyclicPatch - ( - const cyclicPolyPatch&, - Cloud& cloud, - trackingData& td - ); + void hitCyclicPatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a cyclicAMI void hitCyclicAMIPatch ( - const cyclicAMIPolyPatch&, - Cloud& cloud, - trackingData& td, + Cloud&, + trackingData&, const vector& ); //- Overridable function to handle the particle hitting a cyclicACMI void hitCyclicACMIPatch ( - const cyclicACMIPolyPatch&, - Cloud& cloud, - trackingData& td, + Cloud&, + trackingData&, const vector& ); //- Overridable function to handle the particle hitting a //- processorPatch - void hitProcessorPatch - ( - const processorPolyPatch&, - Cloud& cloud, - trackingData& td - ); + void hitProcessorPatch(Cloud&, trackingData&); //- Overridable function to handle the particle hitting a wallPatch - void hitWallPatch - ( - const wallPolyPatch&, - Cloud& cloud, - trackingData& td - ); + void hitWallPatch(Cloud&, trackingData&); //- Convert processor patch addressing to the global equivalents // and set the celli to the face-neighbour - void correctAfterParallelTransfer(const label, trackingData& td); + void correctAfterParallelTransfer(const label, trackingData&); // Ostream Operator