A numerical simulation method for projectile motion based on Fluent-UDF

By calculating the normal distance between the projectile and the wall of the launch tube and the rebound normal vector, and combining a six-degree-of-freedom model and an adaptive time step, the collision simulation problem of the projectile moving in the flow field inside the tube in the existing technology is solved, and accurate collision rebound simulation and simulation stability are achieved.

CN122333893APending Publication Date: 2026-07-03BEIJING AVIATION FEIFANG MACHINERY EQUIP FACTORY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING AVIATION FEIFANG MACHINERY EQUIP FACTORY
Filing Date
2026-04-15
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies cannot effectively simulate the physical process of collision and rebound when simulating projectiles moving at high speeds in a pipe flow field, leading to simulation failure.

Method used

By calculating the normal distance between the projectile surface and the launch tube wall, normal distances less than a preset threshold are selected as collision surfaces to determine whether the projectile has a collision tendency. The reflection velocity is calculated based on the contact bounce normal vector, the mesh is updated, and a six-degree-of-freedom model and adaptive time step adjustment are used to ensure simulation accuracy.

Benefits of technology

Accurate collision simulation of the projectile and the launch tube wall was achieved, avoiding mesh distortion and simulation failure, and improving the realism and stability of the simulation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122333893A_ABST
    Figure CN122333893A_ABST
Patent Text Reader

Abstract

This invention relates to a numerical simulation method for projectile motion based on Fluent-UDF, belonging to the field of fluid dynamics simulation technology. Specifically, it includes: a launch device model consisting of a launch tube and a projectile located inside the launch tube; initialization to obtain the mesh, discrete surfaces, and time steps; starting the simulation; calculating the straight-line distance between the projectile surface and all discrete surfaces at each time step; identifying discrete surfaces with normal distances less than a preset threshold as candidate contact surfaces; obtaining the contact bounce normal vector based on all candidate contact surfaces and their corresponding meshes; reading the current velocity of the projectile; determining whether the projectile has a collision tendency based on the current velocity and the contact bounce normal vector; updating the mesh after obtaining the current velocity of the projectile. This method solves the problem in existing technologies that cannot effectively simulate the physical process of collision bounce when a projectile moves at high speed in a flow field inside a tube.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fluid dynamics simulation technology, and in particular to a numerical simulation method for projectile motion based on Fluent-UDF. Background Technology

[0002] In the field of fluid dynamics simulation, ANSYS's Fluent software is commonly used. When simulating the motion of a projectile within a pipe flow field, the mainstream approach employs dynamic meshing and a six-degree-of-freedom (DOF) model. Dynamic meshing divides the simulation region into a grid, where each grid represents a discrete solution element reflecting the changes in the physical state of the projectile over time due to its motion within the flow field. This grid stores the physical quantities required for the simulation, including but not limited to pressure, velocity, temperature, and density. All grids reflect the distribution of physical quantities in the simulation region at each moment. During simulation, as the projectile moves through the flow field, the surrounding grid is updated in real time. Dynamic meshing adjusts the spatial positions of grid nodes or locally regenerates severely distorted grids to ensure the grid always fits the projectile surface, thus maintaining the accuracy of the flow field calculations. The six-DOF model defines the projectile as a rigid body driven by fluid dynamics, capable of three-dimensional translation and rotation under the force applied by the flow field.

[0003] In existing technologies, when simulating a six-degree-of-freedom model in Fluent, the projectile is simplified to a point mass, ignoring the shape of the projectile and the interaction between the fluid and the pipe wall within the flow field, thus failing to simulate the realistic collision physics. Existing dynamic mesh technology treats the projectile as a rigid body, and when simulating the collision process between the projectile and the launch tube wall, it typically employs either absolute collision or non-contact bounce. In simulating absolute collision, the projectile boundary mesh and the wall mesh rapidly approach each other, and the mesh nodes cannot deform and update in a very short time, directly leading to simulation failure. On the other hand, existing non-contact bounce simulations merely simulate the bounce mechanism, meaning that the projectile directly passes through the launch tube wall during the simulation, which is completely inconsistent with the physical process in the real world and fails to simulate the realistic collision bounce physics.

[0004] Therefore, there is an urgent need in this field for a method that can solve the problem that existing technologies cannot effectively simulate the physical process of collision and bounce when simulating projectiles moving at high speed in a pipe flow field. Summary of the Invention

