Method for solving natural convection problem of two-dimensional square cavity

By using residual networks and discrete Fourier transform physical information neural networks in the two-dimensional square cavity natural convection problem, the boundary conditions are directly encoded and the finite difference method is used, the simulation accuracy and efficiency problems under complex boundary conditions are solved, and high-precision fluid field prediction is achieved.

CN120297172APending Publication Date: 2025-07-11SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510189059.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

When the prior art deals with the problem of natural convection of two-dimensional square cavity under complex boundary conditions, there are problems such as not strictly meeting boundary conditions, difficulty in capturing high-frequency information, slow training convergence, and unstable automatic differential calculations, resulting in insufficient numerical simulation accuracy and low efficiency.

Method used

The physical information neural network based on residual network and discrete Fourier transform is adopted to directly encode boundary conditions at the output layer and calculate derivatives in combination with the finite difference method, which enhances the capture ability of high-frequency information and improves the training convergence speed.

Benefits of technology

High-precision simulation of the fluid field under complex boundary conditions is achieved, ensuring that the boundary conditions are strictly met, improving the convergence speed and calculation stability of the model, and significantly improving the prediction accuracy of the fluid velocity and temperature field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120297172A_ABST
    Figure CN120297172A_ABST
Patent Text Reader

Abstract

The invention provides a method for solving the natural convection problem of a two-dimensional square cavity, and the method comprises the steps: carrying out the grid division of the square cavity, so as to obtain the coordinate position of each discrete point in the square cavity; taking the coordinate position of each discrete point in the square cavity as input data, designing a physical information neural network in combination with discrete Fourier transform characteristics, and adding a hard constraint condition on the boundary of a to-be-solved equation of the two-dimensional square cavity natural convection problem; calculating a loss function for training the physical information neural network, embedding the to-be-solved equation into the loss function, performing iterative optimization on the network model of the physical information neural network based on the loss function and dynamically updating network parameters until the network model converges, and ending training; and predicting new input data by using the trained physical information neural network to obtain numerical solutions of a velocity field, a temperature field and a pressure field of the two-dimensional square cavity natural convection problem as output results. According to the method, the precision and convergence speed of solving the natural convection problem of the two-dimensional square cavity are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular, to a method for solving the two-dimensional square cavity natural convection problem. Background Art

[0002] The natural convection problem widely exists in fluid mechanics and heat transfer. The two-dimensional square cavity natural convection problem is a classical research topic, which is often used to simulate the fluid flow and temperature field distribution caused by the temperature gradient in the cavity. The equations that control this phenomenon include the continuity equation, the momentum equation, and the energy equation. The solution of these equations requires numerical simulation under the corresponding boundary conditions.

[0003] Traditional solution methods such as the Finite Difference Method (FDM), the Finite Element Method (FEM), and the Finite Volume Method (FVM) mainly rely on mesh generation. After discretizing the space, the fluid velocity field and temperature field are obtained through numerical calculations. However, when dealing with complex geometries or high Reynolds number flows, the fineness of the mesh generation directly affects the calculation accuracy and efficiency, easily leading to a sharp increase in the amount of calculation and even numerical divergence problems.

[0004] In recent years, Physics-informed Neural Networks (PINNs) have provided a new method for solving partial differential equations. PINNs learn the distribution of the fluid field through a neural network and incorporate physical constraints into the loss function to achieve end-to-end numerical simulation. The specific methods include the following:

[0005] (1) Standard PINNs method

[0006] PINNs define the loss function and use the residuals of the control equations and the boundary conditions as the training targets of the neural network. In the two-dimensional square cavity problem, the input data is the spatial coordinates (x, y), and the outputs are the velocity field (u, v), the temperature field (T), and the pressure field (p). By minimizing the loss function, the network approximates the solution that satisfies the control equations. The PINNs method proposed by Raissi et al. has been widely applied in the fields of fluid mechanics, heat conduction, etc.

[0007] (2) FPINNs (Fourier Physics-informed Neural Networks, FPINNs)

[0008] FPINNs introduce the Fourier transform to enhance the model's learning ability of high-frequency features through frequency-domain information. This method performs well under complex boundary conditions and is suitable for capturing detailed changes in fluid dynamics.

