version 0.6.0
Loading...
Searching...
No Matches

Implicit discretization of a scalar equation defined on cells. More...

Topics

 Cell advection term
 Implicit advection schemes of a scalar equation defined on cells.
 
 Boundary condition treatment
 Boundary condition treatment of a scalar equation defined on cells.
 
 Cell diffusion term
 Implicit diffusion schemes of a scalar equation defined on cells.
 
 Cell linear system preparation
 Cell linear system preparation of a scalar equation defined on cells.
 

Functions

subroutine mod_impose_cell_value::impose_cell_value (matrix, rhs, position, value, stencil_size, equation_ls_map)
 Impose the linear system to yield the given value at the given position.
 

Detailed Description

This directory provides a set of routines to discretize a scalar advection-diffusion equation defined on cells. The general form of the equation is:

\[ \varrho \bigg( \underbrace{ \frac {\alpha \varphi^{n+1} + \beta \varphi^n + \gamma \varphi^{n-1} } {\Delta t}}_{\text{temporal term}} + \underbrace{ \mathbf{u^{n+1}} \cdot \nabla \tilde{\varphi} }_{\text{advection term}} \bigg) = \underbrace{ \nabla \cdot \left( D \nabla \varphi^{n+1} \right)}_{\text{diffusive term}} \]

where \(\varphi\) is the scalar field, \(D\) the diffusion coefficient, and \( \varrho \) an advection coefficient. The discretization of the advection term can be done either implicitly ( \( \tilde{\varphi}=\varphi^{n+1} \)) or eventually ( \( \tilde{\varphi}=\varphi^{n} \)).

This equation becomes a linear system by the discretization process. The matrix and the right-hand side are constructed by the routines defined here in a term-by-term fashion.

Generic routines

First of all, some routines are designed to simply build-up le linear system:

Routine discretize_cell_transport_equation can be used to discretize the whole equation (see solver_energy.f90 for instance)

Todo
DOC need to be completed on this point

Specific routines

These routines are related to the terms described above.

The enumerator enum_cell_advection_term_scheme is useful to provide arguments.

The functions set_diffusion_flux_coef and set_diffusion_flux_coef_2 are useful to provide the arguments.

Boundary conditions

The boundary conditions are imposed by the following routines:

Set-up routines

These routines contribute to the setup of the linear system:

Function Documentation

◆ impose_cell_value()

subroutine mod_impose_cell_value::impose_cell_value ( double precision, dimension(:), intent(inout) matrix,
double precision, dimension(:), intent(inout) rhs,
double precision, dimension(3), intent(in) position,
double precision, intent(in) value,
integer, intent(in) stencil_size,
type(t_ls_map), intent(in) equation_ls_map )

This routine modifies the linear system such as the solution will yield the given value at the given position. Pretty brutal, this routine has been implemented to fix ill-posed linear system such as the Laplace equation with Neumann boundary conditions everywhere.