- #1

LogarithmLuke

- 83

- 3

- Homework Statement
- Consider the diffusion-advection equation given by ## \mu \Delta u + \mathbf{v} \cdot \nabla u = f \ \text{in} \ \Omega ## with some appropiate boundary conditions. Here the velocity field ##\mathbf{v} : \Omega \rightarrow \mathbb{R}^2## and the source function ## f: \Omega \rightarrow \mathbb{R} ## may depend on the position. Here ##\Delta## is the Laplace operator, and ##\nabla## is the gradient.

Solve the problem on a unit square with Dirichlet boundary conditions. Set up a finite difference scheme using central differences for both the first and second derivatives of ##u##. Implement the scheme. Write your program so it can solve the problem for different choices of ##\mathbf{v}##

- Relevant Equations
- -

So for my scheme I obtained ##\frac{\mu}{h^2} U_{p}+(\frac{v_{1}}{2 h}-\frac{\mu}{h^2})U_{E}+(\frac{v_{2}}{2 h} - \frac{\mu}{h^2})U_{N} - (\frac{v_{1}}{2 h}+\frac{\mu}{h^2})U_{W} - (\frac{v_{2}}{2 h} + \frac{\mu}{h^2})U_{N} + \tau = f## however I am not sure this is correct. I am quite new to the finite difference method, and honestly find it quite difficult. I am also not sure how to go about setting up the A matrix and progressing onward to solve the rest of the problem. Any help would be greatly appreciated.