Next Article in Journal
Parallel Disassembly Sequence Planning Using a Discrete Whale Optimization Algorithm for Equipment Maintenance in Hydropower Station
Previous Article in Journal
Zinc Extraction from Primary Lead Smelting Slags by Oxidant Alkaline Leaching
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Improved Porosity Calculation Algorithm for Particle Flow Code

1
School of Petroleum Engineering, Yangtze University, Wuhan 430100, China
2
Hubei Key Laboratory of Oil and Gas Drilling and Production Engineering, Yangtze University, Wuhan 430100, China
3
School of Petroleum Engineering, National Engineering Research Center for Oil and Gas Drilling and Completion Technology, Yangtze University, Wuhan 430100, China
4
State Key Laboratory of Offshore Oil and Gas Exploitation, Beijing 102299, China
5
CNOOC Research Institute, Beijing 102299, China
*
Authors to whom correspondence should be addressed.
Processes 2024, 12(7), 1410; https://doi.org/10.3390/pr12071410
Submission received: 12 May 2024 / Revised: 30 June 2024 / Accepted: 3 July 2024 / Published: 6 July 2024
(This article belongs to the Section Energy Systems)

Abstract

:
The widely used discrete-element particle flow software PFC’s (PFC 7.0 and previous versions) algorithm for calculating porosity is not sufficiently accurate. Because of this, when the particles are densely packed, the solution to the equation produces an algorithm exception for odd calculations of porosity, which results in the inability to calculate the results. This paper, based on a Darcy seepage model of fluid flow through a granular bed, analyzed the shortcomings of the two porosity calculation methods of PFC and the function analysis method. Combining this analysis with the theory of computer graphics, a new and efficient porosity calculation algorithm was proposed. The result showed that the new proposed porosity calculation algorithm calculated a more accurate and reasonable porosity field and made the iterative solution of the CFD equation more stable. This method makes porosity-related models of PFC more accurate. The algorithm can be not only used to calculate porosity, but also applied to other fields.

1. Introduction

Particle flow refers to a stream of solid particles under the action of external and internal forces. The idea of discrete elements originated in molecular dynamics, which treats a medium as a series of discrete, independently moving particles. The first discrete element particle flow program was developed by Cundall [1,2] and Strack [3].
PFC (Particle Flow Code) is an advanced general computational analysis program developed and commercialized using the discrete-element particle flow method as the basic theoretical background. It is especially suitable for the description of micromechanics and the analysis of mechanical deformation of bulk or cementitious materials. It was developed by the company Itasca, Cundall being one of the founders. The software is widely used in the geotechnical engineering industry and has a great influence.
PFC has been successfully used by many academic institutions and private companies around the world for geoscience investigations, including slope stability analysis [4,5,6], rockfall hazard mitigation [7], cave mining [8,9,10], hydraulic fracturing [11,12,13], wave propagation in solids [14], brittle rock fracturing [15,16], etc. PFC has also been extensively used for material process engineering problems such as bulk material flow mixing [17] and bulk material conveying [18], etc.
The software has an example of simulating Darcy flow, which can be seen in Section 3.2. In this example, when the particles are densely packed, the program is not accurate enough to calculate the porosity, resulting in singularities in solving the equation and the inability to calculate the result.
However, the calculation results may still lead to a situation where the porosity is zero or even negative.
The following are some commonly used porosity calculation methods. 1. Analytical method: the analytical method is to establish a coordinate system and use the analytical expression of the function of the geometry to solve it. The disadvantage is that it is difficult to calculate when encountering complex geometry. 2. PCM (particle centroid method) [19]: this method causes errors that may reach 50% when the particle center is close to the edge of the CFD grid. 3. DPVM (divided particle volume) [20]: this method is used to solve the problem of large errors caused by PCM, but its numerical results are unstable. 4. SKM (statistical kernel method) [21]: the volume fraction of a certain point in its calculation domain is obtained by superposing the volume weights of different particles at that point. 5. Monte Carlo method [22]: its calculation cost is high and the results are unstable.
There are two ways to calculate porosity in the PFC software (PFC 7.0 and previous versions), which are centroid and polyhedron.
In centroid mode (this approach is based on PCM), if a particle’s centroid is contained in a mesh, the particle is considered to be entirely present within that fluid element. This approach results in a jump in porosity between adjacent meshes as particles move around the edge of the mesh, resulting in distortion.
In polyhedron mode (this approach is based on DPVM), the particles are wrapped using a cube, and the volume of the cube is used as the volume of the particles. The mesh porosity is then calculated. The particle volume calculation is significantly overweight, resulting in a low porosity.
These two methods produce significant error in calculating the porosity results, and it is easy to make some mesh porosity zero. When the balls are densely packed, a large part of the calculated mesh is calculated to have a porosity of zero. In addition, the zero-porosity fluid unit can lead to singularities in the governing equations of the fluid, resulting in the problem of overflow of computational data.
The volume of the balls in the mesh can be calculated directly using the 4 / 3 π r 3 analytical formula, but the complication of the problem lies in the calculation of the balls at the edge of the grid. The mesh boundaries will cut the balls apart and belong to different meshes, as shown in Figure 1 and Figure 2.
In both cases, the volume of the ball in the mesh can be easily calculated analytically. However, the complexity [23] of the model is that it assumes that the spheres can overlap to simulate a more realistic physical model. The “overlap” means several spheres partially overlap to form a new geometry.
The addition of the assumption of ball overlap makes it difficult to analytically calculate the volume of the balls in each mesh. For example, in the case of 2D, multiple balls overlapping with squares are shown in Figure 3.
In this case alone, it is difficult to calculate and divide the overlapping parts of the colors. Considering three dimensions, with more sphere overlap and mesh surface segmentation, the porosity calculation becomes more complex. Therefore, the method of function analysis is difficult to calculate for the time being.
In response to the above issues, applying the theory of computer graphics, this paper proposes a new and more efficient porosity calculation algorithm, which calculates a more accurate and reasonable porosity field, making the iterative solution of the equation more stable.

