Advection methods
The advection/
folder gathers the backward semi lagrangian scheme classes. There are two main classes, AdvectionSpatial and AdvectionVelocity. Implementing these operators separately makes sense, since we are using time splitting.
The feet of the characteristic curves are used to interpolate the updated distribution function on mesh points. It uses batched interpolators so the interpolation step is done over the whole distribution function.
Spatial advection
Here the purpose is the advection along a direction on the physical space dimension of the phase space. The dynamics of the motion on the spatial dimension are governed by the following equation.
Velocity advection
Here the purpose is the advection along a direction on the velocity space dimension of the phase space. The dynamics of the motion on the velocity dimension are governed by the following equation, where E is the electric field.
1D advection with a given advection field
The purpose of the BslAdvection1D operator is an advection along a given direction of the phase space. The advection field is given as input. The dynamics of the motion are governed by the following equation.
with
the function to advect. It is defined on domain and the time dimension; the advection field. It could be defined on a subdomain ;- and
a given direction. The advection field domain has to be defined on this dimension for the time integration method.
Example of use
Here are some examples of equation types the BslAdvection1D operator can solve:
- Equation on a 1D domain (and time dimension):
Here
DFieldX f(idx_range_x);
DFieldX A(idx_range_x);
using IDimInterest = IDimX;
- Equation on a 2D domain (and time dimension):
Here
DFieldXY f(idx_range_xy);
DFieldXY A(idx_range_xy);
using IDimInterest = IDimX;
- Equation on a 2Dx2V domain (and time dimension):
Here
DFieldXYVxVy f(idx_range_xyvxvy);
DFieldXY A(idx_range_xy);
using IDimInterest = IDimX;
- Equation on a 1Dx1V domain (and time dimension):
Here
DFieldXVx f(idx_range_xvx);
DFieldXVx A(idx_range_xvx);
using IDimInterest = IDimX;
or
using IDimInterest = IDimVx;
- Equation on a 1Dx1V domain with species dimension (and time dimension):
Here
DFieldSpXVx f(idx_range_sp_xvx);
DFieldSpX A(idx_range_sp_x);
using IDimInterest = IDimX;
Parameters
The operator takes as templated parameters:
- IDimInterest: a dimension of interest (or advection dimension) which refers to the dimension along which we advect the function;
- AdvectionDomain: an advection domain, which refers to the domain where the advection field is defined. It has to contain the dimension of interest for the interpolation of the advection field in the time integration method;
- FunctionDomain: the full domain where the function we want to advect is defined;
- AdvectionFieldBuilder: a spline builder type for the advection field.
- AdvectionFieldEvaluator: a spline evaluator type for the advection field.
- TimeStepper: a time integration method (see timestepper) to solve the characteristic equation. It has to be defined on the advection field domain. The feet have to be a Field of coordinates of the dimension of interest defined on the advection field domain.
Remark/Warning: the BslAdvection1D operator is built with builder and evaluator for the advection field and interpolator for the function we want to advect. Theses operators have to be defined on the same domain as the advection field and function. For instance, if the advection field and/or the function are defined on the species dimension, then the interpolators have to contain the species dimension in its batched dimensions (see tests in the tests/advection/
folder).
Remark/Warning: The advection field need to use interpolation on B-splines. So we cannot use other type of interpolator for the advection field. However there is no constraint on the interpolator of the advected function.
PolarFootFinder
These methods are designed to calculate the foot of the characteristic on the polar plane for a 2D transport equation of the type:
with
The characteristics are the solutions
The characteristic
The characteristic feet are calculated using a time integration method. For details of available methods see timestepper.
Advection domain
There are two advection domains to consider:
- the physical domain;
- the pseudo-Cartesian domain.
The logical domain is not used as it would be hard to calculate the feet close to the O-point in this domain.
It seems logical to use the physical domain, where the studied equation is given, as the advection domain.
However, we want to solve this equation on a polar grid. So before advecting, we have to
compute the mesh points in the physical domain using a mapping function
This adds some steps to the advection operator, we now have to compute
- the mesh points in the physical domain using
; - the characteristic feet in the physical domain;
- the characteristic feet in the logical domain (polar grid) using
; - then interpolate the advection function at the characteristic feet in the logical domain.
The third step can be difficult especially if the mapping function
That is why, we introduce the pseudo-Cartesian domain.
We use another mapping function
Then the four previous steps become
- calculate the mesh points in the pseudo-Cartesian domain using
; - calculate the advection field
in the pseudo-Cartesian domain using the Jacobian matrix of ; - calculate the characteristic feet in the pseudo-Cartesian domain;
- calculate the characteristic feet in the logical domain (polar grid) using
;
Here,
Remark 1: if
Remark 2: if the mapping function is analytically invertible, it is less costly to advect in the physical domain.
References
[1] Edoardo Zoni, Yaman Güçlü. "Solving hyperbolic-elliptic problems on singular mapped disk-like domains with the method of characteristics and spline finite elements". (https://doi.org/10.1016/j.jcp.2019.108889.) Journal of Computational Physics (2019).