Method for correcting heat flow distribution on surface of hypersonic vehicle
By combining CFD simulation and optical fiber measurement technology in the aircraft surface heat flow distribution simulation, the Transformer neural network is used to correct the heat flow distribution in real time, and the problem of insufficient accuracy of heat flow distribution simulation in the existing technology is solved, achieving higher accuracy of heat flow distribution prediction and online correction.
Patent Information
- Application Number
- CN202510036689.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-23
AI Technical Summary
In the prior art, the simulation of the heat flow distribution of the aircraft surface is problem of insufficient accuracy. The calculation results of CFD simulation simulation often have errors, and the optical fiber sensor can only measure a small part of the aircraft surface in real time, and cannot obtain the full field temperature in real time, resulting in the calculation results being inaccurate enough.
A method of correction of the surface heat flow distribution of Transformer based on the surface of the superb aircraft is adopted. By obtaining the heat flow data and temperature data simulated by CFD, and combining the temperature data measured by optical fiber sensors in real time, the Transformer neural network is used to integrate these data, calculate the heat flow correction amount, and add it to the original heat flow data to obtain the corrected heat flow distribution.
By combining CFD simulation and fiber measurement technology, and using Transformer neural network to correct the heat flow distribution data in real time, higher-precision heat flow distribution prediction can be achieved, which can be corrected online in real time during flight to approximate the real heat flow distribution situation.
Smart Images

