Charge exchange collision MCC method for numerical simulation of ion thruster
Technical Field
The invention relates to the field of numerical simulation of ion thrusters, in particular to a charge exchange collision MCC method for numerical simulation of an ion thruster.
Background
Electric propulsion is a technology for realizing thrust by ionizing a propellant with electric energy to generate high jet speed. Compared with the traditional chemical propulsion technology, the electric propulsion technology has higher specific impulse which is 10 times or more than that of the traditional propulsion system, so that the carrying amount of the propellant of the spacecraft can be greatly reduced, and the effective load of the spacecraft is obviously improved. Electric propulsion devices are generally divided into three types: electrostatic, electrothermal, and electromagnetic. The ion thruster is one of electrostatic thrusters, and compared with other thrusters, the ion thruster has the greatest advantages of higher specific impulse and efficiency than other thrusters. The ion thruster is always the research focus of all countries in the world in an electric propulsion system and is mainly used for executing tasks such as satellite orbital transfer, attitude control, north-south orbit maintenance and the like.
The ion thruster mainly takes place in the following key physical processes during operation: a discharge cell discharge process, an ion extraction process, and a plume formation process. In the process of discharging in the discharge chamber, the gas propellant and high-speed electrons are subjected to ionization collision to generate electrons and ions, and neutral atoms of the propellant which do not participate in the ionization collision and the ions generated by ionization can be subjected to charge exchange collision; in the process of ion extraction, ions can generate charge exchange collision with neutral atoms of a propellant when passing through an extraction system to generate slow ions, and the slow ions can flow back to impact each part of the extraction system, so that the service life of the extraction system is influenced finally; in the process of plume formation, charge exchange collision can also occur between ejected beam ions and propellant neutral atoms which are not completely ionized, slow ions are formed, the slow ions are easy to flow back, and then impact a spacecraft and a solar cell sailboard, and the normal work of the spacecraft and the solar cell sailboard is finally influenced. In summary, in each key physical process of the ion thruster, the charge exchange collision is an important influencing factor indispensable in the research of the ion thruster.
In consideration of the limitation of ground simulation test and the high cost of flight test, the numerical simulation of the ion thruster is widely applied, and the charge exchange collision as an important physical problem of the ion thruster has important significance for the research of the numerical simulation. The current major method for charge exchange collision studies is the monte carlo (MCC) method. MCC is a numerical analog method of tracking particle motion and collisions. In the application of ion thruster charge exchange collision, the method describes a particle motion and charge exchange collision process which evolves along with time, and a huge numerical calculation load is inevitably generated during simulation, and the generation reasons are mainly as follows:
1. the time step is short. The time step size selected during simulation is smaller than the physical characteristic time with the minimum particle motion and charge exchange collision in the ion thruster, and the physical characteristic time is usually very short, so that the time step smaller than the minimum physical characteristic time is selected to give a correct simulation result.
2. The number of the simulated particles is large. This is not only because the number of real particles in the physical process of ion thruster charge exchange collision is large, but also the statistical law of particle motion and collision can be correctly described only by using enough number of simulated particles.
3. The number of time iteration steps is large. Since the MCC method describes the evolution of particle motion and collisions over time, a large number of time steps are required to achieve a steady state that continuously simulates reaching the physical process from the initial state of the ion thruster charge exchange collision physical process.
The above reasons can be summarized that the MCC method has long operation time and low operation efficiency in the application of ion thruster charge exchange collision, so that the conventional MCC method is inefficient in the study of ion thruster charge exchange collision.
Disclosure of Invention
Aiming at the problems or the defects, in order to solve the problems of low efficiency and time consumption of calculation of the MCC method in the ion thruster charge exchange collision numerical simulation application, the invention provides the charge exchange collision MCC method for the ion thruster numerical simulation by utilizing the hardware architecture characteristics of a Graphic Processing Unit (GPU).
The specific technical scheme is as follows:
step 1, opening up two sections of storage spaces on a global memory of a GPU device side. Defining a structural body array by a section of storage space, wherein the size of the structural body array is capable of storing all particle information of an ion thruster in a lower simulation area, namely the speed, the position and the particle attribute mark information of initial particles, and the initial particle attribute marks are initialized to be 1, wherein 1 represents a fast particle which does not participate in charge exchange collision, and 2 represents a slow particle which participates in charge exchange collision; and defining an array with the size being the number of the particles in the other section of storage space, storing random numbers required by the particles for participating in charge exchange collision judgment, and assigning values in the array to be 0.
And 2, calling an equipment-side random number generation function of the unified computing architecture platform according to the number N of the particles with the particle attribute mark of 1 in the ion thruster stored in the global memory, setting random number seeds, and generating random numbers equal to the number N of the particles by using the GPU. Each particle has a random number R corresponding to the particle, and is used for judging whether the particle performs charge exchange collision or not, and storing all the random numbers in a global memory opened by the GPU according to an array index mode.
And 3, in the kernel function of the GPU terminal, according to the number N of particles with the particle attribute mark of 1 in the global memory and the single-instruction multithreading characteristic of the GPU, the sizes and dimensions of the thread blocks and the thread grids are distributed, and the index of the thread is obtained through calculation of the sizes and dimensions of the thread blocks and the thread grids. A particle is mapped by a thread, so that each particle has a unique thread index corresponding to the particle. And reading the particle speed information from the global memory by using the thread corresponding to the particle, and calculating the collision cross section of each particle by the thread corresponding to the thread index according to the read particle speed information so as to obtain the probability P of charge exchange collision of the particle. The model for collision probability calculation is shown in FIG. 1, where Vn represents the particle velocity, IDn represents the index of the thread, Pn represents the collision probability, where 1. ltoreq. n.ltoreq.N.
Step 4, in step 2, the random number is stored in the global memory in an array index manner, and the random number is the same as the number of the particles with the attribute mark of 1, and the random number array corresponding to the particle is indexed by using the size of the thread index corresponding to the particle, so as to obtain the random number R corresponding to the particle. And comparing the random number R with the probability P of charge exchange collision of the particle calculated in the step 3, if the probability P of charge exchange collision of the particle is greater than the random number R corresponding to the particle, judging the particle as charge exchange collision, otherwise, judging the particle as not charge exchange collision.
Step 5, performing collision processing on the particles which are judged to have charge exchange collision in the step 4, namely updating the speed of the particles by using the threads corresponding to the particles, and marking the particle attribute of the particles as 2; and performing non-collision processing on the particles which are judged not to generate charge exchange collision. And updating the position information of all the simulated particles, judging whether the particles reach the boundary according to the position information, and deleting the particle information if the particles reach the boundary without participating in the next charge exchange collision judgment process. The flow chart of the particle charge exchange collision MCC is shown in figure 2.
And 6, storing the speed, the position and the particle attribute information of the particles which do not reach the boundary into a global memory of the GPU, counting the number of the particles with the particle attribute mark of 1, and updating the number N of the particles with the attribute mark of 1 at the current moment.
And 7, repeating the steps 2 to 6, judging the charge exchange collision of the particles in the ion thruster at each time step, and iterating from step equal to 0 until step equal to TOTAL is reached, wherein TOTAL is the set TOTAL simulation time step.
And 8, defining a structure array at the CPU host end, wherein the size of the structure array is the particle information capacity stored in the global memory of the GPU. And (4) transmitting the result calculated in the step (7) from the GPU back to a memory of the CPU host for data processing and analysis.
The invention realizes the parallel execution of single instruction and multiple data of the MCC algorithm of the charge exchange collision of the ion thruster by utilizing the physical characteristics of the charge exchange collision of the ion thruster and combining the characteristics of single instruction and multiple threads of a Graphic Processing Unit (GPU) in the field of computers, thereby greatly improving the calculation efficiency and saving the calculation time.
Drawings
FIG. 1 is a model of collision probability calculation;
FIG. 2 is a flow chart of a particle charge exchange collision MCC;
FIG. 3 is an overall flow chart of the present invention;
FIG. 4 is a schematic diagram of an example of a two-dimensional axisymmetric plume model calculation.
Detailed Description
The invention is described in further detail below with reference to the figures and examples.
In the examples, a two-dimensional axisymmetric plume model was tested, taking an ion thruster with xenon as propellant. The cross-sectional schematic diagram is shown in fig. 4, and the charge exchange collision of the ion thruster is simulated by adopting a 2D3V mode. The number of simulated xenon ions is 100 ten thousand, and the initial velocity of the xenon ions is upsilonbiThe initial positions of xenon ions are uniformly distributed at the gate outlet, and the collision cross section of the xenon ions and xenon atoms in charge exchange collision is represented as:
σcex=(k1lnυbi+k2)2×10-20m2 (1)
for xenon ions, the formula medium constant coefficient k1=-0.8821,k2=15.1262。
The probability of charge exchange collisions occurring is expressed as:
P=1-exp(-n0σcexυbiΔt) (2)
wherein the density of xenon atoms n0=1.0*1018Per m3Unit time step Δ t 1.6678 × 10-11s, simulation time step number TOTAL 1000000.
Step 1, opening up 2 sections of memory spaces in a global memory of a GPU, defining a structure body array with the size of 100 ten thousand for storing initial information of xenon ions, and initializing xenon ion attribute marks to 1; another segment defines an array of 100 ten thousand in size for storing the random number and initializes the random number to 0.
And 2, calling an MTGP32 random number generation function of a unified computing architecture (CUDA) to generate N random numbers according to the number N of the particles with the attribute mark of 1 and by taking the time of the computer system as a seed of the random numbers, and placing the N random numbers in a global memory of the GPU in an array index mode.
Step 3, configuring the thread grid to be (1024,1, 1) in size and the thread block to be (128,1,1) in size, starting a kernel function according to the size, and calculating a thread index tid, wherein the calculation formulas are shown as (3) and (4):
tid=blockIdx.x*blockDim.x+threadIdx.x (3)
tid+=gridDim.x*blockDim.x (4)
since the number of simulated xenon ions is far larger than the thread index calculated by the formula (3), the thread index iteration is continuously performed by the formula (4) until all the simulated xenon ions complete the calculation of the collision probability P.
And 4, comparing the collision probability P obtained by calculation in the step 3 with the corresponding random number R stored in the step 2, and judging whether the xenon ions generate charge exchange collision.
Step 5, carrying out collision treatment on the xenon ions subjected to charge exchange collision in the step 4, updating the speed of the xenon ions by using a thread, and marking the particle attribute of the xenon ions as 2 to show that the xenon ions are changed into slow xenon ions; and carrying out non-collision treatment on the xenon ions which do not generate charge exchange collision. And then updating the positions of all the xenon ions, judging whether the xenon ions reach the boundary of the simulation area or not, and deleting the xenon ions reaching the boundary.
And 6, storing the particle information which does not reach the boundary to a GPU global memory, and counting and updating the number N of xenon ions with the particle attribute of 1 at the current time.
And 7, repeating the steps 2 to 6, and iterating from step-0 until TOTAL-1000000 is reached.
And 8, defining a structure array with the size of N at the CPU host end, and transmitting the result calculated in the step 7 from the global memory of the GPU back to the memory of the CPU host end for data processing and analysis.
Through the calculation of the embodiment and the comparison of the conventional ion thruster numerical simulation charge exchange collision MCC method, the calculation time of 13837.4 seconds of the conventional charge exchange collision MCC method is shortened to the calculation time of 110.425 seconds of the method of the embodiment, the acceleration ratio reaches 125, the calculation efficiency is greatly improved, and the calculation time is saved.