2. Methodology

The method proposed in this paper is to further divide the large mesh (which is CFD mesh) into smaller grids and calculate which small grids overlap with the small mesh. The next step is to see which large grid the small mesh belongs to, calculate how many volumes the small mesh occupies in the large grid, and then calculate the porosity of the large grid. The overlap between the balls can also be solved in this case. This paper proposes two methods to calculate the porosity, which are the traversal of the small-sphere algorithm and the traversal of the small-grid algorithm. We analyze the complexity of its time and space, and select the algorithm dynamically, to further improve the flexibility of the algorithm. It is worth mentioning that this method works well whether the CFD mesh is larger or smaller than the particle. The accuracy of the algorithm only requires that the artificially divided small grid (not the CFD mesh) used to calculate the porosity is sufficiently small.

2.1. Traversal Sphere Algorithm

Knowing the coordinates and radius of the sphere, it is necessary to calculate the coordinates of the boundary points of the sphere grid (the sphere is in Cartesian grid). First, the case of a two-dimensional circle is analyzed, and then we move on to a three-dimensional scenario.
In the two-dimensional case, the coordinates of the circle are located at the origin point, and to calculate the boundary coordinates of the circle, we use the analytic formula of the circle:
x 2 + y 2 = r 2
Along the x-axis, the boundary points of the circle are calculated from xr to x + r.
y = y c ± r 2 ( x c x ) 2
Although this method calculates the circle, the amount of calculation is very large at each step and, secondly, the boundary coordinates of the drawn circle are not continuous, as shown in Figure 4.
The midpoint circle algorithm [24] can be used to calculate the boundaries of the circle, which not only improves the computational efficiency (does not need to calculate the square term) but also makes the boundary of the circle continuous, which leads to greater accuracy.
First, define a function:
f   ( x , y ) = x 2 + y 2 r 2
Apparently:
f ( x , y ) < 0 , ( x , y )           i n   t h e   c i r c l e = 0 , ( x , y )           o n   t h e   b o r d e r   o f   c i r c l e > 0 ,   ( x , y )           o u t s i d e   t h e   c i r c l e s   b o u n d a r i e s
Assuming a known boundary point of a circle at ( x k , y k ), the next step is to determine whether the next point is closer to the boundary of the circle at ( x k + 1 , y k ) or ( x k + 1 , y k 1 ). Then it can be seen that the decision parameters are obtained in the middle of these two points of the circular function equation:
p k = f x k + 1 , y k 1 2
p k = ( x k + 1 ) 2 + y k 1 2 2 r 2
The basic idea in this approach is to test the halfway position between two pixels to determine whether this midpoint is inside or outside the circle boundary. The midpoint is shown in Figure 5.
If p k < 0, then this midpoint is within the circle, and the boundaries of the circle are closer to ( x k + 1 , y k ); on the contrary, it is closer to ( x k + 1 , y k 1 ).
p k + 1 = f x k + 1 + 1 , y k + 1 1 2
p k + 1 = [ ( x k + 1 ) + 1 ] 2 + y k + 1 1 2 2 r 2
p k + 1 = p k + 2 ( x k + 1 ) + y k + 1 2 y k 2 ( y k + 1 y k ) + 1
y k + 1 = y k or y k + 1 = y k 1 , depending on the p k .
When y k + 1 = y k :
p k + 1 = p k + 2 x k + 3
When y k + 1 = y k 1 :
p k + 1 = p k + 2 x k 2 y k + 5
The starting point of the decision function is:
( x 0 , y 0 ) = ( 0 , r )
Then:
p 0 = f ( 1 , r 1 2 )
p 0 = 1 + r 1 2 2 r 2
p 0 = 5 4 r
Based on the symmetry of the circle, one point is calculated, and seven other points can be determined. For example, if the circle (x, y) is determined, it can be determined that (−x, y), (−x, −y), (x, −y), (y, x), (−y, x), (−y, −x), (y, −x) are also the boundaries of the circle. As shown in Figure 6.
The midpoint circle algorithm is only an algorithm for calculating the boundaries of circles; this paper extends it to the calculation of solid circles. Each time a point (x, y) is calculated, it is immediately determined that all points between (−x, y) and (x, y) are within the circle. In this way, every time a point is taken at the boundary of the circle, it can be calculated that everything on a line is inside the circle. With all the points on the boundary taken, all calculated lines are combined into a circle, and the lines are guaranteed to be continuously adjacent to each other.
Furthermore, this paper extends the algorithm to the calculation of all the points inside the sphere in 3D.
It can be supposed there is a sphere in 3D space with the center of the circle at the origin. Then add the coordinates of the calculated grid x, y, and z respectively to calculate the actual value of coordinates, and it is easy to calculate the coordinate position of the overlapping small grid for all balls of the same radius.
The algorithm is divided into two loops, and the inner and outer loops each apply a midpoint circle algorithm.
In the outer loop, on the circle where the sphere intersects the xz plane, the midpoint circle algorithm is applied to find a point ( x k , y k , z k ), and obviously the other seven points of symmetry can be found at this point. In fact, only two points of x > 0 and y > 0 are used here, ( x k , y k , z k ) and ( z k , y k x k ).
In the inner loop, for each of the above two points, change the symbol to ( x j , y j , z j ) in the point parallel to the xy plane. Application of the point circle algorithm can calculate eight points, ( x j , y j , z j ) and ( x j , y j , z j ), ( x j , − y j , z j ) and ( x j , y j , z j ), ( y j , x j , z j ) and ( y j , x j , z j ), and ( y j , − x j , z j ) and ( y j , − x j , z j ), such that all points are calculated as points in the sphere. Then apply z = −z on the z-axis of the above eight points, and then connect them in pairs. This calculates a total of eight lines, which are located on two discs, as shown in Figure 7.
Two points were selected for the outer loop, so that the algorithm that calculates an inner and outer loop can calculate 16 lines, located on 4 planes, as shown in Figure 8.
The pseudocode of the algorithm proposed in this section can be written as shown in Algorithm 1.
Algorithm 1: Traversal sphere algorithm.
1:#cells is the matrix of the mesh
2:def line(x,y,z,cells,ball):
3:      for i in range(x):
4:              cells[i+ball.x][y+ball.y][z+ball.z]=True
5:              cells[−i+ball.x][y+ball.y][z+ball.z]=True
6:def disk(ball,celss,r,z):
7:# x is the x-coordinate of the axis in this loop
8:      x=0
9:      yr=r
10:# Calculate the initial value of the decision parameter, P is decision parameter
11:      p = 5/4
12:# Inner loop
13:      while(yr>=x):
14:#Northern Hemisphere
15:              line(x,yr,z,cells,ball)
16:              line(yr,x,z,cells,ball)
17:              line(x,−yr,z,cells,ball)
18:              line(yr,−x,z,cells,ball)
19:#Southern Hemisphere
20:              line(x,yr,−z,cells,ball)
21:              line(yr,x,−z,cells,ball)
22:              line(x,−yr,−z,cells,ball)
23:              line(yr,−x,−z,cells,ball)
24:              if(p<0):
25:                    p = p+2*x+3
26:              else:
27:                    p=p+2*(x−yr)+5
28:                    yr−=1
29:              x+=1
30:def circle(ball,cells):
31:# Execute the midpoint circle algorithm first, get, x and z
32:#r is radius of ball
33:      r=ball.r
34:# z is the z-coordinate of the axis in this loop
35:      z=0
36:      yr=r
37:# Calculate the initial value of the decision parameter, P is decision parameter
38:      P = 5/4
39:# Outer loop
40:      while(yr>=x):
41:# Execute the disc algorithm twice with x and z
42:              disk(ball,cells,z,yr)
43:              disk(ball,cells,yr,z)
44:              if(p<0):
45:                    p = p +2*z+3
46:              else:
47:                    p = p +2*(z−yr)+5
48:                    yr-=1
49:              z+=1
50:def main()::
51:# i is the one of the ball
52:      for i in balls:
53:              circle(i,cells)
Algorithm Complexity Analysis:
K is the number of small grids, and the value needs to be set to True to indicate that they are occupied by the overlapping spheres. N r is the number of balls with radius r, and each type of ball generates a small grid of 4/3π r 3 , and the set of sphere radius is A:
Time Complexity: O( r A   4 / 3 π r 3 )
Space Complexity: O(K)

