MPPICParcel: Retain effect of patch interactions on correction velocity

This prevents infinite loops occurring during correction steps as a
result of a fixed correction velocity repeatedly pushing the particle
towards a rebound patch.

Resolves bug report https://bugs.openfoam.org/view.php?id=2935
This commit is contained in:
Will Bainbridge
2018-05-16 11:52:34 +01:00
parent 62e0e18e84
commit 4e21098cb5

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -94,17 +94,16 @@ bool Foam::MPPICParcel<ParcelType>::move
} }
case trackingData::tpCorrectTrack: case trackingData::tpCorrectTrack:
{ {
vector U = p.U(); const scalar f = p.stepFraction();
const scalar a = p.age();
scalar f = p.stepFraction(); Swap(p.U(), p.UCorrect());
scalar a = p.age();
p.U() = (1.0 - f)*p.UCorrect();
ParcelType::move(cloud, td, trackTime); ParcelType::move(cloud, td, trackTime);
p.U() = U + (p.stepFraction() - f)*p.UCorrect(); Swap(p.U(), p.UCorrect());
p.U() += (p.stepFraction() - f)*p.UCorrect();
p.age() = a; p.age() = a;