[0009] (3) FD-PINNs (Finite Difference Physics-informed Neral Networks, FD-PINNs)

[0010] To address the numerical instability of automatic differentiation in solving high-order derivatives, some studies adopt finite difference methods to calculate derivatives, reducing the computational graph complexity and improving the solution accuracy.

[0011] In summary, the above-mentioned existing technologies have the following defects:

[0012] (1) Incomplete satisfaction of boundary conditions: Standard PINNs approximate boundary conditions by adding boundary loss terms to the loss function. However, this soft constraint method may result in the boundary conditions not being fully satisfied during training, affecting the accuracy of the solution.

[0013] (2) Limited ability to capture high-frequency information: Ordinary PINNs are good at learning low-frequency information but are difficult to effectively capture high-frequency change features in the fluid field, affecting the simulation accuracy of complex flow structures.

[0014] (3) Slow training convergence: Due to the multiple constraints of boundary conditions and governing equations, the training of standard PINNs may converge slowly. Especially under complex boundary conditions, the network requires a longer time to reach a lower loss.

[0015] (4) Complex automatic differentiation calculation: Automatic differentiation may introduce numerical instability when solving high-order derivatives, resulting in training oscillations or divergence and reducing the robustness of the model. Summary of the Invention

[0016] In view of this, embodiments of the present invention provide a method for solving the two-dimensional square cavity natural convection problem, aiming to improve the solution ability of fluid equations under complex boundary conditions.

[0017] According to the first aspect of the embodiments of the present invention, a method for solving the two-dimensional square cavity natural convection problem is provided, including: Step S1, performing grid division on the square cavity to obtain the coordinate positions of each discrete point in the square cavity; Step S2, using the coordinate positions of each discrete point in the square cavity as input data, combining the discrete Fourier transform features, designing a physics-informed neural network, and adding hard constraint conditions on the boundary of the equation to be solved for the two-dimensional square cavity natural convection problem; Step S3, calculating the loss function for training the physics-informed neural network, embedding the equation to be solved into the loss function, iteratively optimizing the network model of the physics-informed neural network based on the loss function, and dynamically updating the network parameters until the network model converges and the training ends; Step S4, using the trained physics-informed neural network to predict new input data, and obtaining the numerical solutions of the velocity field, temperature field, and pressure field of the two-dimensional square cavity natural convection problem as output results.

[0018] In one implementation, in Step S1, the square cavity is a square chamber. The left wall surface of the square chamber is a high-temperature wall surface, the right wall surface is a low-temperature wall surface, the upper and lower wall surfaces are adiabatic, and the square cavity is filled with fluid, which is used to simulate the natural convection phenomenon in an electronic device radiator.

[0019] In another implementation, in Step S2, the equation to be solved for the two-dimensional square cavity natural convection problem is the control equation of fluid dynamics, and the control equation includes a continuity equation, a momentum equation, and an energy equation.

[0020] In another implementation, in Step S2, the network structure of the physics-informed neural network adopts a multi-layer perceptron model based on a residual network. The number of neurons in each layer is 64, and there are 7 hidden layers in total. The last layer outputs four variables (u, v, p, T) of the fluid field.

[0021] In another implementation, in Step S2, using the coordinate positions of each discrete point in the square cavity as input data, combining the discrete Fourier transform features, and designing a physics-informed neural network includes: at the input layer of the physics-informed neural network, performing discrete Fourier transform on the original coordinates of each discrete point in the square cavity to obtain the discrete Fourier frequency domain components of the original coordinates; splicing the original coordinates with the first n components of the real part of the discrete Fourier frequency domain components as the final input of the physics-informed neural network, so that the physics-informed neural network contains both spatial domain and frequency domain information.

[0022] In another implementation, in Step S3, when calculating the loss function, the finite difference method is used to calculate the partial derivatives in the control equation to accelerate the solution process, and the calculation formulas for the first-order derivative and the second-order derivative are:

[0023]

