Finite difference discretisation of the heat equation

236 Views Asked by At

Here is the equation to be discretised:

$$ k\left(\frac{\partial^2 T}{\partial x^2} + \frac{\partial^2 T}{\partial y^2}\right) = \dot{q} $$

Using the following discretisation scheme:

$$ \frac{\partial^2 T}{\partial x^2} = \frac{T_{i+2,j} - 2T_{i+1,j} + T_{i-1,j}}{3(\Delta x)^2} \\ \frac{\partial^2 T}{\partial y^2} = \frac{T_{i,j+2} - 2T_{i,j+1} + T_{i,j-1}}{3(\Delta y)^2} $$

Moreover the domain is a simple square where the left and top side have, respectively, imposed Boundary Condition $\frac{\partial T}{\partial x} = 0$ & $\frac{\partial T}{\partial y} = 0$ and the right and bottom side have imposed Boundary Condition $T=T_0$.

When full discretised I get: $$ 2A \cdot T_{i+1,j} - A \cdot T_{i+2,j} - A \cdot T_{i-1,j} + 2B \cdot T_{i,j+1} - B \cdot T_{i,j+2} - B \cdot T_{i,j-1} = q_{i,j} $$ where $A = \frac{k}{3(\Delta x)^2}$ and $B = \frac{k}{3(\Delta y)^2}$

Now I am asked to find the coefficient matrix and right hand side. The coefficient matrix is quite straight forward but my issue is the right hand side where I can't see to put in both boundary conditions...