[0005] In view of the above analysis, the present invention aims to provide a numerical simulation method for projectile motion based on Fluent-UDF, in order to solve one of the problems of existing technologies in simulating the physical process of collision and rebound when simulating projectiles moving at high speed in a pipe flow field.

[0006] This invention provides a numerical simulation method for projectile motion based on Fluent-UDF, the method specifically including: The launch device model, consisting of a launch tube and a projectile located inside the launch tube, is initialized to obtain a mesh, discrete surfaces, and time step. Start the simulation and execute the following procedure at each time step: S1: Calculate the straight-line distance between the surface of the projectile and the center points of all discrete surfaces, and find the contact surfaces whose straight-line distance is less than a preset threshold as candidate contact surfaces; S2: Obtain the contact bounce normal vector based on all candidate contact surfaces and corresponding meshes; S3: Read the current velocity of the projectile and determine whether the projectile has a collision tendency based on the current velocity and the contact bounce normal vector. If so, the reflection velocity is obtained based on the current velocity of the projectile and the contact bounce normal vector, and the reflection velocity is used as the current velocity of the projectile. Otherwise, the projectile's current velocity is not updated; S4: Update the mesh.

[0007] Based on a further improvement of the above method, the process of obtaining the mesh after initialization includes: creating a moving region and a non-moving region based on the transmitter, dividing the non-moving region into a rectangular structure mesh, and dividing the moving region into a triangular unstructured mesh.

[0008] Based on a further improvement of the above method, the initialization includes projectile initialization, which includes setting the projectile shape and motion mode.

[0009] Based on a further improvement of the above method, the motion mode is six degrees of freedom.

[0010] Based on a further improvement of the above method, the maximum value of the preset threshold is 1 / 10 of the feature length of the projectile, and the minimum value is 5 times the height of the outermost mesh of the wall boundary layer.

[0011] Based on a further improvement of the above method, the contact bounce normal vector is obtained based on all candidate contact surfaces and corresponding meshes through the following process, which specifically includes: The surface normal vector is obtained based on the mesh corresponding to each candidate contact surface; Invert the normal vectors of each face and then add them all together to get the total normal vector. The contact bounce normal vector is obtained by normalizing the total normal vector.

[0012] Based on a further improvement of the above method, the determination of whether a projectile has a collision tendency based on its current velocity and contact bounce normal vector specifically means that if the dot product of the current velocity and contact bounce normal vector is less than 0, then the projectile has a collision tendency.

[0013] Based on a further improvement of the above method, the reflection velocity is calculated using the following formula, which is specifically expressed as: In the formula, It is the reflection speed. It is the current velocity of the projectile. It is the elastic coefficient of the launch tube wall. It is the contact bounce normal vector.

[0014] Based on a further improvement of the above method, the time step is calculated using the following formula, which is specifically expressed as: In the formula, It is the time step. It is the diameter of the launch tube. It is the average velocity at the exit of the launch tube.

[0015] Based on the above method, a further improvement is made: when the grid update fails, the time step is halved and used as the time step, and execution returns to S1-S4.

[0016] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects: 1. By calculating the normal distance between the projectile surface and the launch tube wall, the positional relationship between the projectile and the launch tube wall is reflected in real time. Then, the normal distances that are less than a preset threshold are regarded as collisions between the projectile and the corresponding launch tube wall. The maximum value of the preset threshold is 1 / 10 of the characteristic length of the projectile, and the minimum value is 5 times the height of the outermost mesh of the wall boundary layer. This ensures that the distance between the projectile and the launch tube wall to be collided has a physical fit that fully meets the simulation requirements, without causing mesh distortion or negative meshes due to excessive compression of the mesh caused by simulating absolute collisions, thus preventing simulation failure. This solves the problem in the existing technology that can only simulate absolute collisions when simulating the collision process between the projectile and the launch tube wall, resulting in the inability of the moving mesh to be updated in time and causing simulation failure.

[0017] 2. Based on the corresponding mesh of each candidate contact surface, the corresponding surface normal vector is obtained. Then, the normal vectors of each surface are inverted and added together to obtain the total normal vector. After normalization, the contact bounce normal vector is obtained. Then, the contact bounce normal vector and the current velocity of the projectile are multiplied by a dot product. When the dot product result is less than 0, it is determined that the projectile has a collision tendency. Furthermore, the reflection velocity is obtained based on the current velocity and the contact bounce normal vector. Compared with the existing technology, the simulation results are closer to the real physical process.

