Next Article in Journal
Research on Coal and Rock Recognition in Coal Mining Based on Artificial Neural Network Models
Previous Article in Journal
Development of Architectural Object Automatic Classification Technology for Point Cloud-Based Remodeling of Aging Buildings
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

TGN: A Temporal Graph Network for Physics Prediction

1
Innovation Center, Sichuan University, Chengdu 610065, China
2
Department of Artificial Intelligence, Sichuan University, Chengdu 610065, China
3
Unmanned Systems Research Center, National Innovation Institute of Defense Technology, Beijing 100071, China
4
College of Computer Science, Sichuan University, Chengdu 610065, China
*
Author to whom correspondence should be addressed.
Current address: National Defense Science and Technology Innovation Research Institute, Academy of Military Sciences, Beijing 100091, China.
Appl. Sci. 2024, 14(2), 863; https://doi.org/10.3390/app14020863
Submission received: 15 November 2023 / Revised: 1 December 2023 / Accepted: 7 December 2023 / Published: 19 January 2024
(This article belongs to the Section Computing and Artificial Intelligence)

Abstract

:
Long-term prediction of physical systems on irregular unstructured meshes is extremely challenging due to the spatial complexityof meshes and the dynamic changes over time; namely, spatial dependence and temporal dependence. Recently, graph-based next-step prediction models have achieved great success in the task of modeling complex high-dimensional physical systems. However, due to these models ignoring the temporal dependence, they inevitably suffer from the effects of error accumulation. To capture the spatial and temporal dependence simultaneously, we propose a temporal graph network (TGN) to predict the long-term dynamics of complex physical systems. Specifically, we introduce an Encode-Process-Decode architecture to capture spatial dependence and create low-dimensional vector representations of system states. Additionally, a temporal model is introduced to learn the dynamic changes in the low-dimensional vector representations to capture temporal dependence. Our model can capture spatiotemporal correlations within physical systems. On some complex long-term prediction tasks in fluid dynamics, such as airfoil flow and cylinder flow, the prediction error of our method is significantly lower than the competitive GNN baseline. We show accurate phase predictions even for very long prediction sequences.

1. Introduction

Mesh-based simulations are central to the modeling of complex physical systems. Since the computational cost of such simulations is very expensive, more and more research has started to use mesh-based machine learning models to accelerate the numerical simulation of physical systems such as fluid dynamics [1,2,3], structural mechanics [4,5], and quantum mechanics [6,7]. AI-based prediction of physical systems is the process of analyzing past system states and training a simulator to predict future system states. However, the prediction of physical systems has been a challenging task due to its complex temporal and spatial dependence. Temporal dependence refers to the changes in system states over time, which are characterized by periodicity and trend. Spatial dependence refers to the changes in system states that are affected by the mesh topology, which is manifested as the interaction of physical quantities between neighboring mesh nodes. This spatial dependence is related to the discretization methods (Finite Difference, Finite Volume, or Finite Element) in CFD. In the mesh shown in Figure 1, we use the explicit finite difference method to solve the one-dimensional heat transfer equation, where the state of node i at moment n + 1 is governed by the state of node i and its neighboring nodes at moment n.
Graph neural networks are widely used for the prediction of physical systems on unstructured meshes. These methods encode simulated states into graphs and adaptively assign computations to spatial regions with strong gradients or where high accuracy is required [3,8,9,10]. However, the majority of GNN-based prediction models for physical systems are designed as next-step prediction models. This means that they forecast the next state of a physical system based on its current state. When facing long-term time series forecasting (LTSF) tasks, next-step models inevitably suffer from severe error accumulation, even accompanied by drifting phenomena, and such drifting is difficult to mitigate.
On the other hand, some current autoregressive prediction models have achieved great success in LTSF tasks, such as Recurrent Neural Networks (RNNs) [11], Transformer [12,13,14,15,16,17], or simple linear models [18]. They can capture trending and periodic information from historical time series. For example, cylinder flows show periodic changes during the vortex shedding phase; their system states also trend over time, and the next system state is influenced by the system state at the previous moment or even longer. By utilizing this temporal information, they can greatly mitigate error accumulation and better maintain phase and conserved quantities [19,20]. However, these methods only consider temporal dependence but ignore the topology of the mesh, making the changes of physical systems unconstrained by the physical space and thus failing to accurately predict system states.
In this paper, based on GNNs and linear models, we design a graph space encoder (GSE) and a time encoder (AutoLinear). The GSE leverages message passing to aggregate information but introduces several enhancements, such as employing multiple basis functions to map the messages, combining multiple headers, and utilizing multiple aggregators. The AutoLinear embeds the decomposition blocks used in Autoformer as internal operators and employs lineal models to extract periodic and trending information from time series. This design allows AutoLinear to progressively decompose intermediate results throughout the forecasting process, capturing future time information. We propose a hybrid method, named TGN, by combining GSE and AutoLinear. TGN is utilized for spatiotemporal modeling of complex physical systems on unstructured meshes. First, GSE performs multiple rounds of message passing on the input system state sequence to aggregate the local information into node representations, thus obtaining a graph sequence with spatial characteristics. The node representations of each graph in the sequence form a latent vector that represents the spatial encoding of the corresponding system state in the low-dimensional space. We then transform the graph sequence into a latent vector sequence. Subsequently, AutoLinear captures periodicity and trend in this latent vector sequence, modeling temporal dependence and predicting the next system state. Experiments on two fluid dynamics datasets confirm that TGN achieves state-of-the-art performance. The contributions are summarized as follows:
(1) We propose a new GNN architecture, graph space encoder (GSE), and demonstrate that it can capture the mesh topology to model spatial dependence.
(2) For long-term prediction, we use AutoLinear as a decomposition architecture, which breaks the preprocessing convention of series decomposition and embeds it as an internal block in a linear model. AutoLinear captures periodicity and trends in the time series to mitigate error accumulation.
(3) We model the spatiotemporal dependence of physical systems by combining GSE and AutoLinear.
(4) We evaluate our method on two fluid dynamics datasets. The results show that the accuracy of our method outperforms the state-of-the-art MeshGraphNets [3] baseline, and unlike the baseline, no strong error accumulation or drift is observed in our method.

2. Related Work