2.2. Traversal of Small-Grid Algorithm

Traverse through each small grid ( x i , y i , z i ) and then calculate whether there is a center of a sphere within the distance from each small grid to R (R is the largest radius of all spheres), and if so, the small grid is set to True, that is the small grid overlaps with the sphere. Finally, by counting how many small grids with True values exist in each large grid, the porosity of each large grid can be calculated.
The distance between the small grid and all the balls cannot be calculated, which creates inefficiency. Thus, in order to improve the efficiency of finding the balls, the distance between the small grid and the ball coordinates ( x j , y j , z j ) satisfying x i R < x j <   x i   + R, y i R <   y j   <   y i   + R, z i R <   z j   <   z i   + R should be calculated. In order to find the balls that meet such conditions more quickly, the number of balls, the number of small grids, and the search range R should be considered.
Suppose that the number of small grids is K and the maximum sphere radius is r.
When traversing a small mesh, the sphere is directly found within the cube with an edge of 2R, so its time complexity is O(8K r 3 ).
So the pseudocode can be written as shown in Algorithm 2.
Algorithm 2: Traversal of small-grid algorithm.
1:# Calculate the distance between two points
2:def distance(i,j,k,x,y,z,r):
3:      return (i−x)*(i−x)+(j−y)(j−y)+(k−z)(k−z)−r*r
4:# i+r
5:# Inner loop
6:def small_cube(i,j,k,cells,cells_ball):
7:      for x,y,z,r in range(i−r, i+r, j−r, j+r, k−r, k+r):
8:# The decision function is called only if the center of the circle is inside the small cube
9:              if(cells_ball[x][y][z]==True):
10:#Call the distance function
11:              display=distance(i,j,k,x,y,z,r)
12:# If the ball is with
13:              if(d<0):
14:                    cells[i][j][k]=True
15:                    return
16:def main():
17:# Traverse the grid in the R range
18:# Mark with the coordinates of the center of the sphere
19:      for ball in balls:
20:              cells_ball[ball.x][ball.y][ball.z]=True
21:#Outer loop, which traverses small grids
22:for i,j,k in range(cells):
23:              small_cube(i,j,k,cells,cells_ball)
Algorithm Complexity Analysis:
Time Complexity: O( 8 K r 3 ).
Space Complexity: O(2K).

