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. | |
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}} \]
The module provides several schemes for the discretization of the conservative advection term:
apply_cell_advection_o1_upwind_scheme;apply_cell_advection_o2_centered_scheme;apply_cell_advection_o2_upwind_scheme;apply_cell_advection_quick_scheme;apply_cell_advection_houc3_scheme. as well as a generic routine apply_cell_advection_generic_upwind_reconstruction_scheme that can be used in conjonction with reconstruction schemes (see Interpolation at grid elements).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.
| 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.
| [in] | coefficient | the coefficient field |
| [in] | divergence | the \( \nabla \cdot \mathbf{u^{n+1} \) term |
| [in,out] | matrix | the linear system matrix |
| [in] | equation_ls_map | See type_ls_map::t_ls_map |
| [in] | stencil_size | the 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.
| 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.
| [in] | coefficient | the coefficient field |
| [in] | velocity | the velocity field |
| [in,out] | matrix_line | the resulting stencil matrix |
| [in] | rec_fast_scheme_backward | the backward reconstruction scheme |
| [in] | rec_fast_scheme_forward | the forward reconstruction scheme |
| [in] | ns | the stencil's bound |
| [in] | i,j,k | the 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.
coefficient argument could be factorized.| 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.
| [in] | coefficient | the coefficient field |
| [in] | velocity | the velocity field |
| [in,out] | matrix_line | the resulting stencil matrix |
| [in] | ns | the stencil's bound |
| [in] | i,j,k | the cell indices |
Compute the third order HOUC3 scheme with variable steps.
coefficient argument could be factorized.| 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.
| [in] | coefficient | the coefficient field |
| [in] | velocity | the velocity field |
| [in,out] | matrix_line | the resulting stencil matrix |
| [in] | ns | the stencil's bound |
| [in] | i,j,k | the 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.
coefficient argument could be factorized.| 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.
| [in] | coefficient | the coefficient field |
| [in] | velocity | the velocity field |
| [in,out] | matrix_line | the resulting stencil matrix |
| [in] | ns | the stencil's bound |
| [in] | i,j,k | the 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.
coefficient argument could be factorized.| 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.
| [in] | coefficient | the coefficient field |
| [in] | velocity | the velocity field |
| [in,out] | matrix_line | the resulting stencil matrix |
| [in] | ns | the stencil's bound |
| [in] | i,j,k | the 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.
coefficient argument could be factorized.| 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.
| [in] | coefficient | the coefficient field |
| [in] | velocity | the velocity field |
| [in,out] | matrix_line | the resulting stencil matrix |
| [in] | ns | the stencil's bound |
| [in] | i,j,k | the cell indices |
Compute the second/third order QUICK scheme with variable steps.
coefficient argument could be factorized.