CloudFunctionObjects: ParticleErosion, PatchCollisionDensity: Execute before hitting the face
These functions cannot execute on the 'postPatch' hook because at this point the particle properties have already been altered by the patch interaction (i.e., the rebound has occurred and the velocity has reversed). They need to execute in advance of the patch interaction. There is no 'prePatch' hook, and implementing one is not straightforward, so these functions have been changed to use the 'preFace' hook and manually check that the face in question is a boundary face. Patch contributed by Timo Niemi, VTT.
This commit is contained in:
@ -161,12 +161,12 @@ void Foam::ParticleErosion<CloudType>::preEvolve()
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ParticleErosion<CloudType>::postPatch
|
||||
(
|
||||
const parcelType& p,
|
||||
const polyPatch& pp
|
||||
)
|
||||
void Foam::ParticleErosion<CloudType>::preFace(const parcelType& p)
|
||||
{
|
||||
const fvMesh& mesh = this->owner().mesh();
|
||||
if (!p.onBoundaryFace(mesh)) return;
|
||||
|
||||
const polyPatch& pp = mesh.boundaryMesh()[p.patch(mesh)];
|
||||
const label patchi = pp.index();
|
||||
const label localPatchi = applyToPatch(patchi);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -169,8 +169,8 @@ public:
|
||||
//- Pre-evolve hook
|
||||
virtual void preEvolve();
|
||||
|
||||
//- Post-patch hook
|
||||
virtual void postPatch(const parcelType& p, const polyPatch& pp);
|
||||
//- Pre-face hook
|
||||
virtual void preFace(const parcelType& p);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -280,12 +280,12 @@ void Foam::PatchCollisionDensity<CloudType>::preEvolve()
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::PatchCollisionDensity<CloudType>::postPatch
|
||||
(
|
||||
const parcelType& p,
|
||||
const polyPatch& pp
|
||||
)
|
||||
void Foam::PatchCollisionDensity<CloudType>::preFace(const parcelType& p)
|
||||
{
|
||||
const fvMesh& mesh = this->owner().mesh();
|
||||
if (!p.onBoundaryFace(mesh)) return;
|
||||
|
||||
const polyPatch& pp = mesh.boundaryMesh()[p.patch(mesh)];
|
||||
if (pp.coupled()) return;
|
||||
|
||||
const label patchi = pp.index();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -135,8 +135,8 @@ public:
|
||||
//- Pre-evolve hook
|
||||
virtual void preEvolve();
|
||||
|
||||
//- Post-patch hook
|
||||
virtual void postPatch(const parcelType& p, const polyPatch& pp);
|
||||
//- Pre-face hook
|
||||
virtual void preFace(const parcelType& p);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user