Numerical Methods
Lagrangian Advection
In the numerical computation of the FTLE
, we first compute the flow map \(\varphi_{t_n}^{t_{n+1}}(x_n)\), which maps the initial seed point \(x_n\) at time \(t_n\) to time \(t_{n+1}\).
To obtain this map, one must numerically integrate the underlying dynamical system, which is described by the ODE:
where \(\sigma = \pm1\) selects forward or backward integration. During the time integration process, the algorithm frequently queries the flow velocity vector \(\mathbf{u}(\mathbf{x},t)\) at specific locations and moments with very high precision requirements. However, since the data grid is inherently spatially discretized, high-order interpolation methods are required to keep numerical stability and obtain a physically meaningful flow map. Furthermore, when querying the velocity, special wall treatment must be applied at the boundaries to avoid value discontinuities and to represent certain real physical conditions.
Time Integration
Explicit Euler Method
The first-order explicit Euler scheme Euler
advances the position by sampling the velocity at the beginning of the time step:
This method incurs a global error of order \(O(\Delta t)\) and requires only one velocity evaluation per step, therefore has high computational speed.
Runge-Kutta Method
Proposed by Carl Runge and Martin Kutta around 1900, Runge-Kutta methods constitute a widely used family of algorithms for the numerical integration of ODEs.
In an explicit \(s\)-stage Runge-Kutta scheme for this initial-value problem, the solution is advanced over a time step \(\Delta t\) as follows. First, compute the intermediate stage vectors:
and then update the solution:
Here, the boldface stage variables \(\mathbf{k}_i\) represent intermediate slope estimates.
Second-Order Runge-Kutta (RK2, Heun’s)
Heun’s RK2
method attains second-order accuracy by combining predictor and corrector slopes:
This scheme yields a global error of order \(O(\Delta t^2)\) with two velocity evaluations per step.
Classical Fourth-Order Runge-Kutta (RK4)
The classical RK4
method achieves fourth-order accuracy via four slope evaluations at intermediate points:
This yields a global error of order \(O(\Delta t^4)\) with four velocity evaluations per step.
Sixth-Order Runge-Kutta (RK6)
The seven-stage scheme ERK6(7)
uses non-uniform weights to attain global \(O(\Delta t^6)\) accuracy, originating from [Butcher1964].
As for the coefficients for RK6
are more complex to write into equations, the Butcher table is given as follows.
\(c_i\) |
\(a_{i1}\) |
\(a_{i2}\) |
\(a_{i3}\) |
\(a_{i4}\) |
\(a_{i5}\) |
\(a_{i6}\) |
\(a_{i7}\) |
---|---|---|---|---|---|---|---|
\(0\) |
|||||||
\((5\mp\sqrt{5})/10\) |
\((5\mp\sqrt{5})/10\) |
||||||
\((5\pm\sqrt{5})/10\) |
\(\mp\sqrt{5}/10\) |
\((5\pm2\sqrt{5})/10\) |
|||||
\((5\mp\sqrt{5})/10\) |
\((-15\pm7\sqrt{5})/20\) |
\((-1\pm\sqrt{5})/4\) |
\((15\mp7\sqrt{5})/10\) |
||||
\((5\pm\sqrt{5})/10\) |
\((5\mp\sqrt{5})/60\) |
\(0\) |
\(1/6\) |
\((15\pm7\sqrt{5})/60\) |
|||
\((5\mp\sqrt{5})/10\) |
\((5\pm\sqrt{5})/60\) |
\(0\) |
\((9\mp5\sqrt{5})/12\) |
\(1/6\) |
\((-5\pm3\sqrt{5})/10\) |
||
\(1\) |
\(1/6\) |
\(0\) |
\((-55\pm25\sqrt{5})/12\) |
\((-25\mp7\sqrt{5})/12\) |
\(5\mp2\sqrt{5}\) |
\((5\pm\sqrt{5})/2\) |
|
\(b_i\) |
\(1/12\) |
\(0\) |
\(0\) |
\(0\) |
\(5/12\) |
\(5/12\) |
\(1/12\) |
In our computation, the up symbol side is applied, in other words, ±
represents +
, taking \(\lambda=+\sqrt{5}\). With 15 digis are kept, the explicit Butcher table for RK6
used by the author is shown in the following table.
\(c_i\) |
\(a_{i1}\) |
\(a_{i2}\) |
\(a_{i3}\) |
\(a_{i4}\) |
\(a_{i5}\) |
\(a_{i6}\) |
\(a_{i7}\) |
---|---|---|---|---|---|---|---|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0.276393202250021 |
0.276393202250021 |
0 |
0 |
0 |
0 |
0 |
0 |
0.723606797749979 |
-0.223606797749979 |
0.947213595499958 |
0 |
0 |
0 |
0 |
0 |
0.276393202250021 |
0.0326237921249264 |
0.309016994374947 |
-0.0652475842498529 |
0 |
0 |
0 |
0 |
0.723606797749979 |
0.0460655337083368 |
0 |
0.166666666666667 |
0.510874597374975 |
0 |
0 |
0 |
0.276393202250021 |
0.12060113295833 |
0 |
-0.181694990624912 |
0.166666666666667 |
0.170820393249937 |
0 |
0 |
1 |
0.166666666666667 |
0 |
0.0751416197912285 |
-3.38770632020821 |
0.52786404500042 |
3.61803398874989 |
0 |
\(\mathbf{b_i}\) |
0.0833333333333333 |
0 |
0 |
0 |
0.416666666666667 |
0.416666666666667 |
0.0833333333333333 |
Velocity Interpolation
Trilinear
The trilinear
interpolation method is the fastest among all the methods given in PyFTLE3D
, which is a low-order implement.
The continuous velocity field is reconstructed by trilinear interpolation of the component maps u
, v
, w
that live on the eight vertices of a Cartesian cell:
Tricubic Catmull-Rom
The Tricubic Catmull-Rom interpolation tricubic
used here is a separable three-dimensional cubic spline based on the one-dimensional Catmul-Rom spline (parameter a=-0.5
) for velocity fields, which ensures \(C^{1}\) continuity.
The process is given as follows.
The one-dimensional Catmull-Rom interpolation reconstructs a \(C^{1}\)-continuous approximation of velocity at an arbitrary location \(x = i + t\), where \(t \in [0,1)\) and \(i = \lfloor x\rfloor\) on a uniform grid with \(\Delta x = 1\). A four-point stencil is used:
Define coefficients for \(t \in [0,1)\):
The one-dimensional interpolant is:
For three-dimensional interpolation, let the target velocity location be
At each \(z = k + \Delta\) (where \(\Delta \in \{-1,0,1,2\}\)), perform bicubic interpolation (first in x
, then in y
). For each \(y = j + \ell\) (where \(\ell \in \{-1,0,1,2\}\)), compute:
Then combine along y
:
Finally, interpolate along the third direction z
:
Here \(\mathrm{CR}_{1}(⋯; t)\) denotes the one-dimensional Catmull-Rom spline defined above.
Tricubic by F. Lekien I.P.
Marked as tricubicFL
, this variation of tricubic interpolator is still under development by the author.
Hermite
The hermite
is under an internal review by the author, thus the theoretical basis will be stated after that.
WENO
The weighted essentially non-oscillatory WENO
used here is a fifth-order WENO reconstruction (WENO-5). It is suggested to be used in research with intermittent capture need, e.g., high-speed flows and shock capture.
It shows relatively poor performance in general cases, and comsuming more wall time.
The method originates from [Jiang1996] and expanded to three-dimensional computation, and [Shu2009] gave a review on the WEMO method.
The process is given as follows.
The WENO-5 method reconstructs a non-oscillatory, fifth-order-accurate approximation of a function value at an arbitrary location \(x = x_{i+1/2} + t\,\Delta x\), where \(t \in [0,1)\) and \(x_{i+1/2} = x_i + \tfrac{1}{2}\,\Delta x\) on a uniform grid with \(\Delta x = 1\).
A five-point stencil f_{i-2}
, f_{i-1}
, f_i
, f_{i+1}
, f_{i+2}
is used.
Define three overlapping three-point stencils:
On each stencil \(S_{\ell}\) (\(\ell = 0,1,2\)), construct a quadratic polynomial
that interpolates the three values in that stencil at \(x = x_{i+1/2} + t\,\Delta x\).
The coefficients are chosen so that each \(p_{\ell}(t)\) matches \(f\) at the three stencil points.
For \(S_{0} = \{f_{i-2}, f_{i-1}, f_{i}\}\):
For \(S_{1} = \{f_{i-1}, f_{i}, f_{i+1}\}\):
For \(S_{2} = \{f_{i}, f_{i+1}, f_{i+2}\}\):
Once \(p_{0}(t)\), \(p_{1}(t)\), and \(p_{2}(t)\) are defined, compute the Jiang–Shu smoothness indicators \(\beta_{\ell}\) for each stencil:
Fixed linear weights are \((d_{0}, d_{1}, d_{2}) = (0.1,\,0.6,\,0.3)\). Introduce \(\varepsilon = 10^{-6}\) and define unnormalized weights:
Normalize to obtain nonlinear weights \(\omega_{\ell}\):
Finally, reconstruct at \(x = x_{i+1/2} + t\,\Delta x\) by combining:
Wall Treatment
Documentation being constructed
FTLE Computation
Gradient Discretization
Documentation being constructed
Eigenvalue Solver
Documentation being constructed
Windowing for Dynamic LCS
Documentation being constructed
Computational Density and Comparison
Under testing
General Tips
As for your reference, and configured as defaults, the Berkeley LCS Tutorials used RK4
for advection.
The velocity fields were interpolated with tricubic-FL
by them, originating from [Lekien2005], which has higher performance by solving a 64×64 linear system using the function values, gradients, and mixed partial derivatives at its eight corners, which is in future development plan for Py3DFTLE
with high priority.
Although not detailed, grad_order=2
was employed by them from the equation, supposing the mesh is sufficiently refined.
Please always notice that, although providing much better numerical precision and looks cool in papers, high-order methods could be resource-consuming, even several hundred times.