Node level (cell, face, edge, vertex, point) discrete schemes. More...
Topics | |
Discrete Derivatives | |
The Discrete Derivatives module. | |
Extrapolation | |
Extrapolation schemes. | |
Finite Differences | |
Finite differences schemes. | |
Integration | |
Integration schemes. | |
Interpolation | |
Interpolation schemes for grid elements and points | |
Namespaces | |
module | mod_node_level_schemes_init |
Initialization of declared node level schemes. | |
module | mod_interpolation_polynomial |
Polynomial functions. | |
This module has been made to simplify the discretization of various PDE systems that rely on various schemes. They can be used to discretize in an explicit or implicit manner. All of them are based on the principle of stencils that are simply an array of weights associated to some field discrete values positionned at nodes (hence the name of the module). They can be used in a more general way, even without an underlying grid.
The overall objective is to furnish to the developper a toolbox of easy to use schemes that are useful when discretizing.
The module is subdivided in 4 categories:
We have chosen a common organization for each submodule.
stencil
They are based on a main type
that uses an underlying stencil
. The principle of a generic discrete stencil still has to be applied to all the modules. A stencil is an array of values that represente the weights that are associated for discrete node values and which defines the scheme. For compactness reseaons, the stencil is defined between index_start
and index_end
, where \(index_{end}-index_{start}+1\) is the size of the stencil.
-2
node, simply get the stencil%weight(-2)
value.By convention, we define the 0
index as the reference node index.
To explicitely compute the discrete value of the scheme, one simply has to supply the discrete values at the associated nodes.
The extrapolation, interpolation and integration modules share the same principle.
type_discrete_stencil
for all submoduleschemes
A lot of schemes have already been developped. They are made in order to work with possibly variable steps between nodes (or, if not, the precision of the schemes may diminish). All the schemes are grouped in the corresponding subdirectory and are named in such a way that they are clearly identifiable.
The various schemes have to be initialized properly before being used, as their supporting stencil can vary. Thus, one has to call the associated init
subroutine which do it for the various predefined schemes. The initialization is already called in Notus main function.
computer
A collection of Fortran generic functions have been developped for each submodule to ease the use of schemes. They are named computers, as they are used to compute the schemes' stencil and explicit value.
Imagine that you want to compute the third order backward extrapolation of a set of discrete node values at a distance d
away from the 0
node, one would use:
where h1
is the spacing between the first two nodes (similarly for h2
) and phi0
is the discrete value of a function \(\phi\) at the 0
node.
Now if you want to compute the centered second order second derivative of a function defined on a 3D grid, at the position i,j,k
(which represent the local 0
node) in the \(z\) direction:
where x_step_array
is the array of steps separating the discrete nodes (ie. dx
in Notus for pressure nodes), phi_field
is a 3D scalar array (ie. pressure
in Notus for the pressure field), and the later 3
relates to the third dimension ( \(z\)).
Anyone can also use the schemes for implicit discretization: One simply has to fill the weights of a scheme with the supplied steps and recover its value in the stencil's array.