[0024] Among them, represents the partial derivative of the function u with respect to the variable x. u[i+1,j] represents the value of the function u at the point (i+1,j), where i and j are the indices of discrete points. u[i-1,j] represents the value of the function u at the point (i-1,j). 2Δx represents twice the step size in the x direction, and Δx is the distance between adjacent points in the x direction in the grid or matrix.

[0025] In another implementation, adding hard constraint conditions to the boundary of the equation to be solved for the natural convection problem in a two-dimensional square cavity in step S2 includes: directly encoding the boundary conditions in the output layer of the physics-informed neural network. Specifically, the boundary conditions are embedded in the form of a function in the velocity field and temperature field outputs, so that the velocity field and temperature field strictly satisfy the Dirichlet boundary conditions on the boundary.

[0026] According to the second aspect of the embodiments of the present invention, an electronic device is provided, including a processor and a memory storing a program. Among them, the program includes instructions that, when executed by the processor, cause the processor to execute the steps performed by the method in the first aspect as described above.

[0027] According to the third aspect of the embodiments of the present invention, a computer storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, it implements the method in the first aspect as described above.

[0028] The present invention solves the problems of insufficient numerical simulation accuracy and slow convergence speed caused by complex boundary conditions and nonlinear partial differential equations (PDEs) in the natural convection problem of a two-dimensional square cavity. Traditional numerical methods (such as finite element and finite difference) usually require high computing resources when dealing with complex geometries and high-dimensional nonlinear problems, and there is a loss of accuracy in the boundary condition approximation process. The present invention directly encodes the boundary conditions into the neural network output through a physics-informed neural network with hard constraints that combines high-frequency features (hPINNs), ensuring strict satisfaction of the boundary conditions. At the same time, high-frequency information is added to the input features and the network architecture is improved, thereby improving the accuracy and convergence speed of the solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.

[0030] Figure 1 This is a flow chart of the steps for a method of solving the two-dimensional square cavity natural convection problem of the present invention;

[0031] Figure 2 This is a schematic diagram of the overall network architecture of the physics-informed neural network hPINNs;

[0032] Figure 3 This is a mixed graph of the predicted temperature field and velocity field after the model converges;

[0033] Figure 4 This is a schematic diagram of the error between the predicted result of the model and the true solution. Detailed implementation manners

[0034] For a clearer understanding of the technical features, objectives, and effects of the embodiments of the present invention, the following describes the specific implementation manners of the embodiments of the present invention with reference to the accompanying drawings.

[0035] In this document, "exemplarily" means "serving as an instance, example, or illustration", and any illustration or implementation manner described as "exemplarily" in this document should not be construed as a more preferred or more advantageous technical solution.

[0036] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments in the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art shall fall within the scope of protection of the embodiments of the present invention.

[0037] The present invention proposes a method for solving the two-dimensional square cavity natural convection problem. This method embeds the control equations of fluid dynamics (including the continuity equation, momentum equation, and energy equation) into the loss function of the physics-informed neural network. When outputting the final velocity field and temperature field, through the combination of polynomials and trigonometric functions, the neural network can strictly satisfy the boundary conditions while satisfying the control equations.

[0038] The core of the present invention includes:

[0039] (1) Neural network structure design: Adopt a deep neural network architecture based on the Residual Network (ResNet) and the Exponential Linear Unit (ELU) to enhance the expression ability and stability of the model.

[0040] (2) Boundary condition encoding: By means of the forced constraint strategy, the Dirichlet boundary conditions are directly encoded into the network output, avoiding the problem of error accumulation in the approximation of boundary conditions in the traditional PINNs method.

[0041] (3) Input data augmentation: Combining coordinate space information and Discrete Fourier Transform (DFT) features in the input layer to improve the model's ability to capture high-frequency information in the fluid field.

[0042] (4) Derivative calculation method: Introducing the second-order finite difference method to replace automatic differentiation to calculate the first-order and second-order derivatives required in the function shown, thereby reducing the computational complexity and improving the numerical stability.

[0043] The following further illustrates the specific implementation of the embodiments of the present invention in conjunction with the accompanying drawings of the embodiments of the present invention.

[0044] See Figure 1 , the method of the present invention mainly includes the following steps:

[0045] Step S1: Divide the cavity into grids to obtain the coordinate positions of each discrete point in the cavity;

