TransFlowNet: A physics-constrained Transformer framework for spatio-temporal super-resolution of flow simulations

https://doi.org/10.1016/j.jocs.2022.101906Get rights and content

Highlights

  • TransFlowNet is a novel physics-constrained deep learning framework.

  • TransFlowNet focuses on the spatio-temporal super-resolution of flow simulations.

  • TransFlowNet has a newly designed implicit feature encoder based on Swin Transformer.

  • Two flow simulations are studied to evaluate the performance of TransFlowNet.

Abstract

We propose TransFlowNet, a novel physics-constrained deep learning framework that focuses on the spatio-temporal super-resolution (STSR) of flow simulations. A key insight is how to combine both statistical and physical properties in the process of an STSR network. Therefore, we elaborately design stacked convolutional layers and Transformer blocks to extract shallow and deep features. Besides, we employ an automatic differentiation process for solving the physical constraints. Unlike existing physics-informed solutions, our method is able to solve flow processes with uncertain boundary and initial conditions. Based on two typical flow simulations, we compare our method with the state-of-the-art physics-constrained model and a CNN-based baseline model. Our framework outperforms these methods in both PSNR and SSIM metrics and produces visually the best results. We also test our method at the large spatio-temporal scale, and the high-resolution outputs present stable performances.

Introduction

It is a fundamental task in science and engineering to model the dynamical processes of high-resolution spatio-temporal data on continuous scales of space and time (e.g., climate system [1], [2], physical oceanography [3], fluid mechanics  [4], [5]). This work plays an important role in understanding and reasoning about the natural physical world. Scientists attempt to model these processes in a principled way by conservation laws and physical laws, i.e., partial differential equations (PDEs), and further simulate these behaviors with computational devices. To this end, computational fluid dynamics (CFD [6]) has become a tremendous tool for solving various PDEs numerically in the last decades. However, conventional CFD schemes are based purely on physical properties: known physical laws of PDEs are solved step by step through mesh-based numerical discretization or integration schemes, such as the finite difference method (FDM) and the finite element method (FEM) [7]. These methods are time-consuming and require significant computational resources and expertise [8]. In recent times, deep learning methods have demonstrated great success in accelerating the processing of compute-intensive scientific problems [9]. As a result, researchers start to replace part of the solving process of the CFD scheme with deep learning methods to improve the computational efficiency of numerical results and reduce computational costs.

In this paper, we focus on one such computational problem: how to reconstruct spatio-temporal high-resolution results with fine-scale features given the spatio-temporal low-resolution physical flow simulation volume data (which can be produced by conventional CFD schemes) and governing PDEs. This procedure is referred as Physics-constrained STSR.

At first glance, this problem seems can be solved directly using general video super-resolution methods such as [10], [11]. But most of them are data-driven methods that have not yet been proven to be successful in accurately producing the physical properties of flow systems [12]. In contrast, a method called physical-informed neural networks (PINNs) and its variants [13], [14], [15], [16], [17] incorporate physical constraints into deep neural networks by taking advantage of the automatic differentiation. The application of PINNs in engineering problems is also an active research topic [18], [19]. PINNs accept governing PDEs and a set of boundary and initial conditions as input and produce mesh-free flow feature reconstruction results. However, the training process of PINNs is completely different from the video super-resolution method. It does not require low-resolution images as input, but boundary and initial conditions are necessary. Otherwise, the training loss may not converge. Therefore, the network needs to be retrained once the boundary and initial conditions change. This significant limitation is not sufficient for STSR of flow dynamics with unknown boundary and initial conditions.

Our work has three challenges generally. To extract the inherent statistical correlations between paired low-resolution and high-resolution flow data, the neural network must first be intricately designed. Second, physical constraints must be added to the deep learning framework in order for it to adhere to the physical laws dictated by the PDEs. Last but not least, an effective STSR model should be able to handle flow dynamics processes with unknown boundary and initial conditions and effectively represent high-resolution outputs, for example, by showing a high match on widely used metrics and scaling stably to large spatio-temporal scales.

We tackle these challenges through a novel STSR flow reconstruction network based on Transformer [20] architecture, called TransFlowNet. Our network consists of an encoder (Feature Extraction Network) and a decoder (Physics-constrained Network). For the encoder, we intricately design stacked convolutional and Transformer blocks as shallow and deep features extractors, respectively, with skip connections. Transformer is a new backbone network architecture that, in comparison to Convolutional Neural Network (CNN), has a larger and broader perceptual field for better extraction of deep-level features (i.e, Vision Transformer [21], Swin Transformer [22]). To resolve the physical constraints in the decoder, we use a Multilayer Perception (MLP) with a differentiable nature. A hybrid loss function is also used, which considers both statistical difference and physical residue.

Specifically, our main technical contributions are as follows:

  • We present TransFlowNet, a novel physics-constrained deep learning framework, which focuses on the STSR of flow simulations with unknown boundary and initial conditions in physical systems.

  • We propose a newly designed implicit feature encoder based on Swin Transformer, which gives better results than the CNN-based models and shows stable performances at the large spatio-temporal scale.

  • We conduct experiments and evaluations on the Rayleigh–Bénard convection problem and shallow water equations (SWEs), that show our method has the potential ability in accelerating the processing of the compute-intensive CFD simulation problems.