The development and execution of simulations for complex physical systems can be highly time consuming, and modeling complex physical problems using machine learning models has become an important area of research. Learnable models are useful for accelerating simulations of aerodynamics [1] or turbulence [21,22] and have achieved superior performance in tasks such as weather prediction [23] and graphical visualization [24]. Several studies have introduced physical expertise by incorporating loss terms [25] or feature normalization based on physical information [2] to enhance prediction accuracy. Most of these approaches utilize convolutional neural networks on regular meshes, which are widely employed for learning complex physical systems. However, there has been a recent surge of interest in leveraging GNNs for learnable simulators. GNNs offer the capability to simulate on meshes with irregular or adaptive resolutions. For instance, Belbute-Peres et al. [26] embedded an aerodynamic solver within a graph convolution architecture [27] to achieve super-resolution predictions. Alet et al. [28] employed graph element networks to make predictions on 2D grid domains, whereas MeshGraphNets [3] extended GNN-based predictions to complex 3D systems with thousands of nodes.
These methods can be categorized as either steady-state or next-step prediction models. However, next-step models often suffer from drift and error accumulation in the face of LTSF tasks due to the lack of information about historical time series. In contrast, sequence models can prevent error accumulation by modeling historical time series. Recently, Transformer-based solutions for LTSF tasks have proliferated and have been successfully applied to predict simple small physical systems [19]. However, when predicting complex large physical systems, graph coarsening [28,29,30] is required due to its high memory overhead, which can lead to higher errors in the first few steps of prediction [20]. Zeng et al. [18] introduced a set of simple single-layer linear models (LTSF-Linear), which significantly outperforms the Transformer-based complex LTSF models in experimental results under direct multi-step (DMS) prediction [31]. However, linear models cannot directly deal with unstructured data such as scale-varying meshes, and only take into account temporal features and ignore spatial dependence, making the predicted system dynamics unconstrained by physical space, so applying linear models to predict complex physical systems remains a challenge.
In the field of traffic prediction, much research [32,33,34,35,36,37] makes full use of spatiotemporal dependence to solve traffic prediction problems. Since these methods are based on CNNs to model spatial dependence, they are only applicable to Euclidean spaces, such as images or regular meshes, and cannot be extended to traffic networks with complex topology. In recent years, with the development of GNNs, a series of studies have extended traffic prediction to graph-structured data. Li et al. [38] proposed the DCRNN model, which introduces GNNs to model temporal dependence. Zhu et al. [39] proposed the A3T-GCN model to capture global time dynamics and spatial features. The model utilizes gated recurrent units (GRUs) [40] and graph convolution (GCN) to model the spatiotemporal dependence of traffic flow, and introduces an attention mechanism to focus on the global time information to improve prediction accuracy. Although these methods take into account spatiotemporal dependence and have achieved great success in traffic prediction tasks, they are inherently applicable to small 2D systems based on urban road networks and have limitations for complex high-dimensional physical systems.
Based on this background, this paper develops a new neural network method for the spatiotemporal dependence of physical systems that can extend spatiotemporal modeling to complex physical systems with thousands of nodes.

3. Methodology

3.1. Problem Definition and Overview

Our aim is to model and predict the dynamics of complex physical systems using deep learning algorithms. These physical systems are usually governed by a set of nonlinear partial differential equations (PDEs), and the spatiotemporal solution of the physical system can be obtained by given initial and boundary conditions. Currently, mesh-based finite element simulation is the basis of popular methods in PDE systems. It discretizes the physical space into an unstructured mesh M = ( V , E ) , where each node i V is connected by mesh edges E and | V | = N , i.e., the unstructured mesh contains N mesh points. A mesh consists of nodes and topological relationships of nodes, which can be naturally understood as a graph. Thus, we denote the mesh M of the current physical system as a graph G = ( V , E ) , the mesh nodes become graph nodes V , the mesh edges become bi-directional edges E in the graph, and utilize the graph G to describe the topology of the mesh. We fix the graph G in all time steps. At moment t, each node i V uses the physical quantity q i , t (velocity, density, or pressure) as its attribute. The attributes of these nodes can then be used to define the state field S t = { q i , t : i V } at moment t. Solving such discrete systems using traditional methods involves complex numerical integration of time and space and is usually costly. Therefore, our objective is to develop a learned simulator f that, given the mesh topology G and the state field sequence at the initial t moments, can quickly predict the state field sequence at the next T moments, as shown in Equation (1):
( S t + 1 , , S t + T ) = f ( G ; ( S 1 , , S t ) ) .
These physical systems involve complex spatiotemporal dependence, whereas GSE excels at aggregating local information to learn the topology of the graph, and AutoLinear is able to capture periodic and trending information well from time series (Section 4.3). We fuse these two models and propose a new method, TGN, to predict the dynamics of physical systems. For each time step, we use the GSE to aggregate local information to obtain spatially characterized node representations, and summarize these node representations to create a low-dimensional vector representation for each time step (Section 3.2). These low-dimensional vectors constitute the historical time series, and we use a simple moving average kernel to decompose the spatially characterized historical time series into a trend component and a seasonal component, and focus on the seasonal pattern, alternating between linear transformations and decompositions of the intermediate results of the forecasting process, progressively refining the seasonal component and continuously accumulating the trend component. Finally, two linear models are applied to each of these two components and the results are added together to update the system state in the next step (Section 3.3). The combination of GSE and AutoLinear can effectively utilize spatiotemporal correlations to make stable and accurate predictions (Section 3.4). Figure 2 shows the visualization scheme of the TGN architecture.

3.2. Spatial Encoding

After representing the mesh as a graph G, GSE combines the topology information in G and the attributes of the nodes in S t to capture the spatial features at each time step t and represent them with a latent vector z t . In the discussion on encoding spatial information, we ignore the time variable t to simplify the subsequent expression.
GSE is a graph neural network model with an Encode-Process-Decode architecture [9,41]. It initially extracts node features and edge features from the graph G using Multi-Layer Perceptrons (MLPs).
v i 0 = mlp v ( S [ i ] , n i ) , e i j 0 = mlp e ( p i j , | p i j | ) ,
where S [ i ] denotes the physical quantity of node i and n i denotes the one-hot encoding of the type of node i. p i is the spatial coordinate of node i. We encode the relative position vector p i j and its norm | p i j | as the edge feature.
After that, GSE uses L GraphNet blocks to capture spatial features through the message-passing mechanism to further represent the nodes. Each GraphNet block contains an independent set of parameters, and in Figure 3, we briefly demonstrate the updating process of the nodes of the l-th GraphNet block.
For the l-th GraphNet block we use B basis functions mlp l , b e implemented by MLPs to capture different edge features
e i j l , b = mlp l , b e ( e i j l 1 , v i l 1 , v j l 1 ) , b = 1 , , B ,
and then we use the concatenation operator ‖ to concatenate the results of the basis functions for updating the edge features:
e i j l = b = 1 B e i j l , b .
We update the node features using the output of the previous block and the aggregation result of the edge features e i j l , b , where the aggregation of the edge features can be divided into three steps. First, we aggregate each set of edge features from different basis functions mlp l , b e separately. Second, based on the features of each node i V we compute the combined weight coefficient W l , i = Φ v i l 1 + b R B , where Φ and b denote the learnable weights and bias parameters. Third, we weight the aggregation results of each set of edge features:
v ^ i l = b = 1 B W b l , i j N ( i ) e i j l , b .
Here N ( i ) denotes all neighbors of node i. Inspired by the work of Transformers and Corso et al. [42], we add H heads and combine multiple aggregators A ( A denotes a set of different aggregators such as mean, sum, min, or max). We apply different weighting coefficients to each header and aggregator and extend Equation (5) as
v ^ i l = h = 1 H A b = 1 B w h , , b l , i j N ( i ) e i j l , b .
We then combine the aggregation result v ^ i l of the edge features with the node features and encode them via MLPs to update the node features:
v i l = mlp l v ( v i l 1 , v ^ i l ) .
After L GraphNet blocks updating the graph G, we obtain a new set of node representations V = ( v i L : i V ) . Finally, from the new node representations V, GSE uses an MLP to decode each node’s spatial features
h i = mlp s ( v i L ) , i V .
We combine these vectors to form a latent vector z = concat ( h i : i V ) as a low-dimensional representation of the spatial features of the whole graph. We collectively refer to the above steps for extracting the spatial features of the graph as z = GSE ( G , S ) . The GSE encodes each time step t independently, and it models the spatial dependence of graphs to obtain a sequence of latent vectors ( z 1 , z 2 , , z t ) , which are used as inputs to the temporal model.

