Ghost method for implicit boundary condition treatment of a scalar equation defined on cells. More...
Functions/Subroutines | |
| subroutine | mod_add_cell_bc_ghost::add_cell_bc_ghost_rec (matrix, rhs, boundary_condition, equation_stencil, equation_ls_map) |
| Set boundary condition to a cell-discretized linear system (with ghost cells) | |
| subroutine | mod_add_cell_bc_ghost::apply_boundary_condition_on_matrix_line (matrix, rhs, ia, l, stencil_size, cells_offset, cells_coeff, robin_coeff_1) |
| Apply boundary condition on one line of the matrix. | |
| subroutine | mod_add_cell_bc_ghost_former::add_cell_bc_ghost_former (matrix, rhs, boundary_condition, equation_stencil, equation_ls_map) |
| Set boundary condition to a cell-discretized linear system (with ghost cells) | |
Ghost method for implicit boundary condition treatment of a scalar equation defined on cells.
| subroutine mod_add_cell_bc_ghost_former::add_cell_bc_ghost_former | ( | double precision, dimension(:), intent(inout) | matrix, |
| double precision, dimension(:), intent(inout) | rhs, | ||
| type(t_boundary_condition), intent(in) | boundary_condition, | ||
| type(t_cell_stencil), intent(in) | equation_stencil, | ||
| type(t_ls_map), intent(in) | equation_ls_map ) |
Set boundary condition to a cell-discretized linear system (with ghost cells)
The Robin boundary condition is discretized:
\begin{align} g = \alpha \frac {\partial S_b} {\partial n} + \beta S_b \end{align}
The first row of ghost cells outside the physical domain are used to impose boundary conditions. A second-order discretization scheme is used as follows (right boundary):
--x--x--|··x·· i: first interior cell node, e: exterior cell node, j i b e j: second interior cell node, b: boundary face node.
\begin{align} S_b = \tfrac{1}{2}(S_e + S_i) \end{align}
\begin{align} S_b = 0.375S_e + 0.750S_i - 0.125S_j \\ \alpha = 0 \\ \beta = 1 \end{align}
\begin{align} \alpha \frac {\partial S_b} {\partial n} = \alpha \frac {(S_e - S_i)} {\Delta x} \end{align}
The second row of ghost cells outside the physical domain may be used by a second order scheme, whose stencil is equal to 9 points (13 points in 3D). For this purpose, a second-order extrapolation is done (to be improved)
|
private |
Set boundary condition to a cell-discretized linear system (with ghost cells)
| [in,out] | matrix | the system matrix |
| [in,out] | rhs | the system right-hand side |
| [in] | boundary_condition | the boundary condition |
| [in] | equation_stencil | the equation stencil |
| [in] | equation_ls_map | the linear system mapping |
This function applies the boundary condition discretization directly including ghost cells in the linear system matrix and rhs. It is based on the use of mod_compute_ghost_weights_table::compute_ghost_weights_table as the no ghost counterpart mod_add_cell_bc_noghost::add_cell_bc_noghost ["add_cell_bc_noghost"]. However, this routine has some restrictions:
This function directly sets the matrix lines and rhs entries according to the result of mod_compute_ghost_weights_table::compute_ghost_weights_table, using mod_add_cell_bc_ghost::apply_boundary_condition_on_matrix_line.
|
private |
Apply boundary condition on one line of the matrix.
Set the matrix line and rhs corresponding to the given boundary condition discretization.
| [in,out] | matrix | the system matrix |
| [in,out] | rhs | the system right-hand side |
| [in] | ia | the starting index of the matrix line to set |
| [in] | l | the linear system index corresponding to the matrix line (for rhs) |
| [in] | stencil_size | the size of the stencil |
| [in] | cells_offset | the offsets of the neighboring cells in the stencil, of size ord |
| [in] | cells_coeff | the coefficients of the neighboring cells in the stencil, of size ord+1 (to store the rhs contribution in ord+1) |
| [in] | robin_coeff_1 | the first coefficient of the Robin boundary |