[0018] 3. The time step is calculated using the tube diameter as the characteristic length and the average velocity at the tube exit. Compared with the existing technology that relies solely on manual calculation, this method improves the efficiency of obtaining the time step. The resulting time step balances simulation accuracy and computational efficiency, exhibiting better stability and robustness. When mesh updates fail, the time step is halved, providing an adaptive repair mechanism for the simulation process. If a mesh update fails at a certain time step, the simulation can be iteratively retried by adjusting the time step and executing S1-S4 until the time step is adjusted appropriately. Once the mesh update is successful, the subsequent simulations can continue with the updated time step.

[0019] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description

[0020] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. Figure 1 This is a flowchart of the numerical simulation method for projectile motion according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the simulation model structure in an embodiment of the present invention; Figure 3 This is a schematic diagram of the moving region mesh and the non-moving region mesh according to an embodiment of the present invention; Figure 4a This is a graph showing the vertical velocity variation of a simulated projectile colliding with the wall of a launch tube, according to an embodiment of the present invention. Figure 4b This is a graph showing the vertical displacement change of a simulated projectile colliding with the wall of a launch tube, according to an embodiment of the present invention.

[0021] Figure Labels Q1 - Projectile; Q2 - Launch tube; Q2a - Launch tube wall; Q2b - Launch tube outlet; Q2c - Power source; Q3 - External flow field region; Q4 - Internal flow field region; Q5 - Triangular unstructured mesh in moving region; Q6 - Rectangular mesh in non-moving region. Detailed Implementation

[0022] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0023] A specific embodiment of the present invention discloses a numerical simulation method for projectile motion based on Fluent-UDF, such as... Figure 1 As shown.

[0024] The method specifically includes: The launch device model, consisting of a launch tube and a projectile located inside the launch tube, is initialized to obtain a mesh, discrete surfaces, and time step. Start the simulation and execute the following procedure at each time step: S1: Calculate the straight-line distance between the surface of the projectile and the center points of all discrete surfaces, and find the contact surfaces whose straight-line distance is less than a preset threshold as candidate contact surfaces; S2: Obtain the contact bounce normal vector based on all candidate contact surfaces and corresponding meshes; S3: Read the current velocity of the projectile and determine whether the projectile has a collision tendency based on the current velocity and the contact bounce normal vector. If so, the reflection velocity is obtained based on the current velocity of the projectile and the contact bounce normal vector, and the reflection velocity is used as the current velocity of the projectile. Otherwise, the projectile's current velocity is not updated; S4: Update the mesh.

[0025] Typically, before using Fluent software to simulate the motion of a projectile inside a pipe, the following steps must be completed: Step 1: Create a model of the launching device.

[0026] Specifically, a simulation model of the launching device is established, including a launch tube Q2 and a projectile Q1 located inside the launch tube Q2. One end of the launch tube Q2 is equipped with a power source Q2c to provide initial velocity to the projectile Q1, and the other end of the launch tube Q2 is an outlet Q2b. This step mainly involves defining the specific structure, components, and shapes of each component of the simulation space by establishing a simulation model.

[0027] Specifically, such as Figure 2As shown, the launch tube Q2 is a regular cylindrical tube with one end closed and the other end open. The center point of the closed end face inside the tube serves as the starting point for the projectile Q1.

[0028] The inner flow field region Q4 is set inside the launch tube Q2, and the outer flow field region Q3 is set outside the launch tube. The inner flow field region Q4 and the outer flow field region Q3 together form the simulation space.

[0029] Step 2: Initialize the launch device model.

[0030] Next, the launch device model needs to be initialized to obtain the mesh, discrete surfaces, and time step.

[0031] In principle, Fluent software simulates the motion of a projectile Q1 in the flow field region Q4 inside the launch tube and the flow field region Q3 outside the launch tube. Essentially, it is a process of periodically solving the position, velocity, and state of the projectile Q1 in the flow field of the launch tube within the simulation space, based on the physical motion mode algorithm of the simulation target and the set simulation start conditions.

[0032] The inside and outside of the launch tube are filled with fluid flow fields.

[0033] In one specific embodiment, the fluid is a gas, and the flow field is a gas flow field; In one specific embodiment, the fluid is a liquid, and the flow field is a liquid flow field; In one specific embodiment, the process is a gas-liquid mixed flow field. Specifically, part of the emitter tube is in a gas flow field and the rest is in a liquid flow field.

[0034] During initialization, based on the flow field type, the corresponding flow field fluid motion model and flow field solver are set in Fluent.

