Difference between revisions of "Ghost nodes (theory)"

From Medusa: Coordinate Free Mehless Method implementation
Jump to: navigation, search
Line 14: Line 14:
 
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.
 
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 increases the number of nodes and unknowns by $N_n$.
+
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$.
 
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 u}{\partial n},j}$.
 
We will denote the computed stencil weights for operators with $w_\mathcal{L,j}$ and $w_{\frac{\partial u}{\partial n},j}$.
Line 20: Line 22:
 
We have the same equations as before:
 
We have the same equations as before:
  
* 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$
* for Dirichlet nodes: $u_j = u_{0,j}$
+
* $N_d$ for Dirichlet nodes: $u_j = u_{0,j}$
* for Neumann nodes: $w_{\frac{\partial u}{\partial n},j} \cdot \boldsymbol{u}_{I_j} = g_j$
+
* $N_n$ for Neumann nodes: $w_{\frac{\partial u}{\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.
  
 
=== Explicit version ===
 
=== Explicit version ===
TODO Jure
 

Revision as of 11:52, 17 May 2019

Ghost nodes schema.
Figure 1: Ghost node configuration at the domain boundary.

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 u}{\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 u}{\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.

Explicit version