[100 points] The two-dimensional Laplace equation around a cylinder with a domain [0, 2π]×[1, 5] is given
by.
∂
2ψ
∂x2
+
∂
2ψ
∂y2
= 0 (1)
The analytical solution is given by
ψ(r, θ) = U∞
r −
R2
r
sin(θ) (2)
(3)
In here R = 1 and U∞ = 1. The Drichlet boundary conditions:
ψ(1, θ) = 0 (4)
ψ(5, θ) =
5 −
1
5
sin(θ) (5)
(6)
Use the second-order accurate finite element discretization with uniform 80 × 40, 160 × 80 and 320 × 160
quadrilateral elements to solve the above Laplace equation. For this purpose
1. Implement the fully implicit finite element solution algorithm and use a direct solver (LU factorization) to solve.
2. Plot Error function versus ∆r and ∆θ in a log-log scale. Compute the spatial convergence rate.
3. Compare the error with the solutions of finite difference method.
The error function is given by
Error = kψi,j − ψanalytick2
√
imaxjmax
(7)
[20 points] Solve the same problem with an unstructured quadrilateral/triangular elements.
Several useful MATLAB commands:
Crate a sparse matrix
i=[];
j=[];
s=[];
m=100;
n=100;
A=sparse(i, j, s, m, n);
To solve a sparse linear system
x = Ab ;