[0035] Specifically, fluid motion models typically employ the Navier-Stokes (NS) equations. Based on the type of fluid in the flow field, a corresponding fluid-aided model is selected and combined with the NS equations to meet the solution requirements. The NS equations are a commonly used motion model in fluid motion simulation. Combining them with a corresponding fluid-aided model aims to incorporate turbulence factors generated within the launch tube, thereby obtaining a fluid motion model that more closely resembles the real flow field environment. If the simulation environment consists entirely of liquid or gas flow fields, then k- The turbulence model is combined with the Navier-Stokes equations. If it is a gas-liquid mixed flow field, the VOF multiphase flow model is combined with the Navier-Stokes equations.

[0036] Specifically, for gas flow fields, a density solver is set; for liquid flow fields, the solver is set to use the Couple algorithm under velocity-pressure coupling. The turbulence model, Navier-Stokes equations, and Couple algorithm are all implemented using existing technologies in this field, and will not be described in detail here.

[0037] Furthermore, the process of obtaining the mesh after initialization includes: creating a moving region and a non-moving region based on the transmitter Q2, dividing the non-moving region into a rectangular structured mesh, and dividing the moving region into a triangular unstructured mesh.

[0038] In principle, the projectile Q1 moves in the launch tube, from the flow field region inside the launch tube to the flow field region outside the launch tube. Due to the limited space inside the tube and the open space outside the tube, the projectile Q1 has a significant impact on the flow field Q4 inside the launch tube and the flow field Q3 outside the launch tube along its path. The impact on other regions can be basically ignored.

[0039] In this embodiment, the motion regions of the flow field Q4 inside the launch tube and the flow field Q3 outside the launch tube can both be divided into triangular unstructured meshes by the path of the projectile. This can handle the complex geometric changes caused by the motion of the projectile Q1 and improve the adaptability during simulation calculations. The non-motion regions use rectangular meshes, which offer good orthogonality in simulation calculations, low numerical dissipation, and high computational accuracy. Figure 3 As shown, by dividing the moving region into a triangular unstructured mesh Q5 (marked in blue) and the non-moving region into a rectangular mesh Q6 (marked in green), the motion of the projectile can only affect the local flow field during simulation. The changes in the geometry of the non-moving region and the physical quantities in the flow field can be ignored, thereby reducing the amount of simulation computation and improving the efficiency of the simulation process.

[0040] After initializing and obtaining the mesh, it is necessary to verify the mesh's independence and stability, specifically including: SA1: Set the initial velocity and direction of motion of the projectile for verification; SA2: The current grid is uniformly subdivided to obtain an updated grid, and the number of updated grids is twice the number of current grids; SA3: Run the verification simulation and use the velocity of the projectile as the current verification velocity as the velocity of the launch tube exit. SA4: Run the verification simulation again and use the velocity of the projectile as the next verification velocity as the velocity of the projectile passing through the launch tube exit again. SA5: Calculate the verification deviation between the current verification speed and the next speed, and determine whether the deviation is less than 2%. If so, update the mesh output to the mesh obtained after initialization. Otherwise, use the next speed as the current speed, use the updated grid as the current grid, and return to execute SA2-SA5.

[0041] Furthermore, the average velocity at the launch tube exit is calculated using the following formula, which is specifically expressed as: In the formula, It is the average velocity at the exit of the launch tube. The coordinates are The fluid velocity at the outlet cross-section of the launch tube. The coordinates of the launch tube exit section are The grid area.

[0042] During implementation, the mesh obtained after initialization is ultimately presented as a mesh file and imported into the Fluent software.

[0043] Once all initialization processes are complete, run the mesh file. Fluent uses the finite volume method by default to discretize the simulation region, generating a dynamic mesh network composed of uniformly distributed mesh cells, and obtaining discrete surfaces based on the edges or surfaces of each mesh cell.

[0044] In principle, discrete surfaces are generated during the mesh generation process, naturally formed by the edges or faces of mesh cells, and serve as the basic units for flow field calculation, contact detection, and normal vector solution.

[0045] Unless otherwise specified, all velocities in this embodiment are vectors.

[0046] Then, initialize the projectile and select the corresponding motion model.

[0047] Furthermore, the initialization includes the initialization of the projectile Q1, which includes setting the shape and motion mode of the projectile Q1.

[0048] Specifically, the shape of the projectile Q1 is set to a solid rigid sphere to avoid increasing the simulation complexity due to non-spherical shapes.

