Year: 2021

Abstract:
Turbulence simulation with classical numerical solvers requires very highresolution grids to accurately resolve dynamics. Here we train learned simulators at low spatial and temporal resolutions to capture turbulent dynamics generated at high resolution. We show that our proposed model can simulate turbulent dynamics more accurately than classical numerical solvers at the same low resolutions across various scientifically relevant metrics. Our model is trained end-to-end from data and is capable of learning a range of challenging chaotic and turbulent dynamics at low resolution, including trajectories generated by the state-of-the-art Athena++ engine. We show that our simpler, general-purpose architecture outperforms various more specialized, turbulence-specific architectures from the learned turbulence simulation literature. In general, we see that learned simulators yield unstable trajectories; however, we show that tuning training noise and temporal downsampling solves this problem. We also find that while generalization beyond the training distribution is a challenge for learned models, training noise, convolutional architectures, and added loss constraints can help. Broadly, we conclude that our learned simulator outperforms traditional solvers run on coarser grids, and emphasize that simple design choices can offer stability and robust generalization.

heading: 1 INTRODUCTION
text: Turbulent fluid dynamics are ubiquitous throughout the natural world, and many scientific and engineering disciplines depend on high quality simulations of turbulence. Examples range from design problems in aeronautics (Rhie, 1983) and medicine (Sallam & Hwang, 1984) to scientific problems of understanding molecular dynamics (Smith, 2015), weather (Beljaars, 2003), and vast galactic systems (Canuto & Christensen-Dalsgaard, 1998). Predicting turbulent dynamics is challenging, and finding a general solution to the governing equations of fluid dynamics, the Navier-Stokes Equation, is a famously open problem in Mathematical Physics (Jaffe, 2006). The challenge is due in large part to the fact that turbulence is chaotic: small-scale changes in the initial conditions can lead to a large difference in the outcome. Nonetheless, over the past several decades, high-quality numerical solvers have been engineered that integrate the governing partial differential equations (PDEs), which can maintain accuracy over long integration periods even for complex dynamics. These solvers often must operate over high-resolution grids and therefore require substantial computational resources. Otherwise, high-frequency information is lost due to hard-to-model “numerical viscosity”, and the simulated dynamics can further diverge from the underlying equations due to the chaotic nature of turbulence. Because of the relevance of turbulence simulation to deep mathematical questions and real-world problems, efficient turbulence simulation is likely to be a central problem for Machine Learning in the years to come.
Learned simulation represents a promising avenue for efficient fluid simulation because learned models can potentially adapt to capture the large-scale dynamics on coarse grids. Learned simulators vary in the extent to which they incorporate components from classical solvers, like those that learn closures and subgrid discretization (Duraisamy et al., 2019; Freund et al., 2019; Pathak et al., 2020; Um et al., 2021; Kochkov et al., 2021), versus adopting a pure ML approach (Kim et al., 2018; Lusch et al., 2018; Sanchez-Gonzalez et al., 2020; Wang et al., 2020; Li et al., 2020c;a; Pfaff et al., 2021). Advantages of the pure ML route are that the same model can be used without specialized knowledge of the domain and that they do not involve the challenge of interfacing with PDE solvers. However,
fully learned simulators often work well only when conditions are similar to the training distribution, which can limit their stability over time and their generalization capabilities.
Our primary contribution is to demonstrate that fully learned simulators can learn to predict turbulent dynamics on coarse grids more accurately than classical solvers. This is true over a range of performance metrics, but where the learned simulators particularly excel in their ability to preserve high frequency information. This shows that neural networks can adapt to capture aspects of the large scale dynamics that classical solvers disproportionately miss. While learned simulators can be prohibitively unstable, we show that the simple practice of tuning training noise and the temporal downsampling factor can reliably produce stable rollouts. We introduce a simple model that combines neural networks architectures for grids (Dilated CNNs (Yu & Koltun, 2016), ResNets (He et al., 2015)) with recent advancements on general purpose learned simulation on graphs (encode-process-decode models (Sanchez-Gonzalez et al., 2020; Pfaff et al., 2021) trained with noise (Sanchez-Gonzalez et al., 2018; 2020; Pfaff et al., 2021)). We implement this as well as a set of learned models from the literature that have been proposed for modeling turbulence, and show that Dilated ResNet outperforms the other, often more complicated models. Rather than looking at a single problem, we evaluate our models over a variety of challenging turbulent and chaotic domains, showing that Dilated ResNet is generally able to capture a variety of turbulent dynamics out-of-the-box. This includes two environments generated by the new Athena++ solver(Stone et al., 2020), a state of the art (magneto-)hydrodynamics simulator used for astrophysics, where extremely high-resolution and large-scale simulations are often required. Finally, we evaluate the ability of the learned models to generalize to initial conditions, rollout durations, and environment sizes outside of the training distribution. Generalizing out of distribution is a known challenge for learned models, and we document where our models fail and what model and training choices can improve generalization.

