Skip to content
Snippets Groups Projects
To learn more about this project, read the wiki.

Examples

To get started with DuMux, we recommend the following documented examples. Each example folder contains a ready-to-use DuMux simulation example. The description in each folder (best viewed online by following the link) explains each line of the code example.

📂 Example 1: One-phase flow and tracer transport

In this example, we simulate tracer transport through a confined aquifer with a randomly distributed permeability field. We first solve the pressure field, compute the steady state flow field, and then solve the tracer transport equation. You learn how to

  • generate a randomly distributed permeability field
  • sequentially solve two types of problems after each other:
    • solve a one-phase flow in porous media problem
    • compute the flow field from a pressure solution to pass to a tracer problem
    • solve an instationary tracer transport problem with a given flow field
Tracer result

📂 Example 2: Two-phase flow with infiltration and adaptive grid

In this example we model a soil contamination problem where DNAPL infiltrates a water-saturated porous medium (two-phase flow). The initial distribution of DNAPL is read in from a txt-file. The grid is adapitvely refined where DNAPL enters the domain, around the plume, and around an injection well. You learn how to

  • solve a two-phase flow in porous media problem with two immiscible phases
  • set boundary conditions and a simple injection well
  • implement a problem with heterogenous material parameters
  • use adaptive grid refinement around the saturation front
2p result

📂 Example 3: Shallow water model

The shallow water flow model is applied to simulate steady subcritical flow in a channel including a bottom friction model. You learn how to

  • solve a shallow water flow problem including bottom friction
  • computate and output (VTK) an analytical reference solution
swe result

📂 Example 4: Freeflow channel

In this example, we simulate a free flow between two plates in two dimensions. You learn how to

  • solve a free flow problem
  • set outflow boundary conditions in the free-flow context
freeflow result

📂 Example 5: One-phase flow with rotation-symmetric solution

In this example, a rotation-symmetric solution for the single-phase flow equation is discussed. You learn how to

  • solve a rotation-symmetric problem
  • perform a convergence test against an analytical solution
  • do post-processing in ParaView
Rotation-symmetric setup

📂 Example 6: Biomineralization

In this example, we simulate microbially-induced calcite precipitation You learn how to

  • solve a reactive transport model including
    • biofilm growth
    • mineral precipitation and dissolution
    • changing porosity and permeability
  • use complex fluid and solid systems
  • set a complex time loop with checkpoints, reading the check points from a file
  • set complex injection boundary conditions, reading the injection types from a file
biomin result

📂 Example 7: Lid-driven cavity

In this example, we simulate laminar incompressible flow in a cavity with the Navier-Stokes equations. You learn how to

  • solve a single-phase Navier-Stokes flow problem
  • compare the results of Stokes flow (Re = 1) and Navier-Stokes flow (Re = 1000)
  • compare the numerical results with the reference data using the plotting library matplotlib
liddriven result