Assignment4-2023 For Numerical Analysis
Assignment4-2023 For Numerical Analysis
1
described by the advection-diffusion equation:
∂u
− D∆u + ∇ · (uw) = f, t > 0, (x, y) ∈ Ω, (2)
∂t
where D is the effective diffusivity characterizing the (approximately) diffu-
sive transport of gas caused by the atmospheric turbulence, and w(x, y, t) =
⟨wx , wy ⟩ is the vector field of the mean wind velocity with its components
given by:
y
wx (x, y, t) = B − p , t ≥ 0,
x + y2
2
x (3)
wy (x, y, t) = p , t ≥ 0,
x + y2
2
(a) The FEniCSx code structure for this is provided in the file
Assignment4-code-strycture.py. Some of the code parts have
been written explicitly, others are missing. Finish the code by
implementing the missing parts. You can use the tutorial at
https://jsdokken.com/dolfinx-tutorial/chapter2/heat equation.html
2
variable value
Lx 6
Ly 6
T 5
A 5
B 1.5
α 10
(xc , yc ) (−3, −3)
(x1 , y1 ) (−2.4, 0)
(x2 , y2 ) (0, 1)
D 0.0025
(b) Set the problem parameters as in Table 1 and run the code with
nt = 10 and nx = 51, ny = 51. Insert the figure with the cal-
culated u(x, y, T ) in your report and discuss it.
(c) Refine the spatial discretization by changing nx and ny until you
are satisfied with the calculated result. Due to the structure of
the wind function, it is better to work with nx = 51, 61, 71,
... etc. Insert the figure of u(x, y, T ) at the final appropriate
spatial resolution and explain what criterion did you use to settle
on these values of nx and ny.
(d) Calculate the numerical approximation of u(x, y, T ) at the appro-
priate spatial resolution and with the time discretization set as
nt = 10, 20, 50, 100, 200, 300, recording the value of
u(x, y, T ) obtained with different nt at some chosen spatial lo-
cation. You can use a single value from the array unow obtained
by the code at the end of a run for this purpose. For example,
find the location of the maximum of unow at some nt and record
the value of that element of unow at other nt’s. Plot that value
as a function of nt and discuss it.
(e) Set B = 0.5 and run the code with the appropriate spatial reso-
lution established in the previous steps and with nt = 50. Insert
the figure of the calculated u(x, y, T ) in your report. Find a sim-
ple and visual way to explain the difference between the B = 1.5
and B = 0.5 cases.