Proper writing of IBVP PDE & Finite Difference Implementation

96 Views Asked by At

I've seen a few examples (see slide 4 ) of the 2D heat equation described as

$$ \begin{cases} u_t(t,x,y) = \nabla^2 u(t,x,y), \quad t > 0, \quad (x,y) \in (0,L) \times (0,H), \\ u(t,0,y) = u_{left}(t,y), \quad t \geq 0, \quad y \in [0,H], \\ u(t,L,y) = u_{right}(t,y), \quad t \geq 0, \quad y \in [0,H], \\ u(t,x,0) = u_{bottom}(t,x), \quad t \geq 0, \quad x \in [0,L], \\ u(t,x,H) = u_{top}(t,x), \quad t \geq 0, \quad x \in [0,L], \\ u(0,x,y) = u_0(x,y), \quad (x,y) \in [0,L] \times [0,H]. \end{cases} $$

For $t > 0$, I imagine a computational domain (for finite differences, e.g.) would look like the following:

2D Domain

For one, it seems clear the the boundary condition functions must be the same at the corner points. E.g., at the top-left corner, it must be that $u_{top}(t,0) = u_{left}(t,H)$, correct?

Then, if we were solving this using finite differences, at each time step we solve for $u$ on the interior mesh points, and reset the boundary values at each step, correct?

Finally, with the IBVP posed as above, there seems to be a conflict of constraints. In particular, the boundary values hold for all $t \geq 0$, but the initial condition holds for $t = 0$. If we had, e.g., all boundary values equal to zero for all $t \geq 0$, but an initial condition of 1 everywhere, what should we set the boundary values to be for $t = 0$, 0 or 1?