Variable boundary condition real-time physical field simulation method based on deep learning
A general simulation model built through offline training using deep learning solves the problem of real-time physical field simulation under dynamic boundary conditions by employing Fourier transform and multinomial approximation strategies, achieving fast response and efficient simulation.
Patent Information
- Application Number
- CN202511752328.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-17
AI Technical Summary
Existing technologies cannot achieve real-time physics simulation when dealing with dynamically changing boundary conditions. Traditional methods have huge computational overhead, and deep learning methods require retraining, which cannot meet the requirements for second-level response.
By conducting a single offline deep learning training session, a general simulation model decoupled from specific boundary conditions is constructed. Using Fourier transform and polynomial approximation strategies, rapid simulation of linear and nonlinear physical fields is achieved.
It achieves real-time simulation of arbitrary boundary conditions, avoiding the computational bottleneck of traditional methods and the repetitive training of deep learning, and has a second-level response capability, thus improving the efficiency of industrial design.
Smart Images

Figure CN121543428A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence, applying deep learning to scientific computing, and inventing a real-time physical field simulation method based on deep learning with varying boundary conditions. More specifically, this invention relates to a technique for rapidly solving physical fields described by partial differential equations when boundary conditions change dynamically. Background Technology
[0002] In industrial simulation, such as computer-aided engineering software, the ability to rapidly solve for physical fields with variable boundary conditions is a key technology supporting parametric design and real-time optimization. However, current mainstream solution solutions all exhibit inherent technical limitations when addressing this requirement. Traditional finite element-based numerical solvers, due to their core architecture, cannot adapt to dynamically changing boundary conditions. Any slight adjustment to the boundary conditions forces the solver to execute a complete process from mesh generation and matrix assembly to solving the linear equations. This process incurs enormous computational overhead, resulting in delays of several hours to days during design iterations, making interactive design and real-time optimization impossible.
[0003] To address the efficiency bottlenecks of traditional methods, AI solution methods based on Physical Information Neural Networks (PINNs) have gained attention in recent years. However, traditional PINNs suffer from fundamental limitations in practical engineering applications: their network weights are tightly coupled to specific boundary conditions. Once the boundary conditions change, the entire network must be retrained from scratch, which typically takes minutes to hours, essentially failing to meet the real-time response requirements in dynamic scenarios. In recent years, researchers have attempted to improve upon traditional PINNs, such as meta-learning frameworks. While these aim to reduce retraining costs, their final solution accuracy often falls short of the stringent requirements of engineering applications, and the fine-tuning process still requires a significant amount of time, making it impossible to achieve sub-second response times. Another type of operator learning method, such as DeepONet, faces a different dilemma: they rely on pre-training with massive amounts of boundary condition-solution data pairs, which presents extremely high data acquisition costs and excessively long training cycles in real-world industrial scenarios.
[0004] The industry urgently needs a new solution paradigm that can achieve real-time response when boundary conditions are dynamically adjusted, while ensuring engineering accuracy. This technology needs to overcome the computational efficiency bottleneck of traditional numerical methods, and at the same time overcome the dependence of current deep learning methods on repeated training and big data, ultimately enabling engineers to obtain simulation results in seconds after modifying design parameters. Summary of the Invention
[0005] 1. Technical Solution
[0006] The essence of physics simulation is to solve for the partial differential equation u(x,t) corresponding to the initial / boundary conditions g(x). This invention aims to overcome the technical bottleneck of existing industrial simulation technologies that cannot achieve real-time physics simulation when the boundary conditions g(x) change, and proposes a real-time physics simulation method based on deep learning with varying boundary conditions. Its core idea is: through offline training of a deep neural network, a general simulation model decoupled from the specific boundary conditions g(x) is constructed; in online application, the new boundary conditions are quickly feature-extracted and input into the model, and the corresponding physics distribution is output without any retraining or iterative calculation.
[0007] This method constructs corresponding simulation models for linear and nonlinear physical fields, which consist of the following two parts:
[0008] (1) Basic solution model of linear physical field
[0009] Basic Solution Model Construction: To achieve real-time simulation of linear physical fields, we first need to establish a mathematical model that can be solved quickly for the partial differential equations describing the physical field. The basic solution model is based on the following finding: any boundary conditions can be decomposed into a linear combination of standard sine and cosine basis functions through Fourier transform. Based on the superposition principle of linear equations, the solution of the entire physical field can also be expressed as a linear combination of the corresponding basis function solutions. Therefore, we derive the mathematical expression of the basic solution model as follows:
[0010]
[0011] in These are the real and imaginary parts of the Fourier transform of the boundary condition g(x), respectively. This is the "basic solution" that we need to pre-compute offline.
[0012] Pre-training process: Using a physical information neural network, solve partial differential equations with sine and cosine functions as boundary conditions offline. As a base solution, a base solution library is constructed.
[0013] Online simulation process: When new boundary conditions are input, they are first decomposed into frequency domain coefficients using the Fast Fourier Transform (FFT) algorithm; then, these coefficients are used as combination weights, and the corresponding basic solutions are called from the basic solution library for weighted superposition to instantly synthesize a brand new physical field.
[0014] (2) Polynomial model of nonlinear physical fields
[0015] Polynomial Model Construction: For nonlinear physical fields, this invention achieves rapid simulation by constructing a polynomial model. This model is based on the following principle: for many nonlinear partial differential equations, their physical field solutions can be considered as a complex nonlinear mapping of the initial boundary conditions. To establish this mapping, this invention employs a strategy combining frequency domain dimensionality reduction and polynomial approximation. First, the initial boundary condition g(x) is compressed into a few low-frequency coefficients using a fast Fourier transform. This allows for efficient characterization of the original signal. Based on this, the physical field solution is constructed as a polynomial function of these low-frequency coefficients, with the mathematical expression:
[0016]
[0017] power and These are constants, collectively defining a fixed set of polynomial basis terms; while w j (x,t) serves as the coefficient of this set of basis terms, and is a learnable function that varies with the spatiotemporal coordinates. This model transforms the solution of high-dimensional nonlinear mappings into solving a set of coefficient functions w. j Learning (x,t).
[0018] Pre-training process: Prepare a small amount of physical field data and train a coefficient prediction network using a data-driven approach. This network learns to map spatiotemporal coordinates to a set of polynomial coefficients.
[0019] Online simulation process: For new boundary conditions, low-frequency Fourier coefficients are extracted using FFT. Simultaneously, the desired spatiotemporal coordinates are input into a pre-trained coefficient prediction network, which outputs a set of corresponding polynomial coefficients. Finally, by linearly combining the frequency domain features with the network-predicted coefficients, the physical field value at that point is calculated in real time.
[0020] 2. Technical Effects
[0021] This invention requires only one offline training session to achieve real-time simulation of physical fields with arbitrarily changing boundary conditions. Our method avoids the problem of traditional numerical methods and PINN requiring separate computation for each task, while also possessing versatility: a single network uniformly supports solving both forward and inverse problems. This method is suitable for scientific computing scenarios requiring rapid response to changes in boundary conditions and can effectively improve the efficiency of industrial design. Attached Figure Description
[0022] Figure 1 Basic solutions of the convection equation (upper) and (Below) Schematic diagram
[0023] Figure 2 This is the network structure diagram of the multinomial model.
[0024] Figure 3 These are simulation results of the Burgers equation across the entire spatiotemporal domain using various methods. Detailed Implementation
[0025] The method described in this invention is implemented based on the following experimental environment: the operating system is Windows 10, the programming language is Python 3.8.3, the deep learning framework is PyTorch 1.7.0, and an NVIDIA GTX 3080 (16G) GPU (CUDA 11.4) is used for accelerated computation. The method mainly includes a basic solution model and a multinomial model, which are used to handle linear and nonlinear physical field problems, respectively. They share the same working paradigm: first, a general simulation model is obtained through offline training; in online applications, frequency domain analysis is performed on new boundary conditions, and the model is used to achieve real-time simulation of the physical field. The specific implementation process is as follows:
[0026] 1. Implementation of the basic solution model
[0027] Step 1: Constructing the basic solution model of the convection equation
[0028] The fundamental solution model can be applied to the convection equation, a commonly used linear equation in fluid mechanics. The convection equation has the following form:
[0029]
[0030] u(x,0)=g(x)
[0031] u(0,t)=u(2π,t)
[0032] The experiment is set up with g(x) = sin(px + q), where p and q are variable parameters with a range of p ∈ (0, 3] and q ∈ [0, 2π]. This invention aims to solve the problem of rapidly calculating the physical field corresponding to the convection equation when p and q vary.
[0033] When the initial conditions are discretized as g(x) (x = 0, 1, ..., N-1), they can be decomposed into a linear combination of a finite number of sine / cosine bases using the discrete Fourier transform. Based on the superposition principle of linear equations, the solution to the entire physical field can also be expressed as a linear combination of the solutions to the corresponding basis functions. Therefore, the solution to the convection equation can be expressed as:
[0034]
[0035] The above equation consists of two parts, the basic solution. This refers to using basis functions The solutions to the convection equations under initial conditions, with coefficients... We obtain the real and imaginary parts of the Fourier transform results for the boundary condition g(x) to be solved, totaling N+2. The basic solution can be obtained through offline training, and the coefficients can be calculated quickly online.
[0036] Since the Fourier transform results are mainly concentrated in the low-frequency part, meaning g(x) is primarily approximated by low-frequency bases, the basic solution model can be approximated as a linear combination of M low-frequency basic solutions during implementation, where M << N / 2. Ablation experiments have verified that M = 10 is sufficient to fit the solution of the convection equation.
[0037] Step 2: Offline training of the base solution
[0038] The offline phase involves training the base solution library offline using a physical information neural network. Where i = 0, 1, ..., M-1. Specifically, 2*M (M sine and M cosine) independent neural networks need to be trained sequentially. Each network is configured to operate under the given convection equations and periodic boundary conditions, using specific sine and cosine basis functions. or Used as initial conditions for solving.
[0039] The physical information neural network adopts a fully connected structure, containing four hidden layers, each with 100 neurons, and uses the ReLU function as the activation function. During training, the Adam optimizer is used with an initial learning rate of 0.001, and training is performed for 20,000 epochs. Its loss function is the sum of the physical information loss and the boundary condition loss, optimized using a gradient descent algorithm until the loss converges.
[0040] After all networks have been trained, their model parameters are persistently saved, forming a base solution library for the online phase. The training results... and See diagram Figure 1 .
[0041] Step 3: Solve the forward and inverse problems online
[0042] In the online phase, a pre-built base solution library is used to achieve real-time solutions to both forward and inverse problems. To verify the effectiveness of this method, we selected the convection equation as the test object, generating 60 test samples within the parameter range (uniform sampling of p = 1, 2, 3, q) as initial conditions, and compared it with the traditional physical information neural network vanilla PINN, the meta-learning method DATS+MAD-PINN, and the operator learning methods DeepONet and PI-DeepONet. Evaluation metrics include relative L2 error on the test set and computation time.
[0043] (1) Solving the positive problem
[0044] For any given new initial conditions, first perform a Fast Fourier Transform to extract the first M low-frequency coefficients. Then, using the coefficient sequence as the combination weight, the corresponding sine and cosine basis solutions in the basis solution library are called for weighted linear combination to instantly synthesize the complete physical field.
[0045] Experimental results show that the relative L2 error of the proposed method on the positive problem of convection equations is 0.013±0.005, which is comparable to the accuracy of vanilla PINN (0.013±0.013) trained individually for each sample, and significantly better than DATS+MAD (0.205±0.152), DeepONet (0.495±0.238), and PI-DeepONet (0.608±0.320). In terms of efficiency, the proposed method requires only 0.11 hours for offline training and an average online solution time of 0.14 seconds; while vanilla PINN requires retraining for each new problem, with an average time of 103 seconds. This proposed method achieves a three-order-of-magnitude speed improvement while maintaining accuracy, meeting the requirements of real-time simulation.
[0046] (2) Solving the inverse problem
[0047] Given the physical field observation values {u} in a certain region obs (x k ,t k Under the premise of )}, using the basic solution library at the corresponding coordinates {(x)} k ,t k The solution at )} constructs a system of linear equations, and the Fourier coefficients are inverted using the least squares method. Then, the initial conditions to be inverted are reconstructed using the inverse Fourier transform.
[0048] The relative L2 error of this method in solving inverse problems is 0.014±0.006, and the average time is 0.18 seconds, both of which are better than the error (0.043±0.058) and solution time (110 seconds) of vanilla PINN, further demonstrating the accuracy and efficiency advantages of this invention in complex inversion tasks.
[0049] 2. Implementation of the polynomial model
[0050] Step 1: Constructing a polynomial model using Burgers' equations
[0051] Polynomial models can be applied to another commonly used nonlinear equation in fluid mechanics—the Burgers equation. The Burgers equation takes the following form:
[0052]
[0053] u(x,0)=g(x)
[0054] u(0,t)=u(2π,t)
[0055] The initial condition is set as g(x) = sin(px + q), where p and q are variable parameters with a range of p ∈ (0, 5] and q ∈ [0, 2π]. This invention aims to quickly calculate the physical field corresponding to the Burgers equations regardless of changes in p and q.
[0056] Similar to linear physical fields, the core of this invention lies in utilizing the frequency domain characteristics of the initial condition g(x) to construct a general model. First, g(x) is compressed into the first M low-frequency coefficients using a Fast Fourier Transform. To efficiently characterize its core features. Unlike solutions in linear fields, which can be expressed as linear combinations of basic solutions, the solutions to the Burgers equations form a complex nonlinear mapping with respect to the initial conditions. Therefore, a polynomial approximation strategy is further introduced to construct the physical field solutions as polynomial functions of the aforementioned Fourier coefficients, the mathematical expression of which is:
[0057]
[0058] in The low-frequency coefficients of the Fourier transform of the initial condition g(x) are rapidly extracted in the online stage as new boundary conditions arise. (Power) and These are preset constants, which together define a fixed set of polynomial basis terms. These are the coefficients of the basis terms, a learnable function that varies with spatiotemporal coordinates, obtained through neural network training in the offline phase. Ablation experiments determined that, for the Burgers equation, setting the low-frequency parameter M = 5 and the highest power of the polynomial to 3 achieves the optimal balance between accuracy and efficiency, at which point the total number of polynomial terms N... p =210.
[0059] Step 2: Offline training of the coefficient prediction network
[0060] In the offline phase, a coefficient prediction network is trained using a data-driven approach to learn the coefficient function w in the multinomial model. j (x,t).
[0061] In the data preparation phase, a dataset covering different initial conditions and their corresponding physical field solutions was generated. Specifically, 50 samples were generated, each with the initial condition g(x) = sin(px + q), where the parameter p takes values in {1, 2, 3, 4, 5}, and q is uniformly sampled with 10 values within [0, 2π], for a total of 50 samples. The full-field physical field solution u(x,t) corresponding to each sample was obtained using a high-precision numerical solver and used as the training label. Subsequently, a Fast Fourier Transform was performed on the initial conditions of each sample, extracting the first M = 5 low-frequency coefficients. And generate N based on the preset highest power of the polynomial 3. p = 210 fixed polynomial base terms.
[0062] During the training phase, a coefficient prediction network is constructed. This network employs a fully connected structure, containing four hidden layers, each with 100 neurons, and uses the ReLU function as the activation function. The network's input is the spatiotemporal coordinates (x,t), and its output is N. p A dimensional vector representing all coefficients at that coordinate point. By linearly combining the coefficients output by the network with the preset polynomial basis terms, the predicted solution of the physical field can be obtained.
[0063] During training, the Adam optimizer was used with an initial learning rate of 0.001, and the training was iterated 100,000 times. The goal was to minimize the predicted solution. The mean square error between the network and the real physical field u(x,t) is used to train the network end-to-end, enabling it to accurately map spatiotemporal coordinates to polynomial coefficients. The trained network model will be persistently saved for use in online simulations. The network structure is as follows: Figure 2 As shown.
[0064] Step 3: Solve the forward and inverse problems online
[0065] In the online phase, a pre-trained coefficient prediction network and a multinomial model are used to solve the forward and inverse problems in real time. To verify the effectiveness of this method, we selected the Burgers equation as the test object and generated 50 test samples within the parameter range (uniform sampling of p = 1, 2, 3, 4, 5, q) as initial conditions (the parameters are different from the training set in the offline phase). The results were compared with traditional physical information neural networks (vanilla PINN), meta-learning methods (DATS+MAD-PINN), and operator learning methods (DeepONet, PI-DeepONet). Evaluation metrics included relative L2 error on the test set and computation time.
[0066] (1) Solving the positive problem
[0067] For any given new initial conditions, first perform a Fast Fourier Transform to extract the first M = 5 low-frequency coefficients. And construct N according to the preset power combination rules. p =210 polynomial basis terms; simultaneously, the spatiotemporal coordinates (x,t) to be determined are input into the trained coefficient prediction network to obtain the corresponding coefficient vector. Finally, the coefficients are linearly combined with the basis terms to output the physical field value instantaneously.
[0068] When the initial conditions are too complex and the required accuracy cannot be achieved solely through the aforementioned forward computation, an online fine-tuning mechanism can be activated. This mechanism uses the aforementioned predicted solution as the initial value and employs a physical information loss function to perform a small number of iterative gradient updates on the parameters of the coefficient prediction network. In this embodiment, 200 rounds of fine-tuning iterations are performed in the online solution of the Burgers equation to significantly improve the solution accuracy under complex boundary conditions.
[0069] Experimental results show that the proposed method achieves a relative L2 error of 0.017±0.015 on the forward problem of the Burgers equation, significantly outperforming traditional PINN (0.072±0.079), DATS+MAD (0.576±0.197), DeepONet (0.213±0.058), and PI-DeepONet (0.656±0.062). In terms of efficiency, offline training takes only 0.06 hours, and online solution (including fine-tuning) takes an average of 2.69 seconds; while traditional PINN requires retraining for each new problem, averaging 257 seconds. This method achieves a two-order-of-magnitude speed improvement while maintaining accuracy.
[0070] (2) Solving the inverse problem
[0071] Given the physical field observation values {u} in a certain region obs (x k ,t k Under the premise of )}, the coordinates of the observation point {(x)} k ,t k The input coefficient prediction network obtains the corresponding coefficients, which are then combined with measured physical field data. The Fourier coefficients of the boundary conditions are then inverted using the least squares method. Finally, an inverse Fourier transform is performed on the coefficient sequence to reconstruct the initial conditions to be inverted. This method achieves a relative L2 error of 0.027 ± 0.010 and an average time of 0.13 seconds in solving the inverse problem of the Burgers equation, both superior to the error (0.026 ± 0.019) and solution time (261 seconds) of the traditional PINN, further demonstrating the efficiency advantage and accuracy competitiveness of this invention in nonlinear inversion tasks.
Claims
1. A real-time physics field simulation method based on deep learning with varying boundary conditions, characterized in that, Includes the following steps: (1) For linear partial differential equations, a basic solution model is constructed, and the solution under any initial / boundary conditions is expressed as a linear combination of pre-trained basic solutions. The combination weight is dynamically determined by the Fourier coefficients of the initial / boundary conditions. (2) For nonlinear partial differential equations, a polynomial model is constructed, and the solution is modeled as a polynomial function of the Fourier coefficients of the initial / boundary conditions. The polynomial coefficients are learned offline through a neural network. (3) Perform Fourier transform on any changing initial / boundary conditions, extract low-frequency coefficients, and substitute them into the basic solution model or polynomial model to achieve real-time solution.
2. The method according to claim 1, characterized in that, The construction of the basic solution model includes: (1) Use Discrete Fourier Transform to decompose the initial / boundary conditions into a linear combination of sine / cosine basis functions; (2) Pre-train the basis solutions of partial differential equations with sine and cosine basis functions as initial / boundary conditions. Only training the low-frequency basis solutions can achieve effective approximation. (3) The solution under the new initial / boundary conditions is represented as a linear combination of the pre-trained basic solutions, and the combination weights are its Fourier coefficients.
3. The method according to claim 2, characterized in that, The pre-trained basic solutions of the basic solution model are trained offline using a Physical Information Neural Network (PINN). The training loss includes physical information loss of partial differential equations, initial condition loss, and boundary condition loss.
4. The method according to claim 2, characterized in that, The number M of low-frequency fundamental solutions was determined through ablation experiments; for the one-dimensional spacetime equation, M = 10.
5. The method according to claim 1, characterized in that, The construction of the polynomial model includes: (1) Perform Fourier transform on the initial / boundary conditions and retain low-frequency coefficients; (2) The solution is represented as a polynomial function with low-frequency coefficients, which are learned offline through a neural network; (3) Use a data-driven approach to train the polynomial coefficient function, with spatiotemporal coordinates as input and polynomial coefficients as output.
6. The method according to claim 5, characterized in that, The number of low-frequency coefficients M and the highest power p of the polynomial model max Ablation experiments determined that for the one-dimensional spacetime equation: M = 5, p max =3, the number of terms in the polynomial is 210.
7. The method according to claim 1, characterized in that, The method is applicable to solving both the forward and inverse problems of linear and nonlinear partial differential equations. When solving the inverse problem, the Fourier coefficients of the initial / boundary conditions are derived by using the least squares method.
8. The method according to claim 1, characterized in that, The method trains the basis solutions or polynomial coefficient functions offline, and achieves real-time solutions through Fourier transform and model combination in the online stage, without the need for retraining.
9. The method according to claim 1, characterized in that, The method is applicable to convection equations or Burgers equations.