3.3. Temporal Encoding and State Updating

Prediction of physical system dynamics is the process of predicting the most probable future sequence of length O given a past historical time series of length I. LTSF is the prediction of a larger O, which is a long-standing task and currently a major challenge in the field of physical system prediction. To address this problem, we introduce the decomposition schemes used in Autoformer and FEDformer, and with reference to the architecture of Autoformer, we propose Autolinear, a time encoder based on linear models. Briefly, Autolinear is the combination of linear layers with the decomposition blocks used in Autoformer. The decomposition blocks smooth out cyclical fluctuations and highlight long-term trends by adjusting the moving average kernel, which decomposes the input historical time series X e n = ( z 1 , z 2 , , z t ) into a seasonal component and a trend component
C 0 , T 0 = SeriesDecomp ( X e n ) .
These two components, respectively, reflect the periodicity and the long-term trend of the input series.
However, for long-term forecasting, decomposing the input sequence alone is not sufficient as it does not provide information about future time steps. To address this problem, we fuse decomposition blocks and linear models to construct a series of Linear-Decomp blocks. Linear-Decomp blocks capture the periodicity and trend of the intermediate hidden series during the forecasting period, which allows it to extract the stable trend component and remove the disturbing information from the seasonal component. Autolinear uses L Linear-Decomp blocks to alternatively linearly transform and decompose the seasonal components. The equation for the l-th Linear-Decomp block is:
C l , T l = SeriesDecomp ( Linear ( C l 1 ) + C l 1 ) , T f l = T f l 1 + T l ,
where T f 0 = T 0 is for accumulation. Linear ( · ) is divided into three steps. First Linear encodes the features of the bracketed sequences into high dimensions with an MLP; then it linearly combines the sequences in the high dimensional space; and finally reduces to low dimensions with an MLP.
We use two single-level linear models W C , W T R t on the time axis to perform a weighted sum operation on the seasonal component C L and the trend component T f L of the last Linear-Decomp block, respectively. Finally, we use an MLP to transform the sum of the two results into output features
P t = mlp d e ( W C C L + W T T f L ) .
We collectively refer to the process of extracting output features from the input sequence as P t = AutoLinear ( X e n ).
For velocity and density, we interpret the output feature P t as the derivative of the state field S t and integrate it using Δ t = 1 to compute the next state field S ˜ t + 1 = S t + P t . The feature P t are also used to directly predict the pressure. More information about the feature P t in different systems can be found in Appendix A.1.

3.4. Temporal Graph Network

In order to capture both spatial and temporal dependences of physical systems, we propose a temporal graph network model (TGN) by fusing GSE and AutoLinear. The TGN model predicts the state field sequence after time step t in an autoregressive manner:
S ˜ t + 1 = TGN ( G , ( S 1 , , S t ) ) , , S ˜ t + T = T G N ( G , ( S 1 , , S t , S ˜ t + 1 , , S ˜ t + T 1 ) ) .
During training, for each predicted time step k, we use the error between the predicted state S ˜ k and the corresponding true state S k to supervise the TGN model in generating the predicted state S ˜ k for time step k. The loss function of the T-GCN model is shown in Equation (13).
L k = S k S ˜ k 2 2 .
Compared with next-step models such as MeshGraphNets, our model not only utilizes graph neural networks to learn the topology of the mesh to capture spatial dependence, but also captures trending and periodicity information from historical time series. Modeling from both spatial and temporal perspectives, our model greatly mitigates the error accumulation and yields stable and accurate predictions.

4. Experiments

4.1. Experimental Settings

Dataset. We evaluate our method on two datasets from fluid dynamics systems, including the CylinderFlow dataset and the AirFoil dataset. The CylinderFlow dataset simulates water flow around cylinders with different Reynolds numbers for incompressible fluid experiments. The AirFoil dataset simulates aerodynamics around airfoil cross-sections for compressible fluid experiments. See Appendix A.1 for more information on these two datasets.
Evaluation indicator. To quantitatively evaluate the performance of the model, we calculate the relative mean square error (RMSE), defined as RMSE ( S ˜ , S ) = ( S ˜ i S i ) 2 ( S ˜ i ) 2 , where S i and S ˜ i , respectively, denote the true and predicted flow field states at step i.
Methods. We compare our proposed method with the state-of-the-art baseline MeshGraphNets, which is the next step in predictive modeling and has achieved superior performance in mesh-based prediction tasks. In addition, we replace the time encoder (AutoLinear) in our method with a single-layer linear model (Linear) and Transformer for studying variants of the TGN model. These variants use the same spatial encoder (GSE) and number of history time steps as our method. All methods use the same training noise. Since Transformer cannot be directly applied to meshes of varying sizes, we made minor adjustments to the data structure of the historical time series. See Appendix A.2 for details of the adjustments. See Appendix A.3 for modeling details.

4.2. Experimental Results

