Cabin immersion flow field prediction method and device based on adaptive physical neural network
By using adaptive physical neural network method in complex and non-constant chamber immersion flow fields, the neural network model is constructed and optimized, and the complex flow field problem that is difficult to accurately predict in the existing technology is solved, achieving more efficient prediction accuracy and reduction in computational cost.
Patent Information
- Application Number
- CN202411558359.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-04
AI Technical Summary
The prior art is difficult to effectively predict complex and unstable chamber immersion flow fields, especially in scenarios with severe dynamic changes. The highly nonlinearity and complexity of the flow fields make it difficult for existing methods to accurately predict.
Using an adaptive physical neural network method, a ship model is constructed in CATIA software and fluid simulation is performed in STAR-CCM+ software to generate grid data of the flow field. Then, the data is processed and saved using the Pytorch framework, a data set for neural network training is built, and the parameters of the neural network are optimized through dynamic training strategies to improve prediction accuracy.
It significantly improves the prediction accuracy of the chamber immersion flow field, can accurately capture the dynamic changes of the flow field, and reduces the calculation cost during the prediction process, providing more efficient technical support for ship safety and anti-water immersion capabilities.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of neural network prediction of complex flow fields, and in particular to a method and device for predicting cabin flooding flow fields based on an adaptive physical neural network. Background Art
[0002] In the past few decades, the research on ship flooding flow field has made significant progress. By analyzing physical quantities such as flow velocity and pressure in the flooding flow field, researchers have gained a deep understanding of the changes in the hull force and successfully explained and predicted key hydrodynamic phenomena in the flooding process, such as the jet effect and air compression effect. These achievements not only deepen the understanding of the flooding mechanism, but also provide a scientific basis for improving the ship's anti-flooding ability and vitality.
[0003] The experimental method is a direct and effective means to study the submerged flow field. Through standardized experimental pools, researchers can obtain accurate submerged data in a variety of environments such as still water, regular waves, and irregular waves. These data provide a reliable basis for simulation research and lay a solid foundation for theoretical verification. However, due to the high cost of experimental sites and manpower, the experimental method is difficult to carry out widely and is mainly used for theoretical verification.
[0004] Computational fluid dynamics (CFD) methods have become an important tool for ship flooding research as computing power has increased. The method uses mesh methods represented by the finite element method and the finite difference method, as well as meshless methods represented by the smooth particle method. These methods can accurately solve the incompressible NS equations and provide accurate physical quantities such as velocity, pressure and displacement, which are highly consistent with experimental data. However, the accuracy of CFD depends on complex meshing, flow field modeling and calculation settings, which greatly increases the computational cost. At the same time, fluid mechanics formulas and calculation software, such as STAR-CCM+, need to be updated frequently, and different calculation models, such as k-ε and k-ω turbulence models, further increase the complexity. Since CFD needs to solve the incompressible NS equations on millions or even tens of millions of grids, it usually takes more than ten hours or even longer to calculate a flooding scenario, and with the improvement of accuracy, the computing time and resource requirements increase exponentially, becoming a bottleneck that is difficult to avoid for CFD methods.
[0005] In recent years, neural networks, especially physical information neural networks (PINNs), have shown new application potential in the study of ship submerged flow fields. By combining physical equations and data constraints, PINNs can predict flow fields in non-extreme environments, such as non-huge waves or hurricanes. The PINN method has been successfully applied to the prediction of typical turbulent fields such as flow around cylinders and periodic hills, as well as turbulence modeling, modified turbulence closure models, and data assimilation strategies. PINN inputs data obtained from physical experiments or simulations into the neural network and combines it with physical equations for training, and can ultimately accurately predict the physical quantities in the flow field.
[0006] However, PINN also has shortcomings, which are mainly reflected in the following aspects: First, the training of neural networks is highly dependent on the quality of input data and the selection of flow field areas. Due to the complex nonlinear characteristics of the flow field, the existing PINN training schemes are often difficult to maintain sufficient accuracy in complex flow fields or scenarios with drastic dynamic changes. Secondly, PINN has achieved initial success in some steady flow problems, but its performance is still limited in unsteady flow problems, especially in rapidly changing flow fields, such as cabin flooding scenarios. In addition, there are also challenges in the selection of hyperparameters and optimization of network architecture during the training process, which affect the prediction accuracy and efficiency of the model. Summary of the invention
[0007] The present invention aims to solve the problems in the prior art that the cabin flooding flow field has a high degree of nonlinearity and dynamic changes, and the free liquid surface hydrodynamic phenomenon is complex and difficult to predict.
[0008] To solve the above technical problems, the present invention is achieved through the following technical solutions:
[0009] Solution 1: The present invention proposes a cabin flooding flow field prediction method based on an adaptive physical neural network, the method comprising:
[0010] S1. Construct a ship model of low-speed flow field in CATIA software;
[0011] S2, import the ship model of the low-speed flow field constructed in S1 into the STAR-CCM+ software for fluid simulation, and generate mesh data of the flow field;
[0012] S3, processing the grid data of the flow field generated by S2 according to the time step; processing and saving the processed grid data through the Pytorch framework to construct a data set for neural network training;
[0013] S4. Use the Pytorch framework to dynamically train the dataset for neural network training;
[0014] S5. Use S1 to S4 for cabin flooding flow field prediction to complete cabin flooding flow field prediction based on adaptive physical neural network.
[0015] Furthermore, a preferred embodiment is provided, wherein the ship model for constructing the low-speed flow field in S1 includes a step of setting dimension elements of the cabin, and the dimension elements of the cabin include length, width, height and bulkhead thickness.
[0016] Further, a preferred embodiment is provided, in which the method of importing the ship cabin model into STAR-CCM+ software for fluid simulation in S2 is:
[0017] S2.1. Set up a numerical water pool and select a turbulence model based on external environmental conditions;
[0018] S2.2, dividing the flow field information of the turbulence model, wherein the flow field information includes a velocity inlet, a pressure outlet and a symmetry plane;
[0019] S2.3, dividing the flow field information into grids, and encrypting the grids according to the flow field information divided by the grids;
[0020] S2.4. After completing S2.1 to S2.3, start the ship cabin model and import it into STAR-CCM+ software for fluid simulation.
[0021] Furthermore, a preferred embodiment is provided, in which the grid data for generating the flow field in S2 is obtained from a grid layer at 0.05 m in the vertical direction of the cabin.
[0022] Furthermore, a preferred implementation is provided, in which the dynamic training of the data set for neural network training in S4 includes the steps of constructing and training a basic neural network, dynamic training, and updating the data set.
[0023] Furthermore, a preferred implementation is provided, in which the construction of the basic neural network is implemented by using a fully connected neural network as the main body of the basic neural network.
[0024] Furthermore, a preferred implementation S4 is provided in which a method for dynamically training a data set for basic neural network training is provided, which employs a gradient descent method combined with an Adam optimizer for training.
[0025] Solution 2: A cabin flooding flow field prediction device based on an adaptive physical neural network, the device comprising:
[0026] Ship model building module, used to build ship models of low-speed flow fields in CATIA software;
[0027] The flow field grid data generation module is used to import the ship model of the low-speed flow field constructed by the ship model construction module into the STAR-CCM+ software to perform fluid simulation and generate the flow field grid data;
[0028] The data set processing module is used to process the mesh data of the flow field generated by the mesh data generation module of the flow field according to the time step; the processed mesh data is processed and saved through the Pytorch framework to construct a data set for neural network training;
[0029] Dynamic training module, used to dynamically train the dataset for neural network training using the Pytorch framework;
[0030] The prediction module is used to build the module to the dynamic training module based on the ship model to complete the cabin flooding flow field prediction based on the adaptive physical neural network.
[0031] Solution three: A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes any one of the methods described in Solution one.
[0032] Solution 4: A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of Solution 1.
[0033] The present invention is beneficial in that:
[0034] The method and device for predicting cabin flooding flow field based on adaptive physical neural network described in the present invention aim to significantly improve the prediction accuracy of the complex unsteady flow field of cabin flooding, and discover its internal regularity through deep mining of flow field data. At the same time, the existing calculation methods are optimized to achieve accurate reproduction of the dynamic changes of the flow field, and on this basis, greatly reduce the calculation cost in the prediction process. The present invention can not only capture the complex phenomena of hydrodynamics under the free liquid surface, but also rely on new methods such as physical information neural networks in the case of data scarcity to improve the reliability and adaptability of the model to the development trend of the flow field, thereby providing more efficient technical support for ship safety and anti-flooding capabilities.
[0035] Based on the strategy of combining dynamic training with traditional training, the present invention constructs and trains a physical information neural network that is adapted to the cabin flooding flow field. The network can not only accurately predict the flow field state within the data range, but also predict the flow field at continuous moments outside the data, and output relevant physical quantities and flow field development trends.
[0036] The present invention is also applicable to the field of self-adaptation of cabin flooding flow fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 Schematic diagram of a cabin flooding model for the cabin flooding flow field prediction method based on an adaptive physical neural network described in Implementation Method 1.
[0038] Figure 2 Schematic diagram of the simulation flow field definition of the cabin flooding flow field prediction method based on the adaptive physical neural network described in Implementation Method 1.
[0039] Figure 3 This is a schematic diagram of data collection in the cabin flooding flow field prediction method based on adaptive physical neural network described in Implementation Method 1.
[0040] Figure 4 Schematic diagram of the loss function of configuration 1 described in implementation mode eleven.
[0041] Figure 5 Schematic diagram of the DAPNN training process described in Implementation Example 11.
[0042] Figure 6 This is a schematic diagram comparing the prediction effects of DAPNN and PINN at different times described in Implementation Example 11.
[0043] Figure 7 This is an enlarged schematic diagram comparing the prediction effects of DAPNN and PINN at different times described in Implementation Example 11. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the implementation methods of the present application clearer, the technical solutions in the implementation methods of the present application will be clearly and completely described below in conjunction with the drawings in the implementation methods of the present application. Obviously, the described implementation methods are only part of the implementation methods of the present application, not all of the implementation methods.
[0045] Embodiment 1: This embodiment provides a method for predicting cabin flooding flow field based on an adaptive physical neural network, the method comprising:
[0046] S1. Construct a ship model of low-speed flow field in CATIA software;
[0047] S2, import the ship model of the low-speed flow field constructed in S1 into the STAR-CCM+ software for fluid simulation, and generate mesh data of the flow field;
[0048] S3, processing the grid data of the flow field generated by S2 according to the time step; processing and saving the processed grid data through the Pytorch framework to construct a data set for neural network training;
[0049] S4. Use the Pytorch framework to dynamically train the dataset for neural network training;
[0050] S5. Use S1 to S4 for cabin flooding flow field prediction to complete cabin flooding flow field prediction based on adaptive physical neural network.
[0051] Implementation method 2. This implementation method is a further limitation of the cabin flooding flow field prediction method based on adaptive physical neural network described in implementation method 1. The ship model for constructing the low-speed flow field in S1 includes the step of setting the size elements of the cabin, and the size elements of the cabin include length, width, height and bulkhead thickness.
[0052] Implementation method 3: This implementation method further limits the cabin flooding flow field prediction method based on adaptive physical neural network described in implementation method 1. The method of importing the ship cabin model into STAR-CCM+ software for fluid simulation in S2 is:
[0053] S2.1. Set up a numerical water pool and select a turbulence model based on external environmental conditions;
[0054] S2.2, dividing the flow field information of the turbulence model, wherein the flow field information includes a velocity inlet, a pressure outlet and a symmetry plane;
[0055] S2.3, dividing the flow field information into grids, and encrypting the grids according to the flow field information divided by the grids;
[0056] S2.4. After completing S2.1 to S2.3, start the ship cabin model and import it into STAR-CCM+ software for fluid simulation.
[0057] Implementation method 4: This implementation method further limits the cabin flooding flow field prediction method based on adaptive physical neural network described in implementation method 1. The grid data for generating the flow field in S2 is obtained from the grid layer at 0.05 meters in the vertical direction of the cabin.
[0058] Implementation method five: This implementation method is a further limitation of the cabin flooding flow field prediction method based on adaptive physical neural network described in implementation method one. The dynamic training of the data set for neural network training in S4 includes the steps of constructing and training the basic neural network, dynamic training and updating the data set.
[0059] Implementation method six: This implementation method is a further limitation of the cabin flooding flow field prediction method based on adaptive physical neural network described in implementation method five. The construction of the basic neural network is implemented by using a fully connected neural network as the main body of the basic neural network.
[0060] Implementation method seven: This implementation method is a further limitation of the cabin flooding flow field prediction method based on adaptive physical neural network described in implementation method five. The method for dynamically training the data set for basic neural network training in S4 adopts gradient descent method combined with Adam optimizer for training.
[0061] Embodiment 8: This embodiment proposes a cabin flooding flow field prediction device based on an adaptive physical neural network, the device comprising:
[0062] Ship model building module, used to build ship models of low-speed flow fields in CATIA software;
[0063] The flow field grid data generation module is used to import the ship model of the low-speed flow field constructed by the ship model construction module into the STAR-CCM+ software to perform fluid simulation and generate the flow field grid data;
[0064] The data set processing module is used to process the mesh data of the flow field generated by the mesh data generation module of the flow field according to the time step; the processed mesh data is processed and saved through the Pytorch framework to construct a data set for neural network training;
[0065] Dynamic training module, used to dynamically train the dataset for neural network training using the Pytorch framework;
[0066] The prediction module is used to build the module to the dynamic training module based on the ship model to complete the cabin flooding flow field prediction based on the adaptive physical neural network.
[0067] Embodiment 9. This embodiment proposes a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the method described in any one of embodiments 1 to 7.
[0068] Embodiment 10: This embodiment proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the method described in any one of embodiments 1 to 7 are implemented.
[0069] Implementation eleven: This implementation provides an example, which is used to explain the above implementations one to eight. The specific example is as follows:
[0070] See also Figures 1 to 7Description of this embodiment, step 1, 3D model: This embodiment first selects a ship model suitable for the low-speed flow field and performs 3D modeling in CATIA software. The modeling process involves setting the key dimensional elements of the cabin, including length, width, height and bulkhead thickness. Since the flow process does not involve rotational motion, the calculation of the moment of inertia can be omitted. In addition, the size and position of the flooding breach need to be carefully set to ensure the accuracy of the model.
[0071] This implementation scenario uses the cabin flooding scenario of Flooding Accident Response (FLARE) - there is rectangular damage in the cabin. Figure 1 The flood water flows in from the narrow and long breach distributed along the y-axis. The external environment is a low-speed flow along the x-direction, and the flood water flows slowly through the cabin. Figure 1 In the top view of the figure, blue represents flooding. The flow velocity along the x direction is defined as u, and the flow velocity along the y direction is defined as v.
[0072] To make the flooding scenario two-dimensional, the following assumptions are required: 1. Ignore the gravity G exerted on the seawater during the flooding process, which can be achieved by adjusting the waterline height outside the cabin and matching the grid division. 2. The flooding water and air are considered as incompressible fluids and the movement of the air is negligible during the flooding process. Based on these assumptions, the cabin flooding scenario is as follows: After the cabin is flooded from the narrow and long damage, it spreads along the bottom of the cabin, and the flooding only flows in the two directions of the ship width and length.
[0073] Step 2: Fluid Simulation
[0074] Based on the assumptions in step one, a flooding scenario is arranged for simulation calculations, and a flow field data set is obtained for training and verification. After the modeling is completed, the ship cabin model is imported into the STAR-CCM+ software for fluid simulation. First, a numerical water pool is set up, and a suitable turbulence model is selected according to the external environmental conditions. Subsequently, the flow field information is divided, including important parameters such as velocity inlet, pressure outlet, and symmetry plane. Next, the flow field is meshed, and the mesh is appropriately encrypted according to the complexity of the flow field. After all preparations are completed, the cabin flooding simulation is started, and the mesh data of the flow field is exported in Excel format to provide a basis for subsequent analysis.
[0075] This step is carried out in the fluid calculation software STAR-CCM+, which is a mature fluid simulation software that has gone through dozens of versions.
[0076] The simulation interface in STAR-CCM+ is as follows Figure 2As shown, the parameters of the cabin and flow domain are shown in Table 1. The cabin damage is rectangular, the entire calculation domain is a cuboid, the flow domain length LR is defined as the distance from the inlet to the outlet, the flow domain width DR is defined as the distance between the two symmetry planes, and the flow domain height HR is defined as Figure 2 The distance from the top to the bottom. Seawater pours in from the opening and spreads inside the cabin.
[0077] Table 1 Elements of flooding scene
[0078]
[0079]
[0080] The entire basin is divided into 2.08 million grids, and the grid points can be used to export solution data at different times, and the cabin is encrypted to obtain more accurate calculation results. Since STAR-CCM+ adopts the fluid domain volume method, in order to obtain the cabin flooding distribution information at different times, the volume fraction of water in the grid also needs to be exported. In the simulation, when the volume fraction of water is greater than or equal to 0.5, it is determined that there is water in the space. Based on this, the data collection content includes: velocity vector (x, y direction), pressure, and volume fraction of water at the grid point. Based on the needs of the two-dimensional scene, the grid point data of some areas inside the cabin are exported. The number of millions of grids is to ensure the accuracy of fluid calculations, and not all of them are involved in neural network training.
[0081] This implementation method acquires data from the grid layer at 0.05 meters in the vertical direction of the cabin. Figure 3 The grid distribution and data point collection density of the watershed at h = 0.05 meters are shown. Green represents data collection points. The collection area is 6.8 meters long and 1.9 meters wide. The spatial resolution is 56*38. The time interval is 2.0-5.8 seconds and the time frequency is 0.01 seconds / time. A total of 851,200 data points were obtained.
[0082] Step 3: Data processing
[0083] The data generated by the fluid simulation is processed in depth, and the physical quantities are subdivided according to time based on the grid points. All the data obtained during the immersion process are processed and saved through the Pytorch framework to construct a data set for neural network training. The data processing at this stage provides the necessary input data for subsequent model training.
[0084] These data need to be further processed, and the grid points with flooding are calculated based on the obtained water volume fraction, and the data on these grid points will be used for neural network training. This reflects two characteristics of using neural networks for cabin flooding prediction: 1. The flow field where the data is collected is not regular; 2. Data collection will not wait until the flow field is stable, or in other words, there is no absolutely stable time interval for cabin flooding.
[0085] The immersion condition is selected as u = 1m / s. Before training the neural network, the data information is statistically analyzed and processed to a certain extent. The value ranges of various physical quantities are shown in Table 2. Pressure and velocity are dimensionless using the incoming flow velocity and density.
[0086] Table 2 The value range of training data
[0087]
[0088] Due to the scene, there are no negative numbers for velocity u and pressure p, and the distribution of extreme values is relatively uniform. In contrast, the distribution of velocity v varies greatly. When taking the absolute value, the difference in magnitude reaches 10 7 .
[0089] Step 4: Neural Network Training
[0090] This step covers the construction and training of basic neural networks, dynamic training, and data set updates.
[0091] 4.1. Basic neural network construction
[0092] This implementation method selects a fully connected neural network as the main body of the basic neural network, and the activation function uses a hyperbolic function to enhance the nonlinear mapping ability of the model. Part of the water immersion data is used as input for training, and the loss function consists of physical loss and data loss, aiming to optimize the learning efficiency of the network. The gradient descent method is combined with the Adam optimizer for training. After multiple rounds of iterations, when the neural network loss is reduced to a predetermined level and tends to be stable, the training is terminated to ensure the convergence of the model.
[0093] 4.2 Dynamic Training
[0094] After extracting the basic neural network, the dynamic training process is carried out. The data set different from 4.1 is divided into multiple independent data sets according to the time step, and each time step t corresponds to a specific data set. In the training of the previous and next moments, the neural network parameters will be dynamically iterated so that they can evolve according to the dynamic law of cabin flooding, thereby enhancing the adaptability and accuracy of the model. In addition, the basin area S and the number of basin points N are introduced as components of the loss function in the dynamic training process to further improve the prediction ability of the model.
[0095] 4.3 Dataset Update
[0096] To support dynamic training, the data set is updated. This process aims to ensure that the neural network can effectively capture the dynamic laws of cabin flooding, and the update of the data set provides the necessary data support for this. Specifically, we will select some grid point data from the data set of the previous moment so that it can be integrated into the data set of the next moment, thereby partially retaining the flooding characteristics of the previous moment and realizing the dynamic evolution and update of the data set. This data update mechanism lays a solid foundation for the continuous learning and adaptability of the model.
[0097] The above steps specifically include the following:
[0098] 4.1 Basic Network Training
[0099] The fully connected neural network was selected as the basic neural network. The coordinate and time information in the flow field is used as input, and the key physical quantities such as velocity and pressure of the flow field are output after transformation through several linear layers. In theory, a linear layer with sufficient depth can depict the nonlinear relationship between any input and output. In other words, through training with a large amount of data, the neural network can play the role of a solver of nonlinear partial differential equations to a certain extent.
[0100] In the basic neural network, the input layer contains the two-dimensional coordinates of the flow field particles The grid point coordinates are in the same direction Figure 1 The output layer contains the velocity and pressure corresponding to the point at that time, and the hidden layer in the middle is a number of fully connected layers. The network is trained using the gradient descent method. Table 3 gives the information of the basic neural network training.
[0101] Table 3 Basic neural network training parameters
[0102]
[0103] The loss function of the basic neural network is shown in equation (1). The first part is the loss of physical law L res First, the first-order and second-order partial derivatives of the physical quantities u, v, and p with respect to time are calculated (using the Pytorch automatic differentiation module). These partial derivatives are combined according to the discretized mass conservation equation (Equation 1) and momentum conservation equation (Equation 2) to obtain L res . The momentum conservation equation corresponds to the F of equation (2) momentum , the mass conservation equation corresponds to F in equation (2) mass , and the momentum conservation equation is divided into two parts, x and y; the second part loss function L dataCorresponding to the data points, these are randomly selected points in the flow domain using a random sampling strategy. At these data points, we hope that the error between the predicted velocity and pressure and the true value is close to zero. By reducing the two-part loss, the neural network is encouraged to find a specific set of parameters that can replace the traditional CFD approximator to a certain extent and give the solution of the differential equations implied by the cabin flooding scenario. The mathematical expressions of the various parts of the loss function are shown in equations (2) to (6):
[0104] L loss =α1L res +L data (1)
[0105] L res =F momentum +F mass (2)
[0106]
[0107] F momentum =F momentum_x 2 +F momentum_y 2 (4)
[0108]
[0109] For equations (2) to (6): i ranges from 0, 1, 2…N, representing the number of data points; j ranges from 1 to 2, corresponding to the x and y directions, respectively; u and v correspond to the fluid movement speed in the x and y directions, respectively; p represents pressure; t represents time, ranging from 2.0 to 4.0 seconds; θ k represents the learnable neural network parameters, λ1 and λ2 represent the two constants in the NS equation, and their physical meanings are the density and dynamic viscosity of water.
[0110]
[0111] For equation (7): t represents time, ranging from 2.0 to 4.0 seconds; label represents the true value, pred represents the neural network predicted value; i, j represent the horizontal and vertical coordinates of the discrete flooded area; Represents the speed in the x and y directions at each discrete point. The parameters α1, α2, Represents the weight of each loss.
[0112] This example first verifies the training effect of the basic neural network. Although the fully connected neural network shows good results in scenarios such as flow around a cylinder and flow in a square cavity, the prediction ability of the flow field in the cabin flooding scenario still needs to be verified. The fully connected neural network needs to show a certain ability to capture and model the evolution of flooding to prove its rationality as the basic network of the DAPNN framework.
[0113] A fixed area of the flooded cabin is selected for prediction and reconstruction. The flow field prediction area is a rectangle with the midpoint of the rectangular breach as the origin, and the horizontal and vertical coordinate ranges are [-4.8m, -2m], [-0.95m, 0.95m]. Through repeated training, the number of iterations is determined to be 100,000 times, taking into account both the training time cost and the accuracy. Table 4 gives 5 different loss function parameter values and the corresponding results.
[0114] Table 4 Five initial neural network training configurations
[0115]
[0116] The change in the loss function for configuration 1 is shown in Figure 4 , where the horizontal axis is the iteration round and the vertical axis is the exponent of 10.
[0117] In summary, it is reasonable for this embodiment to use a fully connected neural network as the basic network.
[0118] 4.2 Dynamic Training
[0119] After the basic neural network is trained, dynamic training is performed based on it. The 4.0-4.9 second data is divided into 10 data sets according to time, and the corresponding data set is used for neural network training at each moment. With the continuous use of the data set, the parameters of the neural network are also dynamically updated. The DAPNN network is generated after all training processes are completed. Figure 5 A diagram showing the DAPNN neural network training process.
[0120] In dynamic training, the input adds the flow area for the flooding time, and the corresponding loss term related to the watershed is added to the loss function. See formulas (8) to (10)
[0121] L loss =L res +L data +L fl +L point (8)
[0122] Compared with equation (1), the difference is that L fl and L point , L flThe meaning of is the loss caused by the error of the area change of the basin in the time interval before and after the prediction time domain, which belongs to the quantitative description of the flooded basin. For each flooding time t∈[4,5] to be predicted, equation (9) is L fl The expression of S t Represents the area difference between the flooded area at time t and the previous time. It should be noted that the value of the flow field physical point t is the same during training.
[0123] L fl =|S t label -S t pred | 2 (9)
[0124] Several veins are obtained by discretizing along the flow direction (y direction). Each time the number of grid points on each line is predicted to change, L point Represents the error caused by the prediction of all points on the vein, which describes the qualitative changes of the basin. It belongs to the qualitative description using quantitative means.
[0125]
[0126] Among them, m veins will be discretely generated along the y-axis, N t Represents the difference in the number of grid points on each vein at time t and the previous time. After training the neural network, we hope to get a result where all loss terms are close to 0.
[0127] The flooding process has both differences and similarities at different times. Specifically, the differences lie in the differences in speed and pressure in the same area at different times, and the similarities refer to the similarities in the speed change rate and direction and the pressure change rate in a fixed time period or a fixed area. The dynamic update of the data set provides a data basis for the neural network to capture commonalities and differences. The neural network that iterates as the data set is updated attempts to capture the differences and similarities of the flooding process from it. When extrapolated to future moments without data sets, the neural network can still accurately capture changes in the flooded area and predict key physical quantities in the flow field. The hyperparameters of dynamic training are shown in Table 3.
[0128] 4.3 Dataset Update
[0129] In this example, three soaking time periods are designed for DAPNN training, with a time period of 2.0-4.0 seconds for basic network training (corresponding to Figure 5 t0-t1), the time period for dynamic training is 4.1-4.9 seconds (corresponding to Figure 5 t2-t n-1 ), the time period used for verification is 5.0-5.8 seconds. The data from 5.0-5.8 seconds does not participate in training at all and is only used for verification.
[0130] The data of the flow field grid points were exported at intervals of 0.01 seconds from 2.0 to 4.0 seconds, and a total of 222,230 points were obtained. 5,000 points were randomly selected as the training set, and the remaining points were the validation set. The data set description is shown in equation (11)
[0131]
[0132] Among them, x represents the grid point, i and j represent the discrete coordinates of the flow field space point, and their spatial interval is 0.05 meters. t represents the time of data export, and its frequency is 0.01 seconds, with a value range of 2.0-4.0 seconds.
[0133] The dynamic update of the data set is to cooperate with the dynamic training of the neural network. The first data set of this process consists of a small number of randomly collected points from the 2.0-4.0 second data set and the points in the flooded area at 4.1 seconds. It should be noted here that due to the irregularity of the watershed, the spatial discrete points may not be within the flow field. At this time, it is necessary to determine whether the spatial point is in the flooded area R according to the judgment conditions. fl As mentioned in Section 2.3, the water volume fraction is greater than or equal to 0.5 to determine that the point contains water. According to the extraction results, the number of grid points containing water is about 1000 every 0.1 seconds, and it gradually increases. D0 The description is as follows:
[0134]
[0135] The dataset The grid coordinate point set {(i,j),(i+1,j+1),…(i+m0,j+n0)}∈R f0
[0136] From the first datasets D0 Initially, the data set is updated at intervals of 0.1 seconds. The update method is as follows:
[0137] Collect a certain proportion of data from the previous moment's data set and add it to the data set where the flooded area is located at the next moment:
[0138]
[0139] Similarly, 0.1l ,b 0.1l ,c 0.1l ...k 0.1l}∈R fl And {a 0.1l ,b 0.1l ,c 0.1l ...k 0.1l} belongs to the previous data set. The flooded area is determined by simulation data. , where l takes values of 1, 2, 3, ...
[0140] The prediction effect of DAPNN neural network is shown and compared as follows:
[0141] After the optimal parameter experiment, this implementation intends to use the DAPNN framework with a parameter of 20 and the original PINN framework to predict the flow field at 5.0-5.8 seconds, and compare it with the actual flow field data. The comparison time points are 5.1, 5.5 and 5.8 seconds. The comparison content is the flow field physical quantity and flow field shape. Figure 6 , the left side is the DAPNN prediction result, the right side is the original PINN result, and the middle is the CFD calculation result.
[0142] Figure 6 The middle upper and middle lower parts correspond to 5.1 seconds, 5.5 seconds and 5.8 seconds respectively, covering the entire prediction process. The 5.1 second moment shows the velocity v and the shape of the flow field. The 5.5 and 5.8 seconds show the velocity u and pressure p. The 5.8 second moment is the moment when the pressure prediction error is the largest. Each large image contains a local enlarged image on the right. The prediction difference between the PINN and DAPNN (20) methods for the total area of different basins is within 0.008m 2 and 0.24m 2 It is about 1.5 meters in diameter and occupies a very small proportion in the entire cabin area, so a local enlarged image is drawn. The enlarged position is the position selected by the black selection box, which is used to compare the details of the neural network's prediction of the flow domain shape at different times. In the prediction of velocity v, PINN showed symmetrical hydrodynamic phenomena, which did not exist in the CFD calculation results. In the prediction of DAPNN, the location of the flow field fragmentation was captured. In the prediction of velocity u and pressure p, serious local errors appeared in the PINN prediction. At 5.5 seconds, in the rectangular area formed by the y-axis [-4.8m, 4.0m] and the x-axis [-0.95m, 0.95m], the PINN prediction result was generally larger. At 5.8 seconds, in the rectangular area formed by the y-axis [-0.6m, 0.6m] and the x-axis [0.5m, 0.95m], PINN predicted a non-existent low-pressure area, with an error of up to 550 Pa. In addition, in the rectangular area formed by the y-axis [-3m, -2m] and the x-axis [0.5m, 0.8m], DAPNN also has a prediction error of about 300pa.
[0143] Figure 6 The two models predict the flooded flow field at three moments: 5.1, 5.5, and 5.8 seconds. For each row, the left side is the prediction result of DAPNN, the middle is the actual result of CFD, and the right side is the initial PINN prediction result. The flooded shape is magnified above each prediction graph, as shown in the figure below. Figure 7As shown in the figure, it is to illustrate the prediction effect of different models on the shape of the immersed flow field.
[0144] From the local prediction of the flow shape, the flow shows a trend of fast flow on both sides and slow flow in the middle. Both frameworks give correct predictions of this trend, but DAPNN's prediction is more accurate. Specifically, at 5.5 seconds, the flooding spread to 3.2 meters in the cabin, the result given by PINN is 3.1 meters, and the result given by DAPNN is 3.19 meters. At 5.8 seconds, the concave in the middle of the local prediction map given by DAPNN is significantly larger than the result of PINN.
[0145] Those skilled in the art will appreciate that the above are only preferred embodiments of the present invention, and the various embodiments of the present disclosure and / or the features described in the claims may be combined or combined in various ways, even if such combinations or combinations are not explicitly described in the present disclosure. It is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art may still modify the technical solutions described in the aforementioned embodiments, or perform equivalent substitutions on some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
[0146] Although preferred embodiments of the present invention have been described, additional changes and modifications may be made to these embodiments by those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention. Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for predicting cabin flooding flow field based on an adaptive physical neural network, characterized in that: The method comprises: S1. Construct a ship model of low-speed flow field in CATIA software; S2, import the ship model of the low-speed flow field constructed in S1 into the STAR-CCM+ software for fluid simulation, and generate mesh data of the flow field; S3, processing the grid data of the flow field generated by S2 according to the time step; processing and saving the processed grid data through the Pytorch framework to construct a data set for neural network training; S4. Use the Pytorch framework to dynamically train the dataset for neural network training; S5. Use S1 to S4 for cabin flooding flow field prediction to complete cabin flooding flow field prediction based on adaptive physical neural network.
2. The method for predicting cabin flooding flow field based on adaptive physical neural network according to claim 1 is characterized in that: The construction of the ship model of the low-speed flow field in S1 includes the step of setting the dimension elements of the cabin, and the dimension elements of the cabin include length, width, height and bulkhead thickness.
3. The method for predicting cabin flooding flow field based on adaptive physical neural network according to claim 1 is characterized in that: The method of importing the ship cabin model into STAR-CCM+ software for fluid simulation in S2 is: S2.
1. Set up a numerical water pool and select a turbulence model based on external environmental conditions; S2.2, dividing the flow field information of the turbulence model, wherein the flow field information includes a velocity inlet, a pressure outlet and a symmetry plane; S2.3, dividing the flow field information into grids, and encrypting the grids according to the flow field information divided by the grids; S2.
4. After completing S2.1 to S2.3, start the ship cabin model and import it into STAR-CCM+ software for fluid simulation.
4. The method for predicting cabin flooding flow field based on adaptive physical neural network according to claim 1 is characterized in that: The grid data for generating the flow field in S2 is obtained from the grid layer at 0.05 m in the vertical direction of the cabin.
5. The method for predicting cabin flooding flow field based on adaptive physical neural network according to claim 1 is characterized in that: The dynamic training of the data set for neural network training in S4 includes the steps of building and training the basic neural network, dynamic training and updating the data set.
6. The method for predicting cabin flooding flow field based on adaptive physical neural network according to claim 5 is characterized in that: The basic neural network is constructed by taking a fully connected neural network as the main body of the basic neural network.
7. The method for predicting cabin flooding flow field based on adaptive physical neural network according to claim 5 is characterized in that: The method for dynamically training the data set for basic neural network training in S4 uses the gradient descent method combined with the Adam optimizer for training.
8. The cabin flooding flow field prediction device based on adaptive physical neural network is characterized by: The device comprises: Ship model building module, used to build ship models of low-speed flow fields in CATIA software; The flow field grid data generation module is used to import the ship model of the low-speed flow field constructed by the ship model construction module into the STAR-CCM+ software to perform fluid simulation and generate the flow field grid data; The data set processing module is used to process the mesh data of the flow field generated by the mesh data generation module of the flow field according to the time step; the processed mesh data is processed and saved through the Pytorch framework to construct a data set for neural network training; Dynamic training module, used to dynamically train the dataset for neural network training using the Pytorch framework; The prediction module is used to build the module to the dynamic training module based on the ship model to complete the cabin flooding flow field prediction based on the adaptive physical neural network.
9. A computer device comprising a memory and a processor, characterized in that A computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Velocity field measurement method based on PINN neural network
CN116127834A
Ship single break immersion time prediction method based on convolution-circulation composite neural network
CN116738565A
Flow field prediction method and device, terminal equipment and storage medium
CN117540648A
Flow field prediction method and system based on multi-agent symbolic regression algorithm
CN118428272A
Cited By
Basin flood simulation optimization method based on physical information neural network
CN120470914A