Monte Carlo particle transport simulation method for STL model based on octree neighborhood search
By using the STL model method of Octet neighborhood search in Monca particle transport simulation, the problem of low transportation efficiency in Moncatalogue in heterogeneous geometric model is solved, efficient particle transport and heterogeneous geometric modeling is achieved, and dependence on third-party libraries and commercial software is avoided.
Patent Information
- Application Number
- CN202410220846.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-28
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-02-28
AI Technical Summary
The existing Monka geometric modeling method is inefficient in particle transport simulation of heterogeneous geometric models, and relies on third-party libraries and commercial software, resulting in large memory consumption and long time to export grid files.
The Monka particle transport simulation method based on octree neighborhood search is adopted, and heterogeneous geometric modeling is performed through the CAD model in STL format, and the STL model is divided into octree spatially. The node neighborhood search is used to accelerate node search and improve Monka particle transport efficiency.
It improves Monca particle transport efficiency, avoids dependence on third-party libraries and commercial software, reduces memory consumption and grid file export time, and supports the heterogeneous geometric modeling capability of Monca method.
Smart Images

Figure CN118313014B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of reactor simulation technology, and in particular to an STL model Monte Carlo particle transport simulation method based on octree neighborhood search, specifically to a heterogeneous geometric modeling capability based on the STL model supporting the Monte Carlo method and improving the Monte Carlo particle transport efficiency by performing node neighborhood search after octree space partitioning. Background Art
[0002] Existing Monte Carlo geometry modeling methods are divided into constructive solid geometry (CSG) and computer-aided design geometry (CAD). CSG is highly efficient, but cannot support heterogeneous geometry modeling. CAD can support heterogeneous geometry modeling, but the efficiency is low. When using the Monte Carlo method to simulate particle transport for heterogeneous geometric models, it is necessary to track particles on a large number of small triangular faces, which significantly reduces the efficiency; the traditional Direct Accelerated Geometry Monte Carlo (DAGMC) method must be pre-processed with the commercial mesh generation software Cubit, which will consume too much memory and take too long to export mesh files. At the same time, it must rely on third-party libraries to run. Summary of the invention
[0003] The purpose of the present invention is to provide a Monte Carlo particle transport simulation method for STL models based on octree neighborhood search in order to overcome the defects of the above-mentioned prior art. The CAD model in STL format can support the heterogeneous geometric modeling capability of the Monte Carlo method and improve the Monte Carlo particle transport efficiency. In view of the above problems, the present invention proposes a Monte Carlo particle transport simulation method for STL models based on octree neighborhood search, which describes heterogeneous geometric bodies using CAD models in STL format, avoids the use of Cubit for pre-processing, and does not rely on any third-party library; and divides the STL model into octree spaces, uses neighborhood search to accelerate node search, and improves the Monte Carlo CAD geometry transport efficiency.
[0004] The present invention is achieved through the following technical solutions:
[0005] The present invention relates to a Monte Carlo particle transport simulation method for an STL model based on an octree neighborhood search. The method comprises the following steps: for a heterogeneous geometric model, an STL model is used for geometric description, and the STL model is divided into an octree space; the octree is searched by using a node neighborhood search, all nodes colliding with a ray are found in sequence along a ray emission direction, and an intersection test between the ray and a triangular facet is performed on the nodes in the ray emission direction.
[0006] Furthermore, the method specifically comprises the following steps:
[0007] S1. For heterogeneous geometric models, use STL model for geometric description and perform octree space partition on the STL model;
[0008] S2. Use neighborhood search to search the octree, locate the entity where the particle is located through the current position coordinates of the particle, find the material filled in the entity, and sample the material filled in the entity to obtain the free path D of the particle at the current position coordinates. ffl , find all nodes that collide with the ray in turn along the direction of the ray, perform precise intersection tests on the nodes in the direction of the ray, and obtain the boundary distance D of the particle from the STL model. dtb ;
[0009] S3, D dtb and D ffl The smaller value is taken as the moving distance D of the particle for the next movement;
[0010] S4, according to the flight direction and position coordinates of the particle, move the particle along the flight direction by a distance D, and update the position coordinates of the particle;
[0011] S5. Determine whether the moved particle is on the surface. If yes, return to step S2. If not, obtain the next collision point of the particle and determine the state of the particle after the collision.
[0012] Furthermore, the method specifically comprises the following steps:
[0013] Step 1: For a heterogeneous geometric model, use CAD to model it and export it to STL format. At the same time, define other information in the Monte Carlo transport model, such as material information, source terms, counters, etc.
[0014] Step 2: Set the depth and divide the STL model into octree spaces of the specified depth.
[0015] Step 3: Search the octree using neighborhood search;
[0016] Step 4: Obtain the Monte Carlo particle transport efficiency (particles / second) of the STL model at different depths.
[0017] Furthermore, the STL model Monte Carlo particle transport simulation method based on octree neighborhood search specifically includes the following steps:
[0018] Step 1: For a heterogeneous geometric model, use CAD to model it and export it to STL format. At the same time, define other information in the Monte Carlo transport model, such as material information, source terms, counters, etc.
[0019] Step 2: Set the depth and divide the STL model into octree spaces of the specified depth.
[0020] Step 3: Perform particle transport geometry tracking. Use the current position coordinates of the particle to locate the entity where the particle is located and find the material filled in the entity. First, calculate the cross-section of the material and obtain the free path D of the particle at that location by sampling information such as particle energy. ffl .
[0021] Step 4: Define a ray, the origin of the ray is the coordinates of the particle's location, and the emission direction is the particle's current flight direction.
[0022] Step 5: Locate the node where the particle is located according to the position coordinates of the ray origin and record the node number.
[0023] Step 6: Calculate the distance D from the origin of the ray along the flight direction to the boundary of the bounding box of the current node b .
[0024] Step 7: Move the ray origin along the flight direction by D b .
[0025] Repeat steps 5 to 7 until the ray passes through the octree region.
[0026] Step 8: Perform precise intersection tests on the triangular facets in the recorded nodes one by one to obtain the boundary distance D between the particle and the STL model. dtb .
[0027] Step 9: Compare D dtb With D ffl , take the smaller value of the two as the distance D of the particle's next movement.
[0028] Step 10: According to the flight direction and position coordinates of the particle, move the particle a distance D along the flight direction and update the position coordinates of the particle.
[0029] Furthermore, after step 10: according to the movement trajectory of the particles in the STL model, a counter is used to count the required physical information.
[0030] Furthermore, after step 10, step 11 is executed: determine whether the moved particle is on the model surface. If yes, return to step 3. If not, obtain the next collision point of the particle and determine the state of the particle after the collision. Repeat steps 3 to 11 until the particle dies. Monte Carlo transport is completed after the geometric transport of the above steps is performed on each particle.
[0031] Furthermore, after step 11: the Monte Carlo particle transport efficiency (particles / second) of the STL model at different depths is obtained as a quantitative indicator of the particle transport simulation efficiency. The more particles simulated per second, the higher the transport efficiency.
[0032] Furthermore, the Monte Carlo particle transport refers to: first, establishing the real motion history of a single particle in a given geometric system; then obtaining sufficient random experimental samples by tracking a large number of particles; and then using statistical methods to give an estimate of a certain numerical feature of the random variable, using the estimate as a solution to the problem, and calculating results such as particle flux.
[0033] Furthermore, the process of executing particle transport geometry tracking, locating the entity where the particle is located through the current position coordinates of the particle, and finding the material filled in the entity is as follows: traverse each entity in the model, determine the number of times the particle passes through the boundary of the entity from the current position in any direction, if the number of passes is an even number, then the particle is outside the entity; if the number of passes is an odd number, then the particle is inside the entity, thereby finding the only entity containing the particle and obtaining the material filled in the entity.
[0034] Furthermore, the node bounding box is an axis-aligned bounding box (AABB), that is, each face of the cuboid corresponding to the bounding box is parallel to a certain coordinate axis plane.
[0035] Furthermore, the process of locating the node where the particle is located according to the position coordinates of the ray origin and recording the node number is as follows: starting from the octree root node, determine whether the ray origin is contained in the node bounding box layer by layer. If it is in the node bounding box, extract the 8 child nodes of the node, determine in which child node the ray origin is, until the current node is a leaf node, and record the node number.
[0036] Furthermore, the precise intersection test of the intersection test between the ray and the triangle facet, the process of the precise intersection test is as follows: first determine the intersection point of the ray and the plane where the triangle facet is located, and then determine whether the intersection point is inside the triangle. If so, the ray intersects with the triangle facet.
[0037] Furthermore, the accurate intersection test process adopts the existing test method. By accurately intersecting the ray and the triangular facet, the distance from the ray origin to a certain triangular facet can be obtained, and this distance is the boundary distance between the particle and the STL model.
[0038] Furthermore, the free path D of the particle at that location is obtained by sampling according to the information of material, particle position coordinates, particle energy, etc. ffl The process is as follows: first calculate the cross section of the material at that location, and then use cross section sampling to obtain the free path. The information such as particle position coordinates and particle energy are the inherent properties of the particle.
[0039] Furthermore, in the process of using a counter to count the required physical information: the counter refers to a counter that counts the calculation results, specifically counting the reactor physical information such as neutron flux and reaction rate.
[0040] Furthermore, the Monte Carlo particle transport efficiency is obtained by the Monte Carlo transport time and the total number of particles, specifically, the total number of simulated particles divided by the Monte Carlo transport time.
[0041] Furthermore, the particle death means that the particle is no longer simulated by the Monte Carlo procedure. For example, the particle is dead when it is outside a given geometric system or when it is absorbed.
[0042] The technical effects of the present invention are mainly reflected in:
[0043] A Monte Carlo particle transport simulation method for STL models based on octree neighborhood search is proposed. For a heterogeneous geometric model, the STL model is used for geometric description, and the STL model is divided into octree spaces of a certain depth. In view of the problem that the traditional hierarchical traversal method needs to traverse the entire octree during octree search, which involves a large number of ray bounding box intersection test calculations, a node neighborhood search is used to find all nodes that collide with the ray in sequence along the ray emission direction, and the ray bounding box intersection test is converted into a node positioning test, which effectively improves the efficiency of ray tracing, thereby improving the Monte Carlo particle transport efficiency of the STL model.
[0044] The Monte Carlo particle transport simulation method for STL models based on octree neighborhood search solves the shortcoming that Monte Carlo transport in heterogeneous geometry cannot take into account both modeling accuracy and transport efficiency. Compared with traditional octree hierarchical traversal, it has higher efficiency, thus supporting the heterogeneous geometry modeling capability of the Monte Carlo method and improving the Monte Carlo particle transport efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flow chart of an embodiment;
[0046] Figure 2 The "Stanford Bunny" model diagram of the embodiment;
[0047] Figure 3 This is a schematic diagram of the octree space partition;
[0048] Figure 4 octree node graphs of different depths for the embodiment model;
[0049] Figure 5 Constructing time graphs for different depth octrees of the embodiment model;
[0050] Figure 6 It is the efficiency comparison diagram of the embodiment model;
[0051] Figure 7 This is a graph showing the efficiency improvement of the implementation model. DETAILED DESCRIPTION
[0052] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The features such as component models, material names, connection structures, control methods, etc. that are not clearly described in this technical solution are all regarded as common technical features disclosed in the prior art.
[0053] Example
[0054] In this example, the Figure 2 The "Stanford Bunny" model shown in the figure was modeled using CAD. An isotropic neutron point source was used, placed at the center of the model, and the initial energy was set to 0.0001 MeV.
[0055] In terms of material selection, the material filled in the model is set to water, and the density of water is 1g / cm 3 The model was exported to STL format, and the number of triangular facets was 69451. The model was divided into octree spaces of different depths, and Monte Carlo particle transport simulation was performed. The specific implementation method includes:
[0056] Step 1: Export the "Stanford Bunny" model to STL format and assign materials to the cells. Part of the STL model is shown below.
[0057]
[0058]
[0059] Step 2: Divide the model into octrees of different depths. The octree depths are 3, 4, 5, 6, 7, and 8. Use the Monte Carlo program RMC to perform fixed source calculations. The total number of neutrons simulated is N = 100,000, that is, a total of 100,000 neutrons are simulated.
[0060] Step 3: Use hierarchical traversal to search the octree and obtain the Monte Carlo particle transport efficiency (particles / second) of the STL model at different depths. The hierarchical traversal uses the conventional hierarchical traversal method for comparison.
[0061] Step 4: Use neighborhood search to search the octree. The neighborhood search process is as follows:
[0062] Step 41: Execute particle transport geometry tracking, locate the entity where the particle is located through the current position coordinates of the particle, and find the material filled in the entity (a model is usually composed of many entities, and the position coordinates can be used to determine in which entity the position is located. For this embodiment, the model is composed of only one entity, so there is only one known entity, and this embodiment only sets water as the filling material in this entity). Based on the particle position coordinates, particle energy and other information and the above-obtained materials, first calculate the cross-section of the material, and obtain the free path D of the particle at this location through cross-section sampling (in this embodiment, the specific sampling method adopts the direct sampling method of continuous random variables) ffl .
[0063] Step 42: Define a ray, where the origin of the ray is the coordinates of the particle's location and the emission direction is the particle's current flight direction.
[0064] Step 43: Locate the node where the particle is located according to the position coordinates of the ray origin and record the node number. The specific method is as follows: Starting from the root node of the octree, determine whether the ray origin is contained in the node bounding box layer by layer. If it is in the node bounding box, extract the 8 child nodes of the node and determine in which child node the ray origin is located until the current node is a leaf node.
[0065] Step 44: Calculate the distance D from the origin of the ray along the flight direction to the boundary of the current node bounding box (in this embodiment, the node bounding box adopts an axis-aligned bounding box (AABB), and the node bounding box boundary information is calculated when the octree is divided and generated. Therefore, when accessing the node, its bounding box boundary can also be obtained) b .
[0066] Step 45: Move the ray origin along the flight direction by D b .
[0067] Repeat steps 43 to 45 until the ray passes through the octree region.
[0068] Step 46: Perform precise intersection tests on the triangular facets in the recorded nodes one by one to obtain the boundary distance D between the particle and the STL model. dtb .
[0069] Step 47: Compare D dtb With D ffl , take the smaller value of the two as the distance D of the particle's next movement.
[0070] Step 48: According to the flight direction and position coordinates of the particle, move the particle along the flight direction by a distance D, and update the position coordinates of the particle.
[0071] Step 49: Determine whether the moved particle is on the model surface. If yes, return to step 41. If not, obtain the next collision point of the particle and determine the state of the particle after the collision.
[0072] Repeat steps 41 to 49 until the particle dies, completing the geometric transport of the particle. Monte Carlo transport is completed after geometric transport is performed on each particle. The required physical information can be counted using a counter according to the motion trajectory of the particle in the STL model. For this embodiment, it is not necessary to set a counter to obtain the particle transport efficiency.
[0073] Step 5: The Monte Carlo particle transport efficiency (particles / second) of the STL model at different depths is obtained through the Monte Carlo transport time and the total number of neutrons (this value is obtained based on the Monte Carlo transport time and the total number of particles after the Monte Carlo program is run, and the Monte Carlo transport time is automatically output by the Monte Carlo program).
[0074] Step 6: Evaluate the effect of the technology of the present invention.
[0075] In the octree construction verification of this embodiment, the construction effect of the octree is evaluated by comparing the number of nodes and the octree construction time of the octree at different division depths. The number of nodes and the construction time when the model is divided into octrees of different depths are shown in Table 1. As the depth of the octree division increases, the number of nodes increases rapidly. When the depth is 8, the number of nodes reaches 179489, and the number of nodes far exceeds the number of triangles in the model; at the same time, the time required to build the octree continues to increase. When the depth is 8, it takes 1.637s to build the octree. The octree is a hierarchical spatial data structure that divides a space into eight equal subspaces. The space before the division is called the root node, and the eight subspaces after the division are its child nodes. If there are geometric primitives in the subspace, each subspace can be further divided until a certain termination condition is met (usually the octree reaches a certain division depth or the objects contained in the node do not exceed a certain number). When the termination condition is met, the node does not need to be further divided. At a depth of 4 or later, the objects contained in some nodes do not exceed a certain number, so they will not be further divided and there are no child nodes.
[0076] Table 1. Number of nodes and construction time of the “Stanford Bunny” model when the octree is divided into different depths
[0077]
[0078] In this embodiment, the technical effect of the present invention is quantified by comparing the traditional octree hierarchical traversal method with the octree neighborhood search method proposed in the present invention. The number of particles simulated per second is used as a quantitative indicator of particle transport simulation efficiency. The more particles simulated per second, the higher the transport efficiency. The comparison of computational efficiency and improvement is shown in Table 2 and Table 3. Figure 6 .
[0079] Table 2 Comparison of octree level traversal efficiency and neighborhood search efficiency at different depths
[0080]
[0081] As can be seen from Table 2, with the increase of the octree division depth, the efficiency of the hierarchical traversal method and the neighborhood search method of the present invention first increases and then decreases, reaching the highest efficiency at depths of 7 and 6, respectively. It indicates that the model has reached the optimal octree division depth at this time. Before the model reaches the optimal division depth, the neighborhood search efficiency has advantages over the traditional hierarchical traversal, and can achieve a performance improvement of up to 112.6%. Therefore, the present invention can support heterogeneous geometric modeling of the Monte Carlo method without the need for third-party dependent libraries and commercial software (such as MOAB third-party libraries, Cubit meshing software), and improve the Monte Carlo particle transport efficiency.
[0082] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. Each implementation scheme within its scope shall be subject to the constraints of the present invention.
Claims
1. A Monte Carlo particle transport simulation method for an STL model based on an octree neighborhood search, characterized in that: The method comprises the following steps: S1. For heterogeneous geometric models, use STL model for geometric description and perform octree space partition on the STL model; S2. Use neighborhood search to search the octree, locate the entity where the particle is located through the current position coordinates of the particle, find the material filled in the entity, and sample the material filled in the entity to obtain the free path D of the particle at the current position coordinates. ffl , find all nodes that collide with the ray in turn along the direction of the ray, perform precise intersection tests on the nodes in the direction of the ray, and obtain the boundary distance D of the particle from the STL model. dtb ; S3, D dtb and D ffl The smaller value is taken as the moving distance D of the particle for the next movement; S4, according to the flight direction and position coordinates of the particle, move the particle along the flight direction by a distance D, and update the position coordinates of the particle; S4, determine whether the moved particle is on the model surface, if yes, return to step S2, if not, obtain the next collision point of the particle and determine the state of the particle after collision; S5. Repeat steps S2 to S4 until the particle dies, and complete Monte Carlo transport after performing geometric transport on each particle.
2. The method for simulating STL model Monte Carlo particle transport based on octree neighborhood search according to claim 1, characterized in that: The method comprises the following steps: Step 1: For a heterogeneous geometric model, use CAD to model it and export it to STL format to obtain the STL model and define the information in the Monte Carlo transport model; Step 2: Set the depth and divide the STL model into octree spaces of the specified depth; Step 3: Perform particle transport geometry tracking. Through the current position coordinates of the particle, locate the entity where the particle is located, find the material filled in the entity, first calculate the cross section of the material, and sample the free path D of the particle at the current position coordinates. ffl ; Step 4: Define a ray, the origin of which is the coordinates of the particle's location, and the emission direction is the particle's current flight direction; Step 5: Locate the node where the particle is located according to the position coordinates of the ray origin and record the node number; Step 6: Calculate the distance D from the origin of the ray along the flight direction to the boundary of the bounding box of the current node b ; Step 7: Move the ray origin along the flight direction by D b ; Repeat steps 5 to 7 until the ray passes through the octree area; Step 8: Perform precise intersection tests on the triangular facets in the recorded nodes one by one to obtain the boundary distance D between the particle and the STL model. dtb ; Step 9: Compare D dtb With D ffl , take the smaller value of the two as the distance D of the next movement of the particle; Step 10: According to the flight direction and position coordinates of the particle, move the particle a distance D along the flight direction and update the position coordinates of the particle.
3. The STL model Monte Carlo particle transport simulation method based on octree neighborhood search according to claim 2 is characterized in that: The process of executing particle transport geometry tracking, locating the entity where the particle is located through the current position coordinates of the particle, and finding the material filled in the entity is as follows: Traverse each entity in the model and determine the number of times the particle passes through the boundary of the entity from the current position in any direction. If the number of times is an even number, the particle is outside the entity; if the number of times is an odd number, the particle is inside the entity, thereby finding the only entity containing the particle and obtaining the material filled in the entity.
4. The method for simulating STL model Monte Carlo particle transport based on octree neighborhood search according to claim 2, characterized in that: The process of locating the node where the particle is located according to the position coordinates of the ray origin and recording the node number is as follows: Starting from the root node of the octree, determine whether the ray origin is contained in the node bounding box layer by layer; if it is in the node bounding box, extract the 8 child nodes of the node, determine the child node where the ray origin is located, until the current node is a leaf node, and record the node number.
5. The method for simulating STL model Monte Carlo particle transport based on octree neighborhood search according to claim 2, characterized in that: The process of the precise intersection test is as follows: First, determine the intersection point of the ray and the plane where the triangle patch is located, and then determine whether this intersection point is inside the triangle. If so, the ray intersects with the triangle patch.
6. The method for simulating STL model Monte Carlo particle transport based on octree neighborhood search according to claim 2, characterized in that: The free path D of the particle at the current position coordinate is obtained by sampling the material, particle position coordinate, and particle energy. ffl .
7. The method for simulating STL model Monte Carlo particle transport based on octree neighborhood search according to claim 2, characterized in that: The information in the Monte Carlo transport model includes: Material information, source terms, counters.
8. The method for simulating STL model Monte Carlo particle transport based on octree neighborhood search according to claim 2, characterized in that: After step 10, perform the following step 11: Step 11: Determine whether the moved particle is on the model surface. If yes, return to step 3. If not, obtain the next collision point of the particle and determine the state of the particle after collision. After step 11, perform the following step 12: Step 12: Repeat steps 3 to 11 until the particle dies, and complete Monte Carlo transport after performing geometric transport on each particle.
9. The method for simulating STL model Monte Carlo particle transport based on octree neighborhood search according to claim 1, characterized in that: The Monte Carlo particle transport refers to: First, the real motion history of a single particle in a given geometric system is established; then, sufficient random experimental samples are obtained by tracking a large number of particles; and statistical methods are used to give an estimate of a certain numerical feature of the random variable, which is used as the solution to the problem to calculate the particle flux results.