4 Convergence and the CFL Condition
initial and boundary conditions:
def init-params {:x-start 0
(:x-end 2
:nx 41
:nt 20
:c 1.0
:dt 0.025})
41 points of grid and 0.025 sec of timestep.
Experimenting increasing the size of the grid below to see what happens:
\(nx = 41\)
\(nx = 61\)
\(nx = 81\)
4.1 Reasons for the breakage
increasing grid size means travelling distance within a \(\Delta t\) becomes grater than \(\Delta x\), which correlates to \(nx\). In order to enforce the stability, we introduce Courant number \(\sigma_{max}\). This ensures stability with given discretization params.
\[\sigma = \frac{u \Delta t}{\Delta x} \le \sigma_{max}\]
def init-params' {:x-start 0
(:x-end 2
:nx 41
:nt 20
:c 1.0
:sigma 0.5})
\(nx = 41\)
\(nx = 61\)
\(nx = 81\)
\(nx = 101\)
\(nx = 121\)
The results show with a grid size \(nx\) increases, convection travels shorter distance. With a given \(nt = 20\) in the init param, the time windows becomes shorter as a result of increasing \(nx\).