Qualitative results. We tested our model in two fluid systems, cylinder flow and airfoil flow. In Figure 4, we apply the proposed method to predict the velocity and pressure on the trajectories of the test set for the two systems and compare them with the ground truth (CFD). For cylindrical flow, our model can capture periodic and trending information from historical time series at different Reynolds numbers to accurately predict laminar flow and Karman vortex street behavior in trajectories. In the high-speed airfoil flow, our model can successfully learn the changing flow field at different Mach numbers and angles of attack, and accurately predict its flow separation phenomena as well as vortex-shedding behavior. In both systems, cylinder flow and airfoil flow, our model accurately captures the frequency and phase of vortex shedding and visually presents predictions that are largely consistent with the CFD reference. This long-term stable prediction demonstrates that our model can be applied to complex physical systems.
Model performance comparison. To quantitatively evaluate the performance of our model, model variants, and baseline, we calculate the relative mean square error (RMSE) on single-step rollout (1-step), 50-step rollouts, and the rollouts of the entire trajectory (500-step). In Table 1, we compare the average prediction errors on the two systems. In most cases, our model based on spatiotemporal encoding outperforms the baseline and model variants. For both short-term forecasts (1-step, 50-step) and long-term forecasts (500-step), our model shows superior performance. For airfoil flow, due to its larger mesh size, it requires larger memory consumption, so we reduce its history time steps to three. Although this will lose part of the model performance, our model still performs the best under long-term prediction. The cylinder flow with a larger history time steps (12 time steps) validates the effectiveness of our method and the RMSE of our method is significantly lower than that of the next-step model and the model variants. Surprisingly, our model is able to maintain a stable rollout even beyond the training range, as discussed in Section 4.3.
We also found an interesting experimental result. Although the simple Linear model shows poor results on the long history time steps of the cylinder flow, it achieves competitive prediction accuracy on the airfoil flow. In particular, the Linear model outperforms the complex transformer-based method on the airfoil flow. This is mainly due to the short history time steps of airfoil flow, resulting in its time information being well captured by simple linear models. The use of complex attention mechanisms in the transformer-based method may lead to overfitting, making its prediction accuracy lower than that of the simple Linear model instead.
Figure 5 shows how error accumulation occurs in the different models. The error accumulation of our model is very slow in both systems. Especially in the cylinder flow based on long history time steps, the long-term rollout of our model has significantly lower error accumulation than the baseline and model variants. We attribute this slow error accumulation behavior to the ability of the sequential model to capture periodic and trending information in long time series, as discussed further later in this section. We also note that the Linear and Transformer models have opposite performance results on the two systems. This is due to the fact that the simple Linear model cannot handle the complex temporal information in long time steps (cylinder flow), and the complex Transformer model leads to overfitting when handling short time steps (airfoil flow). On the contrary, our model maintains superior performance for history time steps of different lengths.

4.3. Model Analysis

Role of spatial encoding. Since GSE aggregates neighborhood information on meshes through multiple rounds of message passing, we believe that GSE can capture the topology of irregular unstructured meshes. To investigate the effect of GSE, we remove GSE from TGN but retain the time encoder (AutoLinear). AutoLinear directly processes the raw data from both datasets and performs flow field predictions. In Figure 6, we compare the prediction precision of the model variants AutoLinear and TGN on the cylinder flow and the airfoil flow. We can clearly observe that AutoLinear has a large prediction error and that TGN significantly outperforms AutoLinear, indicating that GSE is necessary for modeling spatiotemporal correlations of complex physical systems.
In cylinder flow, we also visualized the nodes in the low-dimensional vector z t and showed that GSE can capture the relative positions of the mesh nodes. We first randomly selected three nodes on the mesh of the cylinder flow dataset, as shown in Figure 7 (left). To visualize the nodes after GSE encoding, we use principal component analysis (PCA) to reduce the dimensionality of the nodes in z t to two and plot the three selected nodes in Figure 7 (middle). The relative positions of the three nodes are consistent with their actual positions in the mesh, indicating that the GSE learns the topology of the mesh and that each node contains information about its relative position with respect to other nodes. We also apply PCA directly to the nodes in the state field ( S t ) and plot these nodes in Figure 7 (right). These three nodes from the state field are essentially on a straight line, and their relative positions are significantly different from the true relative positions. This poses a challenge for AutoLinear to recognize the topology of the mesh and explains why its error is much higher than that of TGN.
Role of Temporal encoding. In the process of autoregressive forecasting, noise is inevitably present in the historical time series, which can significantly affect the accuracy of forecasts and is the main reason for error accumulation. We believe that the accuracy of long-term forecasting depends on whether the model is able to capture the periodicity and trend well from the noise-filled historical time series.
To test the ability of our time encoder (AutoLinear) for long-term prediction, we use single-step prediction and add Gaussian noise with different distributions to the historical time series. For the cylinder flow, we add noise obeying the Gaussian distribution N ( 0 , σ 2 ) ( σ ( 0.002 , 0.004 , 0.006 , 0.008 , 0.01 , 0.02 , 0.03 ) ) to the velocity. In Figure 8, (left), we show how the average prediction error of all models for the whole trajectory varies with the noise. It can be seen that our model outperforms the next-step model and model variants in terms of error and stability, regardless of the noise distribution. This indicates that our model is able to resist the interference of noise and extract the inherent periodicity and trend information from the time series. On the other hand, MeshGraphNets can maintain a stable error when the noise is small. However, its error increases dramatically as the noise increases, which explains why MeshGraphNets suffers from severe error accumulation in long-term forecasting. Since our sequence models are all based on linear transformation or attention mechanisms for prediction, the weights of the linear layer and attention can directly reveal how the sequence models work. We min-max normalize the weights of the historical time series and plot them in Figure 8 (right). As can be seen from the weight distributions of the three models, the Linear model focuses only on the last history time step, meaning that it basically relies only on the information in the most recent time step to make predictions, and is therefore sensitive to noise. The Transformer model assigns a greater weight to history time steps that are closer to the output, and is able to utilize the information in a larger number of time steps compared to the Linear model for prediction, which helps to capture periodicity and trends in the series and improves the model’s resistance to noise. TGN, in addition to focusing on the most recent time steps, also assigns a larger weight to some of the more distant time steps. We hypothesize that TGN can identify periodic phenomena in the flow process and directly query the information of the previous cycle in the prediction stage to make stable and accurate predictions.
For airfoil flow, we add Gaussian noise to both velocity and density. Even though its historical time series are short, the long-term prediction error of our model is still lower than that of the comparison model. This demonstrates the strong ability of our model to encode temporal information. A complete analysis of this can be found in Appendix A.4.
Longer rollouts. We designed an experiment to test whether our model maintains superior performance beyond the training range. We trained the model on cylinder flow trajectories of 500 time steps and evaluated its performance on trajectories of 900 steps. Figure 9 illustrates the difference in the long-term prediction ability of all models. For cylinder flow, TGN and Transformer are able to preserve velocity magnitude and phase information. On the other hand, Linear and MeshGraphNets show drift, and MeshGraphNets especially have significantly different velocity magnitudes from the real situation.
Table 2 quantitatively compares the performance of the models when rolling out longer time steps. We find that TGN remains stable and outperforms all comparison models for rollouts outside the training range.
Key hyperparameters. We tested the model under different hyperparameters and found that our method is not very sensitive to most of the hyperparameters, such as the dimensionality of the feature vectors, the number of layers of the MLPs, and the number and type of aggregators. However, we still found a key hyperparameter that affects the performance of the model (Figure 10). The number of history time steps usually greatly affects the prediction accuracy as it determines how much we can learn from the historical data. In general, models with strong temporal information extraction capabilities should be able to obtain better results with more history time steps. We found that the model performs best given as many history time steps as possible. This is in contrast to MeshGraphNets, which leads to overfitting given additional history time steps.