[0049] In principle, the uneven distribution of rotational inertia of a non-spherical object can lead to complex changes in its trajectory. Furthermore, determining the contact surface with the inner wall of the launch tube during a collision is more complex and requires a higher level of mesh refinement, which is not the problem this embodiment aims to solve. By setting the projectile Q1 as a solid rigid sphere, all rotational inertia passing through the center of mass to the edge of the sphere are equal, avoiding the influence of the projectile's irregular shape on its trajectory. The only factors affecting the trajectory of the projectile itself are its mass and velocity.

[0050] Furthermore, the motion mode is six degrees of freedom.

[0051] Specifically, in order to simulate real-world scenarios, it is also necessary to initialize the environmental factors that affect the trajectory of the projectile Q1, including gravity, flow field resistance, and flow field buoyancy. The motion mode of the projectile Q1 is set to six degrees of freedom, which can fully simulate the translation, rotation, attitude change of the projectile in the flow field, as well as the complex trajectory changes such as rebound, deflection, and tilt that occur after collision.

[0052] Furthermore, the initialization of projectile Q1 also includes setting the mass, initial velocity, initial position, and motion trend of projectile Q1.

[0053] Furthermore, the projectile Q1 tends to move along the direction of the launch tube outlet Q2b.

[0054] Specifically, the projectile Q1 is initially positioned on the closed surface at one end of the launch tube.

[0055] Furthermore, the initialization also includes initiating contact detection.

[0056] Specifically, in this embodiment, contact detection is achieved by running a UDF (User Defined Function) loaded into Fluent, and the detection process is repeated with the same time step.

[0057] Furthermore, the time step is calculated using the following formula, which is specifically expressed as: In the formula, It is the time step. It refers to the diameter of the launching tube.

[0058] Specifically, in this embodiment, the diameter of the launch tube is taken as the characteristic length, the average velocity at the launch tube exit is taken as the characteristic velocity, and the result obtained by dividing the characteristic length by the characteristic velocity is further reduced by 10. -2 The time step is calculated to ensure that the displacement of the projectile at each time step is less than the mesh size, thereby meeting the mesh stability requirements while balancing computational accuracy and efficiency.

[0059] Next, import the UDF into Fluent and start the simulation.

[0060] A UDF (User Defined Function) is a function developed by the user that can be imported into Fluent for collision detection.

[0061] After starting the simulation, the initial position coordinates of the projectile at one closed end inside the launch tube, the preset initial velocity of the projectile, the direction of the projectile's motion tendency, and the initial velocity and pose of the launch tube are used as initial values. The numerical simulation calculation is started using the selected fluid motion model and the current value of the discretized moving mesh.

[0062] The following procedure is executed at each time step: S1: Calculate the straight-line distance between the surface of the projectile and the center points of all discrete surfaces, and identify discrete surfaces whose straight-line distance is less than a preset threshold as candidate contact surfaces.

[0063] Since numerical simulation cannot realize the absolute contact collision process between the projectile and the launch tube, this embodiment uses non-contact bounce simulation, that is, setting a preset threshold, and considering a collision as occurring when the straight-line distance between the center point of the projectile surface and the center point of the launch tube wall is less than the preset threshold.

[0064] Furthermore, the maximum value of the preset threshold is 1 / 10 of the projectile feature length, and the minimum value is 5 times the height of the outermost mesh of the wall boundary layer.

[0065] Specifically, the outermost mesh of the wall boundary layer usually refers to the mesh corresponding to the discrete surface generated on the wall of the launch tube. When a collision occurs, it is assumed that the surface of the projectile and the outermost mesh of the wall boundary layer are in contact. Therefore, the preset threshold cannot be set too small in order to adapt to the mesh size, otherwise it may cause the UDF to fail to detect the mesh and penetrate the wall, resulting in simulation failure. Therefore, a minimum value of 5 times the height of the outermost mesh of the wall boundary layer is a preferred empirical value. The maximum value of the preset threshold is 1 / 10 of the characteristic length of the projectile. This is to avoid the projectile being considered to have collided and bounced when the distance between it and the contact surface is too far, which would cause the simulation effect to differ too much from the real scene. Using 1 / 10 of the characteristic length of the projectile as the maximum value of the preset threshold is a preferred empirical value.

[0066] Choosing an appropriate preset threshold is key to collision detection and successful simulation. Compared with existing technologies, the preset threshold in this embodiment ensures that the distance between the projectile and the wall of the launch tube where the collision is to occur has a physical fit that fully meets the simulation requirements, without causing the simulation to fail due to excessive compression of the mesh caused by an absolute collision.

