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.

dfsdt=memsvfsx

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.

dfsdt=qsmemsEfsv

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.

tf(t,x)+Axi(x)f(t,x)=0,xΩ,xΩ,

with

  • f the function to advect. It is defined on Ω domain and the time dimension;
  • A the advection field. It could be defined on a subdomain ΩΩ;
  • and xi 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):
tf(t,x)+Ax(x)xf(t,x)=0,xΩ,

Here Ω=ΩR. In the code, it would correspond to

DFieldX f(idx_range_x);
DFieldX A(idx_range_x);
using IDimInterest = IDimX;
  • Equation on a 2D domain (and time dimension):
tf(t,x,y)+Ax(x,y)xf(t,x,y)=0,

Here Ω=ΩR2. In the code, it would correspond to

DFieldXY f(idx_range_xy);
DFieldXY A(idx_range_xy);
using IDimInterest = IDimX;
  • Equation on a 2Dx2V domain (and time dimension):
tf(t,x,y,vx,vy)+Ax(x,y)xf(t,x,y,vx,vy)=0,

Here ΩR2 and ΩR4. In the code, it would correspond to

DFieldXYVxVy f(idx_range_xyvxvy);
DFieldXY A(idx_range_xy);
using IDimInterest = IDimX;
  • Equation on a 1Dx1V domain (and time dimension):
tf(t,x,vx)+Ax(x,vx)xf(t,x,vx)=0, with for instance, Ax(x,vx)=vx,or tf(t,x,vx)+Avx(x,vx)vxf(t,x,vx)=0, with for instance, Avx(x,vx)=E(x),

Here Ω=ΩR2. In the code, it would correspond to

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):
tfs(t,x,vx)+As,x(x)xfs(t,x,vx)=0,

Here Ω=ΩR2. In the code, it would correspond to

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:

tf(t,x(r,θ),y(r,θ))+A(t,x(r,θ),y(r,θ))f(t,x(r,θ),y(r,θ))=0,

with f(0,x,y)=f0(x,y) and A the advection field.

The characteristics are the solutions X and Y of the equations:

tX(t;s,x,y)=Ax(t,X(t;s,x,y),Y(t;s,x,y)),tY(t;s,x,y)=Ay(t,X(t;s,x,y),Y(t;s,x,y)),X(s;s,x,y)=x,Y(s;s,x,y)=y.

The characteristic X represents the trajectory on the x-dimension of the solution f (idem for Y on the y-dimension). The parametrisation of the trajectory are given after the ";". (X(t;s,x,y),Y(t;s,x,y)) indicates that at the time s, the trajectory passes by the point (x,y). In the backward semi-Lagrangian method, we solve the equation of the characteristics to identify the trajectory of the solution passing by each mesh point (x,y)ij at the time s=t+dt. We are interested in its position at the previous time step t. The conservation property along the characteristics informs us that the value of the function at this position (X(t;s=t+dt,x,y),Y(t;s=t+dt,x,y)) at t is the same as the value of the function at the mesh point (x,y)ij at the time s=t+dt.

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 F:

F:(r,θ)i,j(x,y)i,j.

This adds some steps to the advection operator, we now have to compute

  1. the mesh points in the physical domain using F;
  2. the characteristic feet in the physical domain;
  3. the characteristic feet in the logical domain (polar grid) using F1;
  4. then interpolate the advection function at the characteristic feet in the logical domain.

The third step can be difficult especially if the mapping function F is not analytically invertible. It is not impossible but the computations can be costly.

That is why, we introduce the pseudo-Cartesian domain. We use another mapping function G such that:

G:(r,θ)i,j(x,y)i,j=(rcos(θ),rsin(θ))i,j.

Then the four previous steps become

  1. calculate the mesh points in the pseudo-Cartesian domain using G;
  2. calculate the advection field A in the pseudo-Cartesian domain using the Jacobian matrix of (FG1)1;
  3. calculate the characteristic feet in the pseudo-Cartesian domain;
  4. calculate the characteristic feet in the logical domain (polar grid) using G1;

Here, G is analytically invertible (we can fix G1(x=x0,y=y0)=(r=0,θ=0)) and (JFJG1)1 is well-defined. The details are given in Edoardo Zoni's article [1].

Remark 1: if F is the circular mapping function, then the physical domain and the pseudo-Cartesian domain are the same.

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).