Snapshot: Prediction of annual earth surface temperature with Fourier Neural Operator

Recently, a lot of research has been done on the development of Neural Operators. The aim is to map infinite-dimensional functions to infinite-dimensional functions with neural networks. One approach is the Fourier Neural Operator [1]. We use this model to estimate the annual temperature based on the global land-sea-ice distribution. The input of the neural network is the earth’s geography, the output is the global temperature over one year. The training and testing data set is generated with the simulation framework “Klimakoffer” (for more information see Snapshot: Numerical simulations of earth’s climate and [2]).

The best results are achieved when using 4 Fourier integral operator layers, 16 Fourier modes, and a network width of 20. The model thus has 52 433 557 trainable parameters. The remaining specifications are as chosen by Li et al. [1]. It took 4 hours and 26 minutes to train the model on an NVIDIA GeForce RTX 3090 GPU and 0.77 seconds to evaluate it for one given example on a CPU. A relative L2 loss of approximately 0.0025 was achieved during training.

The first video shows one exemplary output. The second animation visualizes the difference between the temperature calculated by the FNO model and the “true” temperature determined by the framework “Klimakoffer”.

References:
[1] Li, Z., Kovachki, N., Azizzadenesheli, K., Liu, B., Bhattacharya, K., Stuart, A., Anandkumar, A. (2020). “Fourier Neural Operator for Parametric Partial Differential Equations”, arXiv, https://arxiv.org/abs/2010.08895
[2] Zhuang, K., North, G.R., Stevens, Mark J. (2017). “A NetCDF version of the two-dimensional energy balance model based on the full multigrid algorithm”, SoftwareX

Thesis Snapshot: Bottom topography modelling for the shallow water equations in Trixi.jl (Master’s thesis by Maximilian Bertrand)

Back in the summer of 2021, severe floods struck Western Germany, resulting in several cities and villages being destroyed and hundreds of people losing their lives. Modelling and predicting those floods can be crucial for investigating such natural disasters. The shallow water equations are a system of physical conservation equations that can model water flow over a given domain. The two dimensional shallow water equations are given as follows:

