0.6.0
Loading...
Searching...
No Matches

Implicit advection schemes of a scalar equation defined on cells. More...

Functions

subroutine mod_add_cell_advection_div_u_term::add_cell_advection_div_u_term (matrix, coefficient, divergence, stencil_size, equation_ls_map)
 Add to the matrix (diagonal element) the compressive part of the cell advection term.
 
subroutine mod_apply_cell_advection_scheme::apply_flux_scheme_to_system (coefficient, velocity, matrix, equation_stencil, equation_ls_map, apply_cell_advection_scheme)
 Modify the matrix by adding each cell's stencil matrix.
 
subroutine mod_apply_cell_advection_scheme::apply_cell_advection_o2_centered_scheme (coefficient, velocity, matrix_line, ns, i, j, k)
 Compute the implicit second order advection scheme stencil matrix.
 
subroutine mod_apply_cell_advection_scheme::apply_cell_advection_o1_upwind_scheme (coefficient, velocity, matrix_line, ns, i, j, k)
 Compute the implicit first order upwind advection scheme stencil matrix.
 
subroutine mod_apply_cell_advection_scheme::apply_cell_advection_o2_upwind_scheme (coefficient, velocity, matrix_line, ns, i, j, k)
 Compute the implicit second order upwind advection scheme stencil matrix.
 
subroutine mod_apply_cell_advection_scheme::apply_cell_advection_quick_scheme (coefficient, velocity, matrix_line, ns, i, j, k)
 Compute the implicit second/third order QUICK advection scheme stencil matrix.
 
subroutine mod_apply_cell_advection_scheme::apply_cell_advection_houc3_scheme (coefficient, velocity, matrix_line, ns, i, j, k)
 Compute the implicit third order HOUC3 advection scheme stencil matrix.
 
subroutine mod_apply_cell_advection_scheme::apply_cell_advection_generic_upwind_reconstruction_scheme (coefficient, velocity, matrix_line, rec_fast_scheme_backward, rec_fast_scheme_forward, ns, i, j, k)
 Compute the advection upwind scheme stencil matrix using a given reconstruction scheme.
 

Detailed Description

Implicit advection schemes of a scalar equation defined on cells.

This module provides several numerical schemes to discretize the continuity/advection term in a conservative manner:

\[ \varrho \underbrace{ \nabla \cdot \left( \mathbf{u^{n+1}} \varphi^{n+1} \right) }_{\text{conservative advection term}} \]

as well as the supplementary compressive term when solving pure advection:

\[ \varrho \underbrace{ \mathbf{u^{n+1}} \nabla \cdot \varphi^{n+1} }_{\text{advection term}} = \varrho \underbrace{ \nabla \cdot \left( \mathbf{u^{n+1}} \varphi^{n+1} \right) }_{\text{conservative advection term}} - \varrho \underbrace{ \varphi^{n+1} \nabla \cdot \mathbf{u^{n+1}} }_{\text{compression term}} \]

Numerical schemes

The module provides several schemes for the discretization of the conservative advection term:

The routine add_cell_advection_div_u_term handles the discretization of the compression term.

The routine apply_flux_scheme_to_system can be called to fill the linear system matrix with a given scheme routine.

Function Documentation

◆ add_cell_advection_div_u_term()

subroutine mod_add_cell_advection_div_u_term::add_cell_advection_div_u_term ( double precision, dimension(:), intent(inout) matrix,
double precision, dimension(:,:,:), intent(in) coefficient,
double precision, dimension(:,:,:), intent(in) divergence,
integer, intent(in) stencil_size,
type(t_ls_map), intent(in) equation_ls_map )

Add to the matrix (diagonal element) the compressive part of the cell advection term.

