Dear Philippe:
I reported a bug of PPM library last time. Now I found another bug in function “ppm_map_part_ghost_get”. When I used “ppm_map_part_ghost_get” function to create the ghost particles for the neighboring sub-domains. I found some particles located in the ghost region can’t be created correctly.
1. Description of the bug.
Below is my problem. Water particles are locate in an tank with 1.0m in width and 0.25m in height. Water particles are arranged in regular, equally spaced grid with a slope of
Fig1. Computational configuration.
The physical domain is divided into 4 sub-domains shown as below:
Fig2. Domain decomposition.
The extent of sub-domains are shown as below:
Sub0 : min(0.0,0.0) max(0.5,0.1)
Sub1: min(0,0,0.1) max(0.5,0.25)
Sub2: min(0.5,0.0) max(1.0,0.1)
Sub3: min(0.5,0.1) max(1.0,0.25)
Using the above domain extent, some particles will located at the line x=0.5 and line y=0.1
(see below figure..) .In this condition, the” ppm_ map_part_ global” woks well, which can map the particles to the correct sub-domains, except some particles located on x=0.5 and y=0.1.
But there is no particle missing, when ” ppm_ map_part_ global” is called.
Fig 3. Particle distribution.
However, when the function “ppm_map_part_ghost_get” is called to make ghost particles, some ghost particles will be lost and can cause particle-particle interaction error.
Below is the figure of configuration of ghost particle for sub-domain 1. We can found there is no ghost particle in the blue box (blue box need to be filled with ghost particles). The same error can also be found in sub-domain2’s ghost layer.
If the above ghost particles configurations were use to computer the particle-particle interactions, error will occur near the sub-domain’s boundary. Below figure is the summation of the kernel value, we can found the summation of the kernel is not 1 at the lower-left of sub-domain 3 (which should be 1).
Fig4. Ghost particle missing in sub-domain 1;
Fig5. Ghost particle missing in sub-domain 2;
Fig6. Kernel value error at sub-domain boundary.
2. Solution.
I guess this type of ghost particle missing is caused by the inconsistency of sub-domains’ extent. When the function“ppm_map_part_ghost_get” was used to detect the ghost particle, below program is used in PPM library“
IF (xt(1,i).GT.xmini.AND.xt(1,i).LT.xmaxi.AND. &
& xt(2,i).GT.ymini.AND.xt(2,i).LT.ymaxi.AND.lghost(i)) THEN “
This means that particles at the boundaries are excluded into consideration. Then the ghost particles are lost in sub-domain 1 and sub-domain 2.
Here I propose to use to define the sub-domain’s extent which means particles located at the left or lower boundaries are belong to the sub-domain, while particles located at the upper or above boundaries are not belong to the sub-domain. “
IF (xt(1,i) >= xmini.AND.xt(1,i).LT.xmaxi.AND. &
& xt(2,i) >= ymini.AND.xt(2,i).LT.ymaxi.AND.lghost(i)) THEN “
Then the above problem can be solved. Below is the configuration of ghost particle, when the proposed method is used and the summation of kernel value.
By the way, I am not sure if the proposed sub-domain’s extent should be used in function “ppm_map_part_global” or “ppm_map_part_partial”.
Fig7. Ghost particle missing in sub-domain 1;
Fig8. Ghost particle missing in sub-domain 1;
Fig9. Kernel summation;