2.3. Algorithm Flowchart

The former is to traverse the small grids occupied by all the small meshes, and the latter is to traverse all the small meshes. Considering time complexity, which algorithm is more efficient depends on the degree of overlap between the balls and the number of balls. If the degree of overlap between ball and ball is high, the former algorithm calculates many duplicate points, resulting in a decrease in efficiency, and conversely, if the degree of overlap is low, its efficiency is higher. The discriminant is r A   4 / 3 π r 3 > 8 K r 3 . The algorithm flowchart is shown in Figure 9.

3. Results and Discussion

3.1. Verification of the Sphere Algorithm

Feasibility verification of the sphere algorithm in Section 2.1: Assuming that the volume of the small mesh is 1, the number of grids is the volume of the sphere. Thus, the radius of the small ball depends on the degree of grid subdivision. The smaller the mesh is, the larger the ball radius is. The feasibility of calculating the volume of the sphere is verified by comparing the formula 4 / 3 π r 3 of the sphere volume, as shown in Table 1.
It can be seen that with the increase of the radius, the error has a decreasing trend, indicating that the algorithm is feasible. The division of the small grid should be small enough so that the radius of the small ball is greater than 9.

3.2. Simulation Results

The physical model of Darcy’s flow is modeled as a 10 cm × 10 cm × 20 cm box in the porous medium in the PFC software (PFC 5.0). The grids (or the cells) are cube grids, assuming that the control volume is much larger than the volume of the ball and that the balls can partially overlap each other, with a density of 2600 k g / m 3 and a water flow velocity of 1 × 10 5 m / s , as shown in Figure 10.
The box is divided into a 10 × 10 × 20 grid, as shown in the Figure 11.
According to Darcy’s law [25] for porous media with low Reynolds numbers:
ν s = K μ p
The superficial velocity and the fluid velocity have this relationship:
ν s = ϵ ν
Substitute Formula (10) into Formula (11):
ν = K μ ϵ p
where ν s is the superficial velocity and ν is the fluid velocity in m/s; K is the permeability, D; μ is the fluid viscosity, mPa·s; ϵ is the porosity; and p is the fluid pressure, mPa. The fluid is assumed to be incompressible. Considering the effect of particle motion on the fluid, the permeability is calculated by the Kozeny–Carman relation:
K ( ϵ ) = 1 180 ϵ 3 ( 1 ϵ ) 2 ( 2 r e ) 2 ϵ 0.7 K ( 0.7 ) ϵ > 0.7
where r e   is the radius of the particles, m.
The above is the calculation of the fluid, and the next calculation is the force motion of the solid particles.
u t = f m e c h + f f l u i d m + g
where u is the velocity of the solid particles, m is the mass of the particles, g is the acceleration due to gravity, f m e c h is the force between the particles, and f f l u i d is the force of the fluid on the particles.
The above formula is only a basic model, and the specific details of other formulas are not the focus of this paper. For more details, refer to the papers of Furtney [26,27] and documents of PFC.
When using the porosity calculation method of PFC, about 1/4 of the mesh porosity of the porosity calculation is close to 0, and from the perspective of Darcy’s formula, the denominator is easily able to approach 0, and the whole formula results tend to be close to infinity, resulting in variable overflow. The actual test results are the same, and the program runs for seven timesteps and then reports an error, indicating that the variable is overflowing, and then cannot be calculated.
This paper designed experiments with different radius spheres. The histogram of the porosity calculation of the original algorithm is shown in Figure 12, Figure 13, Figure 14, Figure 15, Figure 16 and Figure 17.
After using the algorithm in this paper, there are very few meshes with porosity close to zero, which is also in line with the actual situation, and there is no overflow of variables, and the program can run normally. The histogram of the calculation of the porosity of the algorithm in this paper is shown in Figure 18, Figure 19 and Figure 20.

4. Conclusions

Due to the inaccurate way in which the PFC software calculates porosity, the Darcy flow model cannot handle the low permeability and causes the program to crash. Based on the two-dimensional midpoint circle algorithm, this paper further extends to the three-dimensional case, and expands the algorithm to calculate the porosity more accurately and efficiently. Comparing the results calculated by the two calculation methods of the software, the algorithm of this paper makes it more difficult for the porosity to be zero, which is more in line with the actual situation, so that the Darcy seepage model can be run, and avoids the problem of the software algorithm leading to the overflow of the data, which would lead to the crash of the program.
This algorithm is not only used to calculate porosity, but can also be widely used in other computing fields. For example, there is a popular game called “Minecraft”. The scene of this game is made of cubic blocks. A programmer who wants to generate an approximate solid sphere in this game scene needs to find blocks that overlap with the sphere. The algorithm in this article can be used to find these blocks.
The algorithm is currently only a single thread but can be further extended to multi-core parallel computing and GPU parallel computing in the future. The development of its parallel algorithm has great computational efficiency. On the other hand, in the traversal branch of the small-grid algorithm, the search for the small sphere can also be accelerated by indexing. This is the work that needs to be done in the future.

Author Contributions

Conceptualization, S.Z.; Methodology, S.Z.; Software, S.Z.; Writing—original draft, S.Z.; Writing—review & editing, X.X.; Project administration, G.Y.; Funding acquisition, Y.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China, grant number 52104020, and the 14th Five-Year Plan Major Science and Technology Project of CNOOC, project number KJGG2021-0506.

