A monte carlo macro-particle coalescence method based on particle simulation
Patent Information
- Application Number
- CN202311105737.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-08-30
AI Technical Summary
[0006]本发明所要解决的技术问题是,设计一种高效的宏粒子合并方法,解决粒子模拟中宏粒子数过多导致的计算效率过低的问题
[0027]本发明方法,由于各个宏粒子进行相对独立的蒙特卡洛合并操作,因此在算法设计时可以直接依次读取宏粒子信息进行处理,与一般的粒子模拟流程吻合度高,相对于传统的宏粒子合并方法,本方法计算效率高且容易实现,更有利于发挥宏粒子合并方法在提高粒子模拟计算速度上的优势。
Smart Images

Figure CN116992746B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of particle simulation, specifically a Monte Carlo macroparticle merging method based on particle simulation, which reduces the memory usage and improves the computational efficiency of particle simulation. Background Technology
[0002] In the fields of plasma and vacuum electronics, particle simulation methods are commonly used to simulate the interaction between charged particles and electromagnetic fields. In particle simulation calculations, the velocity and position of charged particles are updated using the Lorentz force equation and the equations of motion based on the electromagnetic field information. The current density and charge density are then updated using the position and velocity of the charged particles. Finally, the electromagnetic field information is updated using Maxwell's equations based on the information of the current density and charge density, thus progressing cyclically over time.
[0003] In particle simulations, tracking a large number of charged particles results in enormous computer memory requirements and low simulation efficiency. In practice, a large number of charged particles with similar positions and velocities are replaced by a small number of macroparticles to reduce memory usage and improve computational efficiency. In traditional simulations, the charge of macroparticles usually remains constant throughout the simulation. However, in many real-world scenarios such as gas breakdown and secondary electron multiplication, the charge of charged particles increases exponentially. If the charge of macroparticles remains constant during the simulation, the number of macroparticles in the simulation will increase exponentially, quickly exceeding the performance capacity of currently used computers. Therefore, in problems where the charge of charged particles increases exponentially, it is usually necessary to merge macroparticles with similar positions and velocities during the simulation.
[0004] Currently, the commonly used method for macroparticle merging is to first search for macroparticles with similar positions and velocities, and then pair and merge these macroparticles. This process consumes a significant amount of simulation time due to the search algorithm. Furthermore, ensuring that the center of mass, momentum, and energy remain unchanged during the merging process typically requires more complex algorithms, further consuming computational resources. Therefore, this reduces the effectiveness of macroparticle merging methods in improving simulation efficiency.
[0005] This invention eliminates the need to search for macroparticles with similar positions and velocities. Based on the Monte Carlo method, each macroparticle can be directly and randomly processed, ensuring that physical quantities such as the center of mass, momentum, and energy remain statistically unchanged during the merging process, while rapidly achieving macroparticle merging. This method is not only highly efficient and simple, but also highly compatible with existing commonly used particle simulation workflows, and can be easily embedded into various particle simulation methods. Summary of the Invention
[0006] The technical problem this invention aims to solve is to design an efficient macroparticle merging method to address the issue of low computational efficiency caused by an excessive number of macroparticles in particle simulations. This invention utilizes the Monte Carlo method to rapidly achieve macroparticle merging while ensuring that physical quantities such as the center of mass, momentum, and energy remain statistically unchanged during the merging process.
[0007] The specific technical solution is as follows: A Monte Carlo macroparticle merging method based on particle simulation, the method comprising:
[0008] Step 1: Set the threshold N for the number of macroparticles in the entire simulation region to trigger the macroparticle merging operation. m ;
[0009] Step 2: Divide the simulation area into multiple sub-regions according to the grid, and set V for each sub-region. i The macroparticle number threshold n for macroparticle merging m ;
[0010] Step 3: For each time step, perform a check on each sub-region V i The number of macroparticles n i And the number of macroparticles N in the entire simulation region i Perform statistics;
[0011] Step 4: Determine the number N of macroparticles in the entire simulation region. i Is it greater than the set macroparticle number threshold N? m If the conditions are met, proceed to the next step; if the conditions are not met, do not perform the macroparticle merging operation.
[0012] Step 5: For each sub-region, determine sub-region V i The number of macroparticles n i Is it greater than the set macroparticle number threshold n? m If the condition is met, proceed to the next step; if the condition is not met, do not perform macro-particle merging operation on this sub-region.
[0013] Step 6: For sub-region V i According to N i With N m The value of p is used to calculate a fundamental probability p for the macroparticle merging operation. i ;
[0014] p i =(N i -N m ) / N i
[0015] Step 7: Based on the charge Q of each macroparticle i Using the function f(Q) i ,p iFor the basic probability p i After making corrections, the final probability p for operating on this macroparticle is obtained. fi This makes macroparticles with high charge less likely to be processed, and macroparticles with low charge more likely to be processed, i.e., when Q... i / Q av When >1, f(Q) i ,p i When Q < 1, i / Q av When <= 1, f(Q) i ,p i )>=1, where Q av The average charge of macroparticles;
[0016]
[0017] p fi =p i f(Q i ,p i )
[0018] Step 8: Based on probability p fi Perform a Monte Carlo operation on each macroparticle, and for each macroparticle, with probability p fi Extinction, with probability (1-p) fi To retain data, take a uniformly random number R between 0 and 1. If R... <p fi If R >= 1 - p, then the macroparticle will disappear. fi If so, the macroparticle will remain.
[0019] Step 9: Modify the remaining macroparticle charge Q ci This increases its charge to 1 / (1-p) of the original value. fi This multiplyes by 100%, thus completing the macroparticle merging operation;
[0020] Q ci =Q i / (1-p fi )
[0021] For each macroparticle: charge Q i ,momentum Energy ε i Center of mass By modifying the macroparticle survival probability and the charge of the survived macroparticles, the total charge Q of the merged macroparticles is obtained. a Total momentum p a Total energy ε a Location of the center of mass The expected value remains unchanged;
[0022]
[0023]
[0024]
[0025]
[0026] E(.) represents the corresponding expectation.
[0027] The method of this invention, because each macroparticle performs a relatively independent Monte Carlo merging operation, allows for the direct sequential reading and processing of macroparticle information during algorithm design. This method is highly consistent with general particle simulation processes. Compared to traditional macroparticle merging methods, this method is computationally efficient and easy to implement, and is more conducive to leveraging the advantages of macroparticle merging methods in improving particle simulation computation speed. Attached Figure Description
[0028] Figure 1 A microwave gas breakdown calculation model;
[0029] Figure 2 The charge of macroparticles when using the macroparticle merging method;
[0030] Figure 3 The charge of macroparticles when the macroparticle merging method is not used;
[0031] Figure 4 This is a phase space diagram of electron radial velocity versus axial position when using the macroparticle merging method.
[0032] Figure 5 This is the phase space diagram of electron radial velocity versus axial position without using the macroparticle merging method.
[0033] Figure 6 This is a spatial distribution diagram of electrons when using the macroparticle merging method;
[0034] Figure 7 This is a spatial distribution diagram of electrons without using the macroparticle merging method;
[0035] Figure 8 Input port power diagram when using macro-particle merging method;
[0036] Figure 9 The input port power diagram without using the macro-particle merging method;
[0037] Figure 10 Output port power diagram when using macro-particle merging method;
[0038] Figure 11 This is the output port power diagram when the macro-particle merging method is not used. Detailed Implementation
[0039] The present invention will be further described in detail below using a microwave gas breakdown example through a specific implementation process.
[0040] This implementation simulates a scenario where high-power microwaves pass through an argon-filled coaxial waveguide, such as... Figure 1 As shown, the inner radius is 1 meter, the outer radius is 1.01 meters, and the length is 0.6 meters. A region of 0.05 meters to 0.55 meters is filled with 10 torr of argon gas. The radial grid is 2 mm, the axial grid is 2 mm, and the angular grid is 72 degrees. The simulation time step is 3.77 × 10⁻⁶. -12 The simulation duration is 3.1 nanoseconds. A transverse electromagnetic wave with an electric field amplitude of 3606 V / m and a frequency of 2.8 GHz is input to the left end of the waveguide.
[0041] First, each grid is assigned one initial seed electron and ion, with the charge density of the initial seed electron and ion set to 1.6 × 10⁻⁶ per cubic meter. -5 Coulomb. Electron macroparticle number merging threshold n for each grid region. m Set to 1, the electron macroparticle number merging threshold N for the entire simulation region. m The threshold for merging the number of ion macroparticles in each grid region is set to 50000, and the threshold for merging the number of ion macroparticles in the entire simulation region is also set to 1. m Also set to 50000, and the basic probability correction function is set to In addition, a comparative example is provided that does not employ the macro-particle merging method.
[0042] As the simulation progresses, electrons in the gas gain energy in the microwave electromagnetic field. Some of these electrons exceed the ionization collision threshold and undergo ionization collisions. These collisions strip electrons from the original gas molecules, increasing the density of free electrons. Without merging, the number of macroparticles will continue to grow until the set threshold for merging is reached.
[0043] When the total number of macroparticles in the entire simulation region N i More than N m And the number of macroparticles in a certain grid exceeds n m At that time, each macroparticle in the grid has a probability p fi =f(Q) i ,p i (N) i -N m ) / N i Upon extinction, the remaining macroparticles have a charge that becomes 1 / (1-p) of their original value. fiThe number of macroparticles is increased by a factor of 1.5. After merging, if the number of macroparticles exceeds the threshold required for merging, merging continues in the next time step until the number of macroparticles falls below the threshold. Once the number of macroparticles falls below the threshold, macroparticle merging is stopped in the next time step until the number of macroparticles exceeds the threshold again as the simulation progresses. At this point, macroparticle merging is reactivated. This process is repeated to effectively control the total number of macroparticles, maintaining it at N. m While the surrounding area fluctuates, the statistical values of other physical quantities are largely unaffected by the merging process.
[0044] After a certain simulation period, as the ionization collisions continue, the total charge represented by all macroparticles in the simulation region will increase exponentially, such as... Figures 2-3 As shown. Figure 2 This is a graph showing the change of total charge over time when simulated using the macroparticle merging method. Figure 3 This is a graph showing the total charge versus time obtained from simulations without using the macroparticle merging method. Figure 2 and Figure 3 The results show that the total charge obtained using the macroparticle merging method is almost identical to that obtained without it. This is because the probability of ionization collisions is closely related to electron energy, which in turn is closely related to the work done by the electromagnetic field, and the work done by the electromagnetic field is closely related to electron velocity. Figure 2 and Figure 3 The consistency of the results indicates that the use of the macroparticle merging method in this invention did not have a statistically significant impact on the accurate simulation of these physical quantities, demonstrating the effectiveness of the macroparticle merging method in this invention.
[0045] like Figures 4-7 As shown, Figure 4 This is a phase space diagram of electron radial velocity versus axial position when using the macroparticle merging method. Figure 5 This is the phase space diagram of electron radial velocity versus axial position without using the macroparticle merging method. Figure 6 This is a spatial distribution diagram of electrons when using the macroparticle merging method. Figure 7 These figures, showing the electron spatial distribution without using the macroparticle merging method, further validate the effectiveness of the macroparticle merging method in this invention.
[0046] As the space charge charge increases exponentially, a denser plasma forms, affecting microwave transmission. Microwaves input from the left are attenuated over time and output from the right. Figure 8 This is the input port power diagram when using the macroparticle merging method. Figure 9 This is the input port power diagram without using the macro-particle merging method. Figure 10 This is the output port power diagram when using the macro-particle merging method. Figure 11To obtain the output port power diagram without using the macro-particle merging method, one can start from... Figures 8-11 It can be observed that the output microwave power is significantly less than the input microwave power, and the results when using the macro-particle merging method are almost identical to those when not using the macro-particle merging method.
[0047] In this case, using the macroparticle merging method of this invention, the simulation only takes 25 seconds because the number of macroparticles is controlled, while it would take 18 minutes and 46 seconds without the macroparticle merging method. In some common scenarios, the initial density during simulation will be lower than in this case. In such cases, without the macroparticle merging method, the number of macroparticles would increase by hundreds of millions of times, making the simulation impossible to complete. In these situations, the advantages of using the macroparticle merging method become even more apparent.
Claims
1. A Monte Carlo macroparticle merging method based on particle simulation, the method comprising: Step 1: Set the threshold N for the number of macroparticles in the entire simulation region to trigger the macroparticle merging operation. m ; Step 2: Divide the simulation area into multiple sub-regions according to the grid, and set V for each sub-region. i The macroparticle number threshold n for macroparticle merging m ; Step 3: For each time step, perform a check on each sub-region V i The number of macroparticles n i And the number of macroparticles N in the entire simulation region i Perform statistics; Step 4: Determine the number N of macroparticles in the entire simulation region. i Is it greater than the set macroparticle number threshold N? m If the conditions are met, proceed to the next step; if the conditions are not met, do not perform the macroparticle merging operation. Step 5: For each sub-region, determine sub-region V i The number of macroparticles n i Is it greater than the set macroparticle number threshold n? m If the condition is met, proceed to the next step; if the condition is not met, do not perform macro-particle merging operation on this sub-region. Step 6: For sub-region V i According to N i With N m The value of p is used to calculate a fundamental probability p for the macroparticle merging operation. i ; p i =(N i -N m ) / N i ; Step 7: Based on the charge Q of each macroparticle i Using the function f(Q) i ,p i For the basic probability p i After making corrections, the final probability p for operating on this macroparticle is obtained. fi This makes macroparticles with high charge less likely to be processed, and macroparticles with low charge more likely to be processed, i.e., when Q... i / Q av When >1, f(Q) i ,p i When Q < 1, i / Q av When <= 1, f(Q) i ,p i )>=1, where Q av The average charge of macroparticles; , p fi =p i f(Q i ,p i ); Step 8: Based on probability p fi Perform a Monte Carlo operation on each macroparticle, and for each macroparticle, with probability p fi Extinction, with probability (1-p) fi To retain data, take a uniformly random number R between 0 and 1. If R... <p fi If R >= 1 - p, then the macroparticle will disappear. fi If so, the macroparticle will remain. Step 9: Modify the remaining macroparticle charge Q ci This increases its charge to 1 / (1-p) of the original value. fi This multiplyes by 100%, thus completing the macroparticle merging operation; Q ci =Q i / (1-p fi ), For each macroparticle: charge Q i ,momentum Energy ε i Center of mass By modifying the macroparticle survival probability and the charge of the survived macroparticles, the total charge Q of the merged macroparticles is obtained. a Total momentum p a Total energy ε a Location of the center of mass The expected value remains unchanged; , E(.) represents the corresponding expectation.