A data-driven method for reconstructing the flow field in a coupled water and fish scene
By constructing a coupled water and fish flow field dataset, and utilizing convolutional neural networks and the Eulerian-Lagrange method, rapid sharing and interaction of flow field information were achieved, solving the problems of high cost and low efficiency in traditional flow field simulation methods and improving simulation accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA INST OF WATER RESOURCES & HYDROPOWER RES
- Filing Date
- 2023-09-22
- Publication Date
- 2026-05-26
Smart Images

Figure CN117236222B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the interdisciplinary field of fluid mechanics and artificial intelligence, and in particular to a data-driven method for reconstructing the flow field in a coupled water and fish scenario. Background Technology
[0002] River fragmentation threatens fish survival. The construction of water conservancy facilities such as dams, hydroelectric power stations, and weirs leads to river fragmentation, negatively impacting fish populations. Fish need to cross rivers to find suitable habitats, forage, spawn, or avoid pollutants and harsh environmental conditions. However, migratory fish struggle to survive in rivers affected by these facilities. Therefore, constructing fish passageways in water conservancy projects is crucial. These fish passageways help fish overcome obstacles, enabling them to migrate smoothly, find habitats, forage, and spawn, mitigating the damage to fish ecosystems caused by water conservancy projects and protecting fish resources in rivers. Currently, fish passage design employs a "model trial-on-site construction-on-site testing" model, comparing the fish passage effectiveness of different structural schemes: monitoring, evaluating, and progressively improving all schemes over a period of time until the optimal structure is achieved.
[0003] In past studies, flow field numerical simulations have been computationally expensive and time-consuming. Fish migration models typically calculate fish motion and hydraulic factors separately, neglecting the fluid-structure interaction (FSI) during swimming. This leads to discrepancies between simulation results and actual fish swimming characteristics and dynamic behavior. This separate calculation method fails to fully account for the impact of fish on the flow field and the feedback effect of the flow field on fish swimming. Therefore, traditional flow field numerical simulation methods are costly, inefficient, and inaccurate, and are not suitable for widespread application. Summary of the Invention
[0004] To address the aforementioned shortcomings in existing technologies, this invention provides a data-driven method for reconstructing the flow field in a coupled water and fish scenario. This method solves the problems of high cost, low efficiency, low accuracy, and unsuitability for widespread application in traditional numerical simulation methods of flow fields.
[0005] To achieve the aforementioned objectives, the present invention employs the following technical solution: a data-driven method for reconstructing the flow field of a coupled water and fish scene, comprising the following steps:
[0006] S1: Using CFD models, simulate the coupled flow field of water and fish under various scenarios and construct a coupled flow field dataset of water and fish.
[0007] S2: Based on the coupled flow field dataset of water and fish, the dynamic mesh of the fish body and the dynamic mesh of the background are constructed by using the Lagrange module and the convolutional neural network prediction method.
[0008] S3: Construct convolutional neural network models for the dynamic mesh of the fish body and the dynamic mesh of the background, respectively;
[0009] S4: Based on the convolutional neural network model and the Eulerian-Lagrange method, a rapid flow field reconstruction model is constructed to accurately predict the coupled flow field of water and fish, and to complete the data-driven flow field reconstruction of the coupled water and fish scenario.
[0010] The beneficial effects of the above scheme are as follows: This invention constructs an Eulerian module and a Lagrange module respectively. Through the sharing and interaction of flow field information between these two modules, and by utilizing a trained neural network, it is possible to continuously iterate and calculate the "water-fish" coupled flow field at different time steps, thereby achieving the speed and effectiveness of flow field reconstruction. This invention solves the problems of high cost, low efficiency, low accuracy, and unsuitability for widespread application of traditional flow field numerical simulation methods.
[0011] Furthermore, the method for constructing the water-fish coupled flow field dataset in S1 is as follows: using dynamic mesh technology, the flow field is calculated based on the fluid continuity equation and momentum equation, and the water-fish coupled flow field dataset is obtained by compiling using UDF. The formula for the fluid continuity equation is:
[0012]
[0013] Where ρ is the water flow density, u i Let x be the component of the velocity vector in the x-direction. i Let x be the x-direction and t be the time. The sign of the partial derivative;
[0014] The formula for the momentum equation is as follows:
[0015]
[0016] Among them, u j Let x be the component of the velocity vector in the y-direction. j The direction is y, p is the pressure acting on the water, and μ is the dynamic viscosity coefficient. t G is the eddy viscosity coefficient. i This represents the component of gravitational acceleration in the direction of gravity.
[0017] The beneficial effects of the above-mentioned further scheme are: to obtain the flow field dataset by using dynamic mesh technology and UDF compilation, and by combining the fluid continuity equation and momentum equation.
[0018] Furthermore, in the coupled flow field simulation of water and fish in S1, trigonometric functions are used to fit the wave motion of the fish body. The reference configuration of the fish body is a streamlined region located on the xy plane, and the contour function Y of the fish body is:
[0019]
[0020] Where s is the axial direction measured from the tip of the fish head along the fish axis, a1 is the first envelope coefficient, a2 is the second envelope coefficient, a3 is the third envelope coefficient, a4 is the fourth envelope coefficient, and a5 is the fifth envelope coefficient.
[0021] The wave function h(s,t) of the fish body is:
[0022] h(s,t)=b(s)sin(ks-ωt)
[0023] b(s) = b0 + b1s + b2s 2
[0024] Where b(s) is the amplitude envelope of the fish's lateral movement, k is the wave number of the body wave corresponding to the wavelength, ω is the angular frequency corresponding to the tail beat frequency, b0 is the coefficient of the first amplitude envelope, b1 is the coefficient of the second amplitude envelope, and b2 is the coefficient of the third amplitude envelope.
[0025] The beneficial effect of the above-mentioned further solutions is that, by using the above technical solutions, the coupled flow field of fish and water can be simulated based on the fish's contour function and wave function, which is conducive to obtaining effective and accurate datasets.
[0026] Furthermore, the center of the fish body dynamic mesh in S2 is the same as the center of the fish body outline, and the fish body dynamic mesh is used to accurately calculate the coupled flow field of water and fish;
[0027] The center of the background dynamic mesh is the same as the center of the fish body outline. The background dynamic mesh is used to receive the water and fish coupled flow field calculated by the fish body dynamic mesh.
[0028] For water-fish coupled flow fields involving multiple fish, the background dynamic grids of different individual fish transmit flow field information to each other.
[0029] The beneficial effects of the above-mentioned further solutions are: by using the above technical solutions, the coupled flow field of water and fish can be obtained, and the flow field information sharing between different individual fish can be realized, thereby improving the computational efficiency of the coupled flow field.
[0030] Furthermore, building a convolutional neural network model in S3 includes the following steps:
[0031] S3-1: Use 30% of the water and fish coupled flow field dataset as the test set and the remaining water and fish coupled flow field dataset as the training set;
[0032] S3-2: An input matrix is constructed by superimposing multiple feature matrices independently stored in a two-dimensional matrix, and an output matrix is constructed based on the velocity field of the watershed where the fish is located, stored in the two-dimensional matrix at the next moment. The formula for the input matrix X is:
[0033] X=[U, V, U', V', IM, IM', SDF, SDF']
[0034] Where U is the x-direction velocity matrix of the dynamic mesh, V is the y-direction velocity matrix of the dynamic mesh, U' is the x-direction velocity matrix after moving to the target position, V' is the y-direction velocity matrix after moving to the target position, IM is the mesh type matrix, IM' is the mesh type matrix after the dynamic mesh moves to the target position, SDF is the fish body distance matrix, and SDF' is the fish body distance matrix after the dynamic mesh moves to the target position.
[0035] Then the input matrix X at time t t for:
[0036] X t =[U t V t U t ', V t ',IM t IM t ',SDF t SDF t ']
[0037] Among them, U t Let V be the velocity matrix in the x-direction of the dynamic mesh at time t. t Let U be the y-direction velocity matrix of the dynamic mesh at time t. t 'V' represents the velocity matrix in the x-direction after moving to the target position at time t. t ' is the y-direction velocity matrix after moving to the target position at time t, IM t Let IM be the grid type matrix at time t. t ' is the mesh type matrix after the dynamic mesh has moved to the target position at time t, SDF t Let SDF be the fish body distance matrix at time t. t ' is the fish body distance matrix after the dynamic mesh moves to the target position at time t;
[0038] S3-3: Normalize the input matrix using the following formula:
[0039]
[0040] Let X be the normalized result of the input variables for each sample at time t. min X represents the minimum value of the input variable for each sample. max The maximum value of the input variable for each sample;
[0041] S3-4: Use the input matrix as the input to the convolutional neural network model and the output matrix as the output of the convolutional neural network model;
[0042] S3-5: Train and test the convolutional neural network model using the training and test sets respectively to complete the construction of the convolutional neural network model. During testing, the Adam optimizer is used, and the loss function is the mean squared error of two velocity components to evaluate the predictive performance of the trained convolutional neural network model. The formula is:
[0043]
[0044] Where Loss is the prediction loss, N is the total number of data points, and m is the number of selected data points. For the x-direction velocity of the test set, For the x-direction velocity of the test set, The velocity in the y-direction of the test set. Let be the velocity in the y-direction of the test set.
[0045] The beneficial effects of the above-mentioned further solution are as follows: Through the above technical solution, eight feature matrices, each independently stored in a two-dimensional matrix of the same size, are selected and superimposed to construct the input matrix of the convolutional neural network model. At the same time, the velocity field of the flow field where the fish is located at the next moment is used as the output matrix of the model, and the velocity field of the flow field where the fish is located at the next moment is stored in a two-dimensional matrix. By training, testing and evaluating the model, the required convolutional neural network model is obtained, which can be used to build a rapid flow field reconstruction model in the future.
[0046] Furthermore, the convolutional neural network model in S3-4 is built based on UNet and includes an encoder and a decoder. The encoder includes multiple convolutional blocks, and the decoder includes multiple deconvolutional blocks.
[0047] The beneficial effect of the above-mentioned further solutions is that they provide a specific structure for a convolutional neural network model.
[0048] Furthermore, the flow field fast reconstruction model in S4 includes an Eulerian module and a Lagrange module. The Eulerian module is used to describe the flow field information of the entire computational domain, and the Lagrange module is used to describe the local flow field information centered on the fish body.
[0049] The beneficial effects of the above-mentioned further scheme are: the flow field rapid reconstruction model includes Eulerian and Lagrangian modules, through which flow field information is shared and interacted, thereby continuously and rapidly calculating the water-fish coupled flow field at different times.
[0050] Furthermore, the initial flow field of the Euler module is a steady-state flow field simulated without considering the presence of the fish body, which is obtained by calculation through the fluid continuity equation and the momentum equation;
[0051] The initial flow field of the Lagrange module is the flow field information of the fish's dynamic mesh and the background dynamic mesh at the corresponding positions in the Eulerian module.
[0052] The beneficial effect of the above-mentioned further solutions is that, through the above technical solutions, methods for calculating the initial flow field of the Eulerian module and the Lagrange module are provided respectively.
[0053] Furthermore, the simulation process of the rapid flow field reconstruction model in S4 includes the following steps:
[0054] S4-1: Set the starting position of the fish in the computational domain, initialize the mesh flow field of the Euler module and the mesh flow field of the Lagrange module, and calculate the input matrix of the convolutional neural network model of the fish dynamic mesh and the background dynamic mesh under the initial conditions respectively.
[0055] S4-2: Based on the input matrix, set the swimming speed function of the fish throughout the simulation process, obtain the swimming speed vector according to the swimming speed function, and rotate the coordinate system of the fish body wave motion fitting formula according to the swimming speed vector to obtain the fish body morphology change process during the entire swimming process.
[0056] S4-3: Based on the fish body morphology change process, the input matrices of the fish body dynamic mesh and the background dynamic mesh at time t are input into the pre-trained convolutional neural network model to obtain the predicted output variables at time t, and data sharing is achieved through interpolation;
[0057] S4-4: Iterate through step S4-3 until the simulation ends.
[0058] The beneficial effect of the above-mentioned further solution is that, through the above technical solution, the obtained input matrix is input into the trained convolutional neural network model to obtain the predicted output, thus completing the simulation process of the rapid flow field reconstruction model.
[0059] Furthermore, S4-3 includes the following sub-steps:
[0060] S4-3-1: Obtain the position and shape of the fish at time t, and collect U. t V t U t '、V t '、IM t IM t '、SDF t and SDF t ', to obtain the input matrices of the fish body dynamic mesh and the background dynamic mesh;
[0061] S4-3-2: Input the input matrices of the fish body dynamic mesh and the background dynamic mesh into the trained convolutional neural network model to obtain the predicted output variables of the fish body dynamic mesh and the background dynamic mesh respectively;
[0062] S4-3-3: Interpolate the predicted output variables of the fish body dynamic mesh to the corresponding mesh points of the predicted output variables of the background dynamic mesh, and at the same time interpolate the predicted output variables of the Lagrange mesh to the corresponding mesh points of the Eulerian mesh.
[0063] S4-3-4: Perform the calculation for the next time step and complete the data sharing.
[0064] The beneficial effects of the above-mentioned further solutions are: through the above technical solutions, data sharing between the dynamic mesh of the fish body and the dynamic mesh of the background, as well as data sharing between the Lagrange mesh and the Eulerian mesh, can be achieved simultaneously. Attached Figure Description
[0065] Figure 1 A flowchart of a data-driven method for reconstructing the flow field in a coupled water and fish scenario.
[0066] Figure 2 This is a schematic diagram of the computational domain and boundary conditions.
[0067] Figure 3 This is a schematic diagram illustrating the periodic changes in the morphology of fish movements.
[0068] Figure 4 This is a diagram of the structure of a convolutional neural network model.
[0069] Figure 5 This is a schematic diagram of the Euler module and the Lagrange module.
[0070] Figure 6 This is a comparison chart of the velocity distribution calculated by CFD in the watershed and predicted by this invention within one cycle. Detailed Implementation
[0071] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0072] like Figure 1 As shown, a data-driven method for reconstructing the flow field in a coupled water and fish scene includes the following steps:
[0073] S1: Using CFD models, simulate the coupled flow field of water and fish under various scenarios and construct a coupled flow field dataset of water and fish.
[0074] S2: Based on the coupled flow field dataset of water and fish, the dynamic mesh of the fish body and the dynamic mesh of the background are constructed by using the Lagrange module and the convolutional neural network prediction method.
[0075] S3: Construct convolutional neural network models for the dynamic mesh of the fish body and the dynamic mesh of the background, respectively;
[0076] S4: Based on the convolutional neural network model and the Eulerian-Lagrange method, a rapid flow field reconstruction model is constructed to accurately predict the coupled flow field of water and fish, and to complete the data-driven flow field reconstruction of the coupled water and fish scenario.
[0077] This invention constructs both Eulerian and Lagrange modules. Through the sharing and interaction of flow field information between these two modules, iterative calculations of the water-fish coupled flow field at different time steps can be continuously performed, achieving rapid and effective flow field reconstruction. In this scheme, both the Eulerian and Lagrange modules are composed of a grid of discrete nodes, with each discrete point assigned corresponding hydraulic parameters. For the Eulerian module, these nodes represent the flow field of the entire computational domain; while for the Lagrange module, they represent the flow field region around the fish at different times. The Lagrange grid is similar to a dynamic grid in CFD methods, moving synchronously with the fish's movement during computational iterations. The method proposed in this invention achieves rapid and accurate reconstruction of the water-fish coupled flow field by continuously iteratively calculating the Lagrange grid and synchronously sharing the flow field information with the Eulerian grid.
[0078] The Lagrange module in this invention establishes a mapping relationship between input and output based on a convolutional neural network, thereby calculating the coupled flow field around the fish. By utilizing a trained neural network, the flow field during the fish's swimming process can be continuously calculated.
[0079] The method for constructing the water-fish coupled flow field dataset in S1 is as follows: Using the dynamic mesh technology of Fluent software, the flow field is calculated based on the fluid continuity equation and momentum equation, and the water-fish coupled flow field dataset is obtained by compiling a UDF. The formula for the fluid continuity equation is:
[0080]
[0081] Where ρ is the water flow density, u i Let x be the component of the velocity vector in the x-direction. i Let x be the x-direction and t be the time. The sign of the partial derivative;
[0082] The formula for the momentum equation is as follows:
[0083]
[0084] Among them, u j Let x be the component of the velocity vector in the y-direction. j The direction is y, p is the pressure acting on the water, and μ is the dynamic viscosity coefficient. t G is the eddy viscosity coefficient. i This represents the component of gravitational acceleration in the direction of gravity.
[0085] In the coupled flow field simulation of water and fish in S1, trigonometric functions are used to fit the wave motion of the fish body. The reference configuration of the fish body is a streamlined region located on the xy plane, and the contour function Y of the fish body is:
[0086]
[0087] Where s is the axial direction measured from the tip of the fish head along the fish axis, a1 is the first envelope coefficient, a2 is the second envelope coefficient, a3 is the third envelope coefficient, a4 is the fourth envelope coefficient, and a5 is the fifth envelope coefficient. In this embodiment: a1 = 0.17814, a2 = -0.0756, a3 = -0.21096, a4 = 0.17058, and a5 = -0.0609;
[0088] The wave function h(s,t) of the fish body is:
[0089] h(s,t)=b(s)sin(ks-ωt)
[0090] b(s) = b0 + b1s + b2s 2
[0091] Where b(s) is the amplitude envelope of the fish's lateral movement, k is the wave number of the body wave corresponding to the wavelength, which is taken as 0.95 in this embodiment, ω is the angular frequency corresponding to the tail beat frequency, which is taken as 1 in this embodiment, b0 is the first amplitude envelope coefficient, b1 is the second amplitude envelope coefficient, and b2 is the third amplitude envelope coefficient.
[0092] In this embodiment, as Figure 2 As shown, the object of the calculation is a fish with a body length of 0.1m. The computational domain is 2m × 2m in size, where the fish outline inside the dynamic mesh is divided into 1mm × 1mm meshes, while the area outside the dynamic mesh has a 4mm × 4mm mesh size. During the simulation, the fish's motion within one cycle (i.e., within 1 second) is illustrated in the diagram. Figure 3 As shown.
[0093] Based on the flow field dataset constructed in step S1, in the Lagrangian module, dynamic meshes of fish bodies (M) are analyzed separately. f ) and background dynamic mesh (M b Construct a convolutional neural mesh model. In this embodiment, M f The dimensions are 0.15m × 0.15m, and the grid size is 1mm × 1mm; M b The dimensions are 0.45m × 0.45m, and the grid size is 4mm × 4mm.
[0094] Within the Lagrange module, the movement speed of the fish body dynamic mesh and the background dynamic mesh is consistent with the swimming speed of the fish.
[0095] The center of the fish body dynamic mesh in S2 is the same as the center of the fish body outline. The fish body dynamic mesh is used to accurately calculate the coupled flow field of water and fish.
[0096] The center of the background dynamic mesh is the same as the center of the fish body outline. The background dynamic mesh is used to receive the water and fish coupled flow field calculated by the fish body dynamic mesh.
[0097] For water-fish coupled flow fields involving multiple fish, the background dynamic grids of different individual fish transmit flow field information to each other.
[0098] Building a convolutional neural network model in S3 includes the following steps:
[0099] S3-1: Use 30% of the water and fish coupled flow field dataset as the test set and the remaining water and fish coupled flow field dataset as the training set;
[0100] S3-2: An input matrix is constructed by superimposing multiple feature matrices independently stored in a two-dimensional matrix, and an output matrix is constructed based on the velocity field of the watershed where the fish is located, stored in the two-dimensional matrix at the next moment. The formula for the input matrix X is:
[0101] X=[U, V, U', V', IM, IM', SDF, SDF']
[0102] Where U is the x-direction velocity matrix of the dynamic mesh, V is the y-direction velocity matrix of the dynamic mesh, U' is the x-direction velocity matrix after moving to the target position, V' is the y-direction velocity matrix after moving to the target position, IM is the mesh type matrix, IM' is the mesh type matrix after the dynamic mesh moves to the target position, SDF is the fish body distance matrix, and SDF' is the fish body distance matrix after the dynamic mesh moves to the target position.
[0103] Then the input matrix X at time t t for:
[0104] X t =[U t V t U t ', V t ',IM t IM t ',SDF t SDF t ']
[0105] Among them, U t Let V be the velocity matrix in the x-direction of the dynamic mesh at time t. t Let U be the y-direction velocity matrix of the dynamic mesh at time t. t'V' represents the velocity matrix in the x-direction after moving to the target position at time t. t ' is the y-direction velocity matrix after moving to the target position at time t, IM t Let t be the mesh type matrix, where the mesh containing the moving fish is 1, the fluid region is 0, and the solid region is 2. IM t ' is the mesh type matrix after the dynamic mesh has moved to the target position at time t, SDF t This is the distance matrix of the fish at time t, where the grid cell containing the fish is 0, and the other grid cells represent the shortest distance to the fish's region. (SDF) t ' is the fish body distance matrix after the dynamic mesh moves to the target position at time t;
[0106] S3-3: Normalize the input matrix using the following formula:
[0107]
[0108] Let X be the normalized result of the input variables for each sample at time t. min X represents the minimum value of the input variable for each sample. max The maximum value of the input variable for each sample;
[0109] S3-4: Use the input matrix as the input to the convolutional neural network model and the output matrix as the output of the convolutional neural network model;
[0110] S3-5: Train and test the convolutional neural network model using the training and test sets respectively to complete the construction of the convolutional neural network model. During testing, the Adam optimizer is used, and the loss function is the mean squared error of two velocity components to evaluate the predictive performance of the trained convolutional neural network model. The formula is:
[0111]
[0112] Where Loss is the prediction loss, N is the total number of data points, and m is the number of selected data points. For the x-direction velocity of the test set, For the x-direction velocity of the test set, The velocity in the y-direction of the test set. Let be the velocity in the y-direction of the test set.
[0113] The convolutional neural network model in S3-4 is built based on UNet and includes an encoder and a decoder. The encoder includes multiple convolutional blocks and the decoder includes multiple deconvolutional blocks.
[0114] In this embodiment, the convolutional neural network model includes one encoder and two decoders. The encoder includes seven convolutional blocks, and the decoder includes seven deconvolutional blocks. Each convolutional or deconvolutional block contains three convolutional or deconvolutional layers, and one max-pooling or max-unpooling layer. Figure 4 As shown in (b) above. A single convolutional (deconvolutional) layer includes convolutional (deconvolutional) operations, a ReLU activation function, and a batch normalization process, as shown in (b). Figure 4 As shown in (a) in the figure.
[0115] The S4 flow field fast reconstruction model includes Eulerian modules (Eulerian mesh) and Lagrangian modules (fish mesh and environment mesh), such as... Figure 5 As shown, the Euler module is used to describe the flow field information of the entire computational domain, and the Lagrange module is used to describe the local flow field information centered on the fish body.
[0116] The initial flow field of the Euler module is a steady-state flow field simulated without considering the presence of the fish. It is obtained by using the fluid continuity equation and momentum equation and the Fluent software.
[0117] The initial flow field of the Lagrange module is the flow field information of the fish's dynamic mesh and the background dynamic mesh at the corresponding positions in the Eulerian module.
[0118] The simulation process of the fast flow field reconstruction model in S4 includes the following steps:
[0119] S4-1: Set the starting position of the fish in the computational domain, initialize the mesh flow field of the Euler module and the mesh flow field of the Lagrange module, and calculate the input matrix of the convolutional neural network model of the fish dynamic mesh and the background dynamic mesh under the initial conditions respectively.
[0120] S4-2: Based on the input matrix, set the swimming speed function of the fish throughout the simulation process, obtain the swimming speed vector according to the swimming speed function, and rotate the coordinate system of the fish body wave motion fitting formula according to the swimming speed vector to obtain the fish body morphology change process during the entire swimming process.
[0121] S4-3: Based on the fish body morphology change process, the input matrices of the fish body dynamic mesh and the background dynamic mesh at time t are input into the pre-trained convolutional neural network model to obtain the predicted output variables at time t, and data sharing is achieved through interpolation;
[0122] S4-4: Iterate through step S4-3 until the simulation ends.
[0123] S4-3 includes the following steps:
[0124] S4-3-1: Obtain the position and shape of the fish at time t, and collect U.t V t U t '、V t '、IM t IM t '、SDF t and SDF t ', to obtain the input matrices of the fish body dynamic mesh and the background dynamic mesh;
[0125] M f and M b The input variable at time t is U t M f and M b The input variable at time t-dt is V t Obtain M from the Euler mesh f and M b The flow velocity centered on the position of the fish at time t+dt is taken as U. t 'and V t M is obtained based on the position and movement pattern of the fish at time t. f and M b IM t M is obtained based on the position and motion pattern of the fish at time t+dt. f and M b IM t 'Calculate M based on the fish's position and movement pattern at time t' f and M b SDF t M is calculated based on the position and motion pattern of the fish at time t+dt. f and M b SDF t In this embodiment, dt is 0.1s.
[0126] S4-3-2: Input the input matrices of the fish body dynamic mesh and the background dynamic mesh into the trained convolutional neural network model to obtain the predicted output variables of the fish body dynamic mesh and the background dynamic mesh respectively;
[0127] S4-3-3: Interpolate the predicted output variables of the fish body dynamic mesh to the corresponding mesh points of the predicted output variables of the background dynamic mesh, and at the same time interpolate the predicted output variables of the Lagrange mesh (fish body dynamic mesh and background dynamic mesh) to the corresponding mesh points of the Eulerian mesh.
[0128] S4-3-4: Perform the calculation for the next time step and complete the data sharing.
[0129] This invention utilizes a fully trained neural network to perform CFD calculations and compare the velocity distribution of the predicted flow field within the watershed where the fish is located over a complete motion cycle. For example... Figure 6 As shown, a visual comparison between the two is presented, which clearly demonstrates the accuracy of the flow field reconstruction of the present invention in the simulation results.
[0130] This invention aims to overcome the inefficiency of traditional CFD methods in solving water-fish coupled flow field problems, and proposes a novel method for flow field reconstruction using convolutional neural networks. This method learns patterns from a large amount of dynamic grid flow field numerical simulation data, enabling rapid and accurate prediction of flow field information at any given time, thus achieving precise reconstruction of the water-fish coupled flow field. Compared to traditional CFD methods, this method significantly reduces computation time while ensuring the reliability of the results.
[0131] This invention introduces the concept of the Eulerian-Lagrange method, treating the entire computational domain mesh as an Eulerian module and focusing on the mesh surrounding the fish body as a Lagrange module. This modeling approach is flexible and highly portable. When applied to flow fields in computational domains of different shapes, it is only necessary to recalculate the initial flow field of the Eulerian mesh and then apply the pre-trained convolutional neural network model to the Lagrange module to directly obtain the required flow field information.
[0132] This invention can be combined with fish migration models to provide richer hydraulic information for the virtual fish's motion decisions by calculating the water-fish coupled flow field in real time during the virtual fish's movement, thereby improving the realism of fish simulation. This method provides a new technical means for fishway design and offers more refined support for the simulation and analysis of migration behavior.
[0133] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of the invention.
Claims
1. A data-driven water and fish coupled scenario flow field reconstruction method, characterized in that, Includes the following steps: S1: Using CFD models, simulate the coupled flow field of water and fish under various scenarios and construct a coupled flow field dataset of water and fish. S2: Based on the coupled flow field dataset of water and fish, the dynamic mesh of the fish body and the dynamic mesh of the background are constructed by using the Lagrange module and the convolutional neural network prediction method. S3: Construct convolutional neural network models for the dynamic mesh of the fish body and the dynamic mesh of the background, respectively; S4: Based on the convolutional neural network model and the Eulerian-Lagrange method, a rapid flow field reconstruction model is constructed to accurately predict the water-fish coupled flow field and complete the data-driven water-fish coupled scene flow field reconstruction. The fast flow field reconstruction model in S4 includes an Eulerian module and a Lagrange module. The Eulerian module is used to describe the flow field information of the entire computational domain, and the Lagrange module is used to describe the local flow field information centered on the fish body. The initial flow field of the Euler module is a steady-state flow field simulated without considering the presence of the fish, and is obtained by calculation using the fluid continuity equation and momentum equation. The initial flow field of the Lagrange module is the flow field information of the fish's dynamic mesh and the background dynamic mesh at the corresponding positions in the Eulerian module at the initial position; The simulation process of the rapid flow field reconstruction model in S4 includes the following steps: S4-1: Set the starting position of the fish in the computational domain, initialize the mesh flow field of the Eulerian module and the mesh flow field of the Lagrange module, and calculate the input matrix of the convolutional neural network model of the fish dynamic mesh and the background dynamic mesh under the initial conditions respectively. The input matrix for: in, For dynamic mesh Directional velocity matrix For dynamic mesh Directional velocity matrix After moving to the target position Directional velocity matrix After moving to the target position Directional velocity matrix For a grid type matrix, This is the mesh type matrix after the dynamic mesh has been moved to the target location. The distance matrix between fish bodies. This is the distance matrix of the fish body after the dynamic mesh moves to the target position; S4-2: Based on the input matrix, set the swimming speed function of the fish throughout the simulation process, obtain the swimming speed vector according to the swimming speed function, and rotate the coordinate system of the fish body wave motion fitting formula according to the swimming speed vector to obtain the fish body morphology change process during the entire swimming process. S4-3: Based on the process of fish morphological changes, The input matrices of the dynamic meshes of the fish body and the background at each time step are fed into a pre-trained convolutional neural network model to obtain... The system continuously predicts output variables and achieves data sharing through interpolation. The interpolation specifically involves interpolating the predicted output variables of the fish body dynamic grid to the corresponding grid points of the predicted output variables of the background dynamic grid, while simultaneously interpolating the predicted output variables of the Lagrange grid to the corresponding grid points of the Eulerian grid. S4-4: Iterate through step S4-3 until the simulation ends.
2. The data-driven water and fish coupled scene flow field reconstruction method according to claim 1, characterized in that, The method for constructing the water-fish coupled flow field dataset in S1 is as follows: Dynamic mesh technology is used to calculate the flow field based on the fluid continuity equation and momentum equation, and a UDF is used to compile the data to obtain the water-fish coupled flow field dataset. The formula for the fluid continuity equation is: in, For water flow density, For the velocity vector in directional components, for direction, For time, The sign of the partial derivative; The formula for the momentum equation is as follows: in, For the velocity vector in directional components, for direction, The pressure acting on the water body, The coefficient of dynamic viscosity, Where is the eddy viscosity coefficient. This represents the component of gravitational acceleration in the direction of gravity.
3. The data-driven water and fish coupled scene flow field reconstruction method according to claim 2, characterized in that, In the coupled flow field simulation of water and fish in S1, trigonometric functions are used to fit the wave motion of the fish body. The reference configuration of the fish body is a streamlined region located on the xy plane, and the contour function of the fish body is... for: in, The axial length measured from the tip of the fish's head along the fish's axis. The coefficient of the first envelope, The coefficients of the second envelope. The third envelope coefficient, The fourth envelope coefficient, The coefficient of the fifth envelope; The wave function of the fish body for: in, This represents the amplitude envelope of the fish's lateral movement. The wavenumber of the volume wave corresponding to the wavelength. The angular frequency corresponding to the tail beat frequency. The first amplitude envelope coefficient, The coefficient of the second amplitude envelope. This is the envelope coefficient of the third amplitude.
4. The data-driven water and fish coupled scene flow field reconstruction method according to claim 1, characterized in that, The center of the fish body dynamic mesh in S2 is the same as the center of the fish body outline. The fish body dynamic mesh is used to accurately calculate the coupled flow field of water and fish. The center of the background dynamic mesh is the same as the center of the fish body outline. The background dynamic mesh is used to receive the water and fish coupled flow field calculated by the fish body dynamic mesh. For water-fish coupled flow fields involving multiple fish, the background dynamic grids of different individual fish transmit flow field information to each other.
5. The data-driven water and fish coupled scene flow field reconstruction method according to claim 1, characterized in that, The construction of the convolutional neural network model in S3 includes the following steps: S3-1: Use 30% of the water and fish coupled flow field dataset as the test set and the remaining water and fish coupled flow field dataset as the training set; S3-2: An input matrix is constructed by superimposing multiple feature matrices independently stored in a two-dimensional matrix, and an output matrix is constructed based on the velocity field of the watershed where the fish is located, stored in the two-dimensional matrix at the next moment. The formula is: in, For dynamic mesh Directional velocity matrix For dynamic mesh Directional velocity matrix After moving to the target position Directional velocity matrix After moving to the target position Directional velocity matrix For a grid type matrix, This is the mesh type matrix after the dynamic mesh has been moved to the target location. The distance matrix between fish bodies. This is the distance matrix of the fish body after the dynamic mesh moves to the target position; but Input matrix at time step for: in, for Real-time dynamic grid Directional velocity matrix for Real-time dynamic grid Directional velocity matrix for After moving to the target position Directional velocity matrix for After moving to the target position Directional velocity matrix for The grid type matrix at time step, for The grid type matrix after the dynamic grid moves to the target position. for The distance matrix of the fish body at time step, for The distance matrix of the fish body after the dynamic grid moves to the target position at any time; S3-3: Normalize the input matrix using the following formula: for The normalized results of the input variables for each sample at time point. The minimum value of the input variable for each sample. The maximum value of the input variable for each sample; S3-4: Use the input matrix as the input to the convolutional neural network model and the output matrix as the output of the convolutional neural network model; S3-5: Train and test the convolutional neural network model using the training and test sets respectively to complete the construction of the convolutional neural network model. During testing, the Adam optimizer is used, and the loss function is the mean squared error of two velocity components to evaluate the predictive performance of the trained convolutional neural network model. The formula is: in, To predict losses, The total number of data points. For the selected data, For the test set Directional velocity, For the test set Directional velocity, For the test set Directional velocity, For the test set Directional velocity.
6. The data-driven water and fish coupled scene flow field reconstruction method according to claim 5, characterized in that, The convolutional neural network model in S3-4 is built based on UNet and includes an encoder and a decoder. The encoder includes multiple convolutional blocks and the decoder includes multiple deconvolutional blocks.
7. The data-driven water and fish coupled scene flow field reconstruction method according to claim 1, characterized in that, S4-3 includes the following sub-steps: S4-3-1: Obtain the fish The location and shape at any given time, and the data collected. , , , , , , and The input matrices for obtaining the dynamic mesh of the fish body and the dynamic mesh of the background are obtained. S4-3-2: Input the input matrices of the fish body dynamic mesh and the background dynamic mesh into the trained convolutional neural network model to obtain the predicted output variables of the fish body dynamic mesh and the background dynamic mesh respectively; S4-3-3: Interpolate the predicted output variables of the fish body dynamic mesh to the corresponding mesh points of the predicted output variables of the background dynamic mesh, and at the same time interpolate the predicted output variables of the Lagrange mesh to the corresponding mesh points of the Eulerian mesh. S4-3-4: Perform the calculation for the next time step and complete the data sharing.