5. Conclusions

In this paper, we propose a method based on spatiotemporal encoding, called TGN, which can accurately perform long-term prediction of complex physical systems. On the one hand, we utilize GSE to capture the topology of the graph to obtain the relative position information among nodes and the low-dimensional vector representation of the whole graph; on the other hand, we utilize AutoLinear to capture the periodicity and trend information of the historical time series, and thus accurately predict the dynamics of the physical system. By modeling the spatiotemporal dependence, our model can be successfully applied to the task of long-term prediction of complex physical systems. Compared with the next-step model, our model can greatly mitigate error accumulation and achieve higher prediction accuracy. Our work is not limited to the prediction of physical systems, but can also be applied to other spatiotemporal tasks, such as traffic prediction. However, our method has to use training noise to augment the training data to maintain stable rollout. The training noise is difficult to adjust and may limit the accuracy of the model. In the future, we will explore predictive models that are more accurate and do not require training noise. We sincerely hope that our research will be useful for future spatiotemporal modeling of complex systems in engineering.

Author Contributions

Conceptualization, M.Y. and X.C.; methodology, M.Y. and T.L.; software, M.Y. and T.L.; validation, M.Y. and H.L.; investigation, L.Z.; data curation, M.Y. and T.L.; writing—original draft preparation, M.Y.; writing—review and editing, X.C. and H.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by National Key Project of China (grant number GJXM92579) and supported by Sichuan Science and Technology Program (grant number 2023YFG0158).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author. The data are not publicly available due to privacy.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Appendix A.1. Dataset Details

Our experiments use two fluid datasets, cylinder flow and airfoil flow. The cylinder flow is controlled by incompressible equations, whereas the compressible equations control the airfoil flow. We used COMSOL to simulate incompressible flow and SU2 to simulate compressible flow. All flow fields are discretized using triangular mesh cells and the mesh resolution is adjusted according to the changing characteristics of the flow field. The details of the dataset setup are shown in Table A1. The cylinder flow dataset consists of 70 training trajectories and 60 test trajectories. The airfoil flow dataset consists of 60 training trajectories and 40 test trajectories. Each dataset contains 500 time steps.
Table A1. Details of datasets.
Table A1. Details of datasets.
DatasetPDEsMesh TypeMeshing# Nodes# Steps δ t (s)
Cylinder flowIncompr. NStriFixed19435000.01
Airfoil flowCompr. NStriVarying5233 (avg.)5000.008
Next, we summarize the inputs of nodes and edges for each dataset, as well as the predicted outputs of the model. The mesh topology for all trajectories in the cylinder flow remains consistent. Mesh node i contains n i and m i , where m i denotes the velocity of node i. The node type n i distinguishes between fluid nodes, wall boundary nodes, and inlet/outlet boundary nodes. The model predicts the derivative of the velocity and directly predicts the pressure field p . For the airfoil flow, each trajectory has a different mesh topology. We encode node type n i , velocity m i , and density ρ i and then predict the derivative of velocity m ˙ i and the derivative of density ρ ˙ i as well as the pressure p i . Table A2 details the input and output variables for the two datasets.
Table A2. Inputs and outputs of our model.
Table A2. Inputs and outputs of our model.
DatasetEdge InputsNode InputsOutputs
Cylinder flow p i j , | p i j | n i , m i m ˙ i , p i
Airfoil flow p i j , | p i j | n i , m i , ρ i m ˙ i , ρ ˙ i , p i

Appendix A.2. Time Series for Transformer

Each trajectory of the airfoil flow has a different mesh topology, which means that the latent vectors z i , i { 1 , , t } have different dimensions from one trajectory to another, yet the Transformer model cannot directly use such variable-sized inputs. In order to apply the Transformer model to these inputs and not compromise its performance, we construct for each node its historical time series X i i n = ( h i 1 , h i 2 , , h i t ) , i V . h i t denotes the spatially encoded node (see Section 3.2). Similar to the temporal encoding process in Section 3.3, Transformer encodes the historical time series of each node to obtain the output features P i = Transformer ( X i i n ) , i V , and then predicts the next-step physical quantities q ˜ i , t + 1 for each node by integrating them, and from these predictions we obtain the next-step state field S ˜ t + 1 = { q ˜ i , t + 1 : i V } . The input sequences for both the Transformer model and the other models are derived from the same trajectory and spatial encoders, with only the organized differently, which allows our experiments to balance both fairness and model performance.

Appendix A.3. Model Details

Framework. In GSE we set B = 4 , H = 4 and use three aggregators (sum, mean, max) and GraphNet blocks with L = 15. We use a single layer and four attention heads in the Transformer. MLPs (e.g., mlp v , mlp e , mlp l , b e ) in both GSE and AutoLinear have three hidden layers of size 128 and ReLU activation functions. mlp v and mlp e have input dimensions based on the input features of each node and edge (see Table A2 for more information). mlp l , b e and mlp s have outputs of sizes are 32 and 16, and the output of mlp d e matches the predicted P t . The output sizes of the rest of the MLPs are 128. The outputs of all MLPs are normalized by LayerNorm, except for mlp d e .
Hyperparameters. We use the same training noise strategy as MeshGraphNets to keep our model stable in long-term forecasting. We add zero-mean and fixed-variance Gaussian noise to the corresponding variables of the historical time series. Since the mesh sizes of the cylinder and the airfoil are different and the corresponding memory consumptions are different, we used different numbers of history time steps. We show the key hyperparameters for both datasets in Table A3.
Table A3. Hyperparameters of our model.
Table A3. Hyperparameters of our model.
DatasetBatch SizeNoiseHistory Steps
Cylinder flow2velocity: 2 × 10 2 12
Airfoil flow2velocity: 1 × 10 1 , density: 1 × 10 2 3
Number of parameters. Table A4 shows the number of parameters for each model.
Table A4. Number of parameters for each model.
Table A4. Number of parameters for each model.
DatasetMeshGraphNetsLinearTransformerTGN
Cylinder flow2.9 M3.0 M3.0 M3.1 M
Airfoil flow2.9 M3.0 M3.0 M3.0 M