All experimental results can be found in Section 4. We verify the effectiveness of generating high-resolution data by our method using the PSNR and SSIM metrics. The experimental results demonstrate that TransFlowNet successfully addresses the three challenges mentioned above. First, the implicit feature encoder prompts TransFlowNet to extract the effective deep feature on both spatial and temporal scales. Second, the physics-constrained decoder makes the high-resolution features consistent with the real physical process as much as possible. Finally, our method achieves excellent and stable performances for the spatio-temporal modeling of flow simulations with uncertain boundary and initial conditions. We compare our method with the state-of-the-art physics-constrained model and a CNN-based baseline model using two different flow simulations. Our framework outperforms these methods in both PSNR and SSIM metrics and produces visually the best results (Sections 4.1 Rayleigh–Bénard convection problem, 4.2 SWEs). We also demonstrate the necessity of some important modules in TransFlowNet by the ablation study (Section 4.3). At last, we test our method at the large spatio-temporal scale, and the high-resolution outputs present stable performances (Section 4.4).

Section snippets

Related work

Through the use of neural networks to reconstruct fluid physical features, this work aims to produce STSR results for flow simulations. This task integrates physical-informed deep learning, data-driven flow modeling, flow animation, video super-resolution, and hybrid physical-constrained deep learning.

Data-driven flow modeling. Recently, data-driven models, especially neural network models have been used to accelerate and improve the simulation of flow modeling. For example, Ling et al. [23]

Overview

In this section, we propose TransFlowNet to generate high quality STSR results using the low-resolution solutions of flow simulations. The framework benefits from several Transformer layers to obtain more effective deep feature. Coupled with a set of physical constraints, TransFlowNet demonstrates excellent performance in STSR applications of flow simulation data.

As show in Fig. 1(a), TransFlowNet consists of two networks, called the Feature Extraction Network and the Physics-constrained Network

Experiments

We perform our method on two different flow processes (the Rayleigh–Bénard convection problem and SWEs). Besides the visual comparison, we also compute the mean PSNR and SSIM of each physical variable to give quantitative results. In these two flow simulations, we compare our approach to two earlier works first. Then, we conduct the ablation study to illustrate the important modules of TransFlowNet. At last, we test our method at the large spatio-temporal scale to show its scalability. All

Limitations and discussions

Table 2, Table 3 show that the 3D U-Net model is inferior to the traditional trilinear interpolation algorithm. It shows that the performance of conventional methods cannot be attained by simply using original deep learning models for STSR of flow simulations. Using the physics-constrained deep learning framework, this conundrum can be solved successfully.

As shown in Fig. 5, TransFlowNet still maintains excellent performance when the ground truth data is ×16 down-sampled in space. We test

Conclusion

This paper presents TransFlowNet, a new physics-constrained deep learning framework that produces high-quality STSR results for flow simulations. TransFlowNet achieves the state-of-the-art performance on Rayleigh–Bénard Convection Problem and SWEs with uncertain boundary and initial conditions, significantly surpassing the previous best model. We also conduct experiments to test our method at the large spatio-temporal scale, and the high-resolution outputs present stable performances. We hope

CRediT authorship contribution statement

Xinjie Wang: Conceptualization, Methodology, Writing – original draft, Writing – review & editing. Siyuan Zhu: Software, Writing – original draft. Yundong Guo: Methodology, Validation, Writing – review & editing. Peng Han: Software. Yucheng Wang: Data curation, Validation. Zhiqiang Wei: Supervision. Xiaogang Jin: Writing – review & editing.

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgments

This work was supported by the National Natural Science Foundation of China [Grant No. 62036010]; the Key R&D Program of Zhejiang, China [Grant No. 2022C03126]; the Shandong Provincial Natural Science Foundation of China [Grant No. ZR2021QF124]; China Postdoctoral Science Foundation [Grant No. 2021M703031]; and the Open Project Program of the State Key Lab of CAD&CG, China [Grant No. A2219], Zhejiang University. We also thank the Center for High Performance Computing and System Simulation, the

Xinjie Wang is currently a lecturer of Computer Science at Ocean University of China. She received the B.Sc. degree in computer science from Wuhan University, and the Ph.D. degree in computer science from the State Key Laboratory of CAD&CG, Zhejiang University in 2015. Her main research interests include deep learning, scientific visualization, and computer graphics.

