Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Computational Aerodynamics MSc Aeronautical Eng.

Exercise on the Laplace equation


1. We consider the Laplace equation
fxx + fyy = 0
in a square domain of side L = 1, with Dirichlet boundary conditions at all sides of the square

f (x = 0, y) = 0
f (x = 1, y) = 0
f (x, y = 0) = 0
f (x, y = 1) = sin(πx).

The exact solution for this problem is

sinh(πy) sin(πx)
f (x, y) = .
sinh(π)

• Write a Matlab script to solve the problem numerically using the 5-point stencil Laplacian. Use an
m × m grid with ∆x = ∆y = h.
• Test this script by performing a grid refinement study to verify that it is second order accurate.
• Modify the script to solve the original problem using the following 9-point stencil Laplacian
1
∇29 ui,j = [4(ui−1,j + ui+1,j + ui,j−1 + ui,j+1 )+
6h2
+ ui−1,j−1 + ui−1,j+1 + ui+1,j−1 + ui+1,j+1 − 20ui,j ].

Doing a grid refinement study, determine what is the order of accuracy of this scheme.
• With both schemes, try to solve the same equation halving the domain in the x-direction, x ∈ [0, 0.5],
with a Neumann boundary condition at x = 0.5: fx (0.5, y) = 0.

Bioeng. and Aerospace Eng. Dept. 1 v 1.01

You might also like