Tutorials for Trixi.jl
The tutorial section for Trixi.jl also contains interactive step-by-step explanations via Binder.
Right now, you are using the classic documentation. The corresponding interactive notebooks can be opened in Binder and viewed in nbviewer via the icons and in the respective tutorial. You can also open the raw notebook files via .
Note: To improve responsiveness via caching, the notebooks are updated only once a week. They are only available for the latest stable release of Trixi.jl at the time of caching.
There are tutorials for the following topics:
1 First steps in Trixi.jl
This tutorial provides guidance for getting started with Trixi.jl, and Julia as well. It outlines the installation procedures for both Julia and Trixi.jl, the execution of Trixi.jl elixirs, the fundamental structure of a Trixi.jl setup, the visualization of results, and the development process for Trixi.jl.
2 Behind the scenes of a simulation setup
This tutorial will guide you through a simple Trixi.jl setup ("elixir"), giving an overview of what happens in the background during the initialization of a simulation. While the setup described herein does not cover all details, it involves relatively stable parts of Trixi.jl that are unlikely to undergo significant changes in the near future. The goal is to clarify some of the more fundamental, technical concepts that are applicable to a variety of (also more complex) configurations.s
3 Introduction to DG methods
This tutorial gives an introduction to discontinuous Galerkin (DG) methods with the example of the scalar linear advection equation in 1D. Starting with some theoretical explanations, we first implement a raw version of a discontinuous Galerkin spectral element method (DGSEM). Then, we will show how to use features of Trixi.jl to achieve the same result.
4 DGSEM with flux differencing
To improve stability often the flux differencing formulation of the DGSEM (split form) is used. We want to present the idea and formulation on a basic 1D level. Then, we show how this formulation can be implemented in Trixi.jl and analyse entropy conservation for two different flux combinations.
5 Shock capturing with flux differencing and stage limiter
Using the flux differencing formulation, a simple procedure to capture shocks is a hybrid blending of a high-order DG method and a low-order subcell finite volume (FV) method. We present the idea on a very basic level and show the implementation in Trixi.jl. Then, a positivity preserving limiter is explained and added to an exemplary simulation of the Sedov blast wave with the 2D compressible Euler equations.
6 Subcell limiting with the IDP Limiter
Trixi.jl features a subcell-wise limiting strategy utilizing an Invariant Domain-Preserving (IDP) approach. This IDP approach computes a blending factor that balances the high-order discontinuous Galerkin (DG) method with a low-order subcell finite volume (FV) method for each node within an element. This localized approach minimizes the application of dissipation, resulting in less limiting compared to the element-wise strategy. Additionally, the framework supports both local bounds, which are primarily used for shock capturing, and global bounds. The application of global bounds ensures the minimal necessary limiting to meet physical admissibility conditions, such as ensuring the non-negativity of variables.
7 Non-periodic boundary conditions
Thus far, all examples used periodic boundaries. In Trixi.jl, you can also set up a simulation with non-periodic boundaries. This tutorial presents the implementation of the classical Dirichlet boundary condition with a following example. Then, other non-periodic boundaries are mentioned.
8 DG schemes via DGMulti
solver
This tutorial is about the more general DG solver DGMulti
, introduced here. We are showing some examples for this solver, for instance with discretization nodes by Gauss or triangular elements. Moreover, we present a simple way to include pre-defined triangulate meshes for non-Cartesian domains using the package StartUpDG.jl.
9 Other SBP schemes (FD, CGSEM) via DGMulti
solver
Supplementary to the previous tutorial about DG schemes via the DGMulti
solver we now present the possibility for DGMulti
to use other SBP schemes via the package SummationByPartsOperators.jl. For instance, we show how to set up a finite differences (FD) scheme and a continuous Galerkin (CGSEM) method.
10 Upwind FD SBP schemes
General SBP schemes can not only be used via the DGMulti
solver but also with a general DG
solver. In particular, upwind finite difference SBP methods can be used together with the TreeMesh
. Similar to general SBP schemes in the DGMulti
framework, the interface is based on the package SummationByPartsOperators.jl.
11 Adding a new scalar conservation law
This tutorial explains how to add a new physics model using the example of the cubic conservation law. First, we define the equation using a struct
CubicEquation
and the physical flux. Then, the corresponding standard setup in Trixi.jl (mesh
, solver
, semi
and ode
) is implemented and the ODE problem is solved by OrdinaryDiffEq's solve
method.
12 Adding a non-conservative equation
In this part, another physics model is implemented, the nonconservative linear advection equation. We run two different simulations with different levels of refinement and compare the resulting errors.
13 Parabolic terms
This tutorial describes how parabolic terms are implemented in Trixi.jl, e.g., to solve the advection-diffusion equation.
14 Adding new parabolic terms
This tutorial describes how new parabolic terms can be implemented using Trixi.jl.
15 Adaptive mesh refinement
Adaptive mesh refinement (AMR) helps to increase the accuracy in sensitive or turbolent regions while not wasting resources for less interesting parts of the domain. This leads to much more efficient simulations. This tutorial presents the implementation strategy of AMR in Trixi.jl, including the use of different indicators and controllers.
16 Structured mesh with curvilinear mapping
In this tutorial, the use of Trixi.jl's structured curved mesh type StructuredMesh
is explained. We present the two basic option to initialize such a mesh. First, the curved domain boundaries of a circular cylinder are set by explicit boundary functions. Then, a fully curved mesh is defined by passing the transformation mapping.
17 Unstructured meshes with HOHQMesh.jl
The purpose of this tutorial is to demonstrate how to use the UnstructuredMesh2D
functionality of Trixi.jl. This begins by running and visualizing an available unstructured quadrilateral mesh example. Then, the tutorial will demonstrate how to conceptualize a problem with curved boundaries, generate a curvilinear mesh using the available HOHQMesh software in the Trixi.jl ecosystem, and then run a simulation using Trixi.jl on said mesh. In the end, the tutorial briefly explains how to simulate an example using AMR via P4estMesh
.
18 P4est mesh from gmsh
This tutorial describes how to obtain a P4estMesh
from an existing mesh generated by gmsh
or any other meshing software that can export to the Abaqus input .inp
format. The tutorial demonstrates how edges/faces can be associated with boundary conditions based on the physical nodesets.
19 Explicit time stepping
This tutorial is about time integration using OrdinaryDiffEq.jl. It explains how to use their algorithms and presents two types of time step choices - with error-based and CFL-based adaptive step size control.
20 Differentiable programming
This part deals with some basic differentiable programming topics. For example, a Jacobian, its eigenvalues and a curve of total energy (through the simulation) are calculated and plotted for a few semidiscretizations. Moreover, we calculate an example for propagating errors with Measurement.jl at the end.
21 Custom semidiscretization
This tutorial describes the semidiscretiations of Trixi.jl and explains how to extend them for custom tasks.
Examples in Trixi.jl
Trixi.jl already contains several more coding examples, the so-called elixirs
. You can find them in the folder examples/
. They are structured by the underlying mesh type and the respective number of spatial dimensions. The name of an elixir is composed of the underlying system of conservation equations (for instance advection
or euler
) and other special characteristics like the initial condition (e.g. gauss
, astro_jet
, blast_wave
) or the included simulation features (e.g. amr
, shockcapturing
).
This page was generated using Literate.jl.