Appendix A.4. Further Analysis of Noise and Weights

For airfoil flow, we add random noise to both velocity and density, which obey Gaussian distributions N v ( 0 , v i 2 ) ( v i ( 2 , 4 , 6 , 8 , 10 , 11 , 12 ) ) and N d ( 0 , d i 2 ) ( d i ( 0.002 , 0.004 , 0.006 , 0.008 , 0.01 , 0.011 , 0.012 ) ) , respectively. For ease of representation, we let Q i = ( v i , d i ) . Figure A1 illustrates the variation in the average prediction error with noise and the weight distribution of the model. As can be seen in Figure A1 (left), the shorter history time steps affect the performance of the sequence models, resulting in similar errors for the sequence model and the next-step model. It is difficult to extract useful periodicity and trend information from shorter time series. In this case, the accuracy of the forecast depends on the most recent time step. As can be seen from the weight distribution in Figure A1 (right), our model assigns the maximum weight to the most recent time step and lower weights to the previous time steps. This suggests that TGN can adjust the weight distribution to capture the most useful temporal information.
Figure A1. (left) The averaged error of all state variables with different noise distributions for entire trajectory forecasting on the airfoil flow. (right) The weight distribution of the sequential model on the airfoil flow.
Figure A1. (left) The averaged error of all state variables with different noise distributions for entire trajectory forecasting on the airfoil flow. (right) The weight distribution of the sequential model on the airfoil flow.
Applsci 14 00863 g0a1