[0046] Step S2: Use the coordinate positions of each discrete point in the cavity as input data, combine the discrete Fourier transform features, design a physics-informed neural network, and add hard constraint conditions on the boundaries of the equation to be solved for the natural convection problem in the two-dimensional cavity.

[0047] Step S3: Calculate the loss function for training the physics-informed neural network, embed the equation to be solved into the loss function, iteratively optimize the network model of the physics-informed neural network based on the loss function, and dynamically update the network parameters until the network model converges and the training ends;

[0048] It should be understood that if the loss function does not decrease significantly after a certain number of iterations, the iteration is stopped and the network model is considered to have converged.

[0049] Step S4: Use the trained physics-informed neural network to predict new input data, and obtain the numerical solutions of the velocity field, temperature field, and pressure field of the natural convection problem in the two-dimensional cavity as the output results.

[0050] Optionally, in step S1, the cavity is a square cavity, the left wall surface of the square cavity is a high-temperature wall surface, the right wall surface is a low-temperature wall surface, the upper and lower wall surfaces are adiabatic, and the square cavity is filled with fluid to simulate the natural convection phenomenon in an electronic device radiator. The Reynolds number (Ra) of the fluid is 1000, and the Prandtl number (Pr) is set to 0.7.

[0051] See Figure 2Shows a schematic diagram of the overall network architecture of the physics-informed neural network hPINNs. This method includes the following core technical modules:

[0052] Network Structure Design (Networks): Based on the ResNet structure and the ELU activation function (ActivationFunction), a deep neural network, namely the physics-informed neural network, is built.

[0053] Boundary Condition Forcing Encoding (Hard Constraints): Directly embed the boundary condition expressions in the network output.

[0054] Introduction of Frequency Domain Features (input data): Enhance the input data through the discrete Fourier transform (DFT) so that the network can better learn the spatial variation features of complex fluid fields.

[0055] Finite Difference Calculation of Derivatives: Replace the automatic differentiation method to reduce the computational complexity and improve the numerical stability.

[0056] Optionally, in step S2, the network structure of the physics-informed neural network adopts a multi-layer perceptron model based on the residual network, with 64 neurons in each layer, a total of 7 hidden layers, and the last layer outputs four variables (u, v, p, T) of the fluid field.

[0057] Optionally, in step S2, the equation to be solved for the natural convection problem in a two-dimensional square cavity is the control equation of fluid dynamics, and the control equation includes the continuity equation, the momentum equation, and the energy equation.

[0058] Optionally, in step S2, the coordinate positions of each discrete point in the square cavity are used as input data, combined with the discrete Fourier transform features, to design a physics-informed neural network, including: at the input layer of the physics-informed neural network, perform the discrete Fourier transform on the original coordinates of each discrete point in the square cavity to obtain the discrete Fourier frequency domain components of the original coordinates; concatenate the original coordinates with the first n components of the real part of the discrete Fourier frequency domain components as the final input of the physics-informed neural network, so that the physics-informed neural network contains both spatial domain and frequency domain information.

[0059] Optionally, in step S2, hard constraint conditions are added to the boundaries of the equation to be solved for the natural convection problem in a two-dimensional square cavity, including: directly encoding the boundary conditions at the output layer of the physics-informed neural network, specifically embedding the boundary conditions in the form of a function in the velocity field and temperature field outputs, so that the velocity field and temperature field strictly satisfy the Dirichlet boundary conditions on the boundaries.

[0060] Specifically, the core technical modules of the present invention are further described according to the following examples:

[0061] (1) Physics-Informed Neural Network Structure Design

[0062] The network structure adopts a multi-layer perceptron (MLP) model based on the residual network (ResNet). The number of neurons in each layer is 64, and there are 7 hidden layers in total. The last layer outputs four variables (u, v, p, T) of the fluid field.

[0063] Using the residual network has the following two advantages:

[0064] Solve the problems of gradient vanishing and gradient explosion, and improve the training stability of deep networks;

[0065] Enhance the network's learning ability for complex spatial distribution features.

[0066] (2) Embedding of forced boundary conditions

[0067] In the PINNs model, the forced satisfaction of boundary conditions is achieved by directly modifying the output layer expression. For example:

