2. Finite Volume Discretization
This chapter assumes a finite one-dimensional domain
With a given finite volume discretization we can define a set of
The solution of these Riemann problems is obtained analogue to the IVP in Eq. 1.3.1:
The f-wave solver determines two net-updates
The final update formula from time
Thus a cell
where
Note: We do not use bathymetry in this part of the project, you can simply set a dummy
value in all cells: setGhostOutflow()
). We will add bathymetry to our f-wave solver and
implement new boundary conditions soon.
Tasks
Integrate your f-wave solver into the one-dimensional implementation of a wave propagation patch given in files
WavePropagation1d.h
,WavePropagation1d.cpp
,WavePropagation1d.test.cpp
. Find a good solution to switch between the provided Roe solver and your f-wave solver.The CSV-file middle_states.csv contains a collection of constant middle states which arise immediately in the Riemann solution at the initial discontinuity. Use these middle states as a sanity check.
Embed your solver into a continuous integration tool. Ensure to run at least the solver’s unit tests after every commit to your git repository. You may use any suitable tool for this task including GitHub Actions, GitLab Runner, Travis CI, Buildkite, GoCD or Jenkins.
2.1. Shock and Rarefaction Waves
Shock-Shock Problem:
Let’s use our solver to solve shock-shock Riemann problems.
Imagine two streams of water which move in opposite directions and smash into each other at some position
with initial conditions:
Rare-Rare Problem:
We can setup rare-rare Riemann problems by two streams of water, which move away from each other at some position
with initial conditions identical to Eq. 2.1.1.
Tasks
Implement the shock-shock and rare-rare problems as setups.
Play around with different sets of initial water heights
and particles velocities . What do you observe? Is there a connection to the wave speeds in Ch. 1.3?
2.2. Dam-Break
Fig. 2.2.1 Illustration of the initial setting for the dam break problem.
Now, let’s solve the dam-break problem. You can imagine a water reservoir which is separated, as illustrated in Fig. 2.2.1, from a river by a dam initially. We assume a total failure of the dam, thus nothing keeps the water from moving downstream:
Fig. 2.2.2 shows the analytical solution of the dam-break problem, which consists of a rarefaction and a shock wave.
Fig. 2.2.2 Illustration of the analytical solution of the dam break problem.
Tasks
Apply your solver to the dam-break setup and play around with different sets of initial water heights
and . What do you observe? How large is the impact of the particle velocity in the river?Assume a water reservoir of unlimited size and a village 25 km downstream with initial values
and . How much time do you have to evacuate the village in our model before the shock wave arrives?