References

  1. Bhatnagar, S.; Afshar, Y.; Pan, S.; Duraisamy, K.; Kaushik, S. Prediction of aerodynamic flow fields using convolutional neural networks. Comput. Mech. 2019, 64, 525–545. [Google Scholar] [CrossRef]
  2. Thuerey, N.; Weißenow, K.; Prantl, L.; Hu, X. Deep learning methods for Reynolds-averaged Navier–Stokes simulations of airfoil flows. AIAA J. 2020, 58, 25–36. [Google Scholar] [CrossRef]
  3. Pfaff, T.; Fortunato, M.; Sanchez-Gonzalez, A.; Battaglia, P.W. Learning mesh-based simulation with graph networks. arXiv 2020, arXiv:2010.03409. [Google Scholar]
  4. Hoffer, J.G.; Geiger, B.C.; Ofner, P.; Kern, R. Mesh-free surrogate models for structural mechanic FEM simulation: A comparative study of approaches. Appl. Sci. 2021, 11, 9411. [Google Scholar] [CrossRef]
  5. Song, L.H.; Wang, C.; Fan, J.S.; Lu, H.M. Elastic structural analysis based on graph neural network without labeled data. Comput.-Aided Civ. Infrastruct. Eng. 2023, 38, 1307–1323. [Google Scholar] [CrossRef]
  6. Albergo, M.S.; Kanwar, G.; Shanahan, P.E. Flow-based generative models for Markov chain Monte Carlo in lattice field theory. Phys. Rev. D 2019, 100, 034515. [Google Scholar] [CrossRef]
  7. Kanwar, G.; Albergo, M.S.; Boyda, D.; Cranmer, K.; Hackett, D.C.; Racaniere, S.; Rezende, D.J.; Shanahan, P.E. Equivariant flow-based sampling for lattice gauge theory. Phys. Rev. Lett. 2020, 125, 121601. [Google Scholar] [CrossRef]
  8. De Avila Belbute-Peres, F.; Smith, K.; Allen, K.; Tenenbaum, J.; Kolter, J.Z. End-to-end differentiable physics for learning and control. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS 2018), Montréal, QC, Canada, 3–8 December 2018; Volume 31. [Google Scholar]
  9. Sanchez-Gonzalez, A.; Godwin, J.; Pfaff, T.; Ying, R.; Leskovec, J.; Battaglia, P. Learning to simulate complex physics with graph networks. In Proceedings of the International Conference on Machine Learning, Virtual Event, 13–18 July 2020; pp. 8459–8468. [Google Scholar]
  10. Xu, J.; Pradhan, A.; Duraisamy, K. Conditionally parameterized, discretization-aware neural networks for mesh-based modeling of physical systems. Adv. Neural Inf. Process. Syst. 2021, 34, 1634–1645. [Google Scholar]
  11. Lai, G.; Chang, W.C.; Yang, Y.; Liu, H. Modeling long-and short-term temporal patterns with deep neural networks. In Proceedings of the 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, Ann Arbor, MI, USA, 8–12 July 2018; pp. 95–104. [Google Scholar]
  12. Li, S.; Jin, X.; Xuan, Y.; Zhou, X.; Chen, W.; Wang, Y.X.; Yan, X. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS 2019), Vancouver, BC, Canada, 8–14 December 2019; Volume 32. [Google Scholar]
  13. Zhou, H.; Zhang, S.; Peng, J.; Zhang, S.; Li, J.; Xiong, H.; Zhang, W. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Virtually, 2–9 February 2021; Volume 35, pp. 11106–11115. [Google Scholar]
  14. Wu, H.; Xu, J.; Wang, J.; Long, M. Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting. Adv. Neural Inf. Process. Syst. 2021, 34, 22419–22430. [Google Scholar]
  15. Liu, S.; Yu, H.; Liao, C.; Li, J.; Lin, W.; Liu, A.X.; Dustdar, S. Pyraformer: Low-complexity pyramidal attention for long-range time series modeling and forecasting. In Proceedings of the International Conference on Learning Representations, Vienna, Austria, 3–7 May 2021. [Google Scholar]
  16. Cirstea, R.G.; Guo, C.; Yang, B.; Kieu, T.; Dong, X.; Pan, S. Triformer: Triangular, Variable-Specific Attentions for Long Sequence Multivariate Time Series Forecasting–Full Version. arXiv 2022, arXiv:2204.13767. [Google Scholar]
  17. Zhou, T.; Ma, Z.; Wen, Q.; Wang, X.; Sun, L.; Jin, R. Fedformer: Frequency enhanced decomposed transformer for long-term series forecasting. In Proceedings of the International Conference on Machine Learning, Baltimore, MD, USA, 17–23 July 2022; pp. 27268–27286. [Google Scholar]
  18. Zeng, A.; Chen, M.; Zhang, L.; Xu, Q. Are transformers effective for time series forecasting? In Proceedings of the AAAI Conference on Artificial Intelligence, Washington, DC, USA, 7–14 February 2023; Volume 37, pp. 11121–11128. [Google Scholar] [CrossRef]
  19. Hutchinson, M.J.; Le Lan, C.; Zaidi, S.; Dupont, E.; Teh, Y.W.; Kim, H. Lietransformer: Equivariant self-attention for lie groups. In Proceedings of the International Conference on Machine Learning, Virtual, 18–24 July 2021; pp. 4533–4543. [Google Scholar]
  20. Han, X.; Gao, H.; Pfaff, T.; Wang, J.X.; Liu, L.P. Predicting physics in mesh-reduced space with temporal attention. arXiv 2022, arXiv:2201.09113. [Google Scholar]
  21. Jiang, C.; Vinuesa, R.; Chen, R.; Mi, J.; Laima, S.; Li, H. An interpretable framework of data-driven turbulence modeling using deep neural networks. Phys. Fluids 2021, 33, 055133. [Google Scholar] [CrossRef]
  22. Nakamura, T.; Fukami, K.; Hasegawa, K.; Nabae, Y.; Fukagata, K. Convolutional neural network and long short-term memory based reduced order surrogate for minimal turbulent channel flow. Phys. Fluids 2021, 33, 025116. [Google Scholar] [CrossRef]
  23. Rasp, S.; Thuerey, N. Data-driven medium-range weather prediction with a resnet pretrained on climate simulations: A new model for weatherbench. J. Adv. Model. Earth Syst. 2021, 13, e2020MS002405. [Google Scholar] [CrossRef]
  24. Ummenhofer, B.; Prantl, L.; Thuerey, N.; Koltun, V. Lagrangian fluid simulation with continuous convolutions. In Proceedings of the International Conference on Learning Representations, New Orleans, LO, USA, 6–9 May 2019. [Google Scholar]
  25. Lee, S.; You, D. Data-driven prediction of unsteady flow over a circular cylinder using deep learning. J. Fluid Mech. 2019, 879, 217–254. [Google Scholar] [CrossRef]
  26. Belbute-Peres, F.D.A.; Economon, T.; Kolter, Z. Combining differentiable PDE solvers and graph neural networks for fluid flow prediction. In Proceedings of the International Conference on Machine Learning, Virtual Event, 13–18 July 2020; pp. 2402–2411. [Google Scholar]
  27. Kipf, T.N.; Welling, M. Semi-supervised classification with graph convolutional networks. arXiv 2016, arXiv:1609.02907. [Google Scholar]
  28. Alet, F.; Jeewajee, A.K.; Villalonga, M.B.; Rodriguez, A.; Lozano-Perez, T.; Kaelbling, L. Graph element networks: Adaptive, structured computation and memory. In Proceedings of the International Conference on Machine Learning, Long Beach, CA, USA, 9–15 June 2019; pp. 212–222. [Google Scholar]
  29. Gao, H.; Ji, S. Graph u-nets. In Proceedings of the International Conference on Machine Learning, Long Beach, CA, USA, 9–15 June 2019; pp. 2083–2092. [Google Scholar]
  30. Ying, Z.; You, J.; Morris, C.; Ren, X.; Hamilton, W.; Leskovec, J. Hierarchical graph representation learning with differentiable pooling. Adv. Neural Inf. Process. Syst. 2018, 31. [Google Scholar]
  31. Chevillon, G. Direct multi-step estimation and forecasting. J. Econ. Surv. 2007, 21, 746–785. [Google Scholar] [CrossRef]
  32. Lv, Y.; Duan, Y.; Kang, W.; Li, Z.; Wang, F.Y. Traffic flow prediction with big data: A deep learning approach. IEEE Trans. Intell. Transp. Syst. 2014, 16, 865–873. [Google Scholar] [CrossRef]
  33. Wu, Y.; Tan, H. Short-term traffic flow forecasting with spatial-temporal correlation in a hybrid deep learning framework. arXiv 2016, arXiv:1612.01022. [Google Scholar]
  34. Zhang, J.; Zheng, Y.; Qi, D. Deep spatio-temporal residual networks for citywide crowd flows prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, San Francisco, CA, USA, 4–9 February 2017; Volume 31. [Google Scholar]
  35. Cao, X.; Zhong, Y.; Zhou, Y.; Wang, J.; Zhu, C.; Zhang, W. Interactive temporal recurrent convolution network for traffic prediction in data centers. IEEE Access 2017, 6, 5276–5289. [Google Scholar] [CrossRef]
  36. Ke, J.; Zheng, H.; Yang, H.; Chen, X.M. Short-term forecasting of passenger demand under on-demand ride services: A spatio-temporal deep learning approach. Transp. Res. Part C Emerg. Technol. 2017, 85, 591–608. [Google Scholar] [CrossRef]
  37. Yu, H.; Wu, Z.; Wang, S.; Wang, Y.; Ma, X. Spatiotemporal recurrent convolutional networks for traffic prediction in transportation networks. Sensors 2017, 17, 1501. [Google Scholar] [CrossRef] [PubMed]
  38. Li, Y.; Yu, R.; Shahabi, C.; Liu, Y. Graph convolutional recurrent neural network: Data-driven traffic forecasting. arXiv 2017, arXiv:1707.01926. [Google Scholar]
  39. Bai, J.; Zhu, J.; Song, Y.; Zhao, L.; Hou, Z.; Du, R.; Li, H. A3t-gcn: Attention temporal graph convolutional network for traffic forecasting. ISPRS Int. J. Geo-Inf. 2021, 10, 485. [Google Scholar] [CrossRef]
  40. Cho, K.; Van Merriënboer, B.; Bahdanau, D.; Bengio, Y. On the properties of neural machine translation: Encoder-decoder approaches. arXiv 2014, arXiv:1409.1259. [Google Scholar]
  41. Battaglia, P.W.; Hamrick, J.B.; Bapst, V.; Sanchez-Gonzalez, A.; Zambaldi, V.; Malinowski, M.; Tacchetti, A.; Raposo, D.; Santoro, A.; Faulkner, R.; et al. Relational inductive biases, deep learning, and graph networks. arXiv 2018, arXiv:1806.01261. [Google Scholar]
  42. Corso, G.; Cavalleri, L.; Beaini, D.; Liò, P.; Veličković, P. Principal neighbourhood aggregation for graph nets. Adv. Neural Inf. Process. Syst. 2020, 33, 13260–13271. [Google Scholar]