[0067] During implementation, before loading the UDF into Fluent, starting the UDF, and before simulation, any value within a preset threshold range is pre-set. During simulation, the UDF identifies candidate contact surfaces at each time step based on the preset threshold and the normal distances to the projectile surface and all contact surfaces calculated by Fluent.

[0068] S2: Obtain the contact bounce normal vector based on all candidate contact surfaces and corresponding meshes.

[0069] Furthermore, the contact bounce normal vector is obtained based on all candidate contact surfaces and corresponding meshes through the following process, which specifically includes: The surface normal vector is obtained based on the mesh corresponding to each candidate contact surface; Invert the normal vectors of each face and then add them all together to get the total normal vector. The contact bounce normal vector is obtained by normalizing the total normal vector.

[0070] Specifically, the purpose of step S2 is to obtain the direction of the bounce after the projectile collides with the candidate contact surface. Since there is more than one candidate contact surface, the surface normal vector of the mesh is by default perpendicular to the discrete surface and is in the mesh, which is away from the projectile. Therefore, after obtaining the surface normal vectors of the mesh corresponding to all candidate contact surfaces, they are inverted to obtain the surface normal vector of each candidate contact surface facing the projectile. Then, the surface normal vectors of all the inverted candidate contact surfaces are superimposed to obtain the total normal vector including the bounce direction after the collision. The total normal vector is then normalized to obtain the contact bounce normal vector that only includes the bounce direction.

[0071] S3: Read the current velocity of the projectile and determine whether the projectile has a collision tendency based on the current velocity and the contact bounce normal vector. If so, the reflection velocity is obtained based on the current velocity of the projectile and the contact bounce normal vector, and the reflection velocity is used as the current velocity of the projectile. Otherwise, the projectile's current velocity will not be updated.

[0072] Fluent first solves the flow field control equations at each time step to obtain the surface forces of the projectile. In one specific embodiment, in the gas flow field, aerodynamic forces, such as pressure and viscous forces, are attached to the surface of the projectile; In one specific embodiment, in the liquid flow field, the surface of the projectile is subject to hydrodynamic forces, such as pressure, buoyancy, and viscous forces. Fluent substitutes the surface forces of the projectile into the six-free-body rigid body motion equations, calculates the real-time acceleration through numerical integration, and then obtains the real-time velocity of the projectile from the acceleration integration.

[0073] Specifically, UDF reads the real-time velocity of the projectile and the real-time velocity of the launch tube. The real-time velocity of the projectile and the real-time velocity of the launch tube are calculated in real time by Fluent simulation. The current velocity of the projectile is obtained by subtracting the real-time velocity of the projectile and the real-time velocity of the launch tube. The current velocity of the projectile is the relative velocity with the launch tube as the reference frame.

[0074] Furthermore, the statement that the projectile has a collision tendency is determined based on its current velocity and the contact bounce normal vector. Specifically, if the dot product of the projectile's current velocity and the contact bounce normal vector is less than 0, then the projectile has a collision tendency.

[0075] Specifically, this step involves determining whether the direction of the projectile's current velocity and the contact bounce normal vector are relative by using a dot product operation. If the result of the dot product operation between the projectile's current velocity and the contact bounce normal vector is less than 0, it indicates that the two directions are relative, which means there is a tendency to collide, or that a collision has occurred. The reflection velocity is then obtained based on the projectile's current velocity and the contact bounce normal vector.

[0076] Furthermore, the reflection velocity is calculated using the following formula, which is specifically expressed as follows: In the formula, It is the reflection speed. It is the current velocity of the projectile. It is the elastic coefficient of the launch tube wall. It is the contact bounce normal vector.

[0077] In principle, the rebound velocity of the projectile after its current velocity collides with the wall of the launch tube is in the same direction as the projectile's current velocity tangentially but opposite in the normal direction. Since the projectile is a rigid body, the change in the normal velocity is related to the elastic coefficient of the launch tube wall.

[0078] Therefore, the reflection velocity is obtained by subtracting the velocity loss caused by the inverse superposition of the launch tube wall elastic coefficient and the current velocity normal of the projectile from its current velocity. The launch tube wall elastic coefficient is a preset parameter before running the simulation.

[0079] The reflection velocity is used as the current velocity of the projectile and updated in Fluent for simulation at the next time step; If it is determined that there is no collision trend, that is, the projectile and the launch tube wall have not collided in the current time step, the current velocity of the projectile does not need to be updated, and Fluent continues the simulation for the next time step.