Parameters
[in]coefficientthe coefficient field
[in]divergencethe \( \nabla \cdot \mathbf{u^{n+1} \) term
[in,out]matrixthe linear system matrix
[in]equation_ls_mapSee type_ls_map::t_ls_map
[in]stencil_sizethe stencil size

The term discretizes \( \varrho \phi^{n+1} \nabla \cdot \mathbf{u^{n+1}} \). It is usually neglected when the velocity field is solenoidal. However, it has to be added in the general case, when solving a pure transport equation.

◆ apply_cell_advection_generic_upwind_reconstruction_scheme()

subroutine mod_apply_cell_advection_scheme::apply_cell_advection_generic_upwind_reconstruction_scheme ( double precision, dimension(:,:,:), intent(in) coefficient,
type(t_face_field), intent(in) velocity,
double precision, dimension(-ns:ns,-ns:ns,-ns:ns), intent(inout) matrix_line,
class(t_rec_fast_scheme), intent(inout) rec_fast_scheme_backward,
class(t_rec_fast_scheme), intent(inout) rec_fast_scheme_forward,
integer, intent(in) ns,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k )

Compute the advection upwind scheme stencil matrix using a given reconstruction scheme.

Parameters
[in]coefficientthe coefficient field
[in]velocitythe velocity field
[in,out]matrix_linethe resulting stencil matrix
[in]rec_fast_scheme_backwardthe backward reconstruction scheme
[in]rec_fast_scheme_forwardthe forward reconstruction scheme
[in]nsthe stencil's bound
[in]i,j,kthe cell indices

Compute the advection upwind scheme stencil matrix using a given reconstruction scheme with variable steps. See Interpolation at grid elements for more information about interpolation/reconstruction schemes.

Todo
The coefficient argument could be factorized.

◆ apply_cell_advection_houc3_scheme()

subroutine mod_apply_cell_advection_scheme::apply_cell_advection_houc3_scheme ( double precision, dimension(:,:,:), intent(in) coefficient,
type(t_face_field), intent(in) velocity,
double precision, dimension(-ns:ns,-ns:ns,-ns:ns), intent(inout) matrix_line,
integer, intent(in) ns,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k )

Compute the implicit third order HOUC3 advection scheme stencil matrix.

Parameters
[in]coefficientthe coefficient field
[in]velocitythe velocity field
[in,out]matrix_linethe resulting stencil matrix
[in]nsthe stencil's bound
[in]i,j,kthe cell indices

Compute the third order HOUC3 scheme with variable steps.

Todo
The coefficient argument could be factorized.

◆ apply_cell_advection_o1_upwind_scheme()

subroutine mod_apply_cell_advection_scheme::apply_cell_advection_o1_upwind_scheme ( double precision, dimension(:,:,:), intent(in) coefficient,
type(t_face_field), intent(in) velocity,
double precision, dimension(-ns:ns,-ns:ns,-ns:ns), intent(inout) matrix_line,
integer, intent(in) ns,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k )

Compute the implicit first order upwind advection scheme stencil matrix.

Parameters
[in]coefficientthe coefficient field
[in]velocitythe velocity field
[in,out]matrix_linethe resulting stencil matrix
[in]nsthe stencil's bound
[in]i,j,kthe cell indices

Compute the first order upwind scheme with variable steps. For uniform steps, in 1D, with a positive velocity the right and left fluxes are computed as:

\[ F_l = u_l \phi_l \simeq u_l \phi_L \\ F_r = u_r \phi_r \simeq u_r \phi_C \]

where \(u_l\) and \(u_r\) are the interpolated velocity at the left/right faces.

Todo
The coefficient argument could be factorized.

◆ apply_cell_advection_o2_centered_scheme()

subroutine mod_apply_cell_advection_scheme::apply_cell_advection_o2_centered_scheme ( double precision, dimension(:,:,:), intent(in) coefficient,
type(t_face_field), intent(in) velocity,
double precision, dimension(-ns:ns,-ns:ns,-ns:ns), intent(inout) matrix_line,
integer, intent(in) ns,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k )

Compute the implicit second order advection scheme stencil matrix.

Parameters
[in]coefficientthe coefficient field
[in]velocitythe velocity field
[in,out]matrix_linethe resulting stencil matrix
[in]nsthe stencil's bound
[in]i,j,kthe cell indices

Compute the second order centered scheme with variable steps. For uniform steps, in 1D, the right and left fluxes are computed as:

\[ F_l = u_l \phi_l \simeq u_l (\phi_L + \phi_C)/2 \\ F_r = u_r \phi_r \simeq u_r (\phi_C + \phi_R)/2 \]

where \(u_l\) and \(u_r\) are the interpolated velocity at the left/right faces.

Todo
The coefficient argument could be factorized.

◆ apply_cell_advection_o2_upwind_scheme()

subroutine mod_apply_cell_advection_scheme::apply_cell_advection_o2_upwind_scheme ( double precision, dimension(:,:,:), intent(in) coefficient,
type(t_face_field), intent(in) velocity,
double precision, dimension(-ns:ns,-ns:ns,-ns:ns), intent(inout) matrix_line,
integer, intent(in) ns,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k )

Compute the implicit second order upwind advection scheme stencil matrix.

Parameters
[in]coefficientthe coefficient field
[in]velocitythe velocity field
[in,out]matrix_linethe resulting stencil matrix
[in]nsthe stencil's bound
[in]i,j,kthe cell indices

Compute the second order upwind scheme with variable steps. For uniform steps, in 1D, with a positive velocity the right and left fluxes are computed as:

\[ F_l = u_l \phi_l \simeq u_l (3 \phi_L - \phi_{LL})/2 \\ F_r = u_r \phi_r \simeq u_r (3 \phi_C - \phi_L)/2 \]

where \(u_l\) and \(u_r\) are the interpolated velocity at the left/right faces.

Todo
The coefficient argument could be factorized.

◆ apply_cell_advection_quick_scheme()

subroutine mod_apply_cell_advection_scheme::apply_cell_advection_quick_scheme ( double precision, dimension(:,:,:), intent(in) coefficient,
type(t_face_field), intent(in) velocity,
double precision, dimension(-ns:ns,-ns:ns,-ns:ns), intent(inout) matrix_line,
integer, intent(in) ns,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k )

Compute the implicit second/third order QUICK advection scheme stencil matrix.

Parameters
[in]coefficientthe coefficient field
[in]velocitythe velocity field
[in,out]matrix_linethe resulting stencil matrix
[in]nsthe stencil's bound
[in]i,j,kthe cell indices

Compute the second/third order QUICK scheme with variable steps.

Todo
The coefficient argument could be factorized.