References (69)

  • KissasG. et al.

    Machine learning in cardiovascular flows modeling: Predicting arterial blood pressure from non-invasive 4D flow MRI data using physics-informed neural networks

    Comput. Methods Appl. Mech. Engrg.

    (2020)
  • JinX. et al.

    Nsfnets (Navier-Stokes flow nets): Physics-informed neural networks for the incompressible Navier-Stokes equations

    J. Comput. Phys.

    (2021)
  • PangG. et al.

    nPINNs: Nonlocal physics-informed neural networks for a parametrized nonlocal universal Laplacian operator. Algorithms and applications

    J. Comput. Phys.

    (2020)
  • DoanN. et al.

    Physics-informed echo state networks

    J. Comput. Sci.

    (2020)
  • YangY. et al.

    Adversarial uncertainty quantification in physics-informed neural networks

    J. Comput. Phys.

    (2019)
  • ZhangD. et al.

    Quantifying total uncertainty in physics-informed neural networks for solving forward and inverse stochastic problems

    J. Comput. Phys.

    (2019)
  • ZhuY. et al.

    Physics-constrained deep learning for high-dimensional surrogate modeling and uncertainty quantification without labeled data

    J. Comput. Phys.

    (2019)
  • SunL. et al.

    Physics-constrained bayesian neural network for fluid flow reconstruction with sparse and noisy data

    Theor. Appl. Mech. Lett.

    (2020)
  • HaghighatE. et al.

    Sciann: A keras/TensorFlow wrapper for scientific computations and physics-informed deep learning using artificial neural networks

    Comput. Methods Appl. Mech. Engrg.

    (2021)
  • WangS. et al.

    When and why PINNs fail to train: A neural tangent kernel perspective

    J. Comput. Phys.

    (2022)
  • RaissiM. et al.

    Hidden physics models: Machine learning of nonlinear partial differential equations

    J. Comput. Phys.

    (2018)
  • RichardsonL.F. et al.
  • BauerP. et al.

    The quiet revolution of numerical weather prediction

    Nature

    (2015)
  • VallisG.K.

    Atmospheric and Oceanic Fluid Dynamics: Fundamentals and Large-Scale Circulation

    (2017)
  • MoserR.D. et al.

    Statistical properties of subgrid-scale turbulence models

    Annu. Rev. Fluid Mech.

    (2021)
  • ChungT.J.

    Computational Fluid Dynamics

    (2002)
  • BrennerS.C. et al.

    The Mathematical Theory of Finite Element Methods

    (2008)
  • ReichsteinM. et al.

    Deep learning and process understanding for data-driven Earth system science

    Nature

    (2019)
  • KappelerA. et al.

    Video super-resolution with convolutional neural networks

    IEEE Trans. Comput. Imaging

    (2016)
  • ChuM. et al.

    Learning temporal coherence via self-supervision for GAN-based video generation

    ACM Trans. Graph.

    (2020)
  • WangR. et al.

    Towards physics-informed deep learning for turbulent flow prediction

  • ZhangD. et al.

    Learning in modal space: Solving time-dependent stochastic PDEs using physics-informed neural networks

    SIAM J. Sci. Comput.

    (2020)
  • JagtapA.D. et al.

    Extended physics-informed neural networks (XPINNs): A generalized space-time domain decomposition based deep learning framework for nonlinear partial differential equations

    Commun. Comput. Phys.

    (2020)
  • VaswaniA. et al.

    Attention is all you need

  • Cited by (8)

    • Super-resolution analysis via machine learning: a survey for fluid flows

      2023, Theoretical and Computational Fluid Dynamics
    View all citing articles on Scopus

    Xinjie Wang is currently a lecturer of Computer Science at Ocean University of China. She received the B.Sc. degree in computer science from Wuhan University, and the Ph.D. degree in computer science from the State Key Laboratory of CAD&CG, Zhejiang University in 2015. Her main research interests include deep learning, scientific visualization, and computer graphics.

    Siyuan Zhu is a master student of Computer Science at Ocean University of China. She received her bachelor’s degree in software engineering from Hubei University of Technology in 2020. Her research interests include scientific visualization and deep learning.

    Yundong Guo received his Ph.D. degree in the School of Mechanical Engineering from Zhejiang University in 2021. Currently, he is a Lecturer at the College of Computer Science and Engineering, Shandong University of Science and Technology, China. His research mainly focuses on deep learning and computer vision.

    Peng Han is a master student of Computer Science at Ocean University of China. He received his bachelor’s degree from Qingdao University in 2021. His research interests include machine learning and computer graphics.

    Yucheng Wang is currently a senior engineer of Pilot National Laboratory for Marine Science and Technology (Qingdao). His primary research interests fall in marine eco-system dynamics and deep learning.

    Zhiqiang Wei is currently a professor with the Ocean University of China, Qingdao, China. He received the Ph.D. degree from Tsinghua University, Beijing, China, in 2001. His current research interests are in the fields of intelligent information processing, social media and big data analytics.

    Xiaogang Jin received the B.Sc. degree in computer science and the M.Sc. and Ph.D. degrees in applied mathematics from Zhejiang University, P. R. China, in 1989, 1992, and 1995, respectively. He is a professor with the State Key Laboratory of CAD&CG, Zhejiang University. His current research interests include virtual reality, traffic simulation, collective behavior simulation, cloth animation, virtual try-on, digital human, implicit surface modeling and applications, creative modeling, computer-generated marbling, sketch-based modeling, and computer games. He was the recipient of the ACM Recognition of Service Award in 2015 and the Best Paper Awards from CASA 2017 and CASA 2018. He is a member of the IEEE and ACM.

    View full text