Particle filling method for complex geometric model
By entering geometric files in the simulation simulation software, filling particles, and performing effectiveness judgment and body-mounted operations, the problems of slow particle filling speed, non-body-mounted and inaccurate particle filling speed in the existing technology are solved, and efficient and accurate complex shapes are achieved Particle Swarm Construction.
Patent Information
- Application Number
- CN202411398260.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-02-11
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN119416601A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of numerical simulation industrial software, and in particular to a particle filling method for a complex geometric model. Background Art
[0002] As an important part of industrial software, simulation software is a powerful tool for optimizing design solutions and improving engineering efficiency. For example, simulation software can simulate various scenarios such as landslides and coal seam excavation, and plays an important supporting role in the safe construction of infrastructure and the efficient mining of energy resources. At present, the main implementation methods of simulation software are grid method and particle method. Among them, the particle method is an important supplement to the grid method, especially suitable for complex problems such as non-continuous and large deformation.
[0003] The filling speed of particles is related to the computational efficiency of simulation. At the same time, the spatial distribution of particles has a great influence on the computational accuracy and stability of simulation. The ideal particle distribution is uniform and can accurately describe the geometric and physical information. At present, there are mainly the following methods for filling particles:
[0004] (1) Lattice method. Theoretically, the particles filled by the lattice method have the best uniformity, but it requires a lot of calculations to determine the topological relationship between each particle and the geometric configuration. In addition, the deviation between the filled particles and the geometric configuration is large. There is currently no efficient and unified body-fitting method, which loses a certain degree of accuracy.
[0005] (2) Grid method: Particles can be quickly filled on the basis of an existing grid, but filling a uniform and accurate grid often requires a long time of iterative analysis of topological information, and it is difficult to obtain a high-quality grid for complex geometry.
[0006] (3) Physical combination method. The particle filling method combined with physics can be more suitable for certain physical problems, and the filled particles are more uniform and close to the body, but the calculation of its physical process requires too much computing resources.
[0007] In summary, the existing particle filling methods of simulation software have problems such as slow speed, non-fitting, and inaccuracy. Summary of the invention
[0008] In response to the technical problems existing in the above-mentioned background technology, the present invention proposes a particle filling method for complex geometric models that can quickly construct qualified particle groups of millions to tens of millions of levels, and supports particle attachment and liquid filling, so that the arrangement of particles in space is more uniform, more accurate, and more realistic.
[0009] In order to solve the above technical problems, the present invention provides a particle filling method for a complex geometric model, which first inputs a geometric file, parses the geometric model from the geometric file, then fills the geometric model with particles, then judges the validity of the particles and retains the valid particles, then performs a body-fitting operation on the retained valid particles, and finally outputs a particle file in a specified format.
[0010] The particle filling method of the complex geometric model, wherein the specific process of the particle filling method is:
[0011] (1) Input one or more geometry files in a specified format;
[0012] (2) Searching for the boundary of the geometric model according to the coordinates of the geometric points in the geometric file of the specified format, and determining the position of the maximum coordinate point and the minimum coordinate point of the model;
[0013] (3) Expand the boundary of the geometric model outward by a specified distance to form a filling boundary of the particle;
[0014] (4) filling the extended area with orthogonal particles according to the specified particle radius;
[0015] (5) Judge the validity of orthogonal particles, determine the validity of particles, retain valid particles, and delete invalid particles;
[0016] (6) The particle filling calculation program outputs a particle file in a specified format.
[0017] The particle filling method for complex geometric models, wherein: the geometric file input in the step (1) includes supporting 3D geometric input filling particles with complex surfaces and thin-walled structures, and supporting multi-component geometric input filling particles.
[0018] The particle filling method for the complex geometric model, wherein: the particle filling boundary in the step (3) defaults to the geometric model boundary extending outward in each direction by five times the particle radius.
[0019] The particle filling method for the complex geometric model, wherein: the filling of orthogonal particles in the step (4) is not performed through grid division, and particles are directly filled from the geometric file; and the filled particles are spherical particles of specified particle diameter and uniform size.
[0020] The particle filling method of the complex geometric model, wherein: the step (4) is to use a liquid particle filling method to fill orthogonal particles in the extended area; the liquid particle filling method supports filling orthogonal liquid particles in the cavity area surrounded by the geometric model according to filling parameters;
[0021] The specific process of the liquid particle filling method is: first select a geometric body, input the filling height, filling volume and filling direction; search for air particles inside the geometric body; calculate the distance from the particles to the liquid surface according to the liquid filling direction; if filling is based on height, the particle with the maximum distance is used as the filling starting point, and the specified height is filled upward; if filling is based on volume, the particle with the maximum distance is used as the calculation point, and fills one by one according to the liquid level distance until all particles are filled.
[0022] The particle filling method of the complex geometric model, wherein: the filling of the orthogonal particles in the step (4) supports the use of a particle fitting algorithm to perform a fitting operation after filling; the process of the particle fitting algorithm is: adjusting in the three directions of X, Y, and Z respectively, and only adjusting the coordinates of each direction in this direction; when executing the particle fitting process, the radius of the particle is set to r, and the initial coordinates are (xi, yi, zi); first search for the triangle closest to the particle, then calculate the distance components dx, dy, and dz from the particle to the triangle, and then adjust the coordinates of each particle in the X direction, Y direction, and Z direction respectively:
[0023] xi(new)=xi+(dx-r);
[0024] yi(new)=yi+(dy-r);
[0025] zi(new)=zi+(dx-r);
[0026] After the above adjustments, the particle-body-fitting process can be realized.
[0027] The particle filling method for the complex geometric model, wherein: the geometry file of the specified format in the step (1) includes the patch-type geometry file of the standard format of stl, obj, gi d and vtk; the particle file of the specified format in the step (6) includes the particle file of the standard format of gid, vtk and genvi.
[0028] The particle filling method of the complex geometric model, wherein: the validity of the particles is determined in step (5) by using a point-by-point determination method, a single-ray method, and a three-ray method to determine the validity of the particles;
[0029] The process of particle validity judgment by the point-by-point judgment method is as follows: each particle is judged by the ray method, and whether the particle is in the body is determined according to the number of intersections with the geometric boundary surface; if the number of intersections between the ray and the boundary surface is an odd number, the particle is in the body; if the number of intersections between the ray and the boundary surface is an even number, the particle is outside the body;
[0030] The process of judging the validity of particles by the single ray method is as follows: first, a certain coordinate axis direction is taken as the ray direction, a particle with the minimum coordinate value in the direction is selected, and a ray is emitted in the positive direction; then, the number of intersections between each ray and the boundary surface of the geometric body and the coordinates of the intersections in the direction are calculated, and the intersections are sorted according to the coordinates; then, the validity of the particles is determined according to the particle coordinates, the intersection coordinates and the intersection sequence number; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid when the particle coordinates are between the 2n-1th intersection and the 2nth intersection;
[0031] The process of judging the validity of particles by the three-ray method is as follows: first, the X-axis direction is taken as the ray direction, a particle with the minimum coordinate value in this direction is selected, and a ray is emitted in the positive direction; then the number of intersections between each ray and the boundary surface of the geometric body and the coordinates of the intersections in this direction are calculated, and the intersections are sorted according to the coordinates; then the validity of the particles is determined according to the particle coordinates, the intersection coordinates and the intersection sequence number; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid in the X direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid when the particle coordinates are between the 2n-1th intersection. The particle is valid in the X direction when it is between the 2nth intersection and the 2nth intersection. Then, the Y-axis direction is taken as the ray direction, the particle with the minimum coordinate in this direction is selected, and the ray is emitted in the positive direction. Then, the number of intersections of each ray and the boundary surface of the geometric body and the coordinates of the intersections in this direction are calculated, and the intersections are sorted according to the coordinates. Then, the validity of the particle is determined according to the particle coordinates, intersection coordinates and intersection sequence number. If the number of intersections is 0, all particles in the ray direction are invalid. If the number of intersections is an even number, the particle is valid in the Y direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection. If the number of intersections is an odd number, the particle is valid in the Y direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection. When the particle is between the n-1th intersection and the 2nth intersection, the particle is valid in the Y direction; finally, the Z-axis direction is taken as the ray direction, the particle with the minimum coordinate in this direction is selected, and the ray is emitted in the positive direction; then the number of intersections of each ray and the boundary surface of the geometric body and the coordinates of the intersections in this direction are calculated, and the intersections are sorted according to the coordinates; then the validity of the particle is determined according to the particle coordinates, intersection coordinates and intersection sequence number; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid in the Z direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid in the Z direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; When the particle is between the 2n-1th intersection and the 2nth intersection, it is valid in the Z direction; if a particle is a valid particle in a certain ray direction of X, Y, or Z, the validity value of the particle is accumulated by 1, and when the particle validity value reaches the set upper limit, the particle is determined to be valid; if the upper limit is 1, as long as the particle is a valid particle in any one of the three directions of X, Y, and Z, the particle is valid; when the upper limit is 2, if a particle is a valid particle in any two ray directions of X, Y, and Z, the particle is valid; if the upper limit is 3, the particle is required to be a valid particle in all three directions of X, Y, and Z.
[0032] The particle filling method of the complex geometric model, wherein: the point-by-point determination method, the single ray method and the three-ray method all involve the intersection determination of a ray starting from a certain point and a triangular face, and the determination process is: suppose the coordinates of a certain point P are (p1, q1, r1), the coordinates of the three points of the triangle are (x1, y1, z1), (x2, y2, z2), (x3, y3, z3), and the normal N1 of the triangular face is expressed as (a1, b1, c1); suppose point P emits a line along a certain direction, and another point Q is taken on the ray, and its coordinates are (p2, q2, r2), then the direction vector V1 of the ray can be expressed as (a2, b2, c2), wherein a2=p2-p1, b2=q2-q1, c2=r2-r1; thereby, the intermediate parameter t can be calculated, and the specific expression is:
[0033]
[0034] Assume that the coordinates of the intersection point K of the ray and the triangle patch are (pi, qi, ri), and the calculation formula of its components is:
[0035] pi=p1+a2×t (2);
[0036] qi=q1+b2×t (3);
[0037] ri=r1+c2×t (4);
[0038] Then we calculate whether the intersection point (xi,yi,zi) is inside the triangle patch. The specific expression is:
[0039] (A 12k +A 13k +A 23k -A 123 ) / A 123 <ε (5);
[0040] In the above formula (5), A 123 is the area of the triangle; A 12k , A 13k and A 23k is the area of the triangle enclosed by the intersection point K and any two vertices of the triangle; ε is the tolerance. When the inequality expressed by equation (5) holds, the intersection point k is considered to be inside the triangle, otherwise it is outside the triangle; if one intersection point is outside the triangle, it can be determined that the ray does not intersect the triangle patch;
[0041] If the intersection point K is inside the triangle, then calculate whether the intersection point K is on the same side of the ray, calculate the direction vector V2 from the starting point P to the intersection point K, and its components are (a3, b3, c3), then a3 = pi-p1, b3 = qi-q1, c3 = ri-r3; if the dot product of V2 and V1 is greater than 0, it means that the intersection point K is on the same side of the ray, then the ray intersects with the triangle face, otherwise it does not intersect.
[0042] By adopting the above technical solution, the present invention has the following beneficial effects:
[0043] The particle filling method of the complex geometric model of the present invention can realize the efficient and accurate filling of solid particles in complex geometric bodies and liquid particles in complex cavities through the intersection relationship between rays in the three directions of X, Y, and Z and the complex geometric bodies, combined with the particle body-fitting method; compared with the lattice method and the grid method, the particle filling method of the present invention has higher filling accuracy, and compared with the physical combination method, the particle filling method of the present invention has higher efficiency; the present invention can provide qualified and high-quality particle files for simulation calculations for particle discrete element method (DEM), material point method (MPM), smooth particle hydrodynamics method (SPH), etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 A flow chart of particle filling of a complex geometric model involved in the particle filling method of a complex geometric model of the present invention;
[0046] Figure 2 This is a complex mountain geometry model particle filling test diagram involved in the complex geometry model particle filling method of embodiment 1 of the present invention; wherein, Figure 2 The middle figure (a) is a geometric model diagram of a complex mountain, and the figure (b) is a particle filling effect diagram of a complex mountain;
[0047] Figure 3 This is a test diagram of particle filling of a complex geometric model of a gear stirring oil involved in the particle filling method of a complex geometric model of Example 2 of the present invention. DETAILED DESCRIPTION
[0048] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] The present invention is further explained below in conjunction with specific implementation modes.
[0050] like Figure 1 As shown, the particle filling method for the complex geometric model provided in this embodiment is to first fill the space within the particle filling range with particles arranged orthogonally, and the liquid particles can be filled as needed by the liquid filling method; then the particle validity is judged by the three different methods provided, namely the point-by-point judgment method, the single-ray method, and the three-ray method, and the valid particles are retained; then, the retained valid particles are fitted with the particle body-fitting algorithm to make the arrangement of the particles in the space more uniform, close to the wall surface, and do not exceed the geometric boundary; finally, a particle file in a specific format is output for simulation calculation by SPH, MPM or DEM program.
[0051] The specific process of the particle filling method of the complex geometric model of the present invention is as follows:
[0052] (1) Input one or more geometry files in standard formats such as STL into the particle filling calculation program;
[0053] (2) Constructing a three-dimensional geometric model based on the coordinates of the triangular facet points in standard geometric files such as STL. The three-dimensional geometric model is constructed by a series of triangular facets and is used to characterize the boundaries of the geometric shape of the three-dimensional object and determine the maximum and minimum coordinate point positions of the model;
[0054] (3) Expand the boundary of the geometric model outward by a specified distance to form a filling boundary of the particle;
[0055] (4) filling orthogonal particles in the particle filling area according to the specified particle radius;
[0056] (5) The validity of orthogonal particles is judged by point-by-point determination method, single-ray method and three-ray method to determine the validity of particles, retain valid particles and delete invalid particles;
[0057] Among them, the aforementioned point-by-point judgment method, single-ray method and three-ray method all involve the key step of judging the intersection of a ray starting from a certain point and a triangular face. When making a specific judgment, let the coordinates of a certain point P be (p1, q1, r1), the coordinates of the three points of the triangle be (x1, y1, z1), (x2, y2, z2), (x3, y3, z3), and the normal N1 of the triangular face be expressed as (a1, b1, c1). Let point P emit a line along a certain direction, and take another point Q on the ray, whose coordinates are (p2, q2, r2). Then the direction vector V1 of the ray can be expressed as (a2, b2, c2), where a2 = p2-p1, b2 = q2-q1, c2 = r2-r1. Thus, the intermediate parameter t can be calculated, and the specific expression is:
[0058]
[0059] Assume that the coordinates of the intersection point K of the ray and the triangle patch are (pi, qi, ri), and the calculation formula of its components is:
[0060] pi=p1+a2×t;
[0061] qi=q1+b2×t;
[0062] ri=r1+c2×t;
[0063] Then we calculate whether the intersection point (xi,yi,zi) is inside the triangle patch. The specific expression is:
[0064] (A 12k +A 13k +A 23k -A 123 ) / A 123 <ε;
[0065] In the above formula, A 123 is the area of the triangle; A 12k , A 13k and A 23k is the area of the triangle enclosed by the intersection point K and any two vertices of the triangle; ε is the tolerance. When the inequality expressed by equation (5) holds, the intersection point k is considered to be inside the triangle, otherwise it is outside the triangle; if one intersection point is outside the triangle, it can be determined that the ray does not intersect the triangle patch;
[0066] If the intersection point K is inside the triangle, then calculate whether the intersection point K is on the same side of the ray, calculate the direction vector V2 from the starting point P to the intersection point K, and its components are (a3, b3, c3), then a3 = pi-p1, b3 = qi-q1, c3 = ri-r3; if the dot product of V2 and V1 is greater than 0, it means that the intersection point K is on the same side of the ray, then the ray intersects with the triangle face, otherwise it does not intersect.
[0067] (6) The particle filling calculation program outputs a particle file in a specified format
[0068] The input geometry file in the above step (1) supports 3D geometry input filling particles with complex surfaces and thin-walled structures, and supports multi-component geometry input filling particles.
[0069] The particle filling boundary in the above step (3) defaults to extending the geometric model boundary outward by five times the particle radius in each direction.
[0070] The filling of orthogonal particles in the above step (4) does not go through the step of meshing, but directly fills the particles from the geometry file; and the filled particles are spherical particles of uniform size with a specified particle size.
[0071] The above step (4) includes a liquid particle filling method, which supports filling orthogonal liquid particles in the cavity area surrounded by the geometric model according to the filling parameters. The specific process of the liquid filling method is as follows: first select a geometric body, input the filling height, filling volume and filling direction; search for air particles (invalid particles) inside the geometric body; calculate the distance from the particle to the liquid surface according to the liquid filling direction; if filling is based on height, the particle with the maximum distance is used as the filling starting point, and the specified height is filled upward; if filling is based on volume, the particle with the maximum distance is used as the calculation point, and fills one by one according to the liquid level distance until all particles are filled.
[0072] The method for determining the particle validity in the above step (5) includes a point-by-point determination method, a single-ray method, and a three-ray method.
[0073] Among them, the specific process of the point-by-point judgment method is: each particle is judged by the ray method, and whether the particle is in the body is determined according to the number of intersections with the geometric boundary surface; if the number of intersections between the ray and the boundary surface is an odd number, the particle is located in the body; if the number of intersections between the ray and the boundary surface is an even number, the particle is located outside the body.
[0074] The specific process of the single ray method is as follows: take a certain coordinate axis direction as the ray direction, select the particle with the minimum coordinate in this direction, and emit the ray in the positive direction; calculate the number of intersections of each ray and the boundary surface of the geometric body and the coordinates of the intersections in this direction, and sort the intersections according to the coordinates; determine the validity of the particles based on the particle coordinates, intersection coordinates and intersection sequence numbers; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid when the particle coordinates are between the 2n-1th intersection and the 2nth intersection.
[0075] The process of judging the effectiveness of particles by the three-ray method is as follows: first, the X-axis direction is taken as the ray direction, the particle with the minimum coordinate in this direction is selected, and the line is emitted in the positive direction; then the number of intersections between each ray and the boundary surface of the geometric body and the coordinates of the intersections in this direction are calculated, and the intersections are sorted according to the coordinates; then the particle effectiveness is determined according to the particle coordinates, intersection coordinates and intersection sequence numbers; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid in the X direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid in the X direction when the particle coordinates are between the 2n-1th intersection and the 2nth intersection; then the Y-axis direction is taken as the ray direction, the particle with the minimum coordinate in this direction is selected, and the line is emitted in the positive direction; then the number of intersections between each ray and the boundary surface of the geometric body and the coordinates of the intersections in this direction are calculated, and the intersections are sorted according to the coordinates; then the particle is determined according to the particle coordinates, intersection coordinates and intersection sequence numbers The particle validity is calculated; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid in the Y direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid in the Y direction when the particle coordinates are between the 2n-1th intersection and the 2nth intersection; finally, the Z-axis direction is taken as the ray direction, and the particle with the minimum coordinate in this direction is selected to emit a line in the positive direction; then the relationship between each ray and the edge of the geometric body is calculated. The number of intersections of the interface and the coordinates of the intersections in that direction, sort the intersections according to the coordinates; then determine the validity of the particles according to the particle coordinates, intersection coordinates and intersection sequence numbers; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid in the Z direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid in the Z direction when the particle coordinates are between the 2n-1th intersection and the 2nth intersection. If a particle is a valid particle in a certain ray direction of X, Y, or Z, the validity value of the particle is accumulated by 1, and the particle is determined to be valid when the particle validity value reaches the set upper limit; if the upper limit is 1, the particle is valid as long as it is a valid particle in any one of the three directions of X, Y, and Z; when the upper limit is 2, the particle is valid if it is a valid particle in any two ray directions of X, Y, and Z; if the upper limit is 3, the particle is required to be a valid particle in all three directions of X, Y, and Z.
[0076] The orthogonal particle filling support in the above step (4) uses the particle fitting algorithm to perform the fitting operation after filling. The specific process of the particle fitting algorithm is as follows: adjust in the three directions of X, Y, and Z respectively, and only adjust the coordinates of each direction; when executing the particle fitting process, set the radius of the particle to r and the initial coordinates to (xi, yi, zi); first search for the triangle closest to the particle, then calculate the distance components dx, dy, and dz from the particle to the triangle, and then adjust the coordinates of each particle in the X direction, Y direction, and Z direction respectively:
[0077] xi(new)=xi+(dx-r);
[0078] yi(new)=yi+(dy-r);
[0079] zi(new)=zi+(dx-r);
[0080] After the above adjustments, the particle-body-fitting process can be realized.
[0081] The present invention is further described below in conjunction with specific embodiments.
[0082] Embodiment 1:
[0083] according to Figure 1 The particle filling process of the complex mountain model was carried out using a MSI laptop computer. The CPU model of the laptop is Intel(R)Core(TM)i 7-8750H, which is a 6-core 12-thread CPU. The specific process includes:
[0084] (1.1) Input an STL file describing the mountain geometry.
[0085] (1.2) Search the boundary of the model according to the coordinates of the geometric points in the STL file, determine the position of the maximum coordinate point and the minimum coordinate point of the model, and thus determine the boundary of the model.
[0086] (1.3) Specify the radius of the filling particles so that the model boundary is extended by five times the default particle radius.
[0087] (1.4) Select the three-ray method to judge the topological relationship. First, judge with the X-axis direction as the ray direction, then judge with the Y-axis direction as the ray direction, and finally judge with the Z-axis direction as the ray direction. When judging each direction, first select the particle with the minimum coordinate value in that direction and emit a line in the positive direction; then calculate the number of intersections between each ray and the boundary surface of the geometric body and the coordinates of the intersections in that direction, and sort the intersections according to the coordinates; then determine the validity of the particles according to the particle coordinates, intersection coordinates and intersection sequence numbers; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid in the X direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid in the X direction when the particle coordinates are between the 2n-1th intersection and the 2nth intersection; set the upper limit of the particle validity to 3, and judge the particle validity. When the particle is a valid particle in the three directions of X, Y and Z, the particle is valid and retained, otherwise the particle is deleted.
[0088] (1.5) Using the particle-fitting algorithm, adjustments are made in the X, Y, and Z directions respectively, and only the coordinates in each direction are adjusted.
[0089] (1.6) Output a valid particle file in vtk format. Using this algorithm to fill the complex mountain model with particles, it takes 93 seconds to generate 32.39 million particles. The generated effect is as follows Figure 2 As shown in Figure (b), the algorithm has higher particle filling efficiency and better body fitting effect, uniformity and accuracy.
[0090] Embodiment 2:
[0091] according to Figure 1 The liquid particle filling of the gear oil stirring model is carried out by the process. The particle filling performance test is carried out using a MSI laptop computer, the CPU model of which is Intel(R)Core(TM)i 7-8750H, a 6-core 12-thread CPU. Specifically, it includes:
[0092] (2.1) Input an obj file describing the geometric configuration, select the filling height as 3.5m, and the filling direction as the negative direction of the Z axis.
[0093] (2.2) Search for air particles (invalid particles) inside the gear oil stirring model.
[0094] (2.3) According to the liquid filling direction, calculate the distance from the particle to the liquid surface.
[0095] (2.4) Fill according to the height, starting from the particle with the maximum distance and filling upwards 3.5m.
[0096] (2.5) Select the three-ray method to judge the topological relationship, set the upper limit of particle validity to 3, make a particle validity judgment, and retain valid particles.
[0097] (2.6) Perform the particle fitting algorithm and make adjustments in the X, Y, and Z directions respectively, and only adjust the coordinates in each direction.
[0098] (2.7) Output a valid particle file in gi d format. The generated effect is as follows Figure 3 As shown, the liquid filling method is used to fill the liquid particles, so that the authenticity of the filling is guaranteed.
[0099] The present invention can quickly construct qualified particle groups of millions to tens of millions of complex shapes, and supports particle attachment and liquid filling, making the arrangement of particles in space more uniform, accurate and realistic.
[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A particle filling method for a complex geometric model, characterized in that : First input the geometry file, parse the geometry model from the geometry file, then fill the geometry model with particles, then judge the validity of the particles and retain the valid particles, then perform body fitting operations on the retained valid particles, and finally output the particle file in the specified format.
2. The particle filling method for a complex geometric model according to claim 1, characterized in that: The specific process of the particle filling method is as follows: (1) Input one or more geometry files in a specified format; (2) Searching for the boundary of the geometric model according to the coordinates of the geometric points in the geometric file of the specified format, and determining the position of the maximum coordinate point and the minimum coordinate point of the model; (3) Expand the boundary of the geometric model outward by a specified distance to form a filling boundary of the particle; (4) filling the extended area with orthogonal particles according to the specified particle radius; (5) Judge the validity of orthogonal particles, determine the validity of particles, retain valid particles, and delete invalid particles; (6) The particle filling calculation program outputs a particle file in a specified format.
3. The particle filling method for a complex geometric model as claimed in claim 2, characterized in that: The geometry file input in the step (1) includes supporting 3D geometry input filling particles with complex surfaces and thin-walled structures, and supporting multi-component geometry input filling particles.
4. The particle filling method for a complex geometric model as claimed in claim 2, characterized in that: The particle filling boundary in step (3) defaults to the geometric model boundary extending outward in each direction by five times the particle radius.
5. The particle filling method for a complex geometric model as claimed in claim 2, characterized in that: The filling of orthogonal particles in the step (4) is performed without meshing, and the particles are directly filled from the geometry file; and the filled particles are spherical particles of a specified particle diameter and uniform size.
6. The particle filling method for a complex geometric model as claimed in claim 2, characterized in that: The step (4) is to use a liquid particle filling method to fill orthogonal particles in the extended area; the liquid particle filling method supports filling orthogonal liquid particles in the cavity area surrounded by the geometric model according to filling parameters; The specific process of the liquid particle filling method is: first select a geometric body, input the filling height, filling volume and filling direction; search for air particles inside the geometric body; calculate the distance from the particles to the liquid surface according to the liquid filling direction; if filling is based on height, the particle with the maximum distance is used as the filling starting point, and the specified height is filled upward; if filling is based on volume, the particle with the maximum distance is used as the calculation point, and fills one by one according to the liquid level distance until all particles are filled.
7. The particle filling method for a complex geometric model as claimed in claim 2, characterized in that: The filling of orthogonal particles in step (4) supports the use of a particle fitting algorithm to perform a fitting operation after filling; the process of the particle fitting algorithm is: adjust in the three directions of X, Y, and Z respectively, and only adjust the coordinates of each direction; when executing the particle fitting process, assume that the radius of the particle is r and the initial coordinates are (xi, yi, zi); first search for the triangle closest to the particle, then calculate the distance components dx, dy, and dz from the particle to the triangle, and then adjust the coordinates of each particle in the X direction, Y direction, and Z direction respectively: xi(new)=xi+(dx-r); yi(new)=yi+(dy-r); zi(new)=zi+(dx-r); After the above adjustments, the particle-body-fitting process can be realized.
8. The particle filling method for complex geometric models according to claim 2, characterized in that: The geometry files in the specified format in step (1) include patch-type geometry files in the standard formats of stl, obj, gid and vtk; The particle files of the specified format in step (6) include particle files of gid, vtk and genvi standard formats.
9. The particle filling method for a complex geometric model as claimed in claim 2, characterized in that: The validity of the particles in step (5) is determined by using a point-by-point determination method, a single-ray method, and a three-ray method to determine the validity of the particles; The process of particle validity judgment by the point-by-point judgment method is as follows: each particle is judged by the ray method, and whether the particle is in the body is determined according to the number of intersections with the geometric boundary surface; if the number of intersections between the ray and the boundary surface is an odd number, the particle is in the body; if the number of intersections between the ray and the boundary surface is an even number, the particle is outside the body; The process of judging the validity of particles by the single ray method is as follows: first, a certain coordinate axis direction is taken as the ray direction, a particle with the minimum coordinate value in the direction is selected, and a ray is emitted in the positive direction; then, the number of intersections between each ray and the boundary surface of the geometric body and the coordinates of the intersections in the direction are calculated, and the intersections are sorted according to the coordinates; then, the validity of the particles is determined according to the particle coordinates, the intersection coordinates and the intersection sequence number; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid when the particle coordinates are between the 2n-1th intersection and the 2nth intersection; The process of judging the validity of particles by the three-ray method is as follows: first, the X-axis direction is taken as the ray direction, a particle with the minimum coordinate value in this direction is selected, and a ray is emitted in the positive direction; then the number of intersections between each ray and the boundary surface of the geometric body and the coordinates of the intersections in this direction are calculated, and the intersections are sorted according to the coordinates; then the validity of the particles is determined according to the particle coordinates, the intersection coordinates and the intersection sequence number; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid in the X direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid when the particle coordinates are between the 2n-1th intersection. The particle is valid in the X direction when it is between the 2nth intersection and the 2nth intersection. Then, the Y-axis direction is taken as the ray direction, the particle with the minimum coordinate in this direction is selected, and the ray is emitted in the positive direction. Then, the number of intersections of each ray and the boundary surface of the geometric body and the coordinates of the intersections in this direction are calculated, and the intersections are sorted according to the coordinates. Then, the validity of the particle is determined according to the particle coordinates, intersection coordinates and intersection sequence number. If the number of intersections is 0, all particles in the ray direction are invalid. If the number of intersections is an even number, the particle is valid in the Y direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection. If the number of intersections is an odd number, the particle is valid in the Y direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection. When the particle is between the n-1th intersection and the 2nth intersection, the particle is valid in the Y direction; finally, the Z-axis direction is taken as the ray direction, the particle with the minimum coordinate in this direction is selected, and the ray is emitted in the positive direction; then the number of intersections of each ray and the boundary surface of the geometric body and the coordinates of the intersections in this direction are calculated, and the intersections are sorted according to the coordinates; then the validity of the particle is determined according to the particle coordinates, intersection coordinates and intersection sequence number; if the number of intersections is 0, all particles in the ray direction are invalid; if the number of intersections is an even number, the particle is valid in the Z direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; if the number of intersections is an odd number, the particle is valid in the Z direction when the particle coordinates are between the 2nth intersection and the 2n+1th intersection; When the particle is between the 2n-1th intersection and the 2nth intersection, it is valid in the Z direction; if a particle is a valid particle in a certain ray direction of X, Y, or Z, the validity value of the particle is accumulated by 1, and when the particle validity value reaches the set upper limit, the particle is determined to be valid; if the upper limit is 1, as long as the particle is a valid particle in any one of the three directions of X, Y, and Z, the particle is valid; when the upper limit is 2, if a particle is a valid particle in any two ray directions of X, Y, and Z, the particle is valid; if the upper limit is 3, the particle is required to be a valid particle in all three directions of X, Y, and Z.
10. The particle filling method for a complex geometric model according to claim 9, characterized in that: The point-by-point determination method, the single-ray method, and the three-ray method all involve the intersection determination of a ray starting from a certain point and a triangular face, and the determination process is as follows: suppose the coordinates of a certain point P are (p1, q1, r1), the coordinates of the three points of the triangle are (x1, y1, z1), (x2, y2, z2), and (x3, y3, z3), respectively, and the normal N1 of the triangular face is expressed as (a1, b1, c1); suppose point P emits a line along a certain direction, and another point Q is taken on the ray, and its coordinates are (p2, q2, r2), then the direction vector V1 of the ray can be expressed as (a2, b2, c2), where a2 = p2-p1, b2 = q2-q1, c2 = r2-r1; thus, the intermediate parameter t can be calculated, and the specific expression is: Assume that the coordinates of the intersection point K of the ray and the triangle patch are (pi, qi, ri), and the calculation formula of its components is: pi=p1+a2×t (2); qi=q1+b2×t (3); ri=r1+c2×t (4); Then we calculate whether the intersection point (xi,yi,zi) is inside the triangle patch. The specific expression is: In the above formula (5), A 123 is the area of the triangle; A 12k , A 13k and A 23k is the area of the triangle enclosed by the intersection point K and any two vertices of the triangle; ε is the tolerance. When the inequality expressed by equation (5) holds, the intersection point k is considered to be inside the triangle, otherwise it is outside the triangle; if one intersection point is outside the triangle, it can be determined that the ray does not intersect the triangle patch; If the intersection point K is inside the triangle, then calculate whether the intersection point K is on the same side of the ray, calculate the direction vector V2 from the starting point P to the intersection point K, and its components are (a3, b3, c3), then a3 = pi-p1, b3 = qi-q1, c3 = ri-r3; if the dot product of V2 and V1 is greater than 0, it means that the intersection point K is on the same side of the ray, then the ray intersects with the triangle face, otherwise it does not intersect.
Citation Information
Patent Citations
Ray method-based geometric model particle generation method, device, equipment and medium
CN116702506A
Simulation software skin particle generation method adaptive to complex geometry
CN116992513A
STL model Monte Carlo particle transport simulation method based on octree neighborhood search
CN118313014A