[0068] In the velocity field (u, v), by multiplying xy(1 - x)(1 - y) in the output layer, it is ensured that the velocity field is strictly 0 on the boundary.

[0069] In the temperature field (T), the boundary conditions are directly embedded in the temperature output expression, that is Make it satisfy the setting of high temperature on the left wall and low temperature on the right wall, and there is a smooth transition in the non-boundary region.

[0070] (3) Embedding of high-frequency information

[0071] By performing Fourier transform on the spatial coordinate vector, information of different frequencies in the fluid field can be explicitly introduced into the neural network at the input stage, enabling the network to not only learn the low-frequency trend of the fluid but also effectively capture the high-frequency changes at small scales.

[0072] It should be understood that the coordinate positions of each discrete point in the cavity are used as input data, that is: the input data is the coordinates (x, y) of the orthogonal grid points in the cavity.

[0073] At the input layer of the model, after performing discrete Fourier transform on the coordinates (x, y), the original coordinates are concatenated with the first n components of the real part of their discrete Fourier components as the final input of the model, so that the network contains information in both the spatial domain and the frequency domain.

[0074] Example of input features:

[0075] Assume the input point is (x i , y i ), the input vector representation after introducing Fourier features is:

[0076] [x, y, Re(F x,1 ), …, Re(F x,2 ), Re(F y,1 ), …, Re(F y,n )]

[0077] Among them, F x and F y respectively represent the discrete Fourier transform results of coordinates x and y.

[0078] During the actual training process, the present invention sets the number of frequencies retained by the Fourier transform to 12, ensuring that the model can not only learn the main low-frequency components but also effectively express the high-frequency features near complex boundaries.

[0079] (4) Derivative calculation module

[0080] Optionally, when calculating the loss function in step S3, the finite difference method is used to calculate the partial derivatives in the control equation to replace the automatic differentiation method, which can effectively accelerate the solution process. The calculation formulas for the first-order derivative and the second-order derivative are as follows:

[0081]

[0082] Among them, represents the partial derivative of the function u with respect to the variable x. The derivative describes the rate of change of the function in the x-axis direction at a certain point; u[i + 1, j] represents the value of the function u at the point (i + 1, j), where i and j are the indices of discrete points, usually used to represent positions in a grid or matrix; u[i - 1, j] represents the value of the function u at the point (i - 1, j), similar to u[i + 1, j] but at the point before i; 2Δx represents twice the step size in the x direction, and Δx is the distance between adjacent points in the x direction in the grid or matrix.

[0083] On the boundary (taking i = N as an example), the calculation formulas for the first-order and second-order derivatives are as follows:

[0084]

[0085] This formula is used to calculate the partial derivative near the boundary point. Since the central difference method cannot use the points on both sides to calculate the derivative near the boundary point, the derivative formula using the one-sided points is derived according to the Taylor expansion. Among them, when i = N, since the orthogonal grid is divided into N grid points, when i = N, it means calculating the derivative on the right boundary.

[0086] Experiment:

[0087] The feasibility and superiority of the present invention in solving the natural convection problem of a two-dimensional square cavity have been proven through numerical simulation and experimental verification. The experimental results show that the method of the present invention is significantly superior to the traditional PINNs method in terms of the prediction accuracy of the fluid velocity field and temperature field, and is outstanding in terms of the satisfaction degree of boundary conditions and convergence speed.

[0088] (1) Experimental conditions and settings

[0089] Problem background: Solve the natural convection problem of a two-dimensional square cavity with a size of 1×1, where the left side of the cavity is a high-temperature wall, the right side is a low-temperature wall, and the upper and lower walls are adiabatic.

[0090] Governing equations: Include the continuity equation, momentum equation, and energy equation.

[0091]

[0092]

[0093] Boundary conditions:

[0094]

[0095] Reynolds number (Ra): 1000, Prandtl number (Pr) is set to 0.7.

[0096] (2) Network settings and parameter selection

[0097] Neural network structure: 7-layer Residual Network (ResNet), with 64 neurons in each layer.

[0098] Activation function: Exponential Linear Unit (ELU).