Data Availability Statement

Conflicts of Interest

The funding sponsors had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, and in the decision to publish the results. The author Yongzheng Cui is employed by CNOOC.

References

  1. Cundall, P.A. A computer model for simulating progressive, large-scale movement in blocky rock system. Proc. Int. Symp. Rock Mech. 1971, 8, 129–136. [Google Scholar]
  2. Potyondy, D.O.; Cundall, P.A. A bonded-particle model for rock. Int. J. Rock Mech. Min. Sci. 2004, 41, 1329–1364. [Google Scholar] [CrossRef]
  3. Cundall, P.A.; Strack, O.D. A discrete numerical model for granular assemblies. Geotechnique 1979, 29, 47–65. [Google Scholar] [CrossRef]
  4. Wang, C.; Tannant, D.D.; Lilly, P.A. Numerical analysis of the stability of heavily jointed rock slopes using PFC2D. Int. J. Rock Mech. Min. Sci. 2003, 40, 415–424. [Google Scholar] [CrossRef]
  5. Gao, W.; Yang, H.; Hu, R. Soil–rock mixture slope stability analysis by microtremor survey and discrete element method. Bull. Eng. Geol. Environ. 2022, 81, 121. [Google Scholar] [CrossRef]
  6. Zhang, W.; Wang, J.; Xu, P.; Lou, J.; Shan, B.; Wang, F.; Cao, C.; Chen, X.; Que, J. Stability evaluation and potential failure process of rock slopes characterized by non-persistent fractures. Nat. Hazards Earth Syst. Sci. 2020, 20, 2921–2935. [Google Scholar] [CrossRef]
  7. Fattahi, H.; Sadeghi, M.; Ghaedi, H. Analysis of Rock Fall Phenomenon in Steep Wall Using Modeling by Rocfall Mass-Lump Method and PFC 3D Discrete Element Method-Case Study. Ferdowsi Civ. Eng. 2021, 34, 95–115. [Google Scholar]
  8. Rafiee, R.; Ataei, M.; KhalooKakaie, R.; Jalali, S.E.; Sereshki, F.; Noroozi, M. Numerical modeling of influence parameters in cavabililty of rock mass in block caving mines. Int. J. Rock Mech. Min. Sci. 2018, 105, 22–27. [Google Scholar] [CrossRef]
  9. Svartsjaern, M. A prognosis methodology for underground infrastructure damage in sublevel cave mining. Rock Mech. Rock Eng. 2019, 52, 247–263. [Google Scholar] [CrossRef]
  10. Sjöberg, J. Solving rock mechanics issues through modelling: Then, now, and in the future? In Underground Mining Technology 2020: Proceedings of the Second International Conference on Underground Mining Technology, 3–4 November 2020; Wesseloo, J., Ed.; Australian Centre for Geomechanics: Perth, Australia, 2020. [Google Scholar]
  11. Wang, K.; Zhang, G.; Wang, Y.; Zhang, X.; Li, K.; Guo, W.; Du, F. A numerical investigation of hydraulic fracturing on coal seam permeability based on PFC-COMSOL coupling method. Int. J. Coal Sci. Technol. 2022, 9, 10. [Google Scholar] [CrossRef]
  12. Wang, T.; Zhou, W.; Chen, J.; Xiao, X.; Li, Y.; Zhao, X. Simulation of hydraulic fracturing using particle flow method and application in a coal mine. Int. J. Coal Geol. 2014, 121, 1–13. [Google Scholar] [CrossRef]
  13. Zhou, J.; Zhang, L.; Pan, Z.; Han, Z. Numerical investigation of fluid-driven near-borehole fracture propagation in laminated reservoir rock using PFC2D. J. Nat. Gas Sci. Eng. 2016, 36, 719–733. [Google Scholar] [CrossRef]
  14. Wang, G.; Al-Ostaz, A.; Cheng, A.D.; Mantena, P.R. Hybrid lattice particle modeling of wave propagation induced fracture of solids. Comput. Methods Appl. Mech. Eng. 2009, 199, 197–209. [Google Scholar] [CrossRef]
  15. Jia, L.; Chen, M.; Zhang, W.; Xu, T.; Zhou, Y.; Hou, B.; Jin, Y. Experimental study and numerical modeling of brittle fracture of carbonate rock under uniaxial compression. Mech. Res. Commun. 2013, 50, 58–62. [Google Scholar] [CrossRef]
  16. Li, X.; Wang, S.; Ge, S.; Reza, M.; Li, Z. Investigation on the influence mechanism of rock brittleness on rock fragmentation and cutting performance by discrete element method. Measurement 2018, 113, 120–130. [Google Scholar]
  17. Ferellec, J.F.; Mochizuki, C.; Hirata, A. DEM simulation of bulk material flow in a feeding system of blast furnace. In Numerical Modeling in Micromechanics via Particle Methods-2004, Proceedings of the 2nd International PFC Symposium, Kyoto, Japan, 28–29 October 2004; CRC Press: Boca Raton, FL, USA, 2004. [Google Scholar]
  18. Shimizu, Y.; Cundall, P.A. Three-dimensional DEM simulations of bulk handling by screw conveyors. J. Eng. Mech. 2001, 127, 864–872. [Google Scholar] [CrossRef]
  19. Peng, Z.; Doroodchi, E.; Luo, C.; Moghtaderi, B. Influence of void fraction calculation on fidelity of CFD-DEM simulation of gas-solid bubbling fluidized beds. AIChE J. 2014, 60, 2000–2018. [Google Scholar] [CrossRef]
  20. Xiao, H.; Sun, J. Algorithms in a robust hybrid CFD-DEM solver for particle-laden flows. Commun. Comput. Phys. 2011, 9, 297–323. [Google Scholar] [CrossRef]
  21. Babic, M. Average balance equations for granular materials. Int. J. Eng. Sci. 1997, 35, 523–548. [Google Scholar] [CrossRef]
  22. Rubinstein, R.Y.; Kroese, D.P. Simulation and the Monte Carlo Method; John Wiley & Sons: Hoboken, NJ, USA, 2016. [Google Scholar]
  23. Cormen, T.H.; Leiserson, C.E.; Rivest, R.L.; Stein, C. Introduction to Algorithms; MIT Press: Cambridge, MA, USA, 2022. [Google Scholar]
  24. Donald, H. Computer Graphics with OpenGL; Pearson Education: Chennai, India, 2004. [Google Scholar]
  25. Happel, J.; Brenner, H. Low Reynolds Number Hydrodynamics: With Special Applications to Particulate Media; Springer Science & Business Media: Singapore, 2012; Volume 1. [Google Scholar]
  26. Furtney, J.; Zhang, F.; Han, Y. Review of methods and applications for incorporating fluid flow in the discrete element method. In Proceedings of the 3rd International FLAC/DEM Symposium, Hangzhou, China, 22–24 October 2013. [Google Scholar]
  27. Guyer, J.E.; Wheeler, D.; Warren, J.A. FiPy: Partial differential equations with Python. Comput. Sci. Eng. 2009, 11, 6–15. [Google Scholar] [CrossRef]
