Difference between revisions of "Ghost nodes (theory)"
(→Explicit version) |
(→Meshless setting (implicit)) |
||
Line 18: | Line 18: | ||
This increases the number of nodes and unknowns by N_n. | This increases the number of nodes and unknowns by N_n. | ||
Stencils and stencil weights are computed as before, and ghost nodes are included in the stencils. Fro each node p_j denote the indices of its stencil nodes by I_j. | Stencils and stencil weights are computed as before, and ghost nodes are included in the stencils. Fro each node p_j denote the indices of its stencil nodes by I_j. | ||
− | We will denote the computed stencil weights for operators with w_\mathcal{L,j} and $w_{\frac{\partial | + | We will denote the computed stencil weights for operators with w_\mathcal{L,j} and w_{\frac{\partial }{\partial n},j}. |
We have the same equations as before: | We have the same equations as before: | ||
Line 24: | Line 24: | ||
* N_i for interior nodes: w_{\mathcal{L},j} \cdot \boldsymbol{u}_{I_j} = f_j | * N_i for interior nodes: w_{\mathcal{L},j} \cdot \boldsymbol{u}_{I_j} = f_j | ||
* N_d for Dirichlet nodes: u_j = u_{0,j} | * N_d for Dirichlet nodes: u_j = u_{0,j} | ||
− | * N_n for Neumann nodes: $w_{\frac{\partial | + | * N_n for Neumann nodes: w_{\frac{\partial }{\partial n},j} \cdot \boldsymbol{u}_{I_j} = g_j |
Additional N_n equation for ghost nodes are required. They are obtained by stating that the PDE itself must also hold in the boundary node, i.e., we add | Additional N_n equation for ghost nodes are required. They are obtained by stating that the PDE itself must also hold in the boundary node, i.e., we add |
Revision as of 13:29, 17 May 2019
Ghost nodes are a technique for discretizing (mostly) Neumann boundary conditions in PDEs.
Introduction
Ghost are a technique used for disretizing Neumann boundary conditions in FDM. To be able to use the central difference for first derivative, additional point, called ghost point, is introduced outside the domain boudanry. The unknown function value at the ghost node is added as a variable. At the boundary node, the Neumann condition is enforced, as well as the equation itself (two equations for two unknowns, the ghost and the boundary function value).
Meshless setting (implicit)
Consider the problem \mathcal{L}u = f with Neumann boundary conditions \frac{\partial u}{\partial n} = g on some portion \Gamma_1 of the boundary and Dirichlet conditions u = u_0 on portion \Gamma_2. Denote the number of internal nodes with N_i, number of Neunann boundary nodes with N_n and number of Dirichlet boundary nodes with N_d. The total number of nodes N is equal to N = N_i + N_n + N_d and so is the number of unknowns, representing solution values at these nodes.
For each Neumann node p, additional ghost or fictious nodes are placed outside the domain, as seen in the figure on the right. This is usually done so that one ghost node is added for each boundary node, spaced h away in the normal direction, where h is the local nodal spacing. This increases the number of nodes and unknowns by N_n. Stencils and stencil weights are computed as before, and ghost nodes are included in the stencils. Fro each node p_j denote the indices of its stencil nodes by I_j. We will denote the computed stencil weights for operators with w_\mathcal{L,j} and w_{\frac{\partial }{\partial n},j}.
We have the same equations as before:
- N_i for interior nodes: w_{\mathcal{L},j} \cdot \boldsymbol{u}_{I_j} = f_j
- N_d for Dirichlet nodes: u_j = u_{0,j}
- N_n for Neumann nodes: w_{\frac{\partial }{\partial n},j} \cdot \boldsymbol{u}_{I_j} = g_j
Additional N_n equation for ghost nodes are required. They are obtained by stating that the PDE itself must also hold in the boundary node, i.e., we add
- additional N_n equations for Neumann nodes: w_{\mathcal{L},j} \cdot \boldsymbol{u}_{I_j} = f_j.
Not that no requirements about the PDE or BCs are made in the ghost nodes, they are simply involved as stencil nodes in the two equations for Neumann nodes (and possibly others).
All these equations are assembled in a sparse matrix which is solved and values obtained for ghost nodes can be neglected.
Additionally, more than one layer of ghost nodes can be added and additional equations on the boundary are needed. Sometimes, equations \mathcal{L}^2 u = \mathcal{L}f, etc... are used.
For an example of ghost nodes generation and use in Medusa see the Ghost nodes example.
Explicit version
When explicit time stepping is used, Neumann boundary conditions and ghost nodes are more difficult to implement. We assume that the values of the interior in the n-th iteration are already known and denoted by u_j^n, as well as the boundary and ghost values from the previous iteration u_j^{n-1}.
Consider a boundary node p_j with an associated ghost node p_{g_j} and stencil indices I_j = \{j, g_j, i_1, \ldots, i_{n-2}\}. Denote the stencil weights at p_j for \mathcal{L} as w_{\mathcal{L},j} and for \frac{\partial }{\partial n} as w_{\frac{\partial }{\partial n},j}.
We have two equations at this node:
\sum_{i \in I_j} w_{\mathcal{L},j,i} u_i = f_j