[0099] Input data augmentation: Use the Discrete Fourier Transform (DFT) to extract the first 12 frequency-domain features of the coordinates. The model input is [x, y, Re(F x,1 ), …, Re(F x,2 ), Re(F y,1 ), …, Re(F y,n )], and the output is the velocity field (u, v), temperature field T, and pressure field p.

[0100] Training method: Train on a 201×201 uniform orthogonal grid.

[0101] Optimizer: Adam optimizer, with an initial learning rate set to 0.01.

[0102] (3) Prediction accuracy of temperature field and velocity field

[0103] See Figure 3 mainly shows the mixed graph of the predicted temperature field and velocity field after the model converges.Figure 4 It mainly shows the error between the prediction result of the model and the true solution. The illustrated result shows that the model of the present invention can effectively capture the complex flow structure and temperature gradient change in the boundary layer and has strong high-frequency feature learning ability. In the velocity field, the main error appears near the peak and at the boundary. In the temperature field, the main error appears on the four boundaries.

[0104] In addition, it should be noted that the following are the alternative technical means for some parts of the present invention:

[0105] (1) Substitution of the discrete Fourier feature extraction method

[0106] Current solution: Use the discrete Fourier transform (DFT) to extract the frequency domain features of the spatial coordinates (x, y) and splice them with the original coordinates at the input layer.

[0107] Alternative solution:

[0108] Wavelet Transform: In multi-scale flow problems, wavelet transform can extract spatial domain and frequency domain features simultaneously and is applicable to multi-scale cavity flow.

[0109] Hilbert Transform: Used to extract signal envelope and local frequency features and is suitable for heat convection problems with complex boundaries.

[0110] Polynomial embedding: Use polynomial feature expansion at the input layer, such as [x, y, x 2 , y 2 , xy], to enhance the learning ability of the network without significantly increasing the computational amount.

[0111] (2) Multi-physics field coupling problems

[0112] The method of the present invention is not only applicable to natural convection problems in fluid mechanics but also can be extended to multi-physics field coupling problems, such as:

[0113] Electromagnetic-fluid coupling problem: When solving the coupling problem of electromagnetic field and fluid flow in a cavity, the interaction effect of electromagnetic field and flow field can be simulated by PINNs.

[0114] Heat conduction and flow coupling: When solving the coupling problem of flow and heat conduction in a complex cavity, directly introduce the coupling equation of temperature and velocity field into PINNs.

[0115] Structural mechanics problem: In the fluid-structure interaction problem, take the fluid pressure field as the input and solve the deformation or stress distribution of the solid through PINNs.

[0116] (3) Turbulence problems and high Reynolds number flows

[0117] The method of the present invention can be further extended to turbulent problems and high Reynolds number flow problems:

[0118] Through multi-scale Fourier features and wavelet embedding, the multi-scale structural features in turbulence can be captured, which helps to solve the problem of high-frequency information loss in the turbulence model.

[0119] In high Reynolds number convection problems, a deeper ResNet structure is adopted to enhance the fitting ability of the model to complex turbulence.

[0120] (4) Solve other nonlinear partial differential equations (PDEs)

[0121] The solution framework proposed by the present invention is applicable to solving various complex nonlinear PDE problems, including:

[0122] Wave equation: Simulate the propagation problems of sound waves, seismic waves, etc.

[0123] Biomedical field: Solve biofluid dynamics problems, such as blood flow simulation and drug diffusion problems.

[0124] In summary, compared with the existing methods for solving two-dimensional natural convection in a cavity (such as the finite difference method FDM, the finite element method FEM, and the standard PINNs method), the present invention has the following significant advantages:

[0125] (1) The boundary conditions are strictly satisfied, and the accuracy of the solution is significantly improved

[0126] Traditional PINNs approximate the boundary conditions by adding boundary loss terms to the loss function. However, due to the complex setting of the loss term weights, it is difficult to ensure that the boundary conditions are fully satisfied during training, resulting in the accumulation of boundary errors. The present invention directly encodes the boundary conditions in the network output layer to ensure that the fluid velocity and temperature fields strictly satisfy the Dirichlet boundary conditions at the boundary without additional boundary loss terms. The calculated MSE error of the velocity field is reduced to 3.6e-4, and the MSE error of the temperature field is 1.69e-5, which is significantly better than the ordinary PINNs model.

