From b04bc4c1c6eff382d856f1cfe5401b0265541b9f Mon Sep 17 00:00:00 2001 From: andy <a.heather@opencfd.co.uk> Date: Fri, 22 May 2009 16:24:53 +0100 Subject: [PATCH] added hitPatch() routines --- .../parcels/Templates/DsmcParcel/DsmcParcel.C | 11 ++ .../parcels/Templates/DsmcParcel/DsmcParcel.H | 10 ++ .../molecule/molecule/molecule.C | 18 +++ .../molecule/molecule/molecule.H | 23 +++- src/lagrangian/solidParticle/solidParticle.C | 18 +++ src/lagrangian/solidParticle/solidParticle.H | 129 +++++++++++------- 6 files changed, 155 insertions(+), 54 deletions(-) diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C index f9c13571894..079f92333e7 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C @@ -78,6 +78,17 @@ bool Foam::DsmcParcel<ParcelType>::move } +template<class ParcelType> +template<class TrackData> +void Foam::DsmcParcel<ParcelType>::hitPatch +( + const polyPatch&, + TrackData& td, + const label patchI +) +{} + + template<class ParcelType> template<class TrackData> void Foam::DsmcParcel<ParcelType>::hitProcessorPatch diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H index bbc2fd1539b..9bef41391b5 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H @@ -239,6 +239,16 @@ public: // Patch interactions + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions + template<class TrackData> + void hitPatch + ( + const polyPatch&, + TrackData& td, + const label patchI + ); + //- Overridable function to handle the particle hitting a // processorPatch template<class TrackData> diff --git a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C index ac45040c096..c24e4f46016 100644 --- a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C @@ -241,6 +241,24 @@ void Foam::molecule::setSiteSizes(label size) } +void Foam::molecule::hitPatch +( + const polyPatch&, + molecule::trackData&, + const label +) +{} + + +void Foam::molecule::hitPatch +( + const polyPatch&, + int&, + const label +) +{} + + void Foam::molecule::hitProcessorPatch ( const processorPolyPatch&, diff --git a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H index 04e33428e99..cad7dadf175 100644 --- a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H @@ -256,7 +256,8 @@ public: // Member Functions - //- Tracking + // Tracking + bool move(trackData&); void transformProperties(const tensor& T); @@ -267,6 +268,7 @@ public: void setSiteSizes(label size); + // Access inline const tensor& Q() const; @@ -305,8 +307,27 @@ public: inline label id() const; + // Member Operators + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions + void hitPatch + ( + const polyPatch&, + molecule::trackData& td, + const label patchI + ); + + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions without trackData + void hitPatch + ( + const polyPatch& p, + int& td, + const label patchI + ); + //- Overridable function to handle the particle hitting a processorPatch void hitProcessorPatch ( diff --git a/src/lagrangian/solidParticle/solidParticle.C b/src/lagrangian/solidParticle/solidParticle.C index 7b9fdf18a64..4760afd833a 100644 --- a/src/lagrangian/solidParticle/solidParticle.C +++ b/src/lagrangian/solidParticle/solidParticle.C @@ -98,6 +98,24 @@ bool Foam::solidParticle::move(solidParticle::trackData& td) } +void Foam::solidParticle::hitPatch +( + const polyPatch&, + solidParticle::trackData&, + const label +) +{} + + +void Foam::solidParticle::hitPatch +( + const polyPatch&, + int&, + const label +) +{} + + void Foam::solidParticle::hitProcessorPatch ( const processorPolyPatch&, diff --git a/src/lagrangian/solidParticle/solidParticle.H b/src/lagrangian/solidParticle/solidParticle.H index a0977520cc0..4d20aeb3c99 100644 --- a/src/lagrangian/solidParticle/solidParticle.H +++ b/src/lagrangian/solidParticle/solidParticle.H @@ -163,68 +163,91 @@ public: inline scalar wallImpactDistance(const vector& n) const; - //- Tracking - bool move(trackData&); + // Tracking + //- Move + bool move(trackData&); - //- Overridable function to handle the particle hitting a processorPatch - void hitProcessorPatch - ( - const processorPolyPatch&, - solidParticle::trackData& td - ); - //- Overridable function to handle the particle hitting a processorPatch - //- without trackData - void hitProcessorPatch - ( - const processorPolyPatch&, - int& - ); + // Patch interactions - //- Overridable function to handle the particle hitting a wallPatch - void hitWallPatch - ( - const wallPolyPatch&, - solidParticle::trackData& td - ); + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions + void hitPatch + ( + const polyPatch&, + solidParticle::trackData& td, + const label patchI + ); - //- Overridable function to handle the particle hitting a wallPatch - //- without trackData - void hitWallPatch - ( - const wallPolyPatch&, - int& - ); + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions without trackData + void hitPatch + ( + const polyPatch& p, + int& td, + const label patchI + ); - //- Overridable function to handle the particle hitting a polyPatch - void hitPatch - ( - const polyPatch&, - solidParticle::trackData& td - ); + //- Overridable function to handle the particle hitting a + // processorPatch + void hitProcessorPatch + ( + const processorPolyPatch&, + solidParticle::trackData& td + ); - //- Overridable function to handle the particle hitting a polyPatch - //- without trackData - void hitPatch - ( - const polyPatch&, - int& - ); + //- Overridable function to handle the particle hitting a + // processorPatch without trackData + void hitProcessorPatch + ( + const processorPolyPatch&, + int& + ); - //- Transform the physical properties of the particle - // according to the given transformation tensor - void transformProperties - ( - const tensor& T - ); + //- Overridable function to handle the particle hitting a wallPatch + void hitWallPatch + ( + const wallPolyPatch&, + solidParticle::trackData& td + ); - //- Transform the physical properties of the particle - // according to the given separation vector - void transformProperties - ( - const vector& separation - ); + //- Overridable function to handle the particle hitting a wallPatch + //- without trackData + void hitWallPatch + ( + const wallPolyPatch&, + int& + ); + + //- Overridable function to handle the particle hitting a polyPatch + void hitPatch + ( + const polyPatch&, + solidParticle::trackData& td + ); + + //- Overridable function to handle the particle hitting a polyPatch + //- without trackData + void hitPatch + ( + const polyPatch&, + int& + ); + + //- Transform the physical properties of the particle + // according to the given transformation tensor + void transformProperties + ( + const tensor& T + ); + + //- Transform the physical properties of the particle + // according to the given separation vector + void transformProperties + ( + const vector& separation + ); // I-O -- GitLab