|
| Advection ()=default |
|
| Advection (const Geometry &g) |
| Create Arakawa on a grid. More...
|
|
| Advection (const Geometry &g, bc bcx, bc bcy) |
| Create Advection on a grid using different boundary conditions. More...
|
|
template<class ... Params> |
void | construct (Params &&...ps) |
| Perfect forward parameters to one of the constructors. More...
|
|
template<class ContainerType0 , class ContainerType1 , class ContainerType2 , class ContainerType3 > |
void | upwind (value_type alpha, const ContainerType0 &vx, const ContainerType1 &vy, const ContainerType2 &f, value_type beta, ContainerType3 &result) |
| Compute Advection term \( y = \alpha \vec v\cdot\nabla f + \beta y \). More...
|
|
template<class Geometry, class Matrix, class Container>
struct dg::Advection< Geometry, Matrix, Container >
Upwind discretization of advection operator \( \vec v\cdot\nabla f\)
This is the upwind scheme where a backward derivative is used if v is positive and a forward derivative else For example
advection.upwind( -1., vx, vy, f, 0., df);
void symv(MatrixType &&M, const ContainerType1 &x, ContainerType2 &y)
Definition: blas2.h:287
EllSparseBlockMat< real_type > dx(const aRealTopology2d< real_type > &g, bc bcx, direction dir=centered)
Create 2d derivative in x-direction.
Definition: derivatives.h:33
EllSparseBlockMat< real_type > dy(const aRealTopology2d< real_type > &g, bc bcy, direction dir=centered)
Create 2d derivative in y-direction.
Definition: derivatives.h:65
Upwind discretization of advection operator
Definition: advection.h:44
- Note
- This scheme brings its own numerical diffusion and thus does not need any other artificial viscosity mechanisms. The only places where the scheme might run into oscillations is if there is a stagnation point with v==0 at a fixed position
- See also
- A discussion of this and other advection schemes can be found here https://mwiesenberger.github.io/advection
- Template Parameters
-
Geometry | A type that is or derives from one of the abstract geometry base classes ( aGeometry2d , aGeometry3d , aMPIGeometry2d , ...). Geometry determines which Matrix and Container types can be used: |
Matrix | A class for which the dg::blas2::symv functions are callable in connection with the Container class and to which the return type of dg::create::dx() can be converted using dg::blas2::transfer . The Matrix type can be one of:
|
Container | A data container class for which the blas1 functionality is overloaded and to which the return type of blas1::subroutine() can be converted using dg::assign . We assume that Container is copyable/assignable and has a swap member function. In connection with Geometry this is one of
|
template<class Geometry , class Matrix , class Container >
template<class ContainerType0 , class ContainerType1 , class ContainerType2 , class ContainerType3 >
void dg::Advection< Geometry, Matrix, Container >::upwind |
( |
value_type |
alpha, |
|
|
const ContainerType0 & |
vx, |
|
|
const ContainerType1 & |
vy, |
|
|
const ContainerType2 & |
f, |
|
|
value_type |
beta, |
|
|
ContainerType3 & |
result |
|
) |
| |
Compute Advection term \( y = \alpha \vec v\cdot\nabla f + \beta y \).
This uses the upwind advection mechanism, i.e. a backward derivative for positive v and a forward derivative else
- Parameters
-
alpha | constant |
vx | Velocity in x direction |
vy | Velocity in y direction |
f | function |
beta | constant |
result | Result |
- Template Parameters
-