[0127] (2) High-frequency information is effectively learned, and the simulation ability of complex flow structures is enhanced

[0128] When dealing with complex fluid problems, standard PINNs are difficult to capture high-frequency flow information, especially when the flow changes violently at the boundary or in local areas. The present invention introduces partial discrete Fourier transform features (DFT) in the input layer to enhance the model's learning ability of high-frequency flow features, enabling the accurate expression of velocity gradients and temperature gradients near the boundary. The model can accurately capture the high-frequency flow and temperature changes in the cavity, avoiding the problem of ignoring high-frequency features in traditional methods.

[0129] (3) The ELU activation function improves the convergence speed and non - linear expression ability

[0130] Standard PINNs usually use ReLU or Tanh activation functions. However, in deep networks, ReLU may lead to "neuron death", and Tanh may lead to gradient vanishing, affecting the training stability. The network body of the present invention adopts a residual network (ResNet) structure to alleviate the gradient vanishing problem and improve the training stability of deep networks. It uses the exponential linear unit (ELU) activation function, which outputs a value less than zero but not completely zero in the negative input region, thereby maintaining the activation state of the network and enhancing the non - linear expression ability and training convergence speed of the model in solving complex physical fields. Experiments have proved that this activation function can effectively reduce the situation of gradient vanishing or explosion during network training.

[0131] (4) Using finite differences to calculate derivatives, improving numerical stability and computational efficiency

[0132] Automatic differentiation has defects such as high computational complexity, large memory occupancy, and instability when calculating high - order derivatives. The present invention uses the finite - difference method to calculate the first - order and second - order derivatives, reducing the computational complexity and improving the stability and efficiency of network training. Specifically, in the process of solving partial differential equations, the second - order finite - difference method is used to calculate the first - order and second - order derivatives, replacing automatic differentiation, reducing the computational complexity, and improving the numerical stability and accuracy. At the boundary, the introduction of the finite - difference method still maintains second - order accuracy at the boundary and does not cause accuracy loss due to special boundary treatment. Under the same training conditions, the calculation speed is increased by about 300%.

[0133] As another example, the present invention also provides an electronic device. Now, an electronic device that can be used as the server or client of the present invention will be described. It is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital - electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0134] The electronic device may include: a processor, a communications interface, a memory, and a communication bus.

[0135] The processor, communication interface, and memory communicate with each other via a communication bus. The communication interface is used to communicate with other electronic devices or servers.

[0136] The processor is used to execute a program, specifically, it can execute the relevant steps in the above method embodiments.

[0137] Specifically, the program may include program code, and the program code includes computer operation instructions.

[0138] The processor may be a central processing unit (CPU), or a specific application integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. One or more processors included in the intelligent device may be of the same type, such as one or more CPUs; or they may be of different types, such as one or more CPUs and one or more ASICs.

[0139] The memory is used to store the program. The memory may include high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory.

[0140] When the program is executed by the processor, it is used to cause the electronic device to execute the method for solving the two-dimensional square cavity natural convection problem of the present invention.

[0141] In addition, for the specific implementation of each step in the program, reference can be made to the corresponding steps and descriptions in the corresponding units in the above method embodiments, which will not be elaborated here. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding process descriptions in the foregoing method embodiments, which will not be elaborated here.

[0142] An exemplary embodiment of the present invention also provides a computer storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the methods of the embodiments of the present invention. Reference can be made to the corresponding process descriptions in the foregoing method embodiments, which will not be elaborated here.

[0143] The method according to an embodiment of the present invention can be implemented in hardware, firmware, or be implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or be implemented as computer code that is originally stored in a remote recording medium or a non-transitory machine-readable medium and downloaded through a network and will be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component (such as RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown herein.

[0144] So far, specific embodiments of the present invention have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing may be advantageous.

[0145] It should be understood that although this specification is described according to various embodiments, not every embodiment only contains an independent technical solution. This narrative manner of the specification is only for clarity. Those skilled in the art should regard the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

[0146] Finally, it should be noted that the above embodiments are only used to illustrate the embodiments of the present invention, rather than to limit the embodiments of the present invention. Those of ordinary skill in the relevant technical field can also make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present invention. The patent protection scope of the embodiments of the present invention shall be defined by the claims.

Claims

1. A solution method for the two-dimensional natural convection problem in a square cavity, characterized in that, Including: Step S1: Conduct grid division on the square cavity to obtain the coordinate positions of each discrete point in the square cavity; Step S2: Use the coordinate positions of each discrete point in the square cavity as input data, combine with the discrete Fourier transform features, design a physics-informed neural network, and simultaneously add hard constraint conditions on the boundaries of the equation to be solved for the natural convection problem in the two-dimensional square cavity; Step S3: Calculate the loss function for training the physics-informed neural network, embed the equation to be solved into the loss function, iteratively optimize the network model of the physics-informed neural network based on the loss function, and dynamically update the network parameters until the network model converges and the training ends; Step S4: Use the trained physics-informed neural network to predict new input data, and obtain the numerical solutions of the velocity field, temperature field, and pressure field of the natural convection problem in the two-dimensional square cavity as the output results.

2. The method according to claim 1, wherein In step S1, the square cavity is a square chamber. The left wall of the square chamber is a high-temperature wall, the right wall is a low-temperature wall, the upper and lower walls are adiabatic, and the square cavity is filled with fluid, which is used to simulate the natural convection phenomenon in an electronic device radiator.

3. The method according to claim 1, characterized in that, In step S2, the equation to be solved for the natural convection problem in the two-dimensional square cavity is the control equation of fluid dynamics, and the control equation includes a continuity equation, a momentum equation, and an energy equation.

4. The method according to claim 1, wherein In step S2, the network structure of the physics-informed neural network adopts a multi-layer perceptron model based on a residual network. The number of neurons in each layer is 64, and there are 7 hidden layers in total. The last layer outputs four variables (u, v, p, T) of the fluid field.

5. The method according to claim 4, characterized in that In step S2, using the coordinate positions of each discrete point in the square cavity as input data, combining with the discrete Fourier transform features, designing a physics-informed neural network includes: At the input layer of the physics-informed neural network, perform discrete Fourier transform on the original coordinates of each discrete point in the square cavity to obtain the discrete Fourier frequency domain components of the original coordinates; Concatenate the original coordinates with the first n components of the real part of the discrete Fourier frequency domain components as the final input of the physics-informed neural network, so that the physics-informed neural network contains both spatial domain and frequency domain information.

6. The method according to claim 3, wherein In step S3, when calculating the loss function, use the finite difference method to calculate the partial derivatives in the control equation to accelerate the solution process. The calculation formulas for the first-order derivative and the second-order derivative are: Among them, represents the partial derivative of the function u with respect to the variable x, u[i + 1, j] represents the value of the function u at the point (i + 1, j), i and j are the indices of discrete points, u[i - 1, j] represents the value of the function u at the point (i - 1, j), and 2Δx represents twice the step size in the x direction, where Δx is the distance between adjacent points in the x direction in the grid or matrix.

7. The method according to claim 1, characterized in that In step S2, adding hard constraint conditions on the boundaries of the equation to be solved for the natural convection problem in the two-dimensional square cavity includes: Directly encode the boundary conditions at the output layer of the physics-informed neural network. Specifically, embed the boundary conditions in the form of a function in the velocity field and temperature field outputs, so that the velocity field and temperature field strictly satisfy the Dirichlet boundary conditions on the boundaries.

8. An electronic device, characterized in that, Including: A processor; A memory for storing programs; Wherein, the program includes instructions, and when the instructions are executed by the processor, the processor executes the steps performed by the method according to any one of claims 1-7.

9. A computer storage medium, characterized in that, A computer program is stored thereon, and when the program is executed by the processor, the method according to any one of claims 1-7 is implemented.

Citation Information

Cited By

  • Method for solving second-order elliptic partial differential equation by mixing neural network and finite element method

    CN120578850A

  • Natural convection-containing solid-liquid phase change prediction method based on fusion of LBM and physical information neural network

    CN121434887A