\begin{equation*}
\left\{\begin{aligned}
\frac{\partial}{\partial t} h + \left( h v_1\right)_x + \left( h v_2\right)_y =0&\\
\frac{\partial}{\partial t} hv_1 + \left( hv_1^2 + \frac{1}{2} gh^2\right)_x + \left(h v_1v_2\right)_y &= -ghb_x\\
\frac{\partial}{\partial t}h v_2 + \left( hv_1v_2\right)_x + \left(hv_2^2 +\frac{1}{2} gh^2\right)_y &= -ghb_y
\end{aligned}\right.
\end{equation*}

Here the variable $b$ describes the underlying bottom topography function of the domain. As this system is set up of hyperbolic partial differential equations, we use the numerical solver Trixi.jl to approximate the solutions. This solver is part of the trixi-framework. Trixi.jl already implemented the shallow water equations but did not yet offer the functionality to include real-world topography data into the calculations. Therefore the add-on TrixiBottomTopography.jl has been included in the trixi-framework. This tool uses B-spline interpolation approaches to remodel the bottom topography function from real-world data, which is often given as elevation data at specific points. One example is the DGM1 data set which provides uniformly spaced elevation data of the whole German state of North Rhine-Westphalia. Using this data set and the functionalities implemented in Trixi.jl as well as TrixiBottomTopography.jl, we can simulate a dam break problem over a section of the Rhine river valley.

Snapshot: Dam break against a flexible structure with Smoothed Particle Hydrodynamics

To simulate elastic structures, we use a total Lagrangian SPH formulation [1].
We simulate a dam break against a flexible structure based on the setup given by [1].
For the fluid dynamics, a weakly-compressible Lagrangian SPH formulation with an artificial viscosity by Monaghan [2] and boundary force particles to model the tank [3] was used.
This animation shows the simulation in 0.1x real time with 8.7k fluid particles and 455 particles to model the flexible structure.

References:
[1] O’Connor, J., Rogers, B. D. (2021). “A fluid–structure interaction model for free-surface flows and flexible structures using smoothed particle hydrodynamics on a GPU.” In: Journal of Fluids and Structures, 104. https://doi.org/10.1016/J.JFLUIDSTRUCTS.2021.103312
[2] Monaghan, J. J. (1989). “On the Problem of Penetration in Particle Methods”. In: Journal of Computational Physics, 82(1), 1–15. https://doi.org/10.1016/0021-9991(89)90032-6
[3] Monaghan, J. J., & Kajtar, J. B. (2009). “SPH particle boundary forces for arbitrary boundaries”. In: Computer Physics Communications, 180(10), 1811–1820. https://doi.org/10.1016/j.cpc.2009.05.008

Snapshot: High Mach number Kelvin-Helmholtz instability with DG and subcell positivity limiter

We solve the compressible Euler equations of gas dynamics with a fourth-order accurate entropy-stable discontinuous Galerkin (DG) method and combine it with a first-order accurate finite volume (FV) method at the node level to impose positivity of density and pressure [1,2].
The initial condition of this problem is given by:
\[
\begin{array}{rlrl}
\rho (t=0) &= \frac{1}{2}
+ \frac{3}{4} B,
&
p (t=0) &= 0.1, \\
v_1 (t=0) &= \frac{1}{2} \left( B-1 \right),
&
v_2 (t=0) &= \frac{1}{10} \sin(2 \pi x),
\end{array}
\]
with $B=\tanh \left( 15 y + 7.5 \right) – \tanh(15y-7.5)$, where $\rho$ is the density, $\vec{v}=(v_1,v_2)$ is the velocity, and $p$ is the pressure.

The video shows the evolution of the density in time using $1024^2$ and degrees of freedom. We use the entropy-conservative and kinetic energy preserving flux of Ranocha [3] for the volume fluxes and the Rusanov solver for the surface fluxes of the DG and FV methods. During this simulation, the FV method acts on average in 0.000086% of the computational domain, and never more than 0.002% of the computational domain at a specific time.

References
[1] A. M. Rueda-Ramírez, G. J. Gassner, A Subcell Finite Volume Positivity-Preserving Limiter for DGSEM Discretizations of the Euler Equations, WCCM-ECCOMAS2020, pp. 1–12.
[2] A. M. Rueda-Ramírez, W. Pazner, G. J. Gassner, Subcell limiting strategies for discontinuous galerkin spectral element methods, Computers & Fluids 247 (2022) 105627.
[3] H. Ranocha, Generalised summation-by-parts operators and entropy stability of numerical methods for hyperbolic balance laws, Cuvillier Verlag, 2018.

Snapshot: Multi-component magneto-hydrodynamics simulations with a bounds-preserving discontinuous Galerkin method

We solve the multi-component magneto-hydrodynamics (MHD) equations using a hybrid finite volume (FV)/discontinuous Galerkin (DG) method [1], which combines the two discretization approaches at the node level. To test the robustness of the hybrid FV/DG method, we compute a modification of the Orszag-Tang vortex problem [2], where we use two ion species and initialize the flow with a sharp interface at $y=0$:
\[
\begin{array}{rlrl}
\rho^1(x,y,t=0) &= \begin{cases}
{25}/{36 \pi} & y \ge 0 \\
10^{-8} & y < 0
\end{cases} ,
&\rho^2(x,y,t=0) &= \begin{cases}
10^{-8} & y < 0\\
{25}/{36 \pi} & y \ge 0
\end{cases} , \\
v_1 (x,y,t=0) &= – \sin (2 \pi y),
&v_2 (x,y,t=0) &= \sin (2 \pi x), \\
B_1 (x,y,t=0) &= -\frac{1}{\sqrt{4 \pi}} \sin (2 \pi y),
&B_2 (x,y,t=0) &= -\frac{1}{\sqrt{4 \pi}} \sin (4 \pi x). \\
p (x,y,t=0) &= \frac{5}{12 \pi},
& & \\
\end{array}
\]
where $\rho^1$ is the density of the first ion species, $\rho^2$ is the density of the second ion species,$\vec{v}=(v_1,v_2)$ is the plasma velocity, $\vec{B}=(B_1,B_2)$ is the magnetic field, and $p$ is the plasma pressure (without magnetic pressure).
 
The fourth-order DG method delivers high accuracy, but fails to describe shocks and material interfaces. Therefore, we use a modal indicator [3] to detect the elements where the solution changes abruptly. In those elements, we combine the DG method with a robust lower order FV scheme locally (at the node level) to impose TVD-like conditions on the density of the ion species,
\[
\min_{k \in \mathcal{N} (j)} {\rho}^{i,\mathrm{FV}}_{k}
\le \rho^i_{j} \le
\max_{k \in \mathcal{N} (j)} {\rho}^{i,\mathrm{FV}}_{k},
\]
and a local minimum principle on the specific entropy,
\[
s({\mathbf{u}}_{j}) \ge \min_{k \in \mathcal{N} (j)} s(\mathbf{u}^{\mathrm{FV}}_{k}),.
\]
where $\mathcal{N} (j)$ denotes the collection of nodes in the low-order stencil of each node $j$.
 
The video shows the total density ($\rho=\rho^1+\rho^2$), the density of the first ion species ($\rho^1$), and the so-called blending coefficient ($\alpha$) for the combination of a fourth-order accurate entropy stable DG method with first- and second-order accurate FV methods (Rusanov solver) and $1024^2$ degrees of freedom. A blending coefficient $\alpha=0$ means that only the DG is being used, and a blending coefficient $\alpha=1$ means that only the FV method is being used. The example shows that the hybrid FV/DG scheme is able to capture the shocks of the simulation correctly, deal with near-vacuum conditions and sharp interfaces.

[1] Rueda-Ramírez, A. M.; Pazner, W., & Gassner, G. J. (2022). Subcell limiting strategies for discontinuous Galerkin spectral element methods. Computers & Fluids. arXiv:2202.00576.
[2] Orszag, S.; Tang, C (1979). Small-scale structure of two-dimensional magnetohydrodynamic turbulence. Journal of Fluid Mechanics.
[3] Persson, P. O.; Peraire, J. (2006). Sub-cell shock capturing for discontinuous Galerkin methods. In 44th AIAA Aerospace Sciences Meeting and Exhibit (p. 112).

Snapshot: Dam break simulation with Smoothed Particle Hydrodynamics

To study the Smoothed Particle Hydrodynamics method, we simulate a dam break based on the setup given by [1].
We use a weakly-compressible Lagrangian SPH formulation with an artificial viscosity by Monaghan [2] and boundary force particles to model the tank [3].

This animation shows the simulation in 0.5x real time with 125k fluid particles and 7k boundary particles.

References:
[1] Marrone, S., Antuono, M., Colagrossi, A., Colicchio, G., le Touzé, D., & Graziani, G. (2011). “δ-SPH model for simulating violent impact flows”. In: Computer Methods in Applied Mechanics and Engineering, 200(13–16), 1526–1542. https://doi.org/10.1016/J.CMA.2010.12.016
[2] Monaghan, J. J. (1989). “On the Problem of Penetration in Particle Methods”. In: Journal of Computational Physics, 82(1), 1–15. https://doi.org/10.1016/0021-9991(89)90032-6
[3] Monaghan, J. J., & Kajtar, J. B. (2009). “SPH particle boundary forces for arbitrary boundaries”. In: Computer Physics Communications, 180(10), 1811–1820. https://doi.org/10.1016/j.cpc.2009.05.008

Snapshot: Chaotic behavior of the Kelvin-Helmholtz Instability

We investigate the Kelvin-Helmholtz instability setup of Fjordholm et al. [1], where the sharp interface in the initial condition is randomly perturbed. The simulation is done with an entropy stable DGSEM with polynomial degree N=3 and 32 x 32 grid cells. The final time is t = 2.0. Trixi.jl [2] is used with the setup found in examples/tree_2d_dgsem/elixir_euler_kelvin_helmholtz_instability_fjordholm_etal.jl.

The following gif is showing 100 simulation results of the density distribution for different random interface perturbations:

Here is the average density distribution of all 100 results:

[1] Ulrik S. Fjordholm, Roger Käppeli, Siddhartha Mishra, Eitan Tadmor. Construction of approximate entropy measure valued solutions for hyperbolic systems of conservation laws, 2014. (https://arxiv.org/abs/1402.0909)
[2] Trixi.jl, a numerical simulation framework for hyperbolic conservation laws written in Julia. (https://github.com/trixi-framework/Trixi.jl)

Thesis Snapshot: Planning of collision-free trajectories for UAVs and optimization using uniform B-splines. (Bachelor thesis by Alexander Bast)

Autonomous vehicles will be an integral part of our environment and will have a significant impact on transportation and other industries. In this context, drones, so-called UAVs will be used for aerial transportation. Due to the high information density, motion planning is a fundamental problem in the autonomous movement of vehicles.
In the future, drones should transport goods or perhaps people in a fast, safe and thus collision-free manner. In doing so, the drone should be able to perform all calculations quickly, accurately and autonomously. Therefore, it makes sense to develop algorithms that meet these requirements.
As part of a bachelor thesis, a method [1] was investigated that uses uniform B-splines to replan a drone’s trajectory in the presence of a potential collision. This method formulates the task of replanning the trajectory as the solution to a non-linear optimization problem.
\begin{align*}
E=\lambda_{ep}(p(t_{ep})-p_{ep})^{2}+\lambda_{ep}(p'(t_{ep})-p’_{ep})^{2} + \lambda_{c} \int_{t_{min}}^{t_{max}}c(p(t))||p'(t)||dt + \sum_{i=2}^{4}\int_{t_{min}}^{t_{max}}\lambda_{q}(p^{(i)}(t))^{2}dt
\end{align*}
With this simplified equation, three cost terms are considered: Endpoint error, collision cost and quadratic derivative cost. With the goal of computing an efficient and collision-free trajectory, an iterative process is used to construct a B-spline curve such that it follows a pre-planned and optimal trajectory. The focus of the analysis was on the selection of the control parameters λep, λc, λq, as well as the number of control points to be optimized and the resulting properties of the optimized trajectory. Using a uniform knot vector, the B-spline is expanded to include control points whose spatial coordinates are determined using nonlinear optimization so that the objective function is minimized. Due to the properties of B-splines, upcoming segments can be locally optimized so that a collision is prevented. The use of a uniform knot vector allows an efficient replanning of the trajectory in real time, which can be performed autonomously by a drone. The following figure shows one result.

[1] Vladyslav Usenko, Lukas von Stumberg, Andrej Pangercic, Daniel Cremers, Real-Time Trajectory Replanning for MAVs using Uniform B-splines and a 3D Circular Buffer, Technical University of Munich, 2017, https://arxiv.org/abs/1703.01416.

Thesis Snapshot: The effect of sea ice seasonality on the two-dimensional energy balance model ‘Klimakoffer’ (Bachelor thesis by Xenia Ibach)

In a previous snapshot, the two-dimensional energy balance model has been already presented:\begin{align*}
C(\hat{r})\frac{\partial T(\hat{r},t)}{\partial t} +A+BT(\hat{r},t)= \nabla\cdot(D(\hat{r})\nabla T(\hat{r},t)) + QS(\hat{r},t)(1-a(\hat{r}))
\end{align*}
The model is based on the assumption of a static surface distribution of the surface types land, ocean, sea ice and snow. However, climate change at an increasing rate is also affecting surface types seasonally as well as permanently over the years. Melting ice and snow masses worldwide are a consequence of this, affecting not only snow and sea ice distribution, but also that of oceans and land surfaces through rising sea ice levels.
Therefore, for more accurate climate modeling with this EBM, it is interesting to modify the model with respect to a time-dependent surface distribution. This modification directly affects the model parameters albedo, solar forcing, and heat capacity, requiring the following reformulation of the model:
\begin{align*}
C(\hat{r},t)\frac{\partial T(\hat{r},t)}{\partial t} +A+BT(\hat{r},t)= \nabla\cdot(D(\hat{r})\nabla T(\hat{r},t)) + QS(\hat{r},t)(1-a(\hat{r},t))
\end{align*}
As part of a bachelor’s thesis, two options were presented for introducing a seasonal sea ice distribution into the EBM by using and modifying simulations from the ‘Klimakoffer‘. Similar approaches are also conceivable for the other surface types.
One possibility is to process documented measurements of sea ice distribution, available for example from institutions such as the NSIDC (National Snow and Sea Ice Data Center) or NASA, so that a monthly change in sea ice distribution at the edge of the sea ice extent at the two poles can be mapped using a specially developed algorithm.

A second option is to directly read in satellite images and categorize the color values of the image’s pixels and map them to the surface types required in the EBM. Here, as an example, a satellite image of the Blue Marble series from 2004 of NASA was read in and categorized on the basis of the color values to the different surface types.

Image from NASA’s Blue Marble Next Generation [3]


[1] North, G.R.; Mengel, J.G.; Short, D.A. (1983). Simple Energy Balance Model Resolving the Seasons and the Continents’ Application to the Astronomical Theory of the Ice Ages. Journal of Geophysical Research.
[2] Zhuang, K.; North, G.R.; Stevens, Mark J. (2017). A NetCDF version of the two-dimensional energy balance model based on the full multigrid algorithm. SoftwareX.
[3] EOS Project Science Office at NASA Goddard Space Flight Center, Blue Marble Next Generation, 2004, https://visibleearth.nasa.gov/collection/1484/blue-marble.

Snapshot: A high order detonation diffraction simulation with reactive Euler equations

We show a detonation diffraction simulation with multiple obstacles in a reflective box using reactive multicomponent Euler equations with Trixi.jl. These kind of detonation waves may result in pressure and density drops close to zero which is numerically difficult not only but especially for high order schemes.

In this simulation we use a reacting model which consists of one reaction and two species. This example has been calculated using the high order DG-FV blending method in Trixi.jl with a HOHQMesh generated mesh whereas the chemical network is solved with KROME.

(Note: Not all of these features are currently available in the main code of Trixi.jl.)