Particle position determination method based on particle collision and related device
By calculating the particle collision time and subsequent velocity direction in CFD software, the problem that the prior art cannot handle particle collision in fluid is solved, and the accurate calculation of the particle motion trajectory in fluid is achieved.
Patent Information
- Application Number
- CN202311285125.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-03-28
AI Technical Summary
Existing CFD software cannot calculate the position of particles in a fluid based on particle collisions, especially when collisions occur between particles, and the movement trajectory of particles in the fluid cannot be determined.
By obtaining the vertical distance between two preset particles within the interval time, if it is less than the particle radius sum, calculate the collision time of each preset particle, determine the target particle corresponding to the minimum collision time, and calculate the velocity and direction angle after collision based on the pre-collision and direction angle, and update the particle position.
When a collision occurs between particles in the fluid, the position of particles in the fluid can be calculated based on the particle collision and their motion trajectory can be determined, which solves the situation where the prior art cannot handle particle collisions.
Smart Images

Figure CN119720826A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data analysis technology, and in particular to a particle position determination method based on particle collision and a related device. Background Art
[0002] Computational Fluid Dynamics (CFD) is a simulation technology used to simulate actual fluid flow conditions. Currently, CFD software can calculate the position of particles in the fluid to determine the motion trajectory of particles in the fluid.
[0003] In the related art, CFD software usually considers the interaction between particles in the fluid and the surrounding fluid, calculates the position of the particles in the fluid, and determines the movement trajectory of the particles in the fluid.
[0004] However, collisions may occur between particles in the fluid, and the above method cannot calculate the positions of particles in the fluid based on particle collisions; that is, when collisions occur between particles in the fluid using the above method, the movement trajectories of the particles in the fluid cannot be determined. Summary of the invention
[0005] In view of this, an embodiment of the present application provides a particle position determination method based on particle collision and a related device, which takes into account the interaction between particles in the fluid. When a collision occurs between particles in the fluid, the position of the particles in the fluid can be calculated based on the particle collision to determine the motion trajectory of the particles in the fluid.
[0006] On the one hand, an embodiment of the present application provides a method for determining a particle position based on particle collision, the method comprising:
[0007] Get n Time and t n+1 The interval between moments
[0008] If the vertical distance between the two preset particles within the interval time is less than the sum of the radii of the two preset particles, determine the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle within the interval time, the start position of each preset particle at the start time of the interval time, the end position of each preset particle at the end time of the interval time, and the interval time;
[0009] According to the collision time of each preset particle from the start time of the interval time, two preset particles corresponding to the minimum collision time are determined as two target particles;
[0010] For the minimum collision time, determining the post-collision velocity of each target particle according to the pre-collision velocity of each target particle;
[0011] Determining a post-collision direction angle of each target particle according to the collision surface direction angles of the two target particles;
[0012] Determine the end position of each preset particle at the end time of the minimum collision time according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the minimum collision time;
[0013] The interval time is updated according to the difference time between the interval time and the minimum collision time, and the step of determining the collision time of each preset particle from the start time of the interval time is returned until the interval time is equal to 0, or the vertical distance between every two preset particles within the interval time is greater than or equal to the sum of the radii of every two preset particles.
[0014] Optionally, determining the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle within the interval time, the start position of each preset particle at the start time of the interval time, the end position of each preset particle at the end time of the interval time, and the interval time includes:
[0015] Performing a difference processing on the collision position of each preset particle in the interval time and the starting position of each preset particle at the start time of the interval time, to determine a first difference value corresponding to each preset particle;
[0016] Performing a difference processing on the end position of each preset particle at the end time of the interval and the start position of each preset particle at the start time of the interval to determine a second difference value corresponding to each preset particle;
[0017] The collision time of each preset particle from the start time of the interval time is determined according to the proportionality coefficient between the first difference value corresponding to each preset particle and the second difference value corresponding to each preset particle, and the interval time.
[0018] Optionally, determining the post-collision velocity of each target particle according to the pre-collision velocity of each target particle includes:
[0019] If the two target particles collide completely elastically, the pre-collision velocity of each target particle is determined as the post-collision velocity of each target particle.
[0020] Optionally, the two target particles include a first particle and a second particle, and determining the post-collision direction angle of each target particle according to the collision surface direction angles of the two target particles includes:
[0021] If the first particle and the second particle collide completely elastically, determining the post-collision direction angle of the first particle according to the pre-collision direction angle of the first particle and the collision surface direction angle;
[0022] The post-collision direction angle of the second particle is determined according to the post-collision direction angle of the first particle.
[0023] Optionally, the step of determining the direction angle of the collision surface includes:
[0024] determining a preset angle according to a vertical distance between the first particle and the second particle, a sum of the radii of the first particle and the second particle, and an arccosine function;
[0025] The pre-collision direction angle of the first particle and the preset angle are summed to obtain the collision surface direction angle.
[0026] Optionally, determining the end position of each preset particle at the end time of the minimum collision time according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the minimum collision time includes:
[0027] Determine, according to the speed of each preset particle at the start time of the interval time and the minimum collision time, a change position of each preset particle within the minimum collision time;
[0028] The starting position of each preset particle at the start time of the interval time and the changed position of each preset particle within the minimum collision time are summed to obtain the ending position of each preset particle at the end time of the minimum collision time.
[0029] Optionally, the method further includes:
[0030] If the vertical distance between every two preset particles within the interval time is greater than or equal to the sum of the radii of every two preset particles, the end position of each preset particle at the end time of the interval time is determined according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the interval time.
[0031] On the other hand, an embodiment of the present application provides a particle position determination device based on particle collision, the device comprising: an acquisition unit, a determination unit and an update unit;
[0032] The acquisition unit is used to acquire t n Time and t n+1 The interval between moments
[0033] The determining unit is used to determine the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle in the interval time, the start position of each preset particle at the start time of the interval time, the end position of each preset particle at the end time of the interval time, and the interval time if the vertical distance between the two preset particles in the interval time is less than the sum of the radii of the two preset particles;
[0034] The determining unit is further configured to determine two preset particles corresponding to a minimum collision time as two target particles according to a collision time between each preset particle and a start time of the interval time;
[0035] The determining unit is further configured to determine the post-collision velocity of each target particle according to the pre-collision velocity of each target particle with respect to the minimum collision time;
[0036] The determination unit is further used to determine the post-collision direction angle of each target particle according to the collision surface direction angles of the two target particles;
[0037] The determining unit is further used to determine the end position of each preset particle at the end time of the minimum collision time according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the minimum collision time;
[0038] The updating unit is used to update the interval time according to the difference time between the interval time and the minimum collision time, and return to the step of determining the collision time of each preset particle from the start time of the interval time until the interval time is equal to 0, or the vertical distance between every two preset particles within the interval time is greater than or equal to the sum of the radii of every two preset particles.
[0039] Optionally, the determining unit is specifically configured to:
[0040] Performing a difference processing on the collision position of each preset particle in the interval time and the starting position of each preset particle at the start time of the interval time, to determine a first difference value corresponding to each preset particle;
[0041] Performing a difference processing on the end position of each preset particle at the end time of the interval and the start position of each preset particle at the start time of the interval to determine a second difference value corresponding to each preset particle;
[0042] The collision time of each preset particle from the start time of the interval time is determined according to the proportionality coefficient between the first difference value corresponding to each preset particle and the second difference value corresponding to each preset particle, and the interval time.
[0043] Optionally, the determining unit is further specifically configured to:
[0044] If the two target particles collide completely elastically, the pre-collision velocity of each target particle is determined as the post-collision velocity of each target particle.
[0045] Optionally, the two target particles include a first particle and a second particle, and the determining unit is further specifically configured to:
[0046] If the first particle and the second particle collide completely elastically, determining the post-collision direction angle of the first particle according to the pre-collision direction angle of the first particle and the collision surface direction angle;
[0047] The post-collision direction angle of the second particle is determined according to the post-collision direction angle of the first particle.
[0048] Optionally, the determining unit is further specifically configured to:
[0049] determining a preset angle according to a vertical distance between the first particle and the second particle, a sum of the radii of the first particle and the second particle, and an arccosine function;
[0050] The pre-collision direction angle of the first particle and the preset angle are summed to obtain the collision surface direction angle.
[0051] Optionally, the determining unit is further specifically configured to:
[0052] Determine, according to the speed of each preset particle at the start time of the interval time and the minimum collision time, a change position of each preset particle within the minimum collision time;
[0053] The starting position of each preset particle at the start time of the interval time and the changed position of each preset particle within the minimum collision time are summed to obtain the ending position of each preset particle at the end time of the minimum collision time.
[0054] Optionally, the determining unit is further configured to:
[0055] If the vertical distance between every two preset particles within the interval time is greater than or equal to the sum of the radii of every two preset particles, the end position of each preset particle at the end time of the interval time is determined according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the interval time.
[0056] On the other hand, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:
[0057] The memory is used to store a computer program and transmit the computer program to the processor;
[0058] The processor is configured to execute the method described in the above aspects according to the instructions in the computer program.
[0059] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, it is used to implement the method described in the above aspects.
[0060] Compared with the prior art, this application has at least the following advantages:
[0061] Using the technical solution of the embodiment of the present application, first, obtain t n Time and t n+1 The interval time between the moments; if the vertical distance between the two preset particles in the interval time is less than the sum of the radii of the two preset particles, determine the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle in the interval time, the starting position of each preset particle at the start time of the interval time, the ending position of each preset particle at the end time of the interval time, and the interval time; according to the collision time of each preset particle from the start time of the interval time, determine the two preset particles corresponding to the minimum collision time as the two target particles. When this method determines that the collision condition between particles is met in the interval time between the two moments, the minimum collision time is determined by calculating the collision time of each preset particle from the start time of the interval time, so that the two target particles that collide first in the interval time can be determined.
[0062] Then, for the minimum collision time, the post-collision speed of each target particle is determined according to the pre-collision speed of each target particle; the post-collision direction angle of each target particle is determined according to the collision surface direction angle of the two target particles; the end position of each preset particle at the end of the minimum collision time is determined according to the starting position of each preset particle at the beginning of the interval time, the speed of each preset particle at the beginning of the interval time and the minimum collision time. This method can calculate the post-collision speed and post-collision direction angle of the two target particles that collide first in the interval time, and calculate the end position of each preset particle at the end of the minimum collision time.
[0063] Finally, the interval time is updated according to the difference between the interval time and the minimum collision time, and the step of determining the collision time of each preset particle from the start time of the interval time is returned until the interval time is equal to 0, or the vertical distance between each two preset particles in the interval time is greater than or equal to the sum of the radii of each two preset particles. This method updates the interval time by subtracting the minimum collision time from the interval time, and repeats the aforementioned calculation steps until the interval time is 0 or the collision condition for collision between particles is not met in the interval time, so that the position of each preset particle can be calculated based on particle collision in the interval time. Based on this, this method takes into account the interaction between particles in the fluid, and when particles in the fluid collide with each other, the position of particles in the fluid can be calculated based on particle collision to determine the motion trajectory of particles in the fluid. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0065] Figure 1 A schematic diagram of a system framework involved in an application scenario in an embodiment of the present application;
[0066] Figure 2 A schematic diagram of a flow chart of a particle position determination method based on particle collision provided in an embodiment of the present application;
[0067] Figure 3 A schematic diagram of a particle colliding with a wall provided in an embodiment of the present application;
[0068] Figure 4 A schematic diagram of a collision between particles provided in an embodiment of the present application;
[0069] Figure 5A specific flow chart of a particle position determination method based on particle collision provided in an embodiment of the present application;
[0070] Figure 6 A schematic diagram of the structure of a particle position determination device based on particle collision provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0072] At present, CFD software usually considers the interaction between particles in the fluid and the surrounding fluid, calculates the position of particles in the fluid, and determines the motion trajectory of particles in the fluid. However, particles in the fluid may collide with each other, and the above method cannot calculate the position of particles in the fluid based on particle collision; that is, when particles in the fluid collide with each other, the above method cannot determine the motion trajectory of particles in the fluid.
[0073] In order to solve this problem, in an embodiment of the present application, when determining that the collision condition for the collision between particles is met within the interval time between two moments, the minimum collision time is determined by calculating the collision time of each preset particle from the start time of the interval time, so that the two target particles that collide first within the interval time can be determined; the post-collision speed and post-collision direction angle of the two target particles that collide first are calculated, and the end position of each preset particle at the end time of the minimum collision time is calculated; the interval time is updated by subtracting the minimum collision time from the interval time, and the aforementioned calculation steps are repeated until the interval time is 0 or the collision condition for the collision between particles is not met within the interval time, so that the position of each preset particle can be calculated based on the particle collision within the interval time. That is, considering the interaction between particles in the fluid, when the particles in the fluid collide with each other, the position of the particles in the fluid can be calculated based on the particle collision to determine the motion trajectory of the particles in the fluid.
[0074] For example, one of the scenarios of the embodiment of the present application may be applied to Figure 1In the scenario shown. The scenario includes a server 100, which is loaded with CFD software for calculating the position of particles in a fluid based on particle collisions. The server 100 executes the implementation provided by the embodiment of the present application through the CFD software, and can calculate the position of particles in a fluid based on particle collisions, so as to determine the motion trajectory of particles in the fluid when collisions occur between particles in the fluid.
[0075] First, in the above application scenario, although the action description of the implementation method provided in the embodiment of the present application is executed by the server 100; however, the embodiment of the present application is not limited in terms of the execution subject, as long as the actions disclosed in the implementation method provided in the embodiment of the present application are executed.
[0076] Secondly, the above scenario is only an example scenario provided by the embodiment of the present application, and the embodiment of the present application is not limited to this scenario.
[0077] The specific implementation of the particle position determination method based on particle collision and the related device in the embodiment of the present application is described in detail below with reference to the accompanying drawings through embodiments.
[0078] First, a specific implementation of the particle position determination method based on particle collision in the embodiment of the present application is described in detail through an embodiment.
[0079] See also Figure 2 , shows a schematic flow chart of a particle position determination method based on particle collision in an embodiment of the present application. In this embodiment, the method may include the following steps:
[0080] S201: Get t n Time and t n+1 The interval between moments.
[0081] S202: If the vertical distance between the two preset particles within the interval time is less than the sum of the radii of the two preset particles, determine the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle within the interval time, the start position of each preset particle at the start time of the interval time, the end position of each preset particle at the end time of the interval time, and the interval time.
[0082] S203: According to the collision time at the start time of each preset particle distance interval time, two preset particles corresponding to the minimum collision time are determined as two target particles.
[0083] In the related art, CFD software usually considers the interaction between particles in the fluid and the surrounding fluid, calculates the position of particles in the fluid, and determines the motion trajectory of particles in the fluid. However, particles in the fluid may collide with each other, and the above method cannot calculate the position of particles in the fluid based on particle collision; that is, when particles in the fluid collide with each other using the above method, the motion trajectory of particles in the fluid cannot be determined.
[0084] In the embodiment of the present application, in order to solve the above problems, first, the interaction between the particles in the fluid and the surrounding fluid is considered by CFD software according to the existing method, the position of the particles in the fluid is calculated, and the position of the particles at each time is recorded; at t n Time to t n+1 In the interval time between the moments, it is determined whether there are two preset particles whose vertical distance is less than the sum of the radii of the two preset particles. If so, it indicates that a collision occurs between the particles in the interval time. In this case, it is necessary to determine the collision time of each preset particle from the start time of the interval time through the collision position of each preset particle in the interval time, the start position of each preset particle at the start time of the interval time, the end position of each preset particle at the end time of the interval time, and the interval time. According to the collision time of each preset particle from the start time of the interval time, the two preset particles corresponding to the minimum collision time are determined as the two preset particles that collide first in the interval time, that is, the two target particles.
[0085] When determining that the collision condition for the collision between particles is met within the interval between two moments, the above S201-S203 determines the minimum collision time by calculating the collision time of each preset particle from the start moment of the interval time, thereby determining the two target particles that collide first within the interval time.
[0086] First, see Figure 3 , showing a schematic diagram of a particle colliding with a wall in an embodiment of the present application; wherein, in the stationary coordinate system (X, Y), v is the velocity of the particle before collision, v′ is the velocity of the particle after collision, and n is the unit normal vector of the wall. When the particle collides completely elastically with the wall, according to the laws of conservation of momentum and energy, the velocity of the particle along the wall direction remains unchanged after colliding with the wall, and the velocity along the wall normal direction is in the opposite direction, that is, the angle of incidence is equal to the angle of reflection, and the magnitude of the velocity before collision and the velocity after collision of the particle are equal. At this time, |v′|=|v|, α′=2γ-α, wherein |Ⅱ represents the magnitude of the vector, α is the direction angle of the particle before collision, α′ is the direction angle of the particle after collision, and γ is the direction angle of the wall. Then, in the above Figure 3 Based on Figure 4, showing a schematic diagram of a collision between particles in an embodiment of the present application, the particles are in a mass center coordinate system composed of two particles moving relative to a stationary coordinate system (X, Y) In this mass center coordinate system, the theory of completely elastic collision can be derived: the velocity vectors between the particles are parallel to each other but in opposite directions, and the velocity magnitude of the particles remains unchanged before and after the collision; where A is the vertical distance between the two particles (i.e., the distance between the parallel velocity vectors of the two particles), and B is the sum of the radii of the two particles. A<B indicates that the two particles collide. The mass center coordinate system composed of two particles The position of the particle can be obtained by converting the position and mass relationship of the particle in the stationary coordinate system (X, Y). The velocity of the particle can be obtained by converting the velocity and mass relationship of the particle in the stationary coordinate system (X, Y).
[0087] Based on this, as an example of S201-S203, the time interval is Δt, Δt=t n+1 -t n , if the vertical distance A between two preset particles within Δt is less than the radius and B of the two preset particles, determine the collision time t′ of each preset particle at the start time of Δt according to the collision position of each preset particle within Δt, the starting position of each preset particle at the start time of Δt, the ending position of each preset particle at the end time of Δt, and Δt; according to t′ of each preset particle at the start time of Δt, set t′ min The corresponding two preset particles are determined as two target particles. Assume t′ min The corresponding two preset particles are particle 1 and particle 2, and particle 1 and particle 2 are determined as two target particles, that is, the two target particles are particle 1 and particle 2.
[0088] S204: For the minimum collision time, determine the post-collision velocity of each target particle according to the pre-collision velocity of each target particle.
[0089] S205: Determine the post-collision direction angle of each target particle according to the collision surface direction angles of the two target particles.
[0090] S206: Determine the end position of each preset particle at the end time of the minimum collision time according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the minimum collision time.
[0091] In the embodiment of the present application, after executing the above S201-S203 to determine the two target particles that collide first within the interval time, it is necessary to consider the interaction between the two target particles, that is, for the minimum collision time, determine the post-collision speed of each target particle through the pre-collision speed of each target particle; determine the post-collision direction angle of each target particle through the collision surface direction angle of the two target particles; and determine the end position of each preset particle at the end time of the minimum collision time through the starting position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time and the minimum collision time.
[0092] The above S204-S206 can calculate the post-collision speed and post-collision direction angle of the two target particles that collide first, and calculate the end position of each preset particle at the end time of the minimum collision time.
[0093] As an example of S204-S206, based on the above S201-S203 example, the two target particles are particle 1 and particle 2, and the minimum collision time t′ is min According to the pre-collision velocity of particle 1, the post-collision velocity of particle 1 is determined, and according to the pre-collision velocity of particle 2, the post-collision velocity of particle 2 is determined; according to the collision surface direction angle of particle 1 and particle 2, the post-collision direction angle of particle 1 and the post-collision direction angle of particle 2 are determined. According to the starting position of each preset particle at the starting time Δt, the velocity of each preset particle at the starting time Δt and t′ min , determine each preset particle at t′ min The ending position of the end time.
[0094] S207: Update the interval time according to the difference between the interval time and the minimum collision time, and return to the step of determining the collision time of each preset particle from the start time of the interval time, until the interval time is equal to 0, or the vertical distance between every two preset particles within the interval time is greater than or equal to the sum of the radii of every two preset particles.
[0095] In the embodiment of the present application, after executing the above S204-S206 to determine the post-collision speed and post-collision direction angle of each target particle according to the minimum collision time, and determining the end position of each preset particle at the end time of the minimum collision time, it is necessary to update the interval time by the difference time between the interval time and the minimum collision time, and return to execute step S202 until the interval time is equal to 0, indicating that t is reached. n+1 At that moment, or, within the interval time, the vertical distance between every two preset particles is greater than or equal to the sum of the radii of every two preset particles, indicating that no collision between particles can occur within the interval time.
[0096] The above S207 updates the interval time by subtracting the minimum collision time from the interval time, and repeats the above calculation steps until the interval time is 0 or the collision condition for collision between particles is not met within the interval time, so that the position of each preset particle can be calculated based on particle collision within the interval time.
[0097] As an example of the above S207, based on the above S204-S206 examples, according to the interval time Δt and the minimum collision time t′ min The difference time is updated Δt, and the step of determining the collision time t′ of each preset particle starting from the distance Δt is returned until Δt is equal to 0, or the vertical distance A between every two preset particles within Δt is greater than or equal to the radius and B of every two preset particles.
[0098] Through various implementation methods provided in this embodiment, first, t is obtained. n Time and t n+1 The interval time between the moments; if the vertical distance between the two preset particles in the interval time is less than the sum of the radii of the two preset particles, determine the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle in the interval time, the starting position of each preset particle at the start time of the interval time, the ending position of each preset particle at the end time of the interval time, and the interval time; according to the collision time of each preset particle from the start time of the interval time, determine the two preset particles corresponding to the minimum collision time as the two target particles. When this method determines that the collision condition between particles is met in the interval time between the two moments, the minimum collision time is determined by calculating the collision time of each preset particle from the start time of the interval time, so that the two target particles that collide first in the interval time can be determined.
[0099] Then, for the minimum collision time, the post-collision speed of each target particle is determined according to the pre-collision speed of each target particle; the post-collision direction angle of each target particle is determined according to the collision surface direction angle of the two target particles; the end position of each preset particle at the end of the minimum collision time is determined according to the starting position of each preset particle at the beginning of the interval time, the speed of each preset particle at the beginning of the interval time and the minimum collision time. This method can calculate the post-collision speed and post-collision direction angle of the two target particles that collide first in the interval time, and calculate the end position of each preset particle at the end of the minimum collision time.
[0100] Finally, the interval time is updated according to the difference between the interval time and the minimum collision time, and the step of determining the collision time of each preset particle from the start time of the interval time is returned until the interval time is equal to 0, or the vertical distance between each two preset particles in the interval time is greater than or equal to the sum of the radii of each two preset particles. This method updates the interval time by subtracting the minimum collision time from the interval time, and repeats the aforementioned calculation steps until the interval time is 0 or the collision condition for collision between particles is not met in the interval time, so that the position of each preset particle can be calculated based on particle collision in the interval time. Based on this, this method takes into account the interaction between particles in the fluid, and when particles in the fluid collide with each other, the position of particles in the fluid can be calculated based on particle collision to determine the motion trajectory of particles in the fluid.
[0101] In the above embodiment, when S202 is specifically implemented, it is taken into account that for each preset particle, the preset particle passes through the collision time of the preset particle at the start time of the interval time, and moves from the starting position of the preset particle at the start time of the interval time to the collision position of the preset particle within the interval time; the preset particle passes through the interval time, and moves from the starting position of the preset particle at the start time of the interval time to the ending position of the preset particle at the end time of the interval time; therefore, the proportional relationship between the collision time and the interval time is equal to the ratio of the first difference to the second difference, the first difference represents the difference between the collision position of the preset particle within the interval time and the starting position of the preset particle at the start time of the interval time, and the second difference represents the difference between the ending position of the preset particle at the end time of the interval time and the starting position of the preset particle at the start time of the interval time.
[0102] Based on this, first, the difference between the collision position of each preset particle in the interval time and the starting position of each preset particle at the start time of the interval time is calculated to obtain the first difference corresponding to each preset particle; then, the difference between the end position of each preset particle at the end time of the interval time and the starting position of each preset particle at the start time of the interval time is calculated to obtain the second difference corresponding to each preset particle; finally, the collision time of each preset particle from the start time of the interval time is calculated by the proportional coefficient of the first difference corresponding to each preset particle and the second difference corresponding to each preset particle, and the interval time. That is, in an optional implementation of the embodiment of the present application, S202 determines the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle in the interval time, the starting position of each preset particle at the start time of the interval time, the end position of each preset particle at the end time of the interval time, and the interval time, including the following S2021-S2023:
[0103] S2021: performing a difference process on the collision position of each preset particle within the interval time and the starting position of each preset particle at the start time of the interval time, and determining a first difference value corresponding to each preset particle.
[0104] S2022: performing a difference process on the end position of each preset particle at the end time of the interval and the start position of each preset particle at the start time of the interval to determine a second difference value corresponding to each preset particle.
[0105] S2023: Determine the collision time of each preset particle from the start time of the interval time according to the proportionality coefficient between the first difference value corresponding to each preset particle and the second difference value corresponding to each preset particle, and the interval time.
[0106] As an example of S2021-S2023, based on the above S201-S203 examples, when the preset particle is particle 1, the collision position of particle 1 within Δt is r′, and the starting position of particle 1 at the start time of Δt is r 11 , the final position of particle 1 at the end of Δt is r 12 , and Δt, the calculation formula for t′ at the start time of particle 1 distance Δt is as follows:
[0107]
[0108] r 12 =r 11 +v1Δt
[0109] Where v1 is the velocity of particle 1 at the start time Δt.
[0110] In the above embodiment, when S204 is specifically implemented, considering that the post-collision velocity of the particle that undergoes a completely elastic collision is the same as the pre-collision velocity, when two target particles undergo a completely elastic collision, the post-collision velocity of each target particle is the same as the pre-collision velocity of each target particle. Therefore, in an optional implementation of the embodiment of the present application, S204 includes the following S2040: if two target particles undergo a completely elastic collision, the pre-collision velocity of each target particle is determined as the post-collision velocity of each target particle.
[0111] As an example of S2040, the pre-collision velocity of particle 1 is v1, and the pre-collision velocity of particle 2 is v2. Based on the above S204-S206 examples, if two target particles, i.e., particle 1 and particle 2, collide completely elastically, in the above Figure 4In the schematic diagram of the collision between particles shown, the magnitude of the post-collision velocity v′1 of particle 1 is determined as the magnitude of the pre-collision velocity v1 of particle 1, and the magnitude of the post-collision velocity v′2 of particle 2 is determined as the magnitude of the pre-collision velocity v2 of particle 2. That is, |v′1|=|v1|, |v′2|=|v2|.
[0112] In the above embodiment, when S205 is specifically implemented, considering that the post-collision direction angle of the particle that undergoes a completely elastic collision has a certain relationship with the collision surface direction angle, when the two target particles include a first particle and a second particle, for the first particle, the post-collision direction angle of the first particle can be calculated by the pre-collision direction angle of the first particle and the collision surface direction angle; for the second particle, the post-collision direction angle of the second particle can be determined by the post-collision direction angle of the first particle. Therefore, in an optional implementation of the embodiment of the present application, the two target particles include a first particle and a second particle, and S205 includes the following S2051-S2052:
[0113] S2051: If a completely elastic collision occurs between the first particle and the second particle, a post-collision direction angle of the first particle is determined according to the pre-collision direction angle of the first particle and the collision surface direction angle.
[0114] S2052: Determine the post-collision direction angle of the second particle according to the post-collision direction angle of the first particle.
[0115] As an example of S2051-S2052, based on the above S204-S206 examples, the first particle is particle 1, the second particle is particle 2, and in the above Figure 4 In the schematic diagram of the collision between particles shown, the pre-collision direction angle of particle 1 is α1, and the collision surface direction angle is γ. Based on α1 and γ of particle 1, the post-collision direction angle of particle 1 is determined to be α′1, that is, α′1=2γ-α1; based on α′1 of particle 1, the post-collision direction angle of particle 2 is determined to be α′2, that is, α′2=180°-α′1.
[0116] The collision surface direction angle is determined based on the ray where the vertical distance between the first particle and the second particle is located, the angle between the radius of the first particle and the second particle and the ray where the vertical distance is located, and the pre-collision direction angle of the first particle; therefore, firstly, the ray where the vertical distance is located and the angle between the radius and the ray where the vertical distance is located are calculated through the vertical distance between the first particle and the second particle, the sum of the radii of the first particle and the second particle, and the inverse cosine function to determine the preset angle; then, the sum of the pre-collision direction angle of the first particle and the preset angle is determined as the collision surface direction angle. That is, in an optional implementation of the embodiment of the present application, the step of determining the collision surface direction angle includes the following S1-S2:
[0117] S1: determining a preset angle according to a vertical distance between a first particle and a second particle, a sum of radii of the first particle and the second particle, and an arccosine function.
[0118] S2: The pre-collision direction angle of the first particle and the preset angle are summed to obtain the collision surface direction angle.
[0119] As an example of S1-S2, based on the above S2040 example, the formula for determining the collision surface direction angle γ is as follows:
[0120] γ=α1+β
[0121]
[0122] Where β is the preset angle, cos -1 (·) is the arccosine function, A is the vertical distance between particle 1 and particle 2, and B is the sum of the radii of particle 1 and particle 2.
[0123] In the above embodiment, when S206 is specifically implemented, first, the change position of each preset particle within the minimum collision time can be calculated through the speed of each preset particle at the start of the interval time and the minimum collision time; then, the end position of each preset particle at the end of the minimum collision time can be calculated through the start position of each preset particle at the start of the interval time and the change position of each preset particle within the minimum collision time. Therefore, in an optional implementation of the embodiment of the present application, S206 includes the following S2061-S2062:
[0124] S2061: Determine the change position of each preset particle within the minimum collision time according to the speed of each preset particle at the start time of the interval time and the minimum collision time.
[0125] S2062: summing the starting position of each preset particle at the start of the interval time and the changed position of each preset particle within the minimum collision time to obtain the ending position of each preset particle at the end of the minimum collision time.
[0126] As an example of S2061-S2062, based on the above S204-S206 example, for particle 1, particle 1 has a minimum collision time t′. min The calculation formula for the end position at the end time is as follows:
[0127] r′ 12 =r 11 +v1.t′ min
[0128] For particle 2, particle 2 has the minimum collision time t′ minThe calculation formula for the end position at the end time is as follows:
[0129] r′ 22 =r 21 +v2.t′ min
[0130] Among them, r′ 12 is the minimum collision time t′ of particle 1 min The ending position at the end time, r 11 is the starting position of particle 1 at the start time of Δt, v1 is the velocity of particle 1 at the start time of Δt; r′ 22 is the minimum collision time t′ of particle 2 min The ending position at the end time, r 21 is the starting position of particle 2 at the start time of Δt, and v2 is the velocity of particle 2 at the start time of Δt.
[0131] Furthermore, in the above embodiment, at t n Time to t n+1 During the interval between the moments, determine whether there are two preset particles whose vertical distance is less than the sum of the radii of the two preset particles. If not, that is, the vertical distance between each two preset particles is greater than or equal to the sum of the radii of each two preset particles, indicating that no collision between the particles is possible during the interval. In this case, the end position of each preset particle at the end of the interval can be determined directly through the start position of each preset particle at the start of the interval, the speed of each preset particle at the start of the interval, and the interval. Therefore, in an optional implementation of the embodiment of the present application, the method also includes S3: if the vertical distance between each two preset particles during the interval is greater than or equal to the sum of the radii of each two preset particles, determine the end position of each preset particle at the end of the interval according to the start position of each preset particle at the start of the interval, the speed of each preset particle at the start of the interval, and the interval.
[0132] See also Figure 5 , showing a specific flow chart of a particle position determination method based on particle collision in an embodiment of the present application; obtaining t n Time and t n+1 The interval time between the moments is used to determine whether there are two preset particles whose vertical distance is less than the sum of the radii of the two preset particles within the interval time. If not, the end position of each preset particle at the end time of the interval time is determined by the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time and the interval time. The end position of each preset particle at the end time of the interval time is determined by t n+1 Update at any time nmoment for subsequent iterative calculation; if so, determine the collision time of each preset particle from the start time of the interval time through the collision position of each preset particle in the interval time, the starting position of each preset particle at the start time of the interval time, the ending position of each preset particle at the end time of the interval time, and the interval time; determine the two preset particles corresponding to the minimum collision time as two target particles through the collision time of each preset particle from the start time of the interval time; for the minimum collision time, determine the post-collision speed of each target particle through the pre-collision speed of each target particle; determine the post-collision direction angle of each target particle through the collision surface direction angle of the two target particles; and determine the ending position of each preset particle at the end time of the minimum collision time through the starting position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time and the minimum collision time; update the interval time according to the difference time between the interval time and the minimum collision time; judge whether the interval time is equal to 0, if so, through t n+1 Update at any time n time for subsequent iterative calculations.
[0133] Then, the specific implementation method of the particle position determination device based on particle collision in the embodiment of the present application is described in detail through another embodiment.
[0134] See also Figure 6 , shows a schematic diagram of the structure of a particle position determination device based on particle collision in an embodiment of the present application. In this embodiment, the device may specifically include: an acquisition unit 601, a determination unit 602, and an update unit 603;
[0135] Acquisition unit 601, used to acquire t n Time and t n+1 The interval between moments
[0136] The determining unit 602 is used to determine the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle in the interval time, the start position of each preset particle at the start time of the interval time, the end position of each preset particle at the end time of the interval time, and the interval time if the vertical distance between the two preset particles in the interval time is less than the sum of the radii of the two preset particles;
[0137] The determination unit 602 is further configured to determine two preset particles corresponding to the minimum collision time as two target particles according to the collision time at the start time of each preset particle distance interval time;
[0138] The determination unit 602 is further used to determine the post-collision velocity of each target particle according to the pre-collision velocity of each target particle with respect to the minimum collision time;
[0139] The determination unit 602 is further used to determine the post-collision direction angle of each target particle according to the collision surface direction angles of the two target particles;
[0140] The determination unit 602 is further used to determine the end position of each preset particle at the end time of the minimum collision time according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the minimum collision time;
[0141] The updating unit 603 is used to update the interval time according to the difference time between the interval time and the minimum collision time, and return to the step of determining the collision time of each preset particle from the start time of the interval time until the interval time is equal to 0, or the vertical distance between every two preset particles within the interval time is greater than or equal to the sum of the radii of every two preset particles.
[0142] In an optional implementation of the embodiment of the present application, the determining unit 602 is specifically configured to:
[0143] Performing a difference processing on the collision position of each preset particle within the interval time and the starting position of each preset particle at the start time of the interval time, to determine a first difference value corresponding to each preset particle;
[0144] Performing a difference processing on the end position of each preset particle at the end time of the interval and the start position of each preset particle at the start time of the interval to determine a second difference value corresponding to each preset particle;
[0145] The collision time of each preset particle from the start time of the interval time is determined according to the proportionality coefficient between the first difference value corresponding to each preset particle and the second difference value corresponding to each preset particle, and the interval time.
[0146] In an optional implementation of the embodiment of the present application, the determining unit 602 is further specifically configured to:
[0147] If two target particles collide completely elastically, the pre-collision velocity of each target particle is determined as the post-collision velocity of each target particle.
[0148] In an optional implementation of the embodiment of the present application, the two target particles include a first particle and a second particle, and the determination unit 602 is further specifically configured to:
[0149] If the first particle and the second particle collide completely elastically, the post-collision direction angle of the first particle is determined according to the pre-collision direction angle of the first particle and the direction angle of the collision surface;
[0150] The post-collision direction angle of the second particle is determined based on the post-collision direction angle of the first particle.
[0151] In an optional implementation of the embodiment of the present application, the determining unit 602 is further specifically configured to:
[0152] Determine a preset angle according to a vertical distance between the first particle and the second particle, a sum of the radii of the first particle and the second particle, and an arccosine function;
[0153] The pre-collision direction angle of the first particle and the preset angle are summed to obtain the collision surface direction angle.
[0154] In an optional implementation of the embodiment of the present application, the determining unit 602 is further specifically configured to:
[0155] Determine the change position of each preset particle within the minimum collision time according to the speed of each preset particle at the start time of the interval time and the minimum collision time;
[0156] The starting position of each preset particle at the start of the interval time and the change position of each preset particle within the minimum collision time are summed to obtain the ending position of each preset particle at the end of the minimum collision time.
[0157] In an optional implementation of the embodiment of the present application, the determining unit 602 is further configured to:
[0158] If the vertical distance between every two preset particles in the interval time is greater than or equal to the sum of the radii of every two preset particles, the end position of each preset particle at the end time of the interval time is determined according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the interval time.
[0159] Through various implementation methods provided in this embodiment, first, t is obtained. n Time and t n+1 The interval time between the moments; if the vertical distance between the two preset particles in the interval time is less than the sum of the radii of the two preset particles, determine the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle in the interval time, the starting position of each preset particle at the start time of the interval time, the ending position of each preset particle at the end time of the interval time, and the interval time; according to the collision time of each preset particle from the start time of the interval time, determine the two preset particles corresponding to the minimum collision time as two target particles. When the device determines that the collision condition for the collision between particles is met in the interval time between the two moments, the minimum collision time is determined by calculating the collision time of each preset particle from the start time of the interval time, so that the two target particles that collide first in the interval time can be determined.
[0160] Then, for the minimum collision time, the post-collision speed of each target particle is determined according to the pre-collision speed of each target particle; the post-collision direction angle of each target particle is determined according to the collision surface direction angle of the two target particles; and the end position of each preset particle at the end of the minimum collision time is determined according to the starting position of each preset particle at the beginning of the interval time, the speed of each preset particle at the beginning of the interval time, and the minimum collision time. The device can calculate the post-collision speed and post-collision direction angle of the two target particles that collide first, and calculate the end position of each preset particle at the end of the minimum collision time.
[0161] Finally, the interval time is updated according to the difference between the interval time and the minimum collision time, and the step of determining the collision time of each preset particle from the start time of the interval time is returned until the interval time is equal to 0, or the vertical distance between each two preset particles in the interval time is greater than or equal to the sum of the radii of each two preset particles. The device updates the interval time by subtracting the minimum collision time from the interval time, and repeats the aforementioned calculation steps until the interval time is 0 or the collision condition for collision between particles is not met in the interval time, so that the position of each preset particle can be calculated based on particle collision in the interval time. Based on this, the device takes into account the interaction between particles in the fluid, and when collision occurs between particles in the fluid, the position of particles in the fluid can be calculated based on particle collision to determine the motion trajectory of particles in the fluid.
[0162] In addition, an embodiment of the present application further provides a computer device, the computer device comprising a processor and a memory:
[0163] The memory is used to store a computer program and transmit the computer program to the processor;
[0164] The processor is configured to execute the method described in the above embodiment according to the instructions in the computer program.
[0165] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, it is used to implement the method described in the above embodiment.
[0166] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0167] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0168] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The term "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0169] The above is only a preferred embodiment of the present application and does not constitute any formal limitation to the present application. Although the present application has been disclosed as above with a preferred embodiment, it is not intended to limit the present application. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present application using the methods and technical contents disclosed above without departing from the scope of the technical solution of the present application, or modify it into an equivalent embodiment of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application still fall within the scope of protection of the technical solution of the present application.
Claims
1. A particle position determination method based on particle collision, characterized in that: include: Get n Time and t n+1 the time interval between moments; If the vertical distance between the two preset particles within the interval time is less than the sum of the radii of the two preset particles, determine the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle within the interval time, the start position of each preset particle at the start time of the interval time, the end position of each preset particle at the end time of the interval time, and the interval time; According to the collision time of each preset particle from the start time of the interval time, two preset particles corresponding to the minimum collision time are determined as two target particles; For the minimum collision time, determining the post-collision velocity of each target particle according to the pre-collision velocity of each target particle; Determining a post-collision direction angle of each target particle according to the collision surface direction angles of the two target particles; Determine the end position of each preset particle at the end time of the minimum collision time according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the minimum collision time; The interval time is updated according to the difference time between the interval time and the minimum collision time, and the step of determining the collision time of each preset particle from the start time of the interval time is returned until the interval time is equal to 0, or the vertical distance between every two preset particles within the interval time is greater than or equal to the sum of the radii of every two preset particles.
2. The method according to claim 1, characterized in that Determining the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle within the interval time, the start position of each preset particle at the start time of the interval time, the end position of each preset particle at the end time of the interval time, and the interval time, comprises: Performing a difference processing on the collision position of each preset particle in the interval time and the starting position of each preset particle at the start time of the interval time, to determine a first difference value corresponding to each preset particle; Performing a difference processing on the end position of each preset particle at the end time of the interval and the start position of each preset particle at the start time of the interval to determine a second difference value corresponding to each preset particle; The collision time of each preset particle from the start time of the interval time is determined according to the proportionality coefficient between the first difference value corresponding to each preset particle and the second difference value corresponding to each preset particle, and the interval time.
3. The method according to claim 1, characterized in that Determining the post-collision velocity of each target particle according to the pre-collision velocity of each target particle comprises: If the two target particles collide completely elastically, the pre-collision velocity of each target particle is determined as the post-collision velocity of each target particle.
4. The method according to claim 1, characterized in that The two target particles include a first particle and a second particle, and determining the post-collision direction angle of each target particle according to the collision surface direction angles of the two target particles includes: If the first particle and the second particle collide completely elastically, determining the post-collision direction angle of the first particle according to the pre-collision direction angle of the first particle and the collision surface direction angle; The post-collision direction angle of the second particle is determined according to the post-collision direction angle of the first particle.
5. The method according to claim 4, characterized in that The step of determining the direction angle of the collision surface comprises: determining a preset angle according to a vertical distance between the first particle and the second particle, a sum of the radii of the first particle and the second particle, and an arccosine function; The pre-collision direction angle of the first particle and the preset angle are summed to obtain the collision surface direction angle.
6. The method according to claim 1, characterized in that The step of determining the end position of each preset particle at the end time of the minimum collision time according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the minimum collision time comprises: Determine, according to the speed of each preset particle at the start time of the interval time and the minimum collision time, a change position of each preset particle within the minimum collision time; The starting position of each preset particle at the start time of the interval time and the changed position of each preset particle within the minimum collision time are summed to obtain the ending position of each preset particle at the end time of the minimum collision time.
7. The method according to claim 1, characterized in that The method further comprises: If the vertical distance between every two preset particles within the interval time is greater than or equal to the sum of the radii of every two preset particles, the end position of each preset particle at the end time of the interval time is determined according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the interval time.
8. A particle position determination device based on particle collision, characterized in that: include: Get unit, determine unit and update unit; The acquisition unit is used to acquire t n Time and t n+1 the time interval between moments; The determining unit is used to determine the collision time of each preset particle from the start time of the interval time according to the collision position of each preset particle in the interval time, the start position of each preset particle at the start time of the interval time, the end position of each preset particle at the end time of the interval time, and the interval time if the vertical distance between the two preset particles in the interval time is less than the sum of the radii of the two preset particles; The determining unit is further configured to determine two preset particles corresponding to a minimum collision time as two target particles according to a collision time between each preset particle and a start time of the interval time; The determining unit is further configured to determine the post-collision velocity of each target particle according to the pre-collision velocity of each target particle with respect to the minimum collision time; The determination unit is further used to determine the post-collision direction angle of each target particle according to the collision surface direction angles of the two target particles; The determining unit is further used to determine the end position of each preset particle at the end time of the minimum collision time according to the start position of each preset particle at the start time of the interval time, the speed of each preset particle at the start time of the interval time, and the minimum collision time; The updating unit is used to update the interval time according to the difference time between the interval time and the minimum collision time, and return to the step of determining the collision time of each preset particle from the start time of the interval time until the interval time is equal to 0, or the vertical distance between every two preset particles within the interval time is greater than or equal to the sum of the radii of every two preset particles.
9. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1 to 7 according to the instructions in the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, it is used to implement the method according to any one of claims 1 to 7.