Figure 1. Template for explicit finite differences. The state of node i is affected by neighboring nodes.
Figure 1. Template for explicit finite differences. The state of node i is affected by neighboring nodes.
Applsci 14 00863 g001
Figure 2. The diagram of the TGN. We first represent the physical space as a graph and then use GSE to capture the topology of the graph. The latent vector z t consists of nodes with spatial features and represents the state at time step t. The AutoLinear model captures temporal features from the sequence of latent vectors and uses a decoder to extract derivatives for each node, which are then utilized to update the graph for predicting the next-step state S t + 1 .
Figure 2. The diagram of the TGN. We first represent the physical space as a graph and then use GSE to capture the topology of the graph. The latent vector z t consists of nodes with spatial features and represents the state at time step t. The AutoLinear model captures temporal features from the sequence of latent vectors and uses a decoder to extract derivatives for each node, which are then utilized to update the graph for predicting the next-step state S t + 1 .
Applsci 14 00863 g002
Figure 3. Visualization of node updates. We employ 3 MLPs (B = 3) to update edge features and combine the aggregated results of the edge features through the node weights W l , i . This simplified diagram does not depict multiple heads or aggregators.
Figure 3. Visualization of node updates. We employ 3 MLPs (B = 3) to update edge features and combine the aggregated results of the edge features through the node weights W l , i . This simplified diagram does not depict multiple heads or aggregators.
Applsci 14 00863 g003
Figure 4. Comparison of velocity and pressure fields predicted by our model with ground truth (CFD). Our model accurately predicts the flow field dynamics for different systems and different parameters.
Figure 4. Comparison of velocity and pressure fields predicted by our model with ground truth (CFD). Our model accurately predicts the flow field dynamics for different systems and different parameters.
Applsci 14 00863 g004
Figure 5. Illustration of averaged error over velocity variable (Y-axis) of four models on cylinder flow (left) and airfoil flow (right). Our model show smaller error accumulation compared to both the next-step model and the model variants.
Figure 5. Illustration of averaged error over velocity variable (Y-axis) of four models on cylinder flow (left) and airfoil flow (right). Our model show smaller error accumulation compared to both the next-step model and the model variants.
Applsci 14 00863 g005
Figure 6. Illustration of averaged error over all state variables (Y-axis) of AutoLinear and TGN on cylinder flow (left) and airfoil flow (right). The RMSE of the TGN model is significantly lower than that of the AutoLinear model, which only considers temporal features.
Figure 6. Illustration of averaged error over all state variables (Y-axis) of AutoLinear and TGN on cylinder flow (left) and airfoil flow (right). The RMSE of the TGN model is significantly lower than that of the AutoLinear model, which only considers temporal features.
Applsci 14 00863 g006
Figure 7. Comparison of relative positions of nodes in the cylinder flow ( R e = 300 , t = 500 ). The state field does not preserve the relative positions of nodes in the two-dimensional latent subspace, whereas GSE is capable of learning the relative positions between nodes. The encoded nodes in the two-dimensional latent subspace of GSE closely resemble the actual scenario.
Figure 7. Comparison of relative positions of nodes in the cylinder flow ( R e = 300 , t = 500 ). The state field does not preserve the relative positions of nodes in the two-dimensional latent subspace, whereas GSE is capable of learning the relative positions between nodes. The encoded nodes in the two-dimensional latent subspace of GSE closely resemble the actual scenario.
Applsci 14 00863 g007
Figure 8. (left) The averaged error of all state variables with different noise distributions for entire trajectory forecasting on the cylinder flow. (right) The weight distribution of the sequential model on the cylinder flow.
Figure 8. (left) The averaged error of all state variables with different noise distributions for entire trajectory forecasting on the cylinder flow. (right) The weight distribution of the sequential model on the cylinder flow.
Applsci 14 00863 g008
Figure 9. Comparison of the velocity field predicted by four models with the ground truth (CFD) for the cylinder flow with Reynolds number = 330 and steps = 900.
Figure 9. Comparison of the velocity field predicted by four models with the ground truth (CFD) for the cylinder flow with Reynolds number = 330 and steps = 900.
Applsci 14 00863 g009
Figure 10. The averaged error of our model with different sized history time steps on the cylinder flow.
Figure 10. The averaged error of our model with different sized history time steps on the cylinder flow.
Applsci 14 00863 g010
Table 1. The average relative mean square error (RMSE) of two systems, with unit of 10 4 . The smaller the RMSE the better. The cylinder flow has history time steps of 12, whereas the airfoil flow has history time steps of 3. The best results are highlighted in bold. Our model significantly outperforms MeshGraphNets and model variants in terms of long-term prediction for both datasets.
Table 1. The average relative mean square error (RMSE) of two systems, with unit of 10 4 . The smaller the RMSE the better. The cylinder flow has history time steps of 12, whereas the airfoil flow has history time steps of 3. The best results are highlighted in bold. Our model significantly outperforms MeshGraphNets and model variants in terms of long-term prediction for both datasets.
RolloutModelCylinder FlowAirfoil
uvpuv ρ p
1-stepMeshGraphNets0.10.77923.150.4115.530.010.07
Linear0.061.5266.550.3513.140.010.04
Transformer0.020.3733.070.3711.090.010.17
TGN0.010.2420.630.3310.490.0090.05
50-stepMeshGraphNets0.210.97186.281.1247.120.030.08
Linear0.9910.47101.851.1537.010.040.08
Transformer0.310.9810.761.2244.440.060.11
TGN0.020.34.440.8124.010.020.06
500-stepMeshGraphNets18.36182.01102.81.6334.860.030.05
Linear69.73434.28215.23.5319.450.561.14
Transformer5.9759.7865.563.2628.250.070.12
TGN1.2619.9519.081.387.990.020.03
Table 2. The average relative mean square error in units of 10 4 for cylinder flow. We trained the model on training trajectories of 500 time steps and tested the model on test trajectories of 900 steps.
Table 2. The average relative mean square error in units of 10 4 for cylinder flow. We trained the model on training trajectories of 500 time steps and tested the model on test trajectories of 900 steps.
VariableMeshGraphNetLinearTransformerTGN
u197.1173.1432.388.68
v1069.32862.5494.1154.31
p287.4610.85139.556.71
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Yue, M.; Liu, H.; Chang, X.; Zhang, L.; Li, T. TGN: A Temporal Graph Network for Physics Prediction. Appl. Sci. 2024, 14, 863. https://doi.org/10.3390/app14020863

AMA Style

Yue M, Liu H, Chang X, Zhang L, Li T. TGN: A Temporal Graph Network for Physics Prediction. Applied Sciences. 2024; 14(2):863. https://doi.org/10.3390/app14020863

Chicago/Turabian Style

Yue, Miaocong, Huayong Liu, Xinghua Chang, Laiping Zhang, and Tianyu Li. 2024. "TGN: A Temporal Graph Network for Physics Prediction" Applied Sciences 14, no. 2: 863. https://doi.org/10.3390/app14020863

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop