Method and device for predicting cabin immersion water flow field based on adaptive physical neural network

Through the adaptive physical neural network method, the cabin immersion flow field model is constructed and trained, and the nonlinear and dynamic changes in the cabin immersion flow field prediction is solved, high-precision flow field prediction and dynamic adaptation are achieved, which reduces the calculation cost and improves ship safety.

CN119538772BActive Publication Date: 2025-07-18HARBIN ENG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411558359.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-07-18
Estimated Expiration
2044-11-04

AI Technical Summary

Technical Problem

The prior art has high nonlinearity and complex dynamic changes in the prediction of chamber immersion flow fields, making it difficult to achieve accurate predictions. Especially in non-stable flow scenarios, there are challenges in neural network training relying on data quality and hyperparameter selection.

Method used

Adaptive physical neural network method is adopted to build a ship model in CATIA software, import STAR-CCM+ for fluid simulation, generate grid data, and use the Pytorch framework to process and train the data set, combine the gradient descent method and Adam optimizer for dynamic training, optimize the neural network to adapt to the dynamic changes of the chamber immersion flow field.

Benefits of technology

It significantly improves the prediction accuracy of the cabin water immersion flow field, reduces the calculation cost, and can rely on the physical information neural network to improve the adaptability and reliability of the model in the face of scarcity of data, providing more efficient ship safety and anti-water immersion capability support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538772B_ABST
    Figure CN119538772B_ABST
Patent Text Reader

Abstract

Method and device for predicting cabin flooding flow field based on adaptive physical neural network, which relates to the field of neural networks in complex flow field prediction. It solves the problems that in the prior art, the cabin flooding flow field has high nonlinearity and dynamic changes, and the hydrodynamic phenomena of the free surface are complex and difficult to predict. The method includes: constructing a ship model for low-speed flow field; importing the ship cabin model into STAR-CCM+ software for fluid simulation and generating grid data of the flow field; processing the generated grid data of the flow field by time step; processing and saving the processed grid data through the Pytorch framework to construct a data set for neural network training; using the Pytorch framework to dynamically train the data set for neural network training; the above steps are used for predicting the cabin flooding flow field, and the prediction of the cabin flooding flow field based on the adaptive physical neural network is completed. It is applicable to the adaptive field of the cabin flooding flow field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of neural network in complex flow field prediction, and particularly relates to a method and device for predicting the flooded flow field of a cabin based on an adaptive physics neural network. Background Art

[0002] In the past few decades, remarkable progress has been made in the research on the flooded flow field of ships. By analyzing physical quantities such as flow velocity and pressure in the flooded flow field, researchers have deeply understood the changes in the forces acting on the hull and successfully explained and predicted key hydrodynamic phenomena during the flooding process, such as jet effects and air compression effects. These achievements have not only deepened the understanding of the flooding mechanism but also provided a scientific basis for enhancing the anti-flooding ability and survivability of ships.

[0003] The experimental method is a direct and effective means for studying the flooded flow field. Through a standardized experimental water tank, researchers can obtain accurate flooding data in various environments such as still water, regular waves, and irregular waves. These data provide a reliable basis for simulation research and also lay a solid foundation for theoretical verification. However, due to the high cost of experimental sites and labor, the experimental method is difficult to carry out widely and is mainly used for theoretical verification.

[0004] The computational fluid dynamics (CFD) method has become an important tool for ship flooding research with the improvement of computing power. This method adopts grid-based methods represented by the finite element method and the finite difference method, as well as meshless methods represented by the smoothed particle method. These methods can accurately solve the incompressible Navier-Stokes equations and provide accurate physical quantities such as flow velocity, pressure, and displacement, which are highly consistent with experimental data. However, the accuracy of CFD depends on complex grid generation, flow field modeling, and computational settings, which greatly increase the computational cost. At the same time, fluid mechanics formulas and computational software, such as STAR-CCM+, need to be updated frequently, and different computational models, such as the k-ε and k-ω turbulence models, further increase the complexity. Since CFD needs to solve the incompressible Navier-Stokes equations on grids of millions or even tens of millions, it usually takes more than ten hours or even longer to calculate a flooding scenario, and with the improvement of accuracy, the computational time and resource requirements increase exponentially, which has become an unavoidable bottleneck for the CFD method.

[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 cabin model of the low-speed flow field constructed in S1 into 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 predicting the flooding flow field in the cabin, and complete the prediction of the flooding flow field in the cabin based on the adaptive physical neural network.

[0015] Further, a preferred implementation is provided. The step of setting the dimensional elements of the cabin is included in the ship model for constructing the low-speed flow field in S1. The dimensional elements of the cabin include length, width, height, and bulkhead thickness.

[0016] Further, a preferred implementation is provided. The method of importing the ship cabin model into the STAR-CCM+ software for fluid simulation in S2 is as follows:

[0017] S2.1. Set up a numerical water tank and select a turbulence model according to the external environmental conditions.

[0018] S2.2. Divide the flow field information of the turbulence model, and the flow field information includes velocity inlet, pressure outlet, and symmetry plane.

[0019] S2.3. Mesh the flow field information and perform mesh encryption according to the meshed flow field information.

[0020] After completing S2.1 to S2.3, start importing the ship cabin model into the STAR-CCM+ software for fluid simulation.

[0021] Further, a preferred implementation is provided. The grid data for generating the flow field in S2 obtains data from the grid layer 0.05 meters from the vertical direction of the cabin.

[0022] Further, a preferred implementation is provided. The dynamic training of the dataset for neural network training in S4 includes the steps of constructing and training the basic neural network, dynamic training, and updating the dataset.

[0023] Further, a preferred implementation is provided. The construction of the basic neural network is realized with a fully connected neural network as the main body of the basic neural network.

[0024] Further, a preferred implementation is provided. The method of dynamically training the dataset for training the basic neural network in S4 uses the gradient descent method combined with the Adam optimizer for training.

[0025] Solution 2. A device for predicting the flooding flow field in the cabin based on the adaptive physical neural network. The device includes:

[0026] A ship model construction module for constructing a ship model with a low-speed flow field in the CATIA software.

[0027] The grid data generation module of the flow field is used to import the ship cabin model of the low-speed flow field constructed by the ship model construction module into the STAR-CCM+ software for fluid simulation and generate the grid data of the flow field;

[0028] The data set processing module is used to process the grid data of the flow field generated by the grid data generation module of the flow field step by time; process and save the processed grid data through the Pytorch framework, and construct a data set for neural network training;

[0029] The dynamic training module is used to dynamically train the data set for neural network training using the Pytorch framework;

[0030] The prediction module is used to complete the prediction of the cabin immersion flow field based on the adaptive physical neural network based on the ship model construction module to the dynamic training module.

[0031] Solution 3. A computer device, including a memory and a processor, wherein a computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes the method described in any one of Solution 1.

[0032] Solution 4. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the steps of the method described in any one of Solution 1 are implemented when the computer program is executed by a processor.

[0033] The advantages of the present invention are as follows:

[0034] The method and device for predicting the cabin immersion flow field based on the adaptive physical neural network of the present invention aim to significantly improve the prediction accuracy of the complex unsteady flow field of cabin immersion, discover the internal regularity through in-depth mining of the flow field data. At the same time, optimize the existing calculation methods 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 surface, but also rely on new methods such as physical information neural networks in the case of scarce data 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-immersion ability.

[0035] Based on the strategy of combining dynamic training and traditional training, the present invention constructs and trains a physical information neural network adapted to the cabin immersion flow field. This 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 the development trend of the flow field.

[0036] The present invention is also applicable to the adaptive field of the cabin immersion flow field. Description of the Drawings

[0037] Figure 1 Schematic diagram of the cabin immersion model for the cabin immersion flow field prediction method based on the adaptive physical neural network described in Embodiment 1.

[0038] Figure 2 Schematic diagram of the definition of the simulation flow field for the cabin immersion flow field prediction method based on the adaptive physical neural network described in Embodiment 1.

[0039] Figure 3 Schematic diagram of data acquisition in the cabin immersion flow field prediction method based on the adaptive physical neural network described in Embodiment 1.

[0040] Figure 4 Schematic diagram of the loss function of Configuration 1 described in Embodiment 11.

[0041] Figure 5 Schematic diagram of the DAPNN training process described in Embodiment 11.

[0042] Figure 6 Schematic diagram of the comparison of the prediction effects of DAPNN and PINN at different times described in Embodiment 11.

[0043] Figure 7 Magnified schematic diagram of the comparison of the prediction effects of DAPNN and PINN at different times described in Embodiment 11. Detailed Embodiments

[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some, but not all, of the embodiments of the present application.

[0045] Embodiment 1. This embodiment provides a cabin immersion flow field prediction method based on an adaptive physical neural network, and the method includes:

[0046] S1. Construct a ship model of a low-speed flow field in CATIA software;

[0047] S2. Import the ship cabin model of the low-speed flow field constructed in S1 into STAR-CCM+ software for fluid simulation, and generate grid data of the flow field;

[0048] S3. Process the grid data of the flow field generated in S2 according to time steps; process and save the processed grid data through the Pytorch framework to construct a data set for neural network training;

[0049] S4. Dynamically train the dataset for neural network training using the Pytorch framework;

[0050] S5. Apply S1 to S4 to predict the flooding flow field in the cabin, and complete the prediction of the flooding flow field in the cabin based on the adaptive physics neural network.

[0051] Embodiment 2. This embodiment further limits the method for predicting the flooding flow field in the cabin based on the adaptive physics neural network described in Embodiment 1. The step of setting the size elements of the cabin is included in the ship model for constructing the low-speed flow field in S1. The size elements of the cabin include length, width, height, and cabin wall thickness.

[0052] Embodiment 3. This embodiment further limits the method for predicting the flooding flow field in the cabin based on the adaptive physics neural network described in Embodiment 1. The method of importing the ship cabin model into the STAR-CCM+ software for fluid simulation in S2 is as follows:

[0053] S2.1. Set up a numerical water tank and select a turbulence model according to the external environmental conditions;

[0054] S2.2. Divide the flow field information of the turbulence model. The flow field information includes velocity inlet, pressure outlet, and symmetry plane;

[0055] S2.3. Perform mesh division on the flow field information and encrypt the mesh according to the flow field information divided by the mesh;

[0056] S2.4. After completing S2.1 to S2.3, start importing the ship cabin model into the STAR-CCM+ software for fluid simulation.

[0057] Embodiment 4. This embodiment further limits the method for predicting the flooding flow field in the cabin based on the adaptive physics neural network described in Embodiment 1. The grid data for generating the flow field in S2 obtains data from the grid layer 0.05 meters from the vertical direction of the cabin.

[0058] Embodiment 5. This embodiment further limits the method for predicting the flooding flow field in the cabin based on the adaptive physics neural network described in Embodiment 1. The dynamic training of the dataset for neural network training in S4 includes the steps of constructing and training the basic neural network, dynamic training, and updating the dataset.

[0059] Embodiment 6. This embodiment further limits the method for predicting the flooding flow field in the cabin based on the adaptive physics neural network described in Embodiment 5. The construction of the basic neural network is realized by using the fully connected neural network as the main body of the basic neural network.

[0060] Embodiment Seven. This embodiment further defines the method for predicting the cabin flooding flow field based on the adaptive physical neural network described in Embodiment Five. In S4, the method for dynamically training the dataset for training the basic neural network uses the gradient descent method combined with the Adam optimizer for training.

[0061] Embodiment Eight. This embodiment proposes a device for predicting the cabin flooding flow field based on the adaptive physical neural network. The device includes:

[0062] A ship model construction module for constructing a ship model of a low-speed flow field in CATIA software;

[0063] A flow field grid data generation module for importing the ship cabin model of the low-speed flow field constructed by the ship model construction module into STAR-CCM+ software for fluid simulation and generating grid data of the flow field;

[0064] A dataset processing module for processing the grid data of the flow field generated by the flow field grid data generation module step by time; processing and saving the processed grid data through the Pytorch framework to construct a dataset for neural network training;

[0065] A dynamic training module for dynamically training the dataset for neural network training using the Pytorch framework;

[0066] A prediction module for completing the prediction of the cabin flooding flow field based on the adaptive physical neural network based on the ship model construction module to the dynamic training module.

[0067] Embodiment Nine. This embodiment proposes a computer device including a memory and a processor. A computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes the method described in any one of Embodiments One to Seven.

[0068] Embodiment Ten. This embodiment proposes a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the method described in any one of Embodiments One to Seven are implemented.

[0069] Embodiment Eleven. This embodiment proposes an example for explaining the above Embodiments One to Eight. The example is specifically as follows:

[0070] See Figures 1 to 7Description of this embodiment, Step 1, 3D model: In this embodiment, a ship model suitable for a low-speed flow field is first selected and three-dimensional modeling is carried out 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 break need to be carefully set to ensure the accuracy of the model.

[0071] The flooding scenario of this embodiment adopts the cabin flooding scenario of Flooding Accident Response (FLARE) - there is a rectangular damage in the cabin. Its flooding scenario is shown in Figure 1 . The flooding surges in from a long and narrow break distributed along the y-axis, and the external environment is a low-speed flow along the x-direction. The flooding slowly flows through the cabin. In the Figure 1 top-down view, blue represents the flooding. Along the x-direction, the flow velocity is defined as u, and along the y-direction, the flow velocity is defined as v.

[0072] To two-dimensionalize the flooding scenario, the following assumptions are required: 1 Ignore the gravity G of the seawater during the flooding process, which can be achieved by adjusting the waterline height outside the cabin in combination with mesh division. 2 The flooding and air are considered incompressible fluids, and during the flooding process, the movement of the air is ignored. Based on these assumptions, the cabin flooding scenario is as follows: After the cabin floods in from the long and narrow damage, it spreads along the bottom of the cabin, and the flooding only has flows in the two directions of the ship's width and length.

[0073] Step 2, Fluid simulation

[0074] Based on the assumptions in Step 1, arrange the flooding scenario for simulation calculation to obtain the flow field data set for training and verification. After completing the modeling, import the ship cabin model into STAR-CCM+ software for fluid simulation. First, set up the numerical pool and select a suitable turbulence model according to the external environmental conditions. Subsequently, divide the flow field information, including important parameters such as velocity inlet, pressure outlet, and symmetry plane. Then, perform mesh division of the flow field and appropriately refine the mesh according to the complexity of the flow field. After all the preparatory work is completed, start the cabin flooding simulation and export the mesh data of the flow field 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 undergone dozens of version iterations.

[0076] The simulation interface in STAR-CCM+ is as shown in Figure 2As shown in the figure, the parameters of the cabin and the water area are shown in Table 1. The damage of the cabin is rectangular, the entire computational domain is a cuboid, the length of the water area \(L_R\) is defined as the distance from the inlet to the outlet, the width of the water area \(D_R\) is defined as the distance between two symmetric planes, and the height of the water area \(H_R\) is defined as Figure 2 the distance from the top to the bottom. Seawater surges in from the opening and then spreads inside the cabin.

[0077] Table 1 Elements of the flooding scenario

[0078]

[0079]

[0080] The entire water area is divided into 2.08 million grids. The grid points can export the solution data at different times. 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 content of data acquisition includes: velocity vectors (in the x and y directions), pressure, and volume fraction of water at the grid points. Based on the requirements of the two-dimensional scenario, the grid point data of some areas inside the cabin are exported. The grid number in the millions is to ensure the accuracy of fluid calculation and not all participate in the neural network training.

[0081] This embodiment obtains data from the grid layer 0.05 meters from the vertical direction of the cabin. Figure 3 It shows the grid distribution of the water area and the data point acquisition density at \(h = 0.05\) meters. The green represents the data acquisition points. The length of the acquisition area is 6.8 meters, the width is 1.9 meters, the spatial resolution is 56*38, the time interval is 2.0 - 5.8 seconds, and the time frequency is 0.01 second / time. A total of 851,200 data are obtained.

[0082] Step 3: Data processing

[0083] Deeply process the data generated by the fluid simulation. Based on the grid points, subdivide the physical quantities according to time. Process and save all the data obtained during the flooding process through the Pytorch framework to construct a dataset for neural network training. The data processing in this stage provides the necessary input data for subsequent model training.

[0084] This data still needs to be further processed. Grid points with water immersion are calculated based on the obtained water volume fraction, and the data at these grid points will be used for neural network training. This reflects two characteristics of the work of using neural networks for predicting cabin flooding: 1 The basin where the data is collected is not regular; 2 Data collection does not wait for the flow field to stabilize. Or rather, there is no absolutely stable time interval for cabin flooding.

[0085] Select the flooding condition as u = 1 m / s. Before training the neural network, the data information is statistically analyzed and processed to a certain extent. The value ranges of each physical quantity are shown in Table 2. The pressure and velocity are made dimensionless using the incoming flow velocity and density.

[0086] Table 2 Value ranges of training data

[0087]

[0088] Due to the scenario, the velocity u and pressure p do not have negative values, and the distribution of extreme values is relatively uniform. In contrast, the distribution of velocity v is very different. Taking the absolute value, the order of magnitude difference reaches 10 7 .

[0089] Step 4 Neural network training

[0090] This step covers the construction and training of the basic neural network, dynamic training, and update of the dataset.

[0091] 4.1 Construction of the basic neural network

[0092] In this embodiment, a fully connected neural network is selected as the main body of the basic neural network, and the hyperbolic function is used as the activation function to enhance the nonlinear mapping ability of the model. Part of the flooding data is used as input for training. The loss function consists of physical loss and data loss, aiming to optimize the learning efficiency of the network. The gradient descent method combined with the Adam optimizer is used for training. After multiple rounds of iteration, when the loss of the neural network decreases 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 dataset different from that in 4.1 is divided into multiple independent datasets according to time steps, and each time step t corresponds to a specific dataset. During the training at the front and back moments, the neural network parameters will be dynamically iterated so as to 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 during the dynamic training process to further improve the prediction ability of the model.

[0095] 4.3 Dataset Update

[0096] To cooperate with dynamic training, the dataset 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 dataset provides the necessary data support for this. Specifically, we will select some grid point data from the dataset of the previous moment so as to integrate it into the dataset of the next moment, thereby partially retaining the flooding characteristics of the previous moment and realizing the dynamic evolution and update of the dataset. This data update mechanism lays a solid foundation for the continuous learning and adaptability of the model.

[0097] Among them, the above steps specifically include the following content:

[0098] 4.1 Basic Network Training

[0099] The fully connected neural network is selected as the basic neural network. The coordinates and time information in the flow field are used as inputs, and key physical quantities such as the velocity and pressure of the flow field are output after several linear layer transformations. In theory, a deep enough linear layer can depict the non-linear relationship between any input and output. That is to say, through the training of a large amount of data, the neural network can, to a certain extent, function as a non-linear partial differential equation solver.

[0100] In the basic neural network, the input layer contains the two-dimensional coordinates of the flow field particles The grid point coordinate directions are the same as Figure 1 the x and y in

[0101] Table 3 Information during the training of the basic neural network

[0102]

[0103] The composition of the loss function of the basic neural network is shown in Equation (1). The first part is the loss L of the physical laws res . First, calculate the first-order and second-order partial derivatives of the physical quantities u, v, and p with respect to time (using the automatic differentiation module of Pytorch), and these partial derivatives are combined according to the discretized mass conservation equation (Equation 1) and momentum conservation equation (Equation 2) to obtain L res . Among them, the momentum conservation equation corresponds to F in Equation (2) momentum , the mass conservation equation corresponds to F in Equation (2) mass , and the momentum conservation equation is further divided into two parts in the x and y directions; the second part of the loss function L dataCorresponding to the data points, these are the points randomly selected within the basin using a random sampling strategy. At these data points, we expect the prediction values of velocity and pressure and the true value error to approach zero. By reducing the two parts of the loss, the neural network is encouraged to find a set of specific parameters that can, to a certain extent, replace the traditional CFD approximator and give the solution to the differential equations implied by the cabin flooding scenario. The mathematical expressions of each part 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 takes values 1 and 2, corresponding to the x and y directions respectively, u and v correspond to the fluid motion velocities in the x and y directions respectively, p represents pressure, t represents time, with a range of 2.0 - 4.0 seconds; θ k represents the learnable neural network parameters, and λ1 and λ2 represent two constants in the N - S equation, whose physical meanings are the density and dynamic viscosity of water respectively.

[0110]

[0111] For equation (7): t represents time, with a range of 2.0 - 4.0 seconds; label represents the true value, pred represents the neural network prediction value; i, j represent the horizontal and vertical coordinates obtained by discretizing the flooded area; represents the velocities in the x and y directions at each discrete point. The parameters α1, α2, represent the weights of each part of the loss.

[0112] In this example, the training effect of the basic neural network is verified first. Although the fully connected neural network shows good results in scenarios such as circular cylinder flow around and cavity flow, etc., the prediction ability of the flow field in the scenario of cabin flooding still needs to be verified. The fully connected neural network needs to show a certain ability to capture and model the flooding evolution before it can prove the rationality of its being the basic network of the DAPNN framework.

[0113] A fixed area of the flooded cabin is selected for prediction and reconstruction. Taking the midpoint of the rectangular break as the origin, the flow field prediction area is rectangular, and the horizontal and vertical coordinate ranges are [-4.8m, -2m], [-0.95m, 0.95m]. Through repeated training, the number of iteration steps is determined to be 100,000 times, taking into account both the training time cost and the accuracy. Table 4 gives the values of 5 different loss function parameters and the corresponding results.

[0114] Table 4 Five initial neural network training configurations

[0115]

[0116] The change of the loss function of Configuration 1 is selected and shown in Figure 4 , where the abscissa is the number of iteration rounds and the ordinate is the exponent of 10.

[0117] In summary, it is reasonable to use the fully connected neural network as the basic network in this embodiment.

[0118] 4.2 Dynamic training

[0119] After the basic neural network is trained, dynamic training is carried out based on it. The data from 4.0 - 4.9 seconds is divided into 10 data sets according to time, and the neural network is trained using the corresponding data set at each moment. As the data sets are continuously used, the parameters of the neural network are also dynamically updated. The DAPNN network is generated after all the training processes are completed. Figure 5 Show the training process diagram of the DAPNN neural network.

[0120] In dynamic training, the flow field area corresponding to the flooding moment is newly added as an input, and correspondingly, a loss term related to the river basin 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 lies in L fl and L point , L flIts meaning is the loss caused by the area change error of the basin within the prediction time domain and the time interval before and after, which belongs to the quantitative description of the flooded basin. For each flooded moment t ∈ [4, 5] that needs 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 moment. It should be noted that the value of the physical point t of the flow field is the same during training.

[0123] L fl = |S t label - S t pred | 2 (9)

[0124] Discretization is carried out along the flow direction (y - direction) to obtain several veins. Each time, the number of grid points on each line changes during prediction. L point represents the error brought by the prediction of points on all veins, thus describing the qualitative change of the basin. It belongs to the qualitative description using quantitative means.

[0125]

[0126] Among them, m veins will be discretized in the y - axis direction. N t represents the difference in the number of grid points on each vein between time t and the previous moment. After the neural network training, it is hoped that all loss terms approach 0.

[0127] The flooding process has differences and similarities at different moments. Specifically, the differences lie in the different velocities and pressures in the same area at different moments, and the similarities refer to the similarity of the velocity change rate and direction, and the pressure change rate in a fixed time period or a fixed area. The dynamic update of the dataset provides a data basis for the neural network to capture the commonalities and differences. The neural network iterated with the update of the dataset attempts to capture the differences and similarities of the flooding process from it. When extrapolating to future moments without a dataset, the neural network can still accurately capture the change of the flooded area and predict the key physical quantities in the flow field. The hyperparameters of dynamic training are shown in Table 3.

[0128] 4.3 Dataset Update

[0129] In the example, three flooding time periods are designed for the training of DAPNN. The time period for basic network training is 2.0 - 4.0 seconds (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 ), and the time period for verification is 5.0 - 5.8 seconds. Among them, the data from 5.0 - 5.8 seconds are not involved in training at all and are only used for verification.

[0130] Export the data of the flow field grid points at intervals of 0.01 seconds from 2.0 to 4.0 seconds. A total of 222,230 points are obtained. Randomly select 5,000 points and set them as the training set, and the validation set is the remaining points. The dataset 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 points, the space interval is 0.05 meters, t represents the time of data export, the frequency is 0.01 seconds, and the value range is 2.0 - 4.0 seconds.

[0133] The dynamic update of the dataset is to cooperate with the dynamic training of the neural network. The first dataset of this process consists of a small number of randomly collected points from the 2.0 - 4.0 second dataset and the points in the flooded area at 4.1 seconds. It should be noted here that due to the irregularity of the river basin, 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, if the flooding volume fraction is greater than or equal to 0.5, it is determined that the point contains water. According to the extraction results, at every 0.1 moment, the number of grid points containing water is about 1000 and gradually increases. The first dataset datasets D0 is described as follows:

[0134]

[0135] Among them, the dataset The set of grid coordinate points \(\{(i,j),(i + 1,j + 1),\cdots(i + m0,j + n0)\}\in R f0

[0136] Starting from the first dataset datasets D0 and updating the dataset at intervals of 0.1 seconds, the update method is as follows:

[0137] Collect a certain proportion of data from the previous moment's dataset and add it to the dataset where the flooded area is located at the next moment:

[0138]

[0139] Similarly, \(\{a 0.1l ,b 0.1l ,c 0.1l \cdots k 0.1l \}\in R fl And \(\{a 0.1l ,b 0.1l ,c 0.1l \cdots k 0.1l} Belongs to the previous data set. The flooded area is determined by simulation data. Here, l takes values of 1, 2, 3, …

[0140] The prediction effect display and comparison of the DAPNN neural network are as follows:

[0141] After the optimal parameter experiment, this embodiment intends to use the DAPNN framework with a parameter of 20 and the original PINN framework to predict the flow field at the time of 5.0 - 5.8 seconds, and compare it with the real flow field data. The comparison time points are 5.1, 5.5, and 5.8 seconds. The comparison contents are the flow field physical quantities and the flow field shape. As 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 upper, middle, and lower parts in the figure respectively correspond to 5.1 seconds, 5.5 seconds, and 5.8 seconds, covering the entire prediction process. The 5.1 - second moment shows the velocity v and the shape of the flow field. The 5.5 - second and 5.8 - second moments show the velocity u and the pressure p. Among them, the 5.8 - second moment has the largest pressure prediction error. There is a local enlarged view on the right side of each large figure. The prediction gap between the two methods of PINN and DAPNN(20) for different total basin areas is around 0.008m 2 and 0.24m 2 or so, which accounts for a very small proportion in the entire cabin area. Therefore, a local enlarged view is drawn, and the enlarged position is the position selected by the black selection line, which is used to compare the details of the neural network's prediction of the basin shape at different moments. In the prediction of the velocity v, a symmetric hydrodynamic phenomenon appears in PINN, which does not exist in the CFD calculation result. In the DAPNN prediction, the fragmented position of the flow field is captured. In the prediction of the velocity u and the pressure p, serious local errors appear 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 is 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], a non - existent low - pressure area appears in the PINN prediction, and its error is as high as 550 Pa. In addition, in the rectangular area formed by the y - axis [-3m, -2m] and the x - axis [0.5m, 0.8m], the DAPNN also has a prediction error of about 300 Pa.

[0143] Figure 6 are the predictions of the immersion flow field at three moments of 5.1, 5.5, and 5.8 seconds. For each row, the left side is the DAPNN prediction result, the middle is the CFD real result, and the right side is the initial PINN prediction result. The immersion shape is magnified above each prediction figure, as Figure 7as shown, to illustrate the prediction effect of different models on the shape of the immersion flow field.

[0144] Regarding the local prediction of the basin shape, throughout the process, the flow shows a trend of being faster on both sides and slower in the middle. Both frameworks correctly predict this trend, but the prediction of DAPNN is more accurate. Specifically, at 5.5 seconds, the immersion spreads 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 depression in the middle of the local prediction map given by DAPNN is significantly larger than that of PINN.

[0145] Those skilled in the art can understand that the above is only the preferred embodiment of the present invention. The features described in each embodiment and / or claim of the present disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly recorded in the present disclosure. It is not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0146] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention. Obviously, those skilled in the art can make various changes and variations 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 equivalent technologies, the present invention also intends to include these modifications and variations.

Claims

1. A method for predicting the flow field of cabin flooding based on an adaptive physical neural network, characterized in that The method includes: S1. Construct a ship model of a low-speed flow field in CATIA software; S2. Import the ship cabin model of the low-speed flow field constructed in S1 into STAR-CCM+ software for fluid simulation, and generate grid data of the flow field; S3. Process the grid data of the flow field generated in S2 according to time steps; process and save the processed grid data through the Pytorch framework, and construct a data set for neural network training; S4. Dynamically train the data set for neural network training using the Pytorch framework; S5. Use S1 to S4 for predicting the cabin flooding flow field, and complete the prediction of the cabin flooding flow field based on the adaptive physical neural network; The dynamic training of the data set for neural network training in S4 includes steps of constructing and training a basic neural network, dynamic training, and updating of the data set; The construction of the basic neural network selects the fully connected neural network as the main body of the basic neural network, uses the hyperbolic function as the activation function, takes part of the partially flooded data as input for training, and the loss function consists of physical loss and data loss and is trained using the gradient descent method combined with the Adam optimizer; after multiple rounds of iteration, when the neural network loss drops to a predetermined level and stabilizes, the training is terminated; The physical loss is calculated by calculating the first-order and second-order partial derivatives of a physical quantity u, v, p with respect to time. The above partial derivatives are combined according to the discretized mass conservation equation and the momentum conservation equation to obtain the physical loss , which is calculated by the following formula: (1) (2) (3) (4) Among them, i ranges from 0, 1, 2... N, representing the number of data points, and j takes values 1 and 2, corresponding to the x and y directions respectively , u, v corresponding to the fluid motion velocities in the x and y directions respectively, p representing pressure, t representing time, with a range of 2.0 - 4.0 seconds; representing the learnable neural network parameters, and representing two constants in the Navier - Stokes equations; The data loss is calculated as follows: (7) Among them, t represents time, with a range of 2.0 - 4.0 seconds; label represents the true value, and pred represents the predicted value of the neural network; i and j represent the horizontal and vertical coordinates obtained by discretizing the flooded area; represent the velocities in the x and y directions at each discrete point; the parameters in the equation , , represent the weights of each loss item.

2. The method for predicting the cabin immersion water flow field based on the adaptive physical neural network according to claim 1, wherein The step of setting the dimension elements of the cabin is included in the ship model construction of the low-speed flow field in S1. The dimension elements of the cabin include length, width, height, and cabin wall thickness.

3. The method for predicting the cabin immersion water flow field based on the adaptive physical neural network according to claim 1, characterized in that, The method of importing the ship cabin model into STAR-CCM+ software for fluid simulation in S2 is as follows: S2.

1. Set up a numerical water tank and select a turbulence model according to external environmental conditions; S2.

2. Divide the flow field information of the turbulence model, where the flow field information includes velocity inlet, pressure outlet, and symmetry plane; S2.

3. Perform grid division on the flow field information and perform grid encryption according to the flow field information divided by the grid; S2.

4. After completing S2.1 to S2.3, start importing the ship cabin model into STAR-CCM+ software for fluid simulation.

4. The method for predicting the cabin flooding flow field based on the adaptive physical neural network according to claim 1, wherein The grid data of the flow field generated in S2 obtains data from the grid layer 0.05 meters from the vertical direction of the cabin.

5. A cabin immersion water flow field prediction device based on an adaptive physical neural network, characterized in that, The device includes: A ship model construction module for constructing a ship model of a low-speed flow field in CATIA software; A grid data generation module of the flow field for importing the ship cabin model of the low-speed flow field constructed by the ship model construction module into STAR-CCM+ software for fluid simulation and generating grid data of the flow field; A data set processing module for processing the grid data of the flow field generated by the grid data generation module of the flow field according to time steps; processing and saving the processed grid data through the Pytorch framework, and constructing a data set for neural network training; A dynamic training module for dynamically training the data set for neural network training using the Pytorch framework; A prediction module for completing the prediction of the cabin flooding flow field based on the adaptive physical neural network based on the ship model construction module to the dynamic training module; The dynamic training of the data set for neural network training in the dynamic training module includes steps of constructing and training a basic neural network, dynamic training, and updating of the data set; For the construction of the basic neural network, a fully connected neural network is selected as the main body of the basic neural network, the hyperbolic function is used as the activation function, and partial immersion data is used as the input for training. The loss function consists of a physical loss and a data loss and the gradient descent method combined with the Adam optimizer is used for training; after multiple rounds of iteration, when the neural network loss drops to a predetermined level and tends to be stable, the training is terminated; The physical loss is calculated by computing the first-order and second-order partial derivatives of a physical quantity u, v, p with respect to time. The above partial derivatives are combined according to the discretized mass conservation equation and the momentum conservation equation to obtain the physical loss , which is calculated through the following formula: (1) (2) (3) (4) Among them, i ranges from 0, 1, 2... N, representing the number of data points, and j takes values 1 and 2, corresponding to the x and y directions respectively , u, v respectively corresponding to the fluid motion velocities in the x and y directions p represents pressure, t represents time, with a range of 2.0 - 4.0 seconds represents the learnable neural network parameters and represent two constants in the Navier - Stokes equations The data loss is calculated as follows: (7) Among them, t represents time, with a range of 2.0 - 4.0 seconds; label represents the true value, and pred represents the predicted value of the neural network; i and j represent the horizontal and vertical coordinates obtained by discretizing the flooded area; represent the velocities in the x and y directions at each discrete point; the parameters in the equation , , represent the weights of each loss.

6. 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 4.

7. 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 4 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