View Issue Details

IDProjectCategoryView StatusLast Update
0003084OpenFOAMBugpublic2019-05-02 03:16
ReporterChrisK15 Assigned Towill  
PriorityhighSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSLinux MintOS Version19
Summary0003084: Lagrangian KinematicParcel hitPatch called on inactive parcel => LocalInteraction number of stuck parcels is wrong
DescriptionAs the summary says the number of stuck parcels is counted incorrectly. The bug occurs because of the change from OF 5.x to 6 where the hitFace function is called at the end of the Foam::KinematicParcel<ParcelType>::move function.

The submodel handeling the ineraction is called from the function Foam::KinematicParcel<ParcelType>::hitPatch in KinematicParcel.C:
-> In OF 5.x hitPatch is called from the trackToFace function in Foam::KinematicParcel<ParcelType>::move BUT ONLY if the parcel is active
-> In OF 6 the hitFace function which calls the hitPatch function is called at the end of the ::move function no matter what
so in Foam::LocalInteraction<CloudType>::correct the number of stuck parcels is incremented every timestep.

A possible solution would be to check if the parcel is active or not before the switch statement in Foam::LocalInteraction<CloudType>::correct.
Possibly there are more bugs cause by this through the functions called in Foam::KinematicParcel<ParcelType>::hitPatch
TagsNo tags attached.

Activities

ChrisK15

2018-10-11 15:30

reporter   ~0010093

Just noticed FunctionObject like PatchCollisionDensity also counts the number collisions incorrectly.

A better solution would be to check in Foam::KinematicParcel<ParcelType>::move before calling p.hitFace if the the parcel is active or not. Then the code acts more like OP 5.x, not sure if this again causes other bugs with new FunctionObjects

will

2018-10-11 16:29

manager   ~0010094

Have you tried doing the check? I.e., if you put "p.active()" into both of the if conditions at the bottom of KinematicParcel::move, does it resolve the issue?

ChrisK15

2018-10-11 21:28

reporter   ~0010095

Both issue (stuck parcels, CollisionDensity Function Object) are resolved if you put the p.active() in the if statement at the bottem of KinematicParcel::move! So then the check in LocalInteraction is not needed.

I am just not sure if any other function called from hitPatch needs to be executed even when the parcel is inactive. I mean don't know why you guys moved the hitFace function to this new place maybe there is a reason for it, if not than everything can be fixed by simply adding the p.active() in ::move

tniemi

2018-10-12 08:00

reporter   ~0010096

The reason for moving the hitFace is to have the "calc"-step in between moving and interacting with the patch so that things happening at the patch do not influence the calc-phase.

Setting the active checks to postFace and hitpatch -sections should be ok.

will

2018-10-12 11:43

manager   ~0010097

Resolved in dev by commit c17e6dbfe, and in version 6 by 166e3a7a1

Issue History

Date Modified Username Field Change
2018-10-11 14:56 ChrisK15 New Issue
2018-10-11 15:30 ChrisK15 Note Added: 0010093
2018-10-11 16:29 will Note Added: 0010094
2018-10-11 21:28 ChrisK15 Note Added: 0010095
2018-10-12 08:00 tniemi Note Added: 0010096
2018-10-12 11:43 will Assigned To => will
2018-10-12 11:43 will Status new => resolved
2018-10-12 11:43 will Resolution open => fixed
2018-10-12 11:43 will Fixed in Version => 6
2018-10-12 11:43 will Note Added: 0010097