Method and device for simulating external force driven scene flow based on SPH of CCNN
By transforming the time-propulsion format of smooth particle dynamics and introducing continuous convolutional neural networks, the problem of inefficiency of traditional simulation methods is solved, and efficient external force-driven scene flow simulation is achieved.
Patent Information
- Application Number
- CN202411426001.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-14
AI Technical Summary
Traditional numerical simulation methods of flow scenarios are inefficient when dealing with complex flow phenomena driven by external forces, especially when frequent adjustment of the flow field geometry and fluid viscosity are required.
Using CCNN-based SPH simulation method, the time-propulsion format of smooth particle dynamics is modified, and the displacement of fluid particles is corrected using continuous convolutional neural network, and the predicted velocity, fluid viscosity, wall normal and displacement correction of fluid particles is obtained through data pre-training. Mapping relationship of values.
The numerical simulation efficiency of scene flow is improved, a large time step is allowed to be used, the calculation amount is reduced, and the scene flow under the action of external forces is quickly simulated with a certain accuracy.
Smart Images

Figure CN118940644B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence, and relates to a method and a device for simulating external force driven scene flow based on SPH of CCNN. Background Art
[0002] The simulation of fluid flow driven by external forces in three-dimensional space, such as flash floods, dam breaches, and liquid droplets falling on complex surfaces, is a research topic of concern to multiple disciplines such as environment, civil engineering, materials, and even computer vision.
[0003] Since traditional numerical simulation methods of flow scenes are based on the solution of complex mathematical equations and initial and boundary conditions, the step size of their time evolution is often limited by the Courant-Friedrchs-Lewy conditions, which makes the simulation efficiency low. Especially when a large number of small-scale modifications to the flow field geometry are required during the research process, or the fluid viscosity needs to be repeatedly adjusted and optimized, high requirements are placed on the efficiency of numerical simulation of flow scenes under a certain accuracy.
[0004] Therefore, a method is needed to obtain the implicit relationship between the flow field geometric characteristics and fluid viscosity and the actual velocity field by learning existing similar scene flow simulation data, so that this relationship can be applied to continuously correct the velocity field during the large time step numerical simulation process to quickly obtain the scene flow simulation results. Summary of the invention
[0005] In view of the above technical problems, the present invention proposes a method and device for simulating external force-driven scene flow based on CCNN SPH, so as to achieve the purpose of quickly simulating scene flow under the action of external force and solve the efficiency problem of numerical simulation of flow scene.
[0006] The technical solution adopted by the present invention is:
[0007] A method for simulating external force driven scene flow based on SPH (Smoothed Particle Hydrodynamics) of CCNN (Continuous Convolutional Neural Network), the method comprising:
[0008] (1) Transform the smooth particle dynamics time marching format and use a continuous convolutional neural network to correct the displacement of fluid particles in the transformed time marching format;
[0009] (2) Use the classical smooth particle dynamics method to simulate the scene flow driven by external forces and generate multiple data sets of flow field velocity evolution over time as training sets;
[0010] (3) training the continuous convolutional neural network using the training set;
[0011] (4) Update the position and velocity of the fluid particles according to the time advancement format of the modified smooth particle dynamics model to simulate the given external force-driven scene flow.
[0012] Furthermore, step (1) comprises:
[0013] The modified time advancement format is Moment i The velocity of the fluid particles ,Location And external forces , calculate the predicted speed and predicted location ; By correcting the format Moment i The velocity of the fluid particles and location ; The time advancement format after the transformation is:
[0014] ;
[0015] ;
[0016] ;
[0017] ;
[0018] in, for The time step of the moment; For the i Fluid particles The displacement correction at time, Obtained by continuous convolutional neural network, the formula is:
[0019] ;
[0020] in, express The set of displacement corrections of all fluid particles at a given moment, N represents the number of all fluid particles, i Indicates i Particles; CConNet represents a continuous convolutional neural network, express The set of predicted velocities of fluid particles at time instant, is the fluid viscosity; for The normal set outside the wall at the moment, M represents the number of all wall particles; express The set of predicted positions of fluid particles at the moment; for The position set of wall particles at the moment, M represents the number of all wall particles.
[0021] Furthermore, continuous convolutional neural network CConNet The continuous convolution operation in includes two steps: interpolation to a continuous function and coordinate transformation, specifically:
[0022] Interpolation to a continuous function: The kernel function The interpolation is defined in the cubic region D Continuous function on ;
[0023] Coordinate transformation: transform spherical coordinates to rectangular coordinates , will be located at Smooth area One-to-one mapping to the cube area D , which is defined in the smooth domain The continuous kernel function ;Will and The continuous convolution of is defined as:
[0024] ;
[0025] In the formula, Indicates location in Characteristic functions of the wall particles; Indicates smooth area The set of inner wall particles, m represents the number of inner wall particles in the set; Represents a grid defined on an equidistant rectangular grid The kernel function of .
[0026] Furthermore, the continuous convolutional neural network CConNet Includes 1 input layer, 1 output layer and at least 3 hidden layers;
[0027] Between the input layer and the first hidden layer is a three-branch unit: the first branch takes the characteristic function of the current fluid particle as input and connects 32 1x1x1 convolution kernels; the second branch takes the position and characteristic function of other fluid particles in the current fluid particle field as input and connects 32 4x4x4 convolution kernels; the third branch takes the position and characteristic function of the wall particles in the current fluid particle field as input and connects 32 4x4x4 convolution kernels; the outputs of the three branches are nonlinearly activated and then connected in a splicing manner to obtain the first hidden layer with 96 channels;
[0028] Between the first hidden layer and the second hidden layer, 48 1x1x1 convolution kernels are connected first, and then a binary unit is connected: the first branch takes the characteristic function of the current fluid particle as input and connects 48 1x1x1 convolution kernels; the second branch takes the position and characteristic function of other fluid particles in the current fluid particle field as input and connects 48 4x4x4 convolutions; the outputs of the two branches are summed to obtain the second hidden layer with 48 channels;
[0029] The two adjacent hidden layers after the second hidden layer are connected by a binary unit: the first branch takes the characteristic function of the current fluid particle as input and connects 48 1x1x1 convolution kernels; the second branch, the n-1th hidden layer, takes the position and characteristic function of other fluid particles in the current fluid particle field as input and connects 48 4x4x4 convolutions; the outputs of the two branches are summed to obtain the nth hidden layer with 48 channels (n≥3);
[0030] The last hidden layer and the output layer are connected with a binary unit: the first branch takes the characteristic function of the current fluid particle as input and connects to three 1x1x1 convolution kernels; the second branch, the n-1th hidden layer, takes the position and characteristic function of other fluid particles in the current fluid particle field as input and connects to three 4x4x4 convolutions; the outputs of the two branches are summed to obtain an output layer with 3 channels.
[0031] Furthermore, step (2) is specifically as follows:
[0032] remember The time step length is , the time marching format of the classical smooth particle dynamics is:
[0033] ;
[0034] ;
[0035] ;
[0036] in, Indicates i Acceleration of fluid particles, time step The following Courant-Friedrchs-Lewy stability constraints must be met:
[0037] ;
[0038] ;
[0039] ;
[0040] In the formula, , , , The meanings are smooth length, speed of sound, mass of the i-th fluid particle, The number density of the i-th fluid particle at the moment; is the fluid viscosity;
[0041] By time step The flow scenarios of fluids with different viscosities under multiple different external forces over a period of time are calculated respectively, and multiple data sets of flow field velocity evolution over time are generated as training sets.
[0042] Furthermore, in step (3), the weighted sum of the Euclidean distances between the predicted positions and the true positions of all fluid particles is used as the loss function;
[0043] The Adam algorithm is used to optimize the loss function and obtain the weights and biases of the continuous convolutional neural network. Step (3) is as follows:
[0044] Use the predicted positions of all fluid particles With real location The weighted sum of Euclidean distances is The loss function at the moment :
[0045] ;
[0046] in, is the initial average particle number density, is the number density of predicted positions; is the predicted position of the ith fluid particle; is the position of other particles in the smooth domain of the ith fluid particle, is the smoothing length; where the true position Obtained using the time-marching format of classical smoothed particle dynamics in step (2);
[0047] Optimizing the loss function using the Adam algorithm The optimization iteration number is 100,000 steps, and the learning rate of each step is from 10 -3 Decrease linearly to 10 steps -5 , and obtain the continuous convolutional neural network The weights and biases.
[0048] Furthermore, step (4) is specifically as follows:
[0049] Under a given scenario and external forces, starting from initialization, the positions of fluid particles are updated with a larger time step according to the time advancement format of the modified smooth particle dynamics model. and speed , simulate the given external force driven scene flow;
[0050] The larger time step refers to increasing the adopted time step to 20 times the maximum step in the classical smooth particle dynamics simulation.
[0051] Furthermore, the method further includes a scene initialization step before step (1), including:
[0052] Read or construct the three-dimensional data of the initial scene;
[0053] If the 3D data is a point cloud structure, the point cloud is divided into two categories: fluid points and solid points as walls; if the 3D data is a finite element structure, the finite element is first divided into approximately equal volumes according to the preset average particle density, so that there is a particle at the center of each unit after division, and the point cloud composed of all examples is divided into two categories: fluid points and solid points according to the unit attributes;
[0054] The fluid point is set to a stationary state and used as the initial state of the scene flow.
[0055] A device for simulating external force driven scene flow based on CCNN SPH, the device comprising:
[0056] Scene initialization module: Use point clouds composed of particles to represent the scene, set the initial position and initial velocity of fluid particles and the position of solid particles on the wall;
[0057] Classic smooth particle dynamics module: performs numerical simulation of external force-driven scene flow and generates multiple scene flow data as data sets for later training;
[0058] Smooth particle dynamics training module based on continuous convolutional neural network: used to train continuous convolutional neural network and optimize the weights and bias terms of continuous convolutional neural network connections;
[0059] Smoothed particle dynamics application module based on continuous convolutional neural network: used to simulate scene flow driven by external forces.
[0060] An electronic device, comprising:
[0061] a memory storing computer-readable instructions;
[0062] The processor reads the computer-readable instructions stored in the memory to execute the method of simulating external force-driven scene flow based on CCNN SPH.
[0063] A computer-readable storage medium stores computer-readable instructions. When the computer-readable instructions are executed by a processor of a computer, the computer executes the method of simulating external force-driven scene flow based on CCNN SPH.
[0064] The beneficial technical effects of the present invention are:
[0065] The method for simulating external force-driven scene flow by smooth particle dynamics provided by the present invention is based on a continuous convolutional neural network, and starts from the transformation of the time advancement format of smooth particle dynamics. On the one hand, by simplifying the force on fluid particles, the amount of calculation is greatly reduced, and the time step is no longer restricted by the Courant-Friedrchs-Lewy condition, and the simulation process can adopt a larger time step; on the other hand, the continuous convolutional neural network pre-trained with data obtains the mapping relationship between the predicted velocity of fluid particles, fluid viscosity, and the wall normal and the correction value of the displacement of fluid particles, which is used to update the position and velocity of the fluid particles at the next moment. Under a certain accuracy, the efficiency of the numerical simulation of the scene flow is greatly improved. In addition, the trained continuous convolutional neural network has a high generalization ability and can be widely used in flow simulation of similar scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The above and other objects, features and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
[0067] Figure 1 A schematic diagram of an application environment of the technical solution of the present invention provided for one embodiment of the present invention.
[0068] Figure 2 A flowchart of a method for simulating external force driven scene flow based on SPH using CCNN provided in one embodiment of the present invention.
[0069] Figure 3 A structural block diagram of a device for simulating external force-driven scene flow based on SPH using CCNN provided in one embodiment of the present invention.
[0070] Figure 4 A structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0071] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present invention will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0072] In addition, the described features, structures or characteristics may be combined in one or more example embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention may be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. may be adopted. In other cases, known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring various aspects of the present invention.
[0073] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0074] Example 1: A method for simulating external force driven scene flow based on CCNN SPH, such as Figure 2 As shown, the method includes:
[0075] (1) Transform the smooth particle dynamics time marching format and use a continuous convolutional neural network to correct the displacement of fluid particles in the transformed time marching format;
[0076] (2) Use the classical smooth particle dynamics method to simulate the scene flow driven by external forces and generate multiple data sets of flow field velocity evolution over time as training sets;
[0077] (3) training the continuous convolutional neural network using the training set;
[0078] (4) Update the position and velocity of the fluid particles according to the time advancement format of the modified smooth particle dynamics model to simulate the given external force-driven scene flow.
[0079] In this embodiment, the method further includes a scene initialization step before step (1), including:
[0080] Read or construct the three-dimensional data of the initial scene;
[0081] If the 3D data is a point cloud structure, the point cloud is divided into two categories: fluid points and solid points as walls; if the 3D data is a finite element structure, the finite element is first divided into approximately equal volumes according to the preset average particle density, so that there is a particle at the center of each unit after division, and the point cloud composed of all examples is divided into two categories: fluid points and solid points according to the unit attributes;
[0082] The fluid point is set to a stationary state and used as the initial state of the scene flow.
[0083] In a three-dimensional scene, the location is represented by evenly distributed discrete particles. The average distance between particles is defined as times (e.g. ) is the smooth length , define the central symmetric non-negative function Make its support set is centered on x, is a sphere of radius, and ,say is a smooth function, the support set is the smooth area of x. Any position in the three-dimensional scene Any physical function at The values of can be expressed as convolution form , physical property function It can be number density, mass, velocity, etc.
[0084] Establish the time advancement format of fluid particles in a 3D scene. Moment The resultant acceleration of the fluid particles under the pressure, shear force, and external force between the particles is recorded as ,but , is a multivariate function of position, velocity and external force, where , , They are Moment The pressure, shear force and external force on each fluid particle. The time step length is , then the time advancement format of the classical smooth particle dynamics is:
[0085] ;
[0086] ;
[0087] ;
[0088] The present invention does not use the resultant acceleration , and only use external force Construct forecast-corrected time advancement format.
[0089] In this embodiment, step (1) includes:
[0090] The modified time advancement format is Moment i The velocity of the fluid particles ,Location And external forces , calculate the predicted speed and predicted location ; By correcting the format Moment i The velocity of the fluid particles and location ; The time advancement format after the transformation is:
[0091] ;
[0092] ;
[0093] ;
[0094] ;
[0095] in, for The time step of the moment; For the i Fluid particles The displacement correction at time, Obtained by continuous convolutional neural network, the formula is:
[0096] ;
[0097] in, express The set of displacement corrections of all fluid particles at a given moment, N represents the number of all fluid particles, i Indicates i Particles; CConNet represents a continuous convolutional neural network, express The set of predicted velocities of fluid particles at time instant, is the fluid viscosity; for The normal set outside the wall at the moment, M represents the number of all wall particles; express The set of predicted positions of fluid particles at the moment; for The position set of wall particles at the moment, M represents the number of all wall particles.
[0098] The classic convolution operation is the convolution and operation of the characteristic function (such as grayscale image) and the kernel function, where both the characteristic function and the kernel function are defined at equidistant rectangular coordinate points (pixels). Different from this, for smooth particles, their characteristic functions are divided into two categories: the characteristic function of fluid particles is their predicted velocity and the viscosity of the fluid ; The characteristic function of the solid particle in the wall is the normal to the wall surface at its location Therefore, no matter what kind of characteristic function, they are defined at the location of the particle, rather than at equidistant rectangular coordinate points, and cannot be directly convolved and operated with the kernel function in a classical manner. The continuous convolution operation used in the present invention is proposed to solve this problem.
[0099] In this embodiment, the continuous convolutional neural network CConNet The continuous convolution operation in includes two steps: interpolation to a continuous function and coordinate transformation, specifically:
[0100] Interpolation to a continuous function: The kernel function The interpolation is defined in the cubic region D Continuous function on ;
[0101] Coordinate transformation: transform spherical coordinates to rectangular coordinates , will be located at Smooth area One-to-one mapping to the cube area D , which is defined in the smooth domain The continuous kernel function ;Will and The continuous convolution of is defined as:
[0102] ;
[0103] In the formula, Indicates location in Characteristic functions of the wall particles; Indicates smooth area The set of inner wall particles, m represents the number of inner wall particles in the set; Represents a grid defined on an equidistant rectangular grid The kernel function of .
[0104] The present invention uses the above continuous convolution to construct a neural network containing one input layer, one output layer and no less than three hidden layers to calculate the displacement correction of fluid particles. Among them, the input layer is the position of the particle and its characteristic function, and the output layer is the displacement correction of the fluid particle.
[0105] Among them, the transformation of spherical coordinates to rectangular coordinates in the present invention is , we can use the literature [Griepentrog, Jens A.,Wolfgang Hoeppner, Hans-Christoph Kaiser and Joachim Rehberg. A bi-Lipschitz, volume preserving map from the unit ball onto a cube. Notes on Mathematica ,28, 2008].
[0106] In this embodiment, the continuous convolutional neural network Includes 1 input layer, 1 output layer and at least 3 hidden layers;
[0107] Between the input layer and the first hidden layer is a three-branch unit: the first branch takes the characteristic function of the current fluid particle as input and connects 32 1x1x1 convolution kernels; the second branch takes the position and characteristic function of other fluid particles in the current fluid particle field as input and connects 32 4x4x4 convolution kernels; the third branch takes the position and characteristic function of the wall particles in the current fluid particle field as input and connects 32 4x4x4 convolution kernels; the outputs of the three branches are nonlinearly activated and then connected in a splicing manner to obtain the first hidden layer with 96 channels;
[0108] Between the first hidden layer and the second hidden layer, 48 1x1x1 convolution kernels are connected first, and then a binary unit is connected: the first branch takes the characteristic function of the current fluid particle as input and connects 48 1x1x1 convolution kernels; the second branch takes the position and characteristic function of other fluid particles in the current fluid particle field as input and connects 48 4x4x4 convolutions; the outputs of the two branches are summed to obtain the second hidden layer with 48 channels;
[0109] The two adjacent hidden layers after the second hidden layer are connected by a binary unit: the first branch takes the characteristic function of the current fluid particle as input and connects 48 1x1x1 convolution kernels; the second branch, the n-1th hidden layer, takes the position and characteristic function of other fluid particles in the current fluid particle field as input and connects 48 4x4x4 convolutions; the outputs of the two branches are summed to obtain the nth hidden layer with 48 channels (n≥3);
[0110] The last hidden layer and the output layer are connected with a binary unit: the first branch takes the characteristic function of the current fluid particle as input and connects to three 1x1x1 convolution kernels; the second branch, the n-1th hidden layer, takes the position and characteristic function of other fluid particles in the current fluid particle field as input and connects to three 4x4x4 convolutions; the outputs of the two branches are summed to obtain an output layer with 3 channels.
[0111] In this embodiment, step (2) is specifically as follows:
[0112] In the classic smooth particle dynamics model, Moment i The fluid particles are subject to the interparticle pressure , Shear force And external forces The resultant acceleration is recorded as ,but , is a multivariate function of position, velocity and external force, where , The calculation formats are:
[0113] ;
[0114] ;
[0115] in, is the mass of the ith fluid particle (usually set to 1). There are other particles in , then simply record , yes right The gradient of It is The number density of fluid particles, It is The calculation method of the pressure of a fluid particle depends on the choice of the fluid state equation. Here, the ideal gas state equation is used, then , is the speed of sound (usually set to , H is the height of the scene).
[0116] remember The time step length is , the time marching format of the classical smooth particle dynamics is:
[0117] ;
[0118] ;
[0119] ;
[0120] in, Indicates i Acceleration of fluid particles, time step The following Courant-Friedrchs-Lewy stability constraints must be met:
[0121] ;
[0122] ;
[0123] ;
[0124] In the formula, , , , The meanings are smooth length, speed of sound, mass of the i-th fluid particle, The number density of the i-th fluid particle at the moment; is the fluid viscosity;
[0125] By time step The flow scenarios of fluids with different viscosities under different external forces are calculated over a period of time, and multiple data sets of flow field velocity evolution over time are generated as training sets. Due to the limitation of the time step, in actual operation, the flow scenarios of fluids with different viscosities under different external forces are calculated over a period of time with a smaller time step.
[0126] In step (3) of this embodiment, the weighted sum of the Euclidean distances between the predicted positions and the actual positions of all fluid particles is used as the loss function;
[0127] The Adam algorithm is used to optimize the loss function to obtain the weights and biases of the continuous convolutional neural network. Step (3) is as follows:
[0128] Use the predicted positions of all fluid particles With real location The weighted sum of Euclidean distances is The loss function at the moment :
[0129] ;
[0130] in, is the initial average particle number density, is the number density of predicted positions; is the predicted position of the ith fluid particle; is the position of other particles in the smooth domain of the ith fluid particle, is the smoothing length; where the true position Obtained using the time-marching format of classical smoothed particle dynamics in step (2);
[0131] Optimizing the loss function using the Adam algorithm The optimization iteration number is 100,000 steps, and the learning rate of each step is from 10 -3 Decrease linearly to 10 steps -5 , and obtain a continuous convolutional neural network The weights and biases of .
[0132] In this embodiment, step (4) is specifically as follows:
[0133] Under a given scene and external force, starting from initialization, with a larger time step, the time advancement format of the smooth particle dynamics model modified as follows: Update the position of the fluid particles and speed , simulate the given external force driven scene flow;
[0134] ;
[0135] ;
[0136] ;
[0137] ;
[0138] ;
[0139] The larger time step refers to increasing the adopted time step to 20 times the maximum step in the classical smooth particle dynamics simulation.
[0140] The method for simulating external force-driven scene flow by smooth particle dynamics based on continuous convolutional neural network provided in an embodiment of the present invention starts from transforming the time advancement format of smooth particle dynamics. On the one hand, by simplifying the force on fluid particles, the amount of calculation is greatly reduced, and the time step is no longer restricted by the Courant-Friedrchs-Lewy condition, and the simulation process can adopt a larger time step; on the other hand, the continuous convolutional neural network pre-trained with data obtains the mapping relationship between the predicted velocity of fluid particles, fluid viscosity and wall normal, and the displacement correction value of fluid particles, which is used to update the position and velocity of fluid particles at the next moment. Under a certain accuracy, the efficiency of numerical simulation of scene flow is greatly improved. In addition, the trained continuous convolutional neural network has a high generalization ability and can be widely used in flow simulation of similar scenes.
[0141] The method for simulating external force-driven scene flow by smooth particle dynamics provided by the present invention simplifies the acceleration term in the time advancement format and increases the time advancement step, thereby improving the numerical simulation efficiency of the scene flow driven by external force, and can quickly simulate the flow of fluids with different viscosities under different external forces and scenes; the continuous convolutional neural network adopted by the present invention has high reliability in correcting the displacement of fluid particles and has good generalization ability.
[0142] Embodiment 2: A device for simulating external force driven scene flow based on CCNN SPH, such as Figure 3 As shown, the device comprises:
[0143] Scene initialization module 310: using a point cloud composed of particles to represent the scene, setting the initial position and initial velocity of the fluid particles and the position of the wall solid particles;
[0144] Classic smooth particle dynamics module 320: performs numerical simulation of external force-driven scene flow and generates multiple scene flow data as data sets for later training;
[0145] Smooth particle dynamics training module 330 based on continuous convolutional neural network: used to train continuous convolutional neural network and optimize the weights and bias terms of the continuous convolutional neural network connections;
[0146] Smoothed Particle Dynamics Application Module 340 based on Continuous Convolutional Neural Network: used to simulate scene flows driven by external forces.
[0147] In this embodiment, the smooth particle dynamics training module 330 based on continuous convolutional neural network and the smooth particle dynamics application module 340 based on continuous convolutional neural network include: a continuous convolutional neural network consisting of 1 input layer, 1 output layer and 3 hidden layers, which is used to construct the implicit mapping relationship between the characteristic function of the particle and the displacement correction amount in the time advancement format. In the training module, this mapping relationship is optimized; in the application module, this mapping relationship is used to obtain the displacement correction amount.
[0148] When training the continuous convolutional neural network, the weighted sum of the Euclidean distances between the predicted positions and the actual positions of all fluid particles is used as the loss function. The Adam algorithm is used to optimize the loss function with 100,000 optimization steps and a learning rate of 10 for each step. -3 Decrease linearly to 10 steps -5 .
[0149] The implementation process of the functions and effects of each module / unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0150] It is understood that these modules can be implemented by hardware, software, or a combination of the two. When implemented in hardware, these modules can be implemented as one or more hardware modules, such as one or more application specific integrated circuits. When implemented in software, these modules can be implemented as one or more computer programs executed on one or more processors.
[0151] Embodiment 3: An electronic device, comprising:
[0152] a memory storing computer-readable instructions;
[0153] The processor reads the computer-readable instructions stored in the memory to execute the method of simulating external force-driven scene flow by smooth particle dynamics described in Example 1.
[0154] Embodiment 4: A computer-readable storage medium stores computer-readable instructions. When the computer-readable instructions are executed by a processor of a computer, the computer executes the method of simulating external force-driven scene flow by smooth particle dynamics described in Embodiment 1.
[0155] Figure 1 Schematic diagram of the application environment of the technical solution of the present invention provided by an embodiment of the present invention. Figure 1 As shown, the environment of this embodiment includes a network 110 and a computer device 120. The network 110 may be a communication medium of various connection types capable of providing a communication link between the servers 120, such as a wired communication link or a wireless communication link. The computer device 120 may be a device with computing capabilities such as a server or a server cluster, which is not specifically limited herein.
[0156] refer to Figure 4 An electronic device 400 provided by an embodiment of the present invention is described. Figure 4 The electronic device 400 shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention. Figure 4As shown, the electronic device 400 includes a central processing unit 401 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 402 (ROM) or the program loaded from the storage part 408 to the random access memory 403 (RAM). Various programs and data required for system operation are also stored in the random access memory 403. The central processing unit 401, the read-only memory 402 and the random access memory 403 are connected to each other through a bus 404. The input / output interface 405 (Input / Output interface, i.e., I / O interface) is also connected to the bus 404.
[0157] The following components are connected to the input / output interface 405: an input section 606 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the input / output interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed so that a computer program read therefrom is installed into the storage section 408 as needed.
[0158] In particular, according to an embodiment of the present invention, the processes described in the various method flow charts can be implemented as computer software programs. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 409, and / or installed from a removable medium 411. When the computer program is executed by the central processor 401, various functions defined in the system of the present invention are executed.
[0159] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present invention.
[0160] In an exemplary embodiment of the present invention, a computer-readable storage medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the method described in the above method embodiment.
[0161] According to one embodiment of the present invention, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0162] The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0163] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0164] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0165] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as JAVA, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0166] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0167] In addition, although the steps of the method of the present invention are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0168] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation method of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation method of the present invention.
[0169] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention claimed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art for which the present invention is not claimed. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the appended claims.
Claims
1. A method for simulating external force driven scene flow based on CCNN SPH, characterized in that: The method comprises: (1) Transform the smooth particle dynamics time marching format and use a continuous convolutional neural network to correct the displacement of fluid particles in the transformed time marching format; (2) Use the classical smooth particle dynamics method to simulate the scene flow driven by external forces and generate multiple data sets of flow field velocity evolution over time as training sets; (3) training the continuous convolutional neural network using a training set; (4) Update the position and velocity of the fluid particles according to the time advancement format of the modified smooth particle dynamics model to simulate the given external force-driven scene flow; Step (1) comprises: The modified time advancement format is passed through t n The velocity of the i-th fluid particle at the moment Location and external force a ext , calculate the predicted speed and predicted location By correcting the format, we get t n+1 The velocity of the i-th fluid particle at the moment and location The time advancement format after the transformation is: Among them, Δt n t n The time step at the moment; Δx i is the i-th fluid particle t n+1 The displacement correction at time, Δx i Obtained by continuous convolutional neural network, the formula is: in, Indicates t n+1 The set of displacement corrections of all fluid particles at a given moment, N represents the number of all fluid particles, i represents the i-th particle; CConNet represents a continuous convolutional neural network, Indicates t n+1 The predicted velocity set of fluid particles at time t, μ is the fluid viscosity; t n+1 The normal set outside the wall at the moment, M represents the number of all wall particles; Indicates t n+1 The set of predicted positions of fluid particles at the moment; t n+1 The position set of the wall particles at the moment, M represents the number of all wall particles; The continuous convolution operation in the continuous convolutional neural network CConNet includes two steps: interpolation to a continuous function and coordinate transformation, specifically: Interpolate to a continuous function: interpolate the kernel function k0 to a continuous function k defined on the cube area D; Coordinate transformation: transform spherical coordinates to rectangular coordinates will be located at x i The smooth area O(x i ; h) One-to-one mapping to the cubic region D, we get the definition in the smooth domain O(x i ; h) continuous kernel function Will The continuous convolution with k0 is defined as: In the formula, Indicates location in Characteristic functions of the wall particles; represents the smooth area O(x i ; h) a set of inner wall particles, m represents the number of inner wall particles in the set; k0 represents the kernel function defined on the equidistant rectangular grid D0.
2. The method for simulating external force driven scene flow based on CCNN SPH according to claim 1 is characterized in that: Step (2) is specifically as follows: Note n The time step length at time is Δt n , the time marching format of the classical smooth particle dynamics is: Among them, a i represents the acceleration of the i-th fluid particle, with a time step of Δt n The following Courant-Friedrchs-Lewy stability constraints must be met: In the formula, h, c s , m i , The meanings are smooth length, speed of sound, mass of the i-th fluid particle, t n The number density of the i-th fluid particle at the moment; μ is the fluid viscosity; With a time step of Δt n The flow scenarios are calculated for fluids of different viscosities under multiple different external forces, and multiple data sets of flow field velocity evolution over time are generated as training sets.
3. The method for simulating external force driven scene flow based on SPH of CCNN according to claim 2 is characterized in that: Step (3) is specifically as follows: Use the predicted positions of all fluid particles With real location The weighted sum of the Euclidean distances is used as t n+1 The loss function L at the moment n+1 : in, is the initial average particle number density, is the number density of predicted positions; is the predicted position of the ith fluid particle; is the position of other particles in the smooth domain of the i-th fluid particle; h is the smooth length; Optimize the loss function L using the Adam algorithm n+1 , the optimization iteration number is 100,000 steps, and the learning rate of each step is from 10 -3 Decrease linearly to 10 steps -5 , and obtain the continuous convolutional neural network The weights and biases.
4. The method for simulating external force driven scene flow based on SPH of CCNN according to claim 1 is characterized in that: Step (4) is specifically as follows: Under a given scenario and external forces, starting from initialization, the positions of fluid particles are updated with a larger time step according to the time advancement format of the modified smooth particle dynamics model. and speed Simulate the scene flow driven by a given external force.
5. The method for simulating external force driven scene flow based on SPH of CCNN according to claim 1 is characterized in that: The method further comprises a scene initialization step before step (1), comprising: Read or construct the three-dimensional data of the initial scene; If the 3D data is a point cloud structure, the point cloud is divided into two categories: fluid points and solid points as walls; if the 3D data is a finite element structure, the finite element is first divided into approximately equal volumes according to the preset average particle density, so that there is a particle at the center of each unit after division, and the point cloud composed of all particles is divided into two categories: fluid points and solid points according to the unit attributes; The fluid point is set to a stationary state and used as the initial state of the scene flow.
6. A device for simulating external force driven scene flow based on CCNN SPH, adopting the method according to any one of claims 1 to 5, characterized in that: The device comprises: Scene initialization module: Use point clouds composed of particles to represent the scene, set the initial position and initial velocity of fluid particles and the position of solid particles on the wall; Classic smooth particle dynamics module: performs numerical simulation of external force-driven scene flow and generates multiple scene flow data as data sets for later training; Smooth particle dynamics training module based on continuous convolutional neural network: used to train continuous convolutional neural network and optimize the weights and bias terms of continuous convolutional neural network connections; Smoothed particle dynamics application module based on continuous convolutional neural network: used to simulate scene flow driven by external forces.
7. An electronic device, characterized in that: include: a memory storing computer-readable instructions; A processor reads computer-readable instructions stored in a memory to execute the method for simulating external force-driven scene flow based on SPH using CCNN as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method of simulating external force-driven scene flow based on SPH using CCNN as described in any one of claims 1 to 5.