heading: 2 RELATED WORK
text: Turbulent fluid dynamics are ubiquitous across the universe, and turbulence simulation is a crucial step in problems across disciplines. These include forecasting problems, like predicting the spread of a wildfire (Leonardi et al., 2019) or the evolution of a hurricane (Zhang et al., 2020), engineering challenges, like designing more aerodynamic machinery (Rhie, 1983), and scientific questions, like understanding the physics of insect flight (Dickinson et al., 1999) or dynamics of celestial objects (Fielding et al., 2018). Across applications, a variety of statistical measures are relevant for quantifying physical variables under turbulence (Velocity Autocorrelation, variable histograms, Cooling, Energy spectra). The primary challenge for simulating turbulence is accurately capturing small- and large-scale flow dynamics, and their interplay, simultaneously.
Traditional approaches to computational fluid dynamics integrate the governing PDEs describing the fluid flow, given initial and boundary conditions. State-of-the-art turbulence simulators, such as Athena++, are built upon efficient algorithms that prioritize the preservation of high-order statistics. Such simulators are used frequently in scientific applications to numerically compare model predictions with experimental observations, but can be extremely–often prohibitively–expensive to run. Thus, there is significant practical interest in developing more efficient simulators.
Deep learning models for predicting physical dynamics have traditionally been used for modeling low-dimensional dynamical systems with graph-like (Battaglia et al., 2016; Sanchez-Gonzalez et al., 2018) and grid-like specifications (Raissi et al., 2017; Chen et al., 2018), but there is a growing body of work for fine-grained modeling of complex dynamics, as in particle-based liquids and soft-body physics (Li et al., 2019; Ummenhofer et al., 2020; Sanchez-Gonzalez et al., 2020). Learned models are often used in computer graphics to speed up (Wiewel et al., 2019; Um et al., 2018; Ladický et al., 2015; Holden et al., 2019) or super-resolve (Xie et al., 2018) simulations. A number of papers predict the steady-state flow around 2D airfoil wings, using CNN (Thuerey et al., 2020; Bhatnagar et al., 2019) or GCN (Belbute-Peres et al., 2020) architectures, or the transient dynamics of various low Reynolds number flows using mesh representations (Pfaff et al., 2021).
In recent years, a number of models have been introduced specifically for learning turbulent dynamics. Many of these use neural networks to model some part of an otherwise classical, theoretically motivated numerical integration setup (Duraisamy et al., 2019; Freund et al., 2019; Pathak et al., 2020; Um et al., 2021; Kochkov et al., 2021; Tompson et al., 2016), PDE formulation (Raissi et al., 2017; Champion et al., 2019), or embedding space (Lusch et al., 2018). Other models incorporate
some information about turbulence simulation into the architecture, but like ours, are learned endto-end in a supervised way. Wang et al. (Wang et al., 2020) implemented a fully learned, neural network “Turbulent Flow Network” (TF-Net) that applies physically inspired decomposition with learned parameters and processes the components with U-Nets for fluid simulation. Li and colleagues introduced “Fourier Neural Operators” for turbulence simulation (Li et al., 2020a), which apply neural networks that convolution parameters in the Fourier domain. This model is part of a broader family of work (Portwood et al., 2019; Li et al., 2020b) which combines basis transforms (Fourier, Multipole, etc) with neural operators that process the transformed input. We implement models from these papers as baselines to compare to our learned simulator.

heading: 3 MODEL

heading: 3.1 LEARNED SIMULATION FRAMEWORK ON GRIDS
text: We train a simulation model s : X → X that maps Xt to Xt+∆t, where X is a space of n+1 dimensional tensors which represent the state variables for each point on a grid with n spatial dimensions and one feature dimension at time t. The true physical dynamics applied over K time steps yields a trajectory of states which we denote (Xt0 , ..., XtK ). The “rollout” trajectory produced by iteratively applying s for K steps is denoted (X̃t0 , X̃t1 , ..., X̃tK ), where X̃t0 = Xt0 represents initial conditions given as input. Our learnable simulators (Fig. 1a) implement s using neural networks denoted NN (with weights θ), and predict the next state as the difference from the current state, X̃t+∆t = s(X̃t; θ) = X̃t + NN(X̃t; θ).

heading: 3.2 MODELS
text: In this work we study “fully learned“ models, which learn the physical dynamics end-to-end without any hard-coded solver components. We implemented a novel Dilated ResNet model, as well as several baseline models. Detailed model parameters can be found in the Appendix.
Dilated ResNet Encode-Process-Decode (Dil-ResNet) We designed this architecture to combine the encode-process-decode paradigm (Sanchez-Gonzalez et al., 2018; 2020) with dilated convolutional networks (Fig. 1a). The encoder and decoder each consist of single linear convolutional layer. The processor consists of N = 4 dilated CNN blocks (dCNNn) connected in series with residual connections (Yu & Koltun, 2016; He et al., 2015). Each block consists of 7 dilated CNN layers with dilation rates of (1, 2, 4, 8, 4, 2, 1). A dilated rate of N, indicates each pixel is convolved with pixels that are multiples of N pixels away, such that N=1 reduces to regular convolution. This model is not specialized for turbulence modeling per se, and its components are general-purpose tools for improving performance in CNNs, but we demonstrate that it is effective for it. Residual connections help avoid vanishing gradients, and dilations allow long-range communication while preserving local structure, making it a good fit for modeling PDEs. All individual CNNs use a kernel size of 3 and have 48 output channels (except the decoder, which has an output channel for each feature). Each individual CNN layer in the processor is immediately followed by a rectified linear unit (ReLU) activation function. The Encoder CNN and the Decoder CNNs do not use activations.
Encode-U-Net-Decode (U-Net) We designed this architecture as a simplification of the TF-Net baseline explained below. It uses a simple linear CNN encoder and decoder (same as Dil-ResNet) and a standard U-Net block (Ronneberger et al., 2015). As in (Ronneberger et al., 2015), each CNN stack is made of 3 CNNs, followed by activations. Other hyperparameters of the U-Net also matched those used in (Ronneberger et al., 2015).
Turbulent Flow Net (TF-Net) (Wang et al., 2020) TF-Net uses a domain-specific variation of UNets to model turbulence, along with other architectural domain-specific elements inspired by RANSLES Hybrid Coupling in the encoder. Hyperparameters also matched those used in (Ronneberger et al., 2015; Wang et al., 2020).
Constrained Turbulent Flow Net (Con-TF-Net) (Wang et al., 2020) Wang et al. also explored a constraint term in the loss which penalizes the divergence, which was constrained to be zero everywhere for the PDE in their incompressible turbulence experiments. We implemented a similar modetal, adapting the constrained function to match constraints or preserved quantities in our datasets. For KS-1D, the mean is constrained to be 0; for INCOMP-2D, the divergence is constrained to be 0, and for COMPDECAY-3D the total energy is constrained to be the same as input’s total energy.
Constrained Dilated ResNet (Con-Dil-ResNet) This model is Dil-ResNet (described above) with the additional constraint terms from (Con-TF-Net) added to the loss function. This allows us to examine the effect of the loss term separately from the other aspects of the TF-Net architecture.
Fourier Neural Operator (FNO) (Li et al., 2020a) This model uses the neural operator formalism introduced in earlier work (Li et al., 2020c;b), applied in the Fourier domain. We implemented FNO for 1D and 2D spatial domains as in (Li et al., 2020a) Hyperparameters are from (Li et al., 2020a).
CNN padding We use periodic padding for spatial axes in the case of periodic boundary conditions. For the COOLMIXLAYER-3D which has a fixed boundary condition along the vertical axis, we mask the value at the boundary out from the loss at train time and set it to the ground truth at each step of the rollout. We also augment the input state with a binary feature to distinguish boundary pixels.

