Consider a (1-dimensional) advection-diffusion process, with (constant) diffusivity D > 0, for some concentration u(x,t),
whose initial profile is u(x,0) = u0(x), driven by a given velocity field V, in an (appropriately chosen) interval a ≤ x ≤ b
whose ends are impermeable, during some time 0 ≤ t ≤ tmax.

1. State precisely the full mathematical problem modeling this process.

Take as initial profile the "square bump": u0(x) = 5 for 1 ≤ x ≤ 2, u0(x) = 0 otherwise.

2. Describe what you expect to happen qualitatively and sketch (by hand) the initial profile u0(x) and the
expected profile at time t=4 if V=1 and if V=5 (and D is small). How far does the pulse travel ?

3. Implement the explicit upwind scheme + diffusion for this problem, and derive the CFL stability condition.
In your code insert a "factor" in the time-step, as before.

Assume constant velocity V > 0 and diffusivity D > 0, and take MM = 32, tmax=4.0, and dtout=2.
Choose a and b appropriately, so that the entire action happens inside [a,b].

Every dtout (starting at time=0), your code should output the time, number of time-steps, maximum U-value,
and the entire profile of U (including at time tmax) for plotting.

Now, we want to examine how the presence of diffusion affects the advection profiles obtained in Lab 8.

For each of the cases listed bellow, do the following:
• Plot the profiles at times 0, dtout, tmax, on one plot (in gnuplot: set yrange [0:5.5] to see the top clearly).
• On the plot, mark the parameter values that generated it, mark which curve is at what time,
and make comments/observations as to what you think is happening, how it compares with other cases and why.
• Look at the {time,Umax} pairs you generated, comment on what you observe.
• Find the Peclet Number (using length scale =1, no natural length scale in this problem).
The numerical (cell) Peclet Number is Pe = V*Δx/D.

Here are the cases to examine.

(4a) V=1., D=0.0, factor=1.0
(4b) V=1., D=0.5, factor=1.0
(4c) V=1., D=0.1, factor=1.0
(4d) V=1., D=0.1, factor=0.9
(4e) V=0., D=0.1, factor=0.9
Which of (4c) , (4d) is more accurate?

(5a) V=5., D=0.0, factor=1.0
(5b) V=5., D=0.5, factor=1.0
(5c) V=5., D=2.5, factor=1.0

6. Do the cases with same Peclet Number behave similarly ?

7. Implement Super-Time-Stepping and examine the effect in cases (5b) and (5c), with MM=128.
To compute error, take Euler solution (N=1, ν=0) as U_exact. Try Nsts=10 or 20, and some (small) ν.
Is there any speedup? (Speedup = nsteps_Euler / nateps_STS)