Inconsistent number of particles escaping the system
Summary
The number of particles escaping the system is inconsistent.
I've asked this question (the last reply of the thread) a long time ago but no one answered: https://www.cfd-online.com/Forums/openfoam-solving/217086-particle-fate-dpmfoam-mppicfoam.html#post766848
Might be related to this issue: OpenFOAM-plus#1306
Steps to reproduce
Run particle tracking with user compiled particle forces added to src/lagrangian/intermediate/submodels/Kinematic/ParticleForces
.
The particle force is simply modified from PressureGraident
so I don't think there's any bug in my particle force.
Example case
I don't want to share the case file as it is research related.
If you can't reproduce one with built-in particle force, I'll create a minimal case to reproduce that.
What is the current bug behaviour?
This is the log from v2112. Obviously the number 80777 is problematic, and the simulation result doesn't make sense.
Current number of parcels = 1963
Current mass in system = 8.222595172e-15
Linear momentum = (4.11548211259e-17 -1.5147123108e-17 4.67553491316e-27)
|Linear momentum| = 4.38537870697e-17
Linear kinetic energy = 4.111297586e-17
Average particle per parcel = 1
Injector model1:
- parcels added = 9861
- mass introduced = 4.13056602094e-14
Parcel fate: system (number, mass)
- escape = 80777, 3.38357906372e-13
Parcel fate: patch frontAndBackPlanes|confinement|sidewall|inlet (number, mass)
- escape = 0, 0
- stick = 0, 0
Parcel fate: patch outlet (number, mass)
- escape = 7898, 3.3083065037e-14
- stick = 0, 0
What is the expected correct behavior?
I've done some particle tracking researches using v1712 before and I know this version didn't give me any issue. I tried to backport the same particle force to V1712 and everything looks normal:
Current number of parcels = 467
Current mass in system = 1.95616502564e-15
Linear momentum = (5.25816684692e-17 -4.81196024144e-19 1.35596323969e-34)
|Linear momentum| = 5.25838702324e-17
Linear kinetic energy = 1.77465381473e-18
Injector model1:
- parcels added = 9893
- mass introduced = 4.1439701496e-14
Parcel fate: system (number, mass)
- escape = 9426, 3.94835364703e-14
Parcel fate: patch frontAndBackPlanes|confinement|sidewall|inlet (number, mass)
- escape = 0, 0
- stick = 0, 0
Parcel fate: patch outlet (number, mass)
- escape = 9426, 3.94835364701e-14
- stick = 0, 0
Relevant logs and/or images
Above
Environment information
- OpenFOAM version : v2112
- Operating system : Rocky Linux
- Hardware info :
- Compiler : gcc
Possible fixes
I can confirm v1712 doesn't have this issue, but v1912 and after does. From the thread https://www.cfd-online.com/Forums/openfoam-solving/217086-particle-fate-dpmfoam-mppicfoam.html, the OP said he used v1812, so most likely the bug was introduced between v1712 and v1812.