heading: 3.3 TRAINING
text: Loss All models1 are trained to predict ∆X . We use a mean square error loss `(Xt, Xt+∆t) = MSE(NN(Xt; θ),∆X) to optimize parameters θ. Input Xt and target ∆X = Xt+∆t −Xt features are normalized to be zero-mean and unit variance, which seemed to improve training speed. The additional mean square error loss components for constraint preservation in Con-Dil-ResNet and Con-Dil-ResNet are added to the main loss with a relative weight of 1.
Training noise Optionally, we trained with Gaussian random noise with fixed standard deviation σ added to the input Xt and subtracted from the target ∆X , as this has been shown to improve stability of rollouts and prevent error accumulation by training the model to correct for small errors (Sanchez-Gonzalez et al., 2018; 2020; Pfaff et al., 2021). See Appendix for more details.
1In the original papers, TF-Net, Con-TF-Net, and FNO directly predict X but we did not find substantive differences from predicting ∆X . By having all models predict ∆X as a target, this allows a fairer comparison by reusing the same target normalization.

heading: 4 EXPERIMENTAL TURBULENT DOMAINS
text: We use four PDEs exhibiting chaotic or turbulent dynamics representative of a wide range of problems across science and engineering. (Fig. 1b-e). These environments range from the classic problems (KS Equations, Incompressible Turbulence) to more challenging environments that incorporate compressibility and non-uniform initial conditions. The training data is generated at high resolution Spatial and temporal downsampling factors and additional details about the environments are shown in the Appendix.
1D Kuramoto-Sivashinsky Equation (KS-1D): A PDE that generates unstable, chaotic dynamics in 1D, solved using Fourier spectral method (Kuramoto, 1978; Sivashinsky, 1977). The state consists of a scalar velocity v per 1D grid point. While KS-1D is not technically turbulent, it is a well-studied chaotic equation that is useful for assessing the ability of our learned models to capture dynamics that are highly unstable and nonlinear.
2D Incompressible Decaying Turbulence (INCOMP-2D): Fluid flow modeled by Navier-Stokes in which small-scale eddies decay into large-scale structures due to the inverse energy cascade, solved using direct numerical simulation (Kochkov et al., 2021). The state consists of a vector velocity vx, vy per 2D grid point. These simulations are relevant to open questions in atmospheric dynamics (Boffetta & Ecke, 2012a).
3D Compressible Decaying Turbulence (COMPDECAY-3D): Decaying transonic turbulent flow under Navier-Stokes, assuming adiabatic equation of state with adiabatic index γ = 5/3. The state consists of scalar density ρ, vector velocity vx, vy, vz , and scalar pressure P per 3D grid point. Energy at each grid point isE = 1/2ρv2+3/2P . Simulations were carried out with Athena++ (Stone et al., 2020), a state-of-the-art simulator used in astrophysics. All real fluids are somewhat compressible, and this is particularly non-negligible when modeling gases (Pope, 2000). In astrophysics problems, for which the Athena++ was developed, understanding the properties of these flows plays a crucial role in regulating planet, star, black hole, and galaxy formation (Brandenburg & Nordlund, 2011).
3D Compressible Turbulence with Radiative Cooling Mixing Layer (COOLMIXLAYER-3D): Turbulent mixing resulting from the Kelvin-Helmholtz instability, caused by velocity differences across the interface between fluids of different densities, solved with Athena++. The state is specified in the same way as in COMPDECAY-3D. Mixing involves strong cooling, leading to net flow from the low-density phase into the mixing layer. This environment was additionally challenging because of its open boundaries and non-uniform initial conditions. This process is common in atmosheric flows as well as many aspects of galaxy formation (Fielding et al., 2020).

heading: 5 RESULTS
text: We evaluate the learned simulator models in terms of stability, performance, efficiency, and generalization. Unlike numerical solvers, which are PDE specific, learned simulator models can be designed to be reusable across domains. In Figure 1, we show that the same general-purpose architecture (Dil-ResNet) and loss, trained on each of the domains, learns to capture a range of qualitatively diverse turbulent dynamics across domains (Fig. 1b-e, videos: sites.google.com/view/learned-turbulencesimulators). All results are evaluated on held-out test trajectories sampled from the same distribution used for training (except for generalization sections). All units (except time) are normalized and therefore dimensionless.
Spatial coarsening Numerical solvers are known to lose information, particularly high-frequency information, when applied to coarse grids. We compared our Dilated ResNet (Dil-ResNet) learned simulator to Athena++ run on spatially coarsened grids (see Section 5 for comparison with other models). We chose the energy field E = 12ρv
2 + 32P as the quantitative metric of 3D turbulence for the main text, as it summarizes performance on all state variables. We show results for Athena++ run at resolutions of 323 (the same resolution as the learned models) and at 643 (higher resolution than the learned models, lower than the ground truth). The “ground truth” data is from Athena++ run at 1283. All grids are downsampled to 323 for comparison. We compared models in terms of the
3Note the reason that error rises and falls for this model is that COMPDECAY-3D is decaying turbulence. As time passes, the distribution becomes more uniform in space, resulting in lower error across models.
RMSE of the predicted Energy Field and the Log Energy Spectrum (See Appendix for definition). We used the energy field as the main variable as it is a combination of all five state variables, but see Videos and Appendix for per-variable results.
The learned simulator outperforms the comparable resolution Athena++ 323 across a variety of metrics, despite having no built-in specializations for turbulent dynamics. In Figure 2a-b, we show RMSE for the Energy Field for t < 1, which corresponds to the initial phase of the turbulence decay seen during training (white window in Fig 2b). Energy Field is given as E = 12ρv
2 + 32P , and it summarizes performance on all state variables (other metrics are shown in the Appendix). The learned simulator outperforms both the same- and higher-resolution Athena++ rollouts in terms of the Log Energy Spectrum (Fig. 2c,d), as the Athena++ simulators lose high frequency components that the learned simulators preserve (Figure 2e-i). Log Energy Spectrum is computed by (1) taking the 3-D Fourier transform, (2) computing the amplitude of each component, (3) taking the histogram of the 3-D Fourier transform over frequency amplitude ( √ k2x + k 2 y + k 2 z) to get a 1-D PSD, and (4)
then taking the log. We looked at a range of other physically relevant metrics and find that learned simulator outperforms the comparably coarse 323 Athena++ but not 643 Athena++ on predicting feature histograms, the phase histograms (pressure v. density and entropy v. pressure), and mean squared error for each feature. The learned simulator outperformed both coarse versions of the Athena++ simulator on higher order velocity autocorrelations, as well as spectrum error. Since different scientific questions rely on different metrics, the tradeoffs of learned versus physics based simulators may vary across applications. These metrics are defined in the Appendix.
Stability and training noise While scientific simulators are typically designed to be stable over time, a common failure mode in learned models is that small errors can accumulate over rollouts and lead to a domain shift. One reason for this is that, as the model is fed its most recent prediction back in as input for predicting future steps, its distribution of input states begins to deviate from
that experienced at training, where it fails to generalize and can make arbitrarily poor predictions. We found that adding Gaussian noise σ = 0.01 to the inputs Xt during training led to less accurate one-step predictions (Fig. 3a), but more stable trajectories, which is of particular importance for models that take a very large number of small steps (Fig. 3b). This is presumably because the training distribution has broader support and the model is optimized to map deviant inputs back to the training distribution.
Temporal coarsening An advantage of learned simulators is that they can exploit a much larger step size than the numerical solver, as they can discover efficient updates that capture relevant dynamics on larger timescale. This allows for faster simulation. See Videos and Appendix for qualitative examples of Dil-ResNet trained on a large range of exponentially increasing coarse timesteps in KS-1D, INCOMP-2D and COMPDECAY-3D, which the model can adapt to (note that a separate model is trained for each ∆t). Quantitatively, though the one-step error is at its lowest when using smaller time steps (Fig. 3c), the rollout error has an optimal time step at around 0.032 (Fig. 3d). This demonstrates the tradeoff between large and small time steps. Large time steps (> 0.032) cause predicting the next state to become more challenging. Small time steps (< 0.008), which require more simulator steps, often yield unstable models because they provide more opportunities for errors to accumulate (Fig. 3d) (e.g. for some ∆t, 1s/∆t steps are required). However, they can still be stabilized to some extent with training noise (Fig. 3f).
Comparison across learned models In Figure 4 we compare the learned models in terms of the performance across the different primary turbulence datasets. We find that Dilated ResNet tends to be the top performing model, outperforming more specialized architectures, although most learned models were also able to provide a good qualitative match to the ground truth. We show in further detail the predictions of the different models in the Appendix and in the Videos. All models shown in Figure 4 are evaluated such that the first predicted step is the 7th step of the ground truth trajectory. This is to allow comparison with TF-Net, which takes C = 6 context states as input.
Running time Learned simulators can accelerate simulations not only by coarsening in time and space, but also by running off-the-shelf on specialized GPU hardware, unlike e.g., Athena++ which is currently CPU specific. By downsampling in time (∆t = 0.0005 → 0.032) and space (1283 → 323) the Dil-ResNet model trained on COMPDECAY-3D running on a single GPU speeds up the wall-clock simulation time by 1000x compared to Athena++ running on an 8-core CPU (further details in Appendix). GPU solvers can be developed for many applications and can greatly accelerate simulation; however, these can require a lot of expertise and time to develop, and will still require high spatial and temporal resolution grids.
Constraint satisfaction and preserved quantities Traditional solvers often implement constraints to preserve conserved quantities. Learned simulators, however, do not necessarily learn such constraints and may fail to capture these (see Appendix Figure). We found that training with noise prevents this in some cases: it helps Dil-ResNet keep the mean value of the KS-1D velocity, and the INCOMP-2D divergence bounded near zero. However, in COMPDECAY-3D using noise does not seem to help preventing the model from predicting drifts in total mass, vector momentum and energy, even though they are fixed across the whole dataset. We speculate this is because these preserved quantities only account for 5 degrees of freedom out of a 3D state that is made of 163840 (= 5 · 323) output variables.
Generalization to longer rollouts Dil-ResNet can stably unroll KS-1D for much longer than the trajectories seen in training. This is expected as the distribution of states is stationary in time (see Appendix). By contrast, the distribution of states in COMPDECAY-3D is not stationary in time, as the flow decays progressively into smaller and smaller structures. We can use this to construct a much more challenging generalization setting by training the Dil-ResNet on early stages of the decay only (t < 1), and testing on longer durations in which the turbulence develops further than ever observed during training. (1 < t < 4 in Fig. 2b, d). We find Dil-ResNet remains competitive with 323 Athena++ for turbulence that has decayed for up to twice longer t < 2 than observed during training.
Generalization to different initial conditions We varied the ratio of solenoidal to compressive components in the initial velocity field in COMPDECAY-3D (Fig. 5a) in order to test the models’ ability to generalize to novel initial conditions. Compared to Athena++ at 323 and 643, we found that the models generalize well to more solenoidal but not to more compressive initial conditions, possibly due to faster turbulence decay under compressive conditions4. We find that Dilated ResNet (with or without noise) has particular difficulty generalizing to the more compressive components. This is somewhat ameliorated with the added constraint to the loss function (Con-Dilated-ResNet). Results for other models are similar (see Appendix).
Generalization to larger boxes We tested the generalization capability of the Dilated ResNet model to COOLMIXLAYER-3D boxes with different size L in the x and y direction (the length along the vertical z axis perpendicular to the mixing layer remained constant). We quantified the predicted cooling velocity (small laminar flow in the low-density phase perpendicular to the interface, see Appendix for more details) which is of scientific relevance and known to depend on the box size. Specifically, for COOLMIXLAYER-3D, the dynamics undergo a transition when the box width increases relative to the cooling length,which is difficult to study because simulations for these widths essentially prohibitive. We found that unless Dil-ResNet is trained on a range of sizes, the predicted cooling velocity does not follow the right trend, and even when trained on a range of sizes, generalization beyond the training range is not reliable across seeds (Fig. 5b). We speculate
4Note the baseline error is expected to decrease for more compressive components due to faster decay.
that achieving this form of generalization would require either stronger inductive biases, more sophisticated dataset engineering, or both.

heading: 6 CONCLUSIONS
text: Learned simulation techniques have been advancing steadily in recent years. Our results demonstrate that learned simulators can outperform comparably coarse solvers in challenging turbulence settings on a range of scientifically relevant statistical measures, suggesting that state-of-the-art learned simulators can be useful for efficient, accurate simulation even in chaotic domains. Learned simulators can perform particularly well in terms of preserving high frequency information. The Dilated ResNet model had lower log Energy Spectrum RMSE than both 323 Athena++ and the higher resolutions 643 Athena++, and the RMSE remained lower even beyond the duration seen during training. In our experiments, we found that using training noise and temporal downsampling improved the stability and accuracy of extended rollouts.
Out-of-distribution generalization is a known challenge for learned simulations (Duraisamy et al., 2019) and for deep learning methods more generally, and we find that the coarse Athena++ models outperform the learned models on more extreme generalization conditions. However, we find certain architectural and training choices can make learned models more robust. In particular, physically informed constraints (e.g., Con-Dil-ResNet and Con-TF-Net), and different choices in convolutional architectures improved generalization to different initial conditions to some extent. We further found that, for COOLMIXLAYER-3D, augmenting the training data with a larger range of box sizes improved generalization performance to an even larger range. Future work should explore methods from other areas of deep learning for improving adversarial robustness and domain generalization, such as feature denoising (Xie et al., 2019) and discriminative objectives (Tzeng et al., 2017; Lample et al., 2017).
More broadly, we conclude that a key potential role for learned simulators in the near term is distilling expensive, high-resolution engineered simulators into low-resolution algorithms to strike better performance-versus-efficiency tradeoffs than low-resolution engineered simulators. Our Dilated ResNet, which used minimal inductive biases rooted in physics, could be applied effectively to diverse and challenging environments, which suggests that even generic CNN-based models may apply well to a wide range of physical domains which can be represented as grids.

heading: A APPENDIX

heading: B ADDITIONAL MODEL DETAILS
text: Encode-U-Net-Decode (U-Net) We designed this architecture as a simplification of the TF-Net baseline explained below. It uses a simple linear CNN encoder and decoder (same as Dil-ResNet) and a standard U-Net block (Ronneberger et al., 2015). The standard U-Net block consists of 7 layers. The first 3 layers each consist of a CNN stack followed by a factor-of-2 downsampling via striding the input. The fourth layer of the U-Net is another CNN stack, which at this point operates over a grid that is 8 times smaller than the input along each spatial axis. The last 3 layers each consist of a factor-of-2 upsampling using nearest neighbors, concatenation with the output of one of the first three layers (in reverse), and another CNN stack. This downsampling/upsampling process allows long-range communication similar to the Dilated ResNet, while also preserving local structure. As in (Ronneberger et al., 2015), each CNN stack is made of 3 CNNs, followed by activations. Other hyperparameters of the U-Net also matched those used in (Ronneberger et al., 2015).
Turbulent Flow Net (TF-Net) (Wang et al., 2020) TF-Net uses a domain-specific variation of U-Nets to model turbulence, along with other architectural domain-specific elements inspired by RANS-LES Hybrid Coupling in the encoder. The model implements a custom encoder by taking a sequence of the most recent C = 6 states as inputs, and uses this to build three separate input arrays, by applying specific combinations of learned spatial filters, learned temporal filters, and differences
of those. Each of these components are processed by a separate U-Net encoder (first 4 layers of the U-Net), then the latent outputs of each layer are concatenated and fed into a shared U-Net decoder (final 3 layers). Hyperparameters also matched those used in (Ronneberger et al., 2015; Wang et al., 2020).
Constrained Turbulent Flow Net (Con-TF-Net) (Wang et al., 2020) Wang et al. also explored a constraint term in the loss which penalizes the divergence, which was constrained to be zero everywhere for the PDE in their incompressible turbulence experiments. We implemented a similar model, adapting the constrained function to match either constraints or preserved quantities in our datasets. For KS-1D, the mean is constrained to be 0; for INCOMP-2D, the divergence is constrained to be 0, and for COMPDECAY-3D the total energy is constrained to be the same as the total energy of the input.
Constrained Dilated ResNet (Con-Dil-ResNet) This model is Dil-ResNet (described above) with the additional constraint terms from (Con-TF-Net) added to the loss function. This allows us to examine the effect of the loss term separately from the other aspects of the TF-Net architecture.
Fourier Neural Operator (FNO) (Li et al., 2020a) This model uses the neural operator formalism introduced in earlier work (Li et al., 2020c;b), applied in the Fourier domain. This model applies matrix multiplications in the Fourier-transformed grid with complex weights learned independently for each component, as well as linear updates The model combines pixel-wise learned linear embeddings in the spatial domain The model combines learned linear layers, applied to each point of the spatial grid separately, with matrix multiplication on the Fourier-transformed grid using learned weights. A unique matrix of weights is learned for point in the Fourier grid. Low-pass filtering is optionally implemented by truncating all but K modes along each dimension in the Fourier-transformed grid. The authors explored using a version of the model that takes a stack of past states as input. Since the state is fully-Markov, we opted for the version of the model that takes a single state as input as it is more comparable to the majority of the other models. Unlike previous models, which rely on spatially local convolutions and depth for long-range communication, this model applies long-range communication at every step in the Fourier domain. We implemented this model for 1D and 2D spatial domains as in (Li et al., 2020a).
We found difficulties running this model on the 3D datasets due to compute and memory constraints. We speculate this is due to time and space complexity of the Fourier transform (when taking into account the backwards pass) which would probably require a custom gradient re-materialization strategy. This may be specific to TensorFlow which required us to reimplement the non-differentiable tf.signal.rfft3d as a sequence of tf.signal.rfft2d and tf.signal.fft.
B.1 ADDITIONAL DATASET DETAILS
B.1.1 1D KURAMOTO-SIVASHINSKY (KS) EQUATION
This is a well-studied 1D PDE that generates unstable, chaotic dynamics in 1 dimension (Kuramoto, 1978; Sivashinsky, 1977) with periodic boundaries. The ground truth simulations are computed using the Fourier Spectral Method. Initial condition was set to cos (w1x+ φ1)(1+sin (w2x+ φ2)), where x ranges from 0 to 2π, φi are sampled uniformly from [0, 2π), and w1 are integers sampled uniformly from [1, 12). We perform a warmup from this initial condition for 75 simulation time units.
B.1.2 2D INCOMPRESSIBLE DECAYING TURBULENCE
This models fluid flow described by the Navier-Stokes equations in which small-scale eddies decay into the large-scale structures due to the inverse energy cascade (Boffetta & Ecke, 2012b). The underlying simulations were performed by solving the incompressible Navier-Stokes equations using a direct numerical simulation (DNS) finite-volume solver. Boundaries along both dimensions are periodic, and the initial conditions consist of random velocity fields with small-scale variation. Initial conditions for different trajectories were obtained by sampling a high-resolution velocity field from a log-normal distribution of amplitude 1 and wavenumber k = 10. We perform a warmup for 500 simulation time units, this is done to discard the transient flow that is heavily influenced by the underlying numerical scheme.
Compressible KS Equation Incompressible Compressible Radiative Cooling
B.1.3 3D COMPRESSIBLE DECAYING TURBULENCE
This models decaying transonic Navier-Stokes turbulent flow in a 3D cubic box with periodic boundary conditions (e.g., Orszag & Patterson, 1972). These simulations adopt an adiabatic equation of state with a constant adiabatic index γ = 5/3. Simulations were carried out with Athena++ (Stone et al., 2020). The initial turbulence is driven on scales ≥ L, the size of the box. The turbulent driving pattern in the initial condition is split into its compressive and solenoidal components using a Helmholtz decomposition. The relative strength of these two components is varied from purely compressive to purely solenoidal. The initial driving pattern results in a root-mean-squared velocity of √
2cs, where c2s = (5/3)(P/ρ) is the sound speed of the fluid. The initial conditions are varied across trajectories by randomizing the phase of the spectral components, leading to different pattern in real space. We perform a warmup for 0.05 simulation time units. Compressible turbulence is ubiquitous across problems in science: all fluids are somewhat compressible, and this is usually nonnegligible when modeling gases (Pope, 2000). In astrophysics problems, for which the Athena++ was specifically developed, understanding the dynamics and properties of these flows on small
and large scales plays a crucial role in regulating planet, star, black hole, and galaxy formation (Brandenburg & Nordlund, 2011).
B.1.4 3D COMPRESSIBLE RADIATIVE COOLING MIXING LAYER DYNAMICS
These simulations model the interplay of radiative cooling and mixing that results from turbulence driven by the Kelvin-Helmholtz instability, which can arise when there is velocity difference across the interface between two fluids of different densities. The simulations are set up as a boundary problem initialized with a low-density fluid (ρ = 0.01) on the top half of the domain (z > 0) moving in the positive x direction (vx = 2.04, vy = vz = 0), and a high-density fluid (ρ = 1.) moving in the negative x direction in the bottom half of the domain (vx = −2.04, vy = vz = 0). The initial pressure is set to 1. The boundary conditions are periodic in both x and y, and fixed in z. To break the symmetry, small perturbations to vz are added along the boundary. These perturbations are changed across trajectories by randomizing the phase of the spectral components, leading to different patterns in real space. We perform a warmup for 2.32 simulation time units. Simulations were carried out with Athena++ (Stone et al., 2020).
This data presents a few unique challenges compared to the others. First, it was the only domain with fixed boundary conditions. Second, because turbulent dynamics are limited to the vicinity of the mixing layer, and because the behavior of the fluid above, at, and below the mixing layer is markedly different, there is less data representative of each type of fluid dynamic behavior.
B.2 ADDITIONAL MODEL DETAILS
The learned simulator consisted of a CNN encoder, a dilated CNN processor with residual skip connections, and a CNN decoder. The parameters of the model are listed in Table A.1.
CNN parameters All individual CNNs use a kernel size of 3 and have 48 output channels (except the decoder, which has an output channel for each feature). Each individual CNN layer in the processor is immediately followed by a rectified linear unit (ReLU) activation function. The Encoder CNN and the Decoder CNNs do not use activations.
Dilated connections The dilation rate in the CNN filter introduces space between each element in the filter. Whereas a standard CNN filter with kernel 3 would operate over 3 adjacent pixels, a dilated CNN filter with kernel 3 and dilation 2 will operate over 3 pixels spaced at intervals of 2 in each dimension, spanning a field 5 pixels wide. This increases the scale of the CNN kernels while preserving the number of parameters and the resolution.
CNN padding For each dimension in X with periodic boundary conditions, we implemented periodic padding. For dimensions with a fixed boundary condition, we forced the boundary to a value rather than letting the model predict it, and masked the loss so the model was not trained to predict boundary conditions. The tensor was padded with repetitions of the boundary value. We also augmented the input state with a feature that indicated fixed-boundary versus non-boundary states using a one-hot vector, so the model could distinguish them.
B.3 ADDITIONAL TRAINING DETAILS
Training noise In some cases, we trained with Gaussian random noise with fixed variance σ added to the input Xt of the loss function. Note that this not only affects the input to the neural network, but also slightly modifies the target ∆X = Xt+∆t−Xt (and also impacts the variance used to normalize targets).
Loss At training time we sample pairs of input-output states (separated by the model time step) from the trajectories, and perform gradient updates based on a single step of the model. We do not rollout the model during training.
Optimization We optimized the loss using an Adam optimizer. We trained the models for up to 10M steps, with exponential learning rate decay annealed from 1e− 4 to 1e− 7 in the first 6M steps.
Models usually reached convergence at around 5M steps. Training took up to a week on an NVIDIA V100 GPU.
Hyper-parameter optimization We did not perform exhaustive hyper-parameter optimization, except on the scale of the noise (which we scanned for each domain) and some informal tuning of the depth of the dilated blocks and latent size (to make sure the network had enough capacity for the most challenging domain). Note that achieving optimal performance on test trajectories from the training distribution was not part of the scope of this work, and there are likely hyperparameters that would improve performance over our results.
Validation All of the research was performed by looking at performance on the validation sets. The test set was completely held-out until final evaluation prior to writing the paper.
Early stopping For the Mixing Layer Turbulence (COOLMIXLAYER-3D), which was more prone to overfitting, we used early stopping based on the validation performance. For all other models we simply evaluated the model as it was at the end of training.
B.4 ADDITIONAL RESULTS
Three instances of each model were trained 3 times using 3 different initialization seeds. Bar plots indicate median performance and bars indicate min-max performance. We chose the energy field E = 12ρv
2 + 32P as the quantitative metric of 3D turbulence for the main text, as it summarizes performance on all state variables.
Figures and videos for 3D environments (COOLMIXLAYER-3D and COMPDECAY-3D) show a single slice of the 3D grid at y = 0, displaying the x and z coordinates in the horizontal and vertical axis, respectively.
Downsampling in time Fig. B.6 as well as Videos show models for KS-1D, INCOMP-2D, and COMPDECAY-3D models trained and working well on a wide range of time step sizes. Note that for a fair comparison in Fig. 3d,f performance is averaged across only time steps that are predicted for all models (e.g. multiples of the largest time step, 256).
Downsampling in space All comparisons across spatial resolutions are always obtained by first downsampling the data into a common 323 grid, using an approach that preserves mass, momentum, and energy (Same approach used by Athena++). Fig. B.2 (top row) shows the downsampling comparisons equivalent to Fig. 2g-i for each of the state variables independently.
Running time For 1 simulation time unit of COMPDECAY-3D, the CPU runtime for Athena++ with 8 CPU processors is ∼4s, ∼60s, and ∼1000s for 323, 643, and 1283 resolutions, respectively (quartic scaling, as the time step is also scaled with the resolution to compensate for numerical viscosity). In comparison, the learned model’s runtime is 1s on an NVIDIA V100 GPU, and 20-30s on a 8-core CPU. Note that the learned model runs at reduced spatial and temporal resolution, but preserves the dynamics of the high resolution 1283 Athena++ simulation. Simulations in Athena++ may be faster if implemented for GPUs. However, because scientific simulators like Athena++ are specialized, each simulator’s GPU implementation requires specialized engineering effort, whereas learned models can take advantage of methods designed more generally for deep learning.
Cooling velocity Having reliable models that generalize to larger boxes increases the applicability of learned models to scientific domains by enabling experiments in regions of parameter space that would otherwise be prohibitively expensive to simulate. For example, for COOLMIXLAYER3D, the dynamics undergo a transition when the box width increases relative to the cooling length (vturbtcool), which is difficult to study because simulations for these widths essentially prohibitive. Thus, we want to understand what affects the learned simulator’s ability to generalize to a range of box widths (the length Lx and width Ly of the input tensor X) not previously seen in the training data. For COOLMIXLAYER-3D, we can look at the cooling velocity, the average inflowing velocity at the low density fluid boundary that develops as a means to resupply the energy
that has been radiated away in the mixing layer. Cooling velocity is a useful metric because it is a scalar quantity that depends on the box width. Furthermore, understanding how turbulent dynamics at a mixing layer pull heat from the surroundings is scientifically relevant for questions in astrophysics (Fielding et al., 2020). We evaluate generalization to different box sizes (Lx = Ly ∈ [0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0]) (Fig. 5b). We find that the model trained on box length Lx = Ly = 0.75 (orange) is not able to produce trajectories with the correct cooling velocity for other box sizes. However, we also find that augmenting the dataset with data from a range of box sizes (Lx = Ly ∈ [0.5, 0.75, 1.0, 1.25]) improves accuracy of the cooling velocity estimate for the unseen box lengths, although the generalization outside the training domain remains imperfect and unreliable across seeds. We speculate that achieving this form of generalization would require stronger inductive biases and/or more sophisticated dataset engineering.
Other Statistical Metrics The choice of metrics can impact the utility of learned simulators for scientific applications. Here we describe a few physically motivated metrics we use to evaluate the learned models.
We use the power spectral density, which we quantify for the total energy in Figure 2, to quantify how well the different models are preserving information at different resolutions. Simulators at coarse resolution are known to lose high-frequency information, and we are specifically interested understanding how learned and physics-based simulators compare in terms of preserving detailed, high-frequency components. To quantify the power spectral density, we n-D Fourier transform, take the magnitude at each point of the Fourier transformed signal to get the n-D PSD, and convert this to a 1D spectrum by taking the mean magnitude over points in the n-D frequency grid with the same frequency vector length to get a 1D power spectral density PSD(k) over a scalar frequency k = √∑ k2xi for spatial dimensions xi . Frequencies with a vector of length > 1 (the length of the environment along 1 dimension) are cutoff, leaving only frequencies that fall within the sphere of radius 1. We plot log PSD and compute spectrum error over these frequencies. The spectra for different state variables are shown in Figure B.1 for the coarsened Athena++ models and DilResNet, and in Figure B.3 for the learned models. The error over time for the spectra is shown in Figures B.2 and B.2.
The probability distribution functions (PDFs) of the fluid quantities provides an important basis for understanding turbulent flows. Due to the inherently chaotic nature of turbulence, statistical measures are often the most robust measures of their properties. The shape and widths of PDFs are common metrics for characterizing turbulent flows(Federrath & Klessen, 2012). Moreover, joint PDFs of fluid quantities (e.g., velocity-temperature, or pressure-entropy) are used to understand more complex flow behavior and to characterize which flow components are responsible for observed behavior (Fielding et al., 2020). Joint distribution functions are often especially useful when certain physical processes only take place in specific region of phase space (e.g., combustion or radiative cooling). PDFs for different state variables and joint distributions (entropy v. pressure, density v. pressure) are shown in Figure B.1 for the coarsened Athena++ models and Dil-ResNet, and in Figure B.3 for the learned models. The error over time for these statistics is shown in Figures B.2 and B.2.
Another measure of interest are spatial autocorrelation measures, particularly velocity autocorrelation. Like the histograms, these capture statistical structure and provide a metric that is more invariant to the chaotic behavior of turbulence. The pth order autocorrelation is closely related to the velocity structure function, Sp(`) = Er,u,‖u‖=1[‖vr+`u − vr‖ p ], for velocity v, defined at a position vector r (e.g., vr), with unit vector u multiplied by a scalar `. Seminal self-similarity arguments that underpin turbulent theory lead to the prediction that Sp(`) ∝ `p/3 (Kolmogorov, 1941; Frisch, 1995). Structure and autocorrelation functions, therefore, provide important measures on the ability of learned simulators to capture subtle, but scientifically essential properties of turbulent flows. Firstand second-order autocorrelation functions for different state variables are shown in Figure B.1 for the coarsened Athena++ models and the Dil-ResNet model and Figure B.3 for all models trained on COMPDECAY-3D. The error for each of these functions over time are shown in Figures B.2 and B.4.
Model comparison Fig. B.7 shows predicted rollouts for KS-1D of different learned models presented in Figure 4a. Fig. B.3 shows statistics of the final frame of the predicted rollouts for different learned models presented in Figure 4. The error of each of these statistics over time is shown in Fig. B.4. Videos show the rolled out predictions for different models for INCOMP-2D and COMPDECAY-3D.
KS-1D generalization Figs. B.8 and B.9 show generalization to larger domains and longer trajectories. While the learned simulations do not perfectly capture the ground truth, we see that qualitative features of turbulence are preserved across the rollout.
COMPDECAY-3D generalization Figs. B.8 and B.9 show quantitative generalization performance of the Dil-ResNet model to larger domains and longer trajectories on KS-1D. While the learned simulations do not perfectly capture the ground truth, we see that qualitative features of turbulence are preserved across the rollout. Figures B.2 and B.4 show different metrics for different variables across rollout (pink background indicates the region not seen during training). Videos show the predicted rollouts when generalizing to different initial conditions and to longer rollouts.

Review summaries:
The authors evaluate some different architectures of neural nets for learning turbulence. They showcase the results for four different systems and in terms of several metrics. The main conclusion is that a learned simulator can indeed be good even for turbulence and possibly improved with additional mechanisms such as additional noise and constraints.

This paper present a  neural network-based model by training learned simulators at low spatial and temporal resolutions to capture turbulent dynamics generated at high resolution. It also shows that the proposed model can simulate turbulent dynamics more accurately than classical numerical solvers at the same low resolutions across various scientifically relevant metrics. Finally, a series of numerical examples including one-dimensional, two-dimensional, and three-dimensional nonlinear equations are used to demonstrate the feasibility of the algorithm. I reviewed this paper in NeurIPS 2021, which was titled “Learned Simulators for Astrophysical Turbulence”. The authors revised the paper based on previous reviews. Thanks for the efforts the authors have made.

This paper proposes a method to predict turbulent dynamics of coarse simulations. To achieve this, a modified ResNet architecture is proposed, which the authors call Dilated ResNet (dResNet). This dResNet is combined with an encoder/decoder model inspired by graph networks. Unfortunately, the details of this architecture are not made very clear, but I hope this is something the authors can adress in future revisions of their work. Beyond the proposed architecture, the paper presents an interesting range of test cases from 1D KS to 3D compressible turbulence.