Figure CN120030933A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a training model, in particular to a Transformer-based correction method for heat flux distribution on the surface of a hypersonic aircraft. Background Art
[0002] In the prior art, the simulation of heat flux distribution on the aircraft surface mainly uses CFD simulation software to predict the heat flux distribution of the entire aircraft surface. However, relying solely on CFD simulation, it has the problem of insufficient accuracy, and the calculation results often have certain errors. In addition, some optical fiber sensors are added to measure high-precision temperature, but these measurement data only measure a small area of the aircraft surface. During the flight, it is impossible to obtain the temperature of the entire field in real time, and the calculation results are still not accurate enough. Summary of the invention
[0003] In order to overcome the deficiencies of the prior art, the present invention provides a method for correcting heat flux distribution on the surface of a hypersonic vehicle.
[0004] The technical solution adopted by the present invention to solve the technical problem is: A method for correcting heat flux distribution on the surface of a hypersonic vehicle comprises the following steps: Step S1: Obtain the CFD simulated aircraft surface heat flow data qCFD (x, y, z, t) and the corresponding temperature data TCFD (x, y, z, t), use the fiber optic sensor to measure the temperature in real time in the 8% area of the aircraft surface, and obtain the fiber optic temperature data Tfiber (xf, yf, zf, t).
[0005] Step S2: Use the Transformer neural network to integrate the heat flow data qCFD (x, y, z, t), the temperature data TCFD (x, y, z, t) and the fiber temperature data Tfiber (xf, yf, zf, t), calculate the heat flow correction Δq, add the heat flow correction Δq to the heat flow data qCFD (x, y, z, t), and obtain the corrected heat flow distribution qcorrected (x, y, z, t), which satisfies the formula: qcorrected = Δq + qCFD.
[0006] Step S3: Convert the corrected heat flux distribution qcorrected (x, y, z, t) into a predicted temperature distribution Tpred (x, y, z, t) through a heat conduction model.
[0007] Step S4: Calculate the total loss function L to guide the model training of the Transformer neural network, wherein the total loss function L includes the temperature constraint loss Lt, the heat flow constraint loss Lq and the smoothness loss L ▽ , the total loss function L satisfies the formula: L=Lt+Lq+L▽ .
[0008] Step S5: Calculate the gradient of the total loss function L with respect to all model parameters through the self-differentiation equation.
[0009] Step S6: Use the optimizer to update the parameters of the Transformer neural network based on the gradient information.
[0010] The Transformer neural network includes an input layer, an embedding layer, a Transformer encoder, a physical constraint layer and an output layer. The input layer is used to normalize the input data; the embedding layer converts the input data into a high-dimensional feature vector and adds position encoding; the Transformer encoder uses a multi-head self-attention mechanism and a feedforward neural network to capture the global and local dependencies in the data; the physical constraint layer converts the corrected heat flow distribution into a predicted temperature distribution through a heat conduction model; and the output layer outputs a heat flow correction value for correcting the heat flow distribution.
[0011] The input sequence of the heat flow data qCFD (x, y, z, t) in the input layer is expressed as: [batch_size, seq_len, num_cfd_features], where seq_len is the number of grid points on the aircraft surface, and num_cfd_features is the features of CFD heat flow and CFD temperature.
[0012] The input sequence of the optical fiber temperature data Tfiber (xf, yf, zf, t) in the input layer is expressed as: [batch_size, num_fiber_points, num_fiber_features], wherein num_fiber_points is the number of optical fiber points on the surface of the aircraft, and num_fiber_features is the temperature and position information of the optical fiber.
[0013] The embedding layer uses a linear layer or a convolutional layer to convert the heat flow data qCFD (x, y, z, t) and the temperature data TCFD (x, y, z, t) into a high-dimensional feature vector, and merges the input sequence in the sequence dimension. The merged input sequence is expressed as: [batch_size, seq_len + num_fiber_points, embed_dim], where embed_dim is the dimension size of the embedding vector.
[0014] The temperature constraint loss Lt satisfies the formula: Lt=MSE(Tpred, Tfiber), wherein Tpred is the predicted temperature distribution Tpred(x, y, z, t), Tfiber is the optical fiber temperature data Tfiber(xf, yf, zf, t), and MSE is the mean square error.
[0015] The heat flow constraint loss Lq satisfies the formula: Lq=α||Δq|| 1 +β||Δq|| 2 , where α and β are weight parameters and Δq is the heat flow correction.
[0016] The smoothness loss L ▽ Satisfy the formula: L ▽ =γ∑|▽qcorrected(x,y,z,t)| 2 , where γ is the weight parameter.
[0017] The beneficial effects of the present invention are as follows: the method of the present invention combines CFD simulation and optical fiber measurement technology, and uses the Transformer neural network to correct the heat flux distribution data in real time. In addition, the weight parameters of the Transformer neural network are iteratively updated through the back propagation and gradient descent of the loss function, so that it can accurately predict the heat flux distribution in real time. In actual flight, the optical fiber temperature measurement data will continue to be updated in real time, and the real-time measured optical fiber temperature data Tfiber will be input into the trained Transformer neural network. The Transformer neural network outputs the updated heat flux distribution qcorrected, that is, it can be corrected online in real time during the flight, so that the heat flux prediction is closer to the actual situation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0019] Figure 1 It is a schematic flow chart of the correction method of the present invention. DETAILED DESCRIPTION
[0020] Reference Figure 1 A method for correcting heat flux distribution on the surface of a hypersonic vehicle comprises the following steps: Step S1: Obtain the CFD simulated aircraft surface heat flow data qCFD (x, y, z, t) and the corresponding temperature data TCFD (x, y, z, t), use the optical fiber sensor to measure the temperature in real time in the 8% area of the aircraft surface, and obtain the optical fiber temperature data Tfiber (xf, yf, zf, t). In this embodiment, the temperature data TCFD (x, y, z, t) itself may not be accurate enough, but it can be used as background information to improve the stability of model training. In addition, some auxiliary information can also be collected, such as the thermal conductivity k of the aircraft material, boundary conditions (ambient temperature, pressure) and flight state parameters (flight speed, attitude), etc., which can be input into the model as additional features for reference during physical constraints or post-processing.
[0021] Step S2: Use the Transformer neural network to integrate the heat flow data qCFD (x, y, z, t), the temperature data TCFD (x, y, z, t) and the fiber temperature data Tfiber (xf, yf, zf, t), calculate the heat flow correction Δq, add the heat flow correction Δq to the heat flow data qCFD (x, y, z, t), and obtain the corrected heat flow distribution qcorrected (x, y, z, t), satisfying the formula: qcorrected = Δq + qCFD. The Transformer neural network includes an input layer, an embedding layer, a Transformer encoder, a physical constraint layer and an output layer.
[0022] Specifically, the input layer is used to normalize the input data to accelerate model training and improve stability. The input sequence of the heat flow data qCFD (x, y, z, t) is expressed as: [batch_size, seq_len, num_cfd_features], where seq_len can be the number of grid points on the aircraft surface, num_cfd_features contains the features of CFD heat flow and CFD temperature, and batch_size is the number of samples passed to the model for processing in the iteration. The input sequence of the fiber temperature data Tfiber (xf, yf, zf, t) is expressed as: [batch_size, num_fiber_points, num_fiber_features], where num_fiber_points is the number of fiber points on the aircraft surface, and num_fiber_features is the fiber temperature Tfiber and position information (xf, yf, zf). In this embodiment, the location of the fiber optic sensor needs to be marked in the CFD grid to ensure the spatial correspondence between the heat flow data and the fiber optic temperature data. If the data is a time series, it is necessary to ensure the synchronization of CFD simulation and fiber optic measurement in time to accelerate model training. For data in areas not covered by the fiber optic, interpolation methods or surrounding data can be used to fill in.
[0023] The embedding layer converts the input data into a high-dimensional feature vector and adds position coding. In this embodiment, the position coding is used to convert the position information (xf, yf, zf) of the optical fiber sensor into a high-dimensional vector. Specifically, a fixed mathematical function (such as sine and cosine) can be used to encode the three-dimensional coordinates into a high-dimensional vector. In addition, a linear layer or a convolutional layer can be used to convert the heat flow data qCFD (x, y, z, t) and the temperature data TCFD (x, y, z, t) into a high-dimensional feature vector, and the input sequence is merged in the sequence dimension. The merged input sequence is expressed as: [batch_size, seq_len + num_fiber_points, embed_dim], where embed_dim is the dimension size of the embedding vector, which facilitates the model to better integrate CFD and optical fiber data.
[0024] The Transformer encoder uses a multi-head self-attention mechanism and a feedforward neural network to capture global and local dependencies in the data. The multi-head self-attention mechanism is configured with 8 or 16 heads, allowing the model to capture different types of dependencies in different subspaces in parallel; the structure of the feedforward neural network is a two-layer linear transformation with a nonlinear activation function (such as ReLU or GELU) in the middle, providing an independent nonlinear transformation for each position to enhance the feature representation capability. In this embodiment, after each sublayer (self-attention and feedforward neural network), a direct connection between the input and the sublayer output is added so that the input of each layer can be directly added to its output. This structure helps alleviate the gradient vanishing problem and ensures that the gradient in the deep network will not be overly reduced. In addition, normalizing the results helps stabilize the training process and prevent gradient explosion.
[0025] The Transformer encoder adopts a stacking and depth design. The input end of each encoder layer is connected to the output end of the previous layer to form a deep network structure. In this embodiment, the encoder layer adopts a 6-layer structure. Through multi-layer stacking, the feature extraction ability and deep expression ability of the model can be enhanced.
[0026] The physical constraint layer converts the corrected heat flux distribution into a predicted temperature distribution through a heat conduction model (heat conduction equation or known physical model). In this embodiment, the heat conduction model is embedded in the forward propagation process of the Transformer main model to ensure that the corrected heat flux distribution can generate accurate predicted temperature.
[0027] The output layer outputs the heat flow correction Δq, which is used to correct the heat flow distribution. The output of the Transformer is converted into the heat flow correction Δq through the linear layer, the high-dimensional feature vector is mapped back to the original heat flow dimension, and the required heat flow correction Δq is predicted.
[0028] Step S3: Convert the corrected heat flux distribution qcorrected (x, y, z, t) into a predicted temperature distribution Tpred (x, y, z, t) through a heat conduction model (heat conduction equation or known physical model).
[0029] Step S4: Calculate the total loss function L to guide the model training of the Transformer neural network, wherein the total loss function L includes the temperature constraint loss Lt, the heat flow constraint loss Lq and the smoothness loss L ▽ , the total loss function L satisfies the formula: L=Lt+Lq+L ▽ .
[0030] The temperature constraint loss Lt satisfies the formula: Lt=MSE(Tpred, Tfiber), where Tpred is the predicted temperature distribution Tpred(x, y, z, t), Tfiber is the optical fiber temperature data Tfiber(xf, yf, zf, t), and MSE is the mean square error. In this embodiment, in order to make the corrected heat flux distribution closer to the actual situation, the temperature requirements of the optical fiber measurement area need to be met. During training, qcorrected is substituted into a simplified heat conduction equation or a known physical model to obtain the predicted temperature distribution Tpred(x, y, z, t), and then the difference between the predicted temperature distribution Tpred and the optical fiber temperature data Tfiber is measured by the mean square error MSE. Minimizing the temperature constraint loss Lt can make the predicted temperature distribution Tpred as close as possible to the optical fiber temperature data Tfiber, thereby ensuring that the heat flux distribution qcorrected can more accurately reflect the actual heat flux distribution data.
[0031] The heat flow constraint loss Lq satisfies the formula: Lq=α||Δq|| 1 +β||Δq|| 2 , where α and β are weight parameters, and Δq is the heat flux correction. In this embodiment, considering that the corrected heat flux cannot deviate too much from the original CFD result without constraints, regularization is applied to the full-field heat flux modification to limit the deviation between the corrected heat flux distribution and the original CFD result, prevent the weight parameter from being too large, and improve the generalization ability of the model. ||Δq|| 1 and ||Δq|| 2 is used to regularize the loss function, where ||Δq|| 1 is the absolute value and has sparsity in terms of model parameters or corrections: it encourages most elements in the correction to be zero, so that corrections are made only where necessary. ||Δq|| 2 It is the sum of squares and has smoothness in terms of model parameters or corrections: it encourages all elements in the correction to be small and avoids individual elements being too large, which helps to improve the numerical stability of the model.
[0032] The smoothness loss L ▽ Satisfy the formula: L ▽ =γ∑|▽qcorrected(x,y,z,t)| 2 , where γ is a weight parameter. In this embodiment, the gradient term L is added ▽ To ensure the spatial smoothness of the heat flux distribution qcorrected, in physical systems, the heat flux distribution is usually continuous and smooth, especially on complex structures such as the surface of an aircraft. If the model generates a heat flux distribution with spikes or mutations, it will not conform to the actual physical laws, resulting in unreliable prediction results in practical applications. Therefore, the smoothness loss L ▽Used to ensure that the corrected heat flux distribution remains continuous and smooth in space.
[0033] Step S5: Calculate the gradient of the total loss function L with respect to all model parameters (including Transformer encoder, embedding layer, output layer, etc.) through the self-differentiation equation. In this embodiment, the gradient of the total loss function L with respect to all model parameters is obtained by differentiating the respective loss parts and accumulating them, which can be solved by applying the chain rule step by step. This process uses the automatic differentiation mechanism to automatically calculate the gradient when using an automatic differentiation framework (such as PyTorch). The framework automatically calculates the gradient of the total loss with respect to all parameters using the chain rule according to the calculation graph.
[0034] The gradient is propagated from the loss function through each layer back to the model parameters, guiding the parameter update to minimize the loss. Among them, the gradient of the temperature constraint loss Lt directly affects the Transformer physical constraint layer and the output layer, because the temperature constraint loss Lt is calculated by Tpred, and Tpred depends on qcorrected and the heat flow correction Δq. The gradient of the heat flow constraint loss Lq acts on the heat flow correction Δq, further affecting the parameters of the Transformer encoder and the embedding layer. The gradient is passed to the Transformer encoder through the embedding layer and position encoding, guiding the model on how to better integrate CFD and fiber data. Smoothness loss L ▽ The gradient of affects the corrected heat flux distribution qcorrected, which in turn affects the heat flux correction Δq and related network parameters. According to the gradient flow, the model parameters are adjusted to minimize the loss and make the heat flux prediction closer to the actual situation.
[0035] Step S6: Use an optimizer (such as Adam) to update the parameters of the Transformer neural network based on the gradient information.
[0036] Working principle: Use historical data (CFD results, experimental data) or high-fidelity simulation data as training sets. During the training process, given the heat flow data qCFD, the fiber temperature data Tfiber measured by the fiber, and the heat flow distribution qcorrected output by the Transformer neural network, then iteratively update the weight parameters of the Transformer neural network through the back propagation and gradient descent of the loss function (such as the Adam optimizer), and optimize the Transformer neural network through the training process so that it can accurately predict and correct the heat flow distribution. In actual flight, the fiber temperature measurement data will continue to be updated in real time, and the real-time measured fiber temperature data Tfiber will be input into the trained Transformer neural network, and the network will output the updated heat flow distribution qcorrected. This method can realize online correction during flight, making the heat flow prediction closer to the actual situation.
[0037] The above implementation modes cannot limit the protection scope of the present invention. The equivalent modifications and changes made by those skilled in the art without departing from the overall concept of the present invention are still within the scope of the present invention.
Claims
1. A method for correcting heat flux distribution on the surface of a hypersonic vehicle, characterized in that: The following steps are involved: Step S1: Obtain the CFD simulated aircraft surface heat flow data qCFD (x, y, z, t) and the corresponding temperature data TCFD (x, y, z, t), use the optical fiber sensor to measure the temperature in real time in the 8% area of the aircraft surface, and obtain the optical fiber temperature data Tfiber (xf, yf, zf, t); Step S2: Use the Transformer neural network to integrate the heat flow data qCFD (x, y, z, t), the temperature data TCFD (x, y, z, t) and the fiber temperature data Tfiber (xf, yf, zf, t), calculate the heat flow correction Δq, add the heat flow correction Δq to the heat flow data qCFD (x, y, z, t), and obtain the corrected heat flow distribution qcorrected (x, y, z, t), which satisfies the formula: qcorrected = Δq + qCFD; Step S3: convert the corrected heat flux distribution qcorrected (x, y, z, t) into the predicted temperature distribution Tpred (x, y, z, t) through the heat conduction model; Step S4: Calculate the total loss function L to guide the model training of the Transformer neural network, wherein the total loss function L includes the temperature constraint loss Lt, the heat flow constraint loss Lq and the smoothness loss L ▽ , the total loss function L satisfies the formula: L=Lt+Lq+L ▽ ; Step S5: Calculate the gradient of the total loss function L with respect to all model parameters through the self-differentiation equation; Step S6: Use the optimizer to update the parameters of the Transformer neural network based on the gradient information.
2. The method for correcting heat flux distribution on the surface of a hypersonic vehicle according to claim 1, characterized in that The Transformer neural network includes an input layer, an embedding layer, a Transformer encoder, a physical constraint layer and an output layer. The input layer is used to normalize the input data; the embedding layer converts the input data into a high-dimensional feature vector and adds position encoding; the Transformer encoder uses a multi-head self-attention mechanism and a feedforward neural network to capture the global and local dependencies in the data; the physical constraint layer converts the corrected heat flow distribution into a predicted temperature distribution through a heat conduction model; and the output layer outputs a heat flow correction value for correcting the heat flow distribution.
3. The method for correcting heat flux distribution on the surface of a hypersonic vehicle according to claim 2, characterized in that The input sequence of the heat flow data qCFD (x, y, z, t) in the input layer is expressed as: [batch_size, seq_len, num_cfd_features], where seq_len is the number of grid points on the aircraft surface, and num_cfd_features is the features of CFD heat flow and CFD temperature.
4. The method for correcting heat flux distribution on the surface of a hypersonic vehicle according to claim 3, characterized in that The input sequence of the optical fiber temperature data Tfiber (xf, yf, zf, t) in the input layer is expressed as: [batch_size, num_fiber_points, num_fiber_features], wherein num_fiber_points is the number of optical fiber points on the surface of the aircraft, and num_fiber_features is the temperature and position information of the optical fiber.
5. The method for correcting heat flux distribution on the surface of a hypersonic vehicle according to claim 4, characterized in that The embedding layer uses a linear layer or a convolutional layer to convert the heat flow data qCFD (x, y, z, t) and the temperature data TCFD (x, y, z, t) into a high-dimensional feature vector, and merges the input sequence in the sequence dimension. The merged input sequence is expressed as: [batch_size, seq_len + num_fiber_points, embed_dim], where embed_dim is the dimension size of the embedding vector.
6. The method for correcting heat flux distribution on the surface of a hypersonic vehicle according to claim 1, characterized in that The temperature constraint loss Lt satisfies the formula: Lt=MSE(Tpred, Tfiber), wherein Tpred is the predicted temperature distribution Tpred(x, y, z, t), Tfiber is the optical fiber temperature data Tfiber(xf, yf, zf, t), and MSE is the mean square error.
7. The method for correcting heat flux distribution on the surface of a hypersonic vehicle according to claim 1, characterized in that The heat flow constraint loss Lq satisfies the formula: Lq=α||Δq||1+β||Δq||2, where α and β are weight parameters, and Δq is the heat flow correction amount.
8. The method for correcting heat flux distribution on the surface of a hypersonic vehicle according to claim 1, characterized in that The smoothness loss L ▽ Satisfy the formula: L ▽ =γ∑|▽qcorrected(x,y,z,t)| 2 , where γ is the weight parameter.