Figure 1. The ball overlaps with the edge of the square.
Figure 1. The ball overlaps with the edge of the square.
Processes 12 01410 g001
Figure 2. The ball overlaps the vertices of the square.
Figure 2. The ball overlaps the vertices of the square.
Processes 12 01410 g002
Figure 3. Multiple balls overlapping with squares.
Figure 3. Multiple balls overlapping with squares.
Processes 12 01410 g003
Figure 4. The boundaries of the circle are discontinuous [24].
Figure 4. The boundaries of the circle are discontinuous [24].
Processes 12 01410 g004
Figure 5. Schematic diagram of the value of the midpoint [24].
Figure 5. Schematic diagram of the value of the midpoint [24].
Processes 12 01410 g005
Figure 6. Schematic diagram of the symmetry point [24].
Figure 6. Schematic diagram of the symmetry point [24].
Processes 12 01410 g006
Figure 7. Schematic diagram of the second round of traversal.
Figure 7. Schematic diagram of the second round of traversal.
Processes 12 01410 g007
Figure 8. Schematic diagram of the second round of traversal.
Figure 8. Schematic diagram of the second round of traversal.
Processes 12 01410 g008
Figure 9. Schematic diagram of the algorithm flow.
Figure 9. Schematic diagram of the algorithm flow.
Processes 12 01410 g009
Figure 10. Particle distribution diagram.
Figure 10. Particle distribution diagram.
Processes 12 01410 g010
Figure 11. Grid distribution Diagram.
Figure 11. Grid distribution Diagram.
Processes 12 01410 g011
Figure 12. Histogram of porosity calculated by the original algorithm in polyhedron mode when the radius of the sphere is 1 × 10 3   m .
Figure 12. Histogram of porosity calculated by the original algorithm in polyhedron mode when the radius of the sphere is 1 × 10 3   m .
Processes 12 01410 g012
Figure 13. Histogram of porosity calculated by the original algorithm in centroid mode when the radius of the sphere is 1 × 10 3   m .
Figure 13. Histogram of porosity calculated by the original algorithm in centroid mode when the radius of the sphere is 1 × 10 3   m .
Processes 12 01410 g013
Figure 14. Histogram of porosity calculated by the original algorithm in polyhedron mode when the radius of the sphere is 2.5 × 10 3 m .
Figure 14. Histogram of porosity calculated by the original algorithm in polyhedron mode when the radius of the sphere is 2.5 × 10 3 m .
Processes 12 01410 g014
Figure 15. Histogram of porosity calculated by the original algorithm in centroid mode when the radius of the sphere is 2.5 × 10 3   m .
Figure 15. Histogram of porosity calculated by the original algorithm in centroid mode when the radius of the sphere is 2.5 × 10 3   m .
Processes 12 01410 g015
Figure 16. Histogram of porosity calculated by the original algorithm in polyhedron mode when the radius of the sphere is 5 × 10 3   m .
Figure 16. Histogram of porosity calculated by the original algorithm in polyhedron mode when the radius of the sphere is 5 × 10 3   m .
Processes 12 01410 g016
Figure 17. Histogram of porosity calculated by the original algorithm in centroid mode when the radius of the sphere is 5 × 10 3   m .
Figure 17. Histogram of porosity calculated by the original algorithm in centroid mode when the radius of the sphere is 5 × 10 3   m .
Processes 12 01410 g017
Figure 18. Histogram of the calculation of the porosity of the algorithm in this paper when the radius of the sphere is 1 × 10 3   m .
Figure 18. Histogram of the calculation of the porosity of the algorithm in this paper when the radius of the sphere is 1 × 10 3   m .
Processes 12 01410 g018
Figure 19. Histogram of the calculation of the porosity of the algorithm in this paper when the radius of the sphere is 2.5 × 10 3   m .
Figure 19. Histogram of the calculation of the porosity of the algorithm in this paper when the radius of the sphere is 2.5 × 10 3   m .
Processes 12 01410 g019
Figure 20. Histogram of the calculation of the porosity of the algorithm in this paper when the radius of the sphere is 5 × 10 3   m .
Figure 20. Histogram of the calculation of the porosity of the algorithm in this paper when the radius of the sphere is 5 × 10 3   m .
Processes 12 01410 g020
Table 1. Table of errors between the volume calculated using the method of this paper and the true volume.
Table 1. Table of errors between the volume calculated using the method of this paper and the true volume.
Theoretical ValueCalculated in This PaperErrorRadius
4.2176.1%1
33.535−4.4%2
113.19317.8%3
268.122316.8%4
523.6529−1.0%5
904.88199.5%6
1436.814052.2%7
2144.719877.4%8
3053.628456.8%9
4188.841750.3%10
5575.354252.7%11
7238.271111.8%12
9202.889852.4%13
11,494.011,2672.0%14
14,137.213,7932.4%15
17,157.316,5953.3%16
20,579.520,1652.0%17
24,429.024,1151.3%18
28,730.928,4610.9%19
33,510.332,9431.7%20
38,792.437,9692.1%21
44,602.243,8231.7%22
50,965.050,5370.8%23
57,905.857,1151.4%24
65,449.864,0252.2%25
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, S.; Xin, X.; Cui, Y.; Yu, G. An Improved Porosity Calculation Algorithm for Particle Flow Code. Processes 2024, 12, 1410. https://doi.org/10.3390/pr12071410

AMA Style

Zhang S, Xin X, Cui Y, Yu G. An Improved Porosity Calculation Algorithm for Particle Flow Code. Processes. 2024; 12(7):1410. https://doi.org/10.3390/pr12071410

Chicago/Turabian Style

Zhang, Siyu, Xiankang Xin, Yongzheng Cui, and Gaoming Yu. 2024. "An Improved Porosity Calculation Algorithm for Particle Flow Code" Processes 12, no. 7: 1410. https://doi.org/10.3390/pr12071410

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop