I'm working on a 2-D planar finite difference code. My differencing scheme at the boundary nodes involves introducing ghost nodes in the computation. My code also involves a multi-dimensional derivative: $$ \frac{d^2u}{dxdy} \approx \frac{u_{i+1,j+1} - u_{i+1,j-1} - u_{i-1, j+1} + u_{i-1,j-1}}{4\Delta x\Delta y} $$

This scheme becomes an issue at a corner node. Let me illustrate: $$ g1\ \ g2 \ \ g3 \\ g4\ \ d1 \ \ d2 \\ g5\ \ d3 \ \ d4 \\ $$

the g's represent the ghost codes and the d's represent the real domain nodes that I'm solving for. x-direction is horizontal; y-direction is vertical. Dirichlet boundary conditions are specified for both the top and left boundaries. Let's say $u=u_1$ at the top boundary and $u=u_2$ at the left boundary. What should be the boundary condition at ghost node g1, which lies along both the x and y boundaries?

  • 1
    $\begingroup$ Mathematically the problem is ill-posed because of this inconsistency of the boundary conditions at the corner. So there is no "right" solution. Nevertheless, you can arbitrarily set $g1$ to either $u1$ or $u2$, based on whatever criterion you like, and obtain a solution. $\endgroup$ – Bill Greene Apr 12 '17 at 16:59
  • 1
    $\begingroup$ adding up to Bill Greene's comment: imagine, for example, that you are solving heat equation in FDTD and using simple Dirichlet boundary conditions saying that the top wall is at 300K and all the other are at 100K. What happens at the top left and top right corners? Are they at 300K? or at 100K? No way to answer if your model your heat distribution this way - so you can arbitrarily choose if you want to consider them 'top' or 'side'. The real question is if such model is useful - and it is for many situations. $\endgroup$ – Anton Menshov Apr 12 '17 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.