[0080] S4: Update the mesh.

[0081] At the current time step, Fluent completes the simulation calculations, and the UDF performs collision detection. Fluent then updates the mesh. This is done to update the mesh's position coordinates, moving mesh volume, surface normal vectors, mesh velocity vectors, mesh mass, and physical quantities such as turbulence, density, and forces based on the projectile's motion changes at the current time step, in order to perform simulation and collision detection for the next time step. The calculation of physical quantities during mesh updates is automatically executed by various built-in algorithms in Fluent, as well as pre-selected fluid motion and turbulence models. Those skilled in the art should understand the principle of mesh updates, so it will not be elaborated further.

[0082] In this embodiment, the most common cause of mesh update failure is an excessively large time step. An excessively large time step will cause the displacement of the projectile in a single time step to significantly exceed the characteristic scale of the local mesh cell. When updating the node positions, the moving mesh needs to be stretched or squeezed significantly, which can easily cause sharp distortion of the mesh cells, negative volume, or node overlap. Especially in the case of sudden velocity changes after collision and bounce, an excessively large time step will cause the mesh deformation to exceed the correction capability of Fluent's built-in smoothing algorithm, ultimately leading to the failure of the moving mesh update.

[0083] If this happens, the time step needs to be adjusted.

[0084] Furthermore, if the grid update fails, the time step is halved and used as the new time step, and execution returns to S1-S4.

[0085] If the mesh update fails at the current time step, the time step is halved and used as the new time step. Then, the process of executing S1-S4 is repeated. This iterative update process ensures that if the mesh update fails after executing the current time step, the current time step is halved and S1-S4 is executed again until a suitable time step is found that allows the mesh update to succeed after executing S1-S4. This ensures the continuity of the simulation data and prevents simulation failure due to mesh update failure.

[0086] Figure 4a The vertical velocity variation curve of the simulated projectile colliding with the launch tube wall, generated in this embodiment, is shown. Figure 4b The vertical displacement curve of the simulated projectile colliding with the launch tube wall generated in this embodiment is shown. It can be seen that the simulation results are very close to the real scene.

[0087] This embodiment discloses a numerical simulation method for projectile motion based on Fluent-UDF, the method specifically including: The launch device model, consisting of a launch tube and a projectile located within the launch tube, is initialized to obtain a mesh, discrete surfaces, and time step. The cylindrical tube, open at one end and closed at the other, is divided into an inner flow field region and an outer flow field region. A power source is placed inside the closed end of the launch tube as the initial position for the projectile simulation. The corresponding flow field motion model and flow field solver are set according to the flow field type. The moving region created by the launch tube is divided into a triangular unstructured mesh, and the non-moving region is divided into a rectangular structured mesh, thus completing the mesh initialization. Mesh independence and stability are then assessed. The average velocity at the launch tube exit, obtained after verification, was used as the characteristic velocity. A mesh file was generated and imported into Fluent. The projectile was initialized as a rigid sphere to avoid the influence of its shape on the trajectory, ensuring that only mass and velocity affected its trajectory. The motion mode was set to six degrees of freedom to fully simulate the projectile's translation, rotation, attitude changes, and trajectory changes after collision, rebound, and deflection in the flow field. The initial velocity and motion trend of the projectile were set, and the projectile diameter was used as the characteristic length. Finally, environmental factors were set according to the flow field type, thus completing the initialization of the simulation model. Next, the UDF for contact detection was loaded into Fluent and started, where the time step was obtained based on the characteristic length and characteristic velocity.Afterwards, the simulation is started. Fluent uses the finite volume method to discretize the mesh based on all initial settings and imported mesh files, and then starts dynamic meshing to obtain all discrete surfaces. At each time step, the following steps are performed: based on the projectile's motion trend and location, all contact surfaces are identified from the discrete surfaces. Then, the normal distance between the projectile and all contact surfaces is calculated, and contact surfaces with normal distances less than a preset threshold are selected as candidate contact surfaces. The numerical simulation uses non-contact bounce, with the maximum preset threshold being 1 / 10 of the projectile's characteristic length and the minimum being 5 times the height of the outermost mesh layer of the wall boundary layer. This ensures that the distance between the projectile and the launch tube wall where the collision is to occur has a physical fit that fully meets the simulation requirements, without causing excessive mesh compression due to an absolute collision simulation, which could lead to mesh distortion or negative meshes and simulation failure. Then, based on the... The method uses alternative contact surfaces and corresponding meshes to obtain contact bounce normal vectors. Then, based on the dot product of the current velocity of the projectile and the contact bounce normal vector (resulting in a value less than 0), a collision is considered. For cases where a collision occurs, the reflection velocity is calculated using the current velocity of the projectile and the contact bounce normal vector, and this reflection velocity replaces the current velocity of the projectile. For cases where no collision occurs, the current velocity of the projectile remains unchanged. Finally, the mesh is updated to obtain the physical quantity calculation results required for the next time step simulation. If the mesh update fails, the collision detection and projectile velocity update steps are iteratively verified by halving the time step and re-executing the steps until the mesh update is successful. The final time step and the obtained current velocity of the projectile are then used to continue the subsequent simulation, ensuring the continuity of the simulation data and avoiding simulation failure due to mesh update failure. This embodiment solves the problem that existing technologies cannot effectively simulate the physical process of collision and bounce when simulating a projectile moving at high speed in a pipe flow field.

[0088] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0089] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A numerical simulation method for projectile motion based on Fluent-UDF, characterized in that, The method specifically includes: The launch device model, consisting of a launch tube and a projectile located inside the launch tube, is initialized to obtain a mesh, discrete surfaces, and time step. Start the simulation and execute the following procedure at each time step: S1: Calculate the straight-line distance between the surface of the projectile and the center points of all discrete surfaces, and find the contact surfaces whose straight-line distance is less than a preset threshold as candidate contact surfaces; S2: Obtain the contact bounce normal vector based on all candidate contact surfaces and corresponding meshes; S3: Read the current velocity of the projectile and determine whether the projectile has a collision tendency based on the current velocity and the contact bounce normal vector. If so, the reflection velocity is obtained based on the current velocity of the projectile and the contact bounce normal vector, and the reflection velocity is used as the current velocity of the projectile. Otherwise, the projectile's current velocity is not updated; S4: Update the mesh.

2. The numerical simulation method for projectile motion based on Fluent-UDF according to claim 1, characterized in that, The initialization process for obtaining the mesh includes: creating an inner flow field region and an outer flow field region based on the launch tube, wherein the outer flow field region includes a moving region and a non-moving region, dividing the non-moving region into a rectangular structured mesh, and dividing the moving region into a triangular unstructured mesh.

3. The numerical simulation method for projectile motion based on Fluent-UDF according to claim 1, characterized in that, The initialization includes projectile initialization, which includes setting the projectile shape and motion mode.

4. The numerical simulation method for projectile motion based on Fluent-UDF according to claim 3, characterized in that, The motion mode is six degrees of freedom.

5. The numerical simulation method for projectile motion based on Fluent-UDF according to claim 1, characterized in that, The maximum value of the preset threshold is 1 / 10 of the feature length of the projectile, and the minimum value is 5 times the height of the outermost mesh of the wall boundary layer.

6. The numerical simulation method for projectile motion based on Fluent-UDF according to claim 5, characterized in that, The contact bounce normal vector is obtained based on all candidate contact surfaces and corresponding meshes through the following process, which specifically includes: The surface normal vector is obtained based on the mesh corresponding to each candidate contact surface; Invert the normal vectors of each face and then add them all together to get the total normal vector. The contact bounce normal vector is obtained by normalizing the total normal vector.

7. The numerical simulation method for projectile motion based on Fluent-UDF according to claim 6, characterized in that, The method of determining whether a projectile has a collision tendency based on its current velocity and contact bounce normal vector specifically means that if the dot product of the current velocity and the contact bounce normal vector is less than 0, then the projectile has a collision tendency.

8. The numerical simulation method for projectile motion based on Fluent-UDF according to claim 7, characterized in that, The reflection velocity is calculated using the following formula, which is specifically expressed as follows: In the formula, It is the reflection speed. It is the current velocity of the projectile. It is the elastic modulus of the launch tube wall. It is the contact bounce normal vector.

9. The numerical simulation method for projectile motion based on Fluent-UDF according to claim 1, characterized in that, The time step is calculated using the following formula, which is specifically expressed as follows: In the formula, It is the time step. It is the diameter of the launch tube. It is the average velocity at the exit of the launch tube.

10. The numerical simulation method for projectile motion based on Fluent-UDF according to claim 1, characterized in that, If the grid update fails, the time step is halved and used as the time step, and execution returns to S1-S4.