Implicit boundary condition treatment of a scalar equation defined on cells. More...
Topics | |
| Implicit boundary condition treatment, with ghost cells | |
| Ghost method for implicit boundary condition treatment of a scalar equation defined on cells. | |
| Implicit boundary condition treatment, without ghost cells | |
| No ghost method for implicit boundary condition treatment of a scalar equation defined on cells. | |
| Implicit boundary condition treatment, common fonctions | |
| Common module to compute ghost weights table for implicit boundary conditions . | |
Namespaces | |
| module | enum_cell_bc_scheme |
| Enumeration modules associated to cell scalar boundary condition scheme. | |
| module | enum_face_bc_scheme |
| Enumeration modules associated to face-centered vector field boundary condition scheme. | |
Implicit boundary condition treatment of a scalar equation defined on cells.
The boundary conditions can be Dirichlet, Neumann and Robin type. Since it is possible to express the first two boundary conditions as special Robin one, we only discretize the Robin BC (coefficient are set in the UI part of the code). It writes:
\begin{align} g = \alpha S_b + \beta \frac {\partial S_b} {\partial n} \end{align}
Imposition of the BC can be done following two methods:
Either way, reconstruction polynomials are used to compute the associated coefficients incorporating the boundary condition. For retrocompatibility, numerical methods used previously are referred as former in the parameterization and the routines name.
The principal routine is named mod_add_cell_bc_noghost::add_cell_bc_noghost, for which we wrote a thorough documentation. Explicit cells extrapolation is based on the same principle, see mod_apply_bc_on_ghost_b_cells::apply_bc_on_ghost_b_cells.
The approach is based on extrapolating the cell-averaged values using a polynomial of degree \( p = \text{order} - 1 \), reconstructed from interior cells. The figure below illustrates the numbering of the left boundary (denoted by ║):
g2 g1 ║ i1 i2 i3
━━━━━━╋━━━━━━╬━━━━━━╋━━━━━━╋━━━━━━╋
┃ ║ ┃ ┃ ┃
ghost cells ║ interior/inner cells
The average value in the first ghost cell \( \bar{S}_{g_1} \) is computed between its boundaries \(a_1\) and \(b_1\) by a constrained polynomial extrapolation:
\begin{align} \bar{S}_{g_1} = \frac{1}{b_1 - a_1} \int_{a_1}^{b_1} P(x)\,dx \end{align}
where \( P(x) \) is the unique polynomial of degree \( p \) that interpolates the cell averages of the interior cells, and is constrained to satisfy the Robin boundary condition at the boundary location \(x_b\):
\begin{align} g = \alpha P'(x_b) + \beta P(x_b) \end{align}
This way, we obtain a numerical strategy to express the first ghost cell average value, whatever its size is, as a function of inner cells and the boundary condition values. We can thus express the weights associated to each inner cell and the right-hand-side as:
\begin{align} \bar{S}_{g_1} = \sum_{m=1}^{p} \omega_m^{(1)} \bar{S}_{i_m} + \omega_g^{(1)} g \end{align}
where \( \omega_{\cdot}^{(1)} \) are weights associated to either inner nodes (subscript \( m \)) or Robin's right-hand-side (subscript \( g \)). These weights can be compactly stored in a vector. The function mod_compute_ghost_weights_table::compute_ghost_weights_table serves this purpose.
Now, if more than one ghost cell is required (e.g., extent = 2), we could express the previous expression on different boundaries \((a_i,b_i)\). However, for algorithmic reasons, we apply a recursive process to express any subsequent ghost cell \(g_i\) average value:
\begin{align} \bar{S}_{g_i} = \frac{1}{b_i - a_i}\int_{a_i}^{b_i} P(x)\,dx \end{align}
while using Chale's property :
\begin{align} \bar{S}_{g_i} &= \frac{1}{b_i - a_i} \left( \int_{a_i}^{b_1} P(x)\,dx - \int_{a_{i-1}}^{b_1} P(x)\,dx \right) \\ &= \frac{1}{b_i - a_i} \left( (b_1 - a_i) \bar{S}_{g_i \rightarrow g_1} - (b_1 - b_{i}) \bar{S}_{g_{i-1} \rightarrow g_1} \right) \end{align}
where \( \bar{S}_{g_i \rightarrow g_j} \) is the average value of the polynomial on an interval from cell \(g_i\) to \(g_j\) and where \(b_i = a_{i-1}\).