Skip to main content
Log in

A Fully Lagrangian Advection Scheme

  • Published:
Journal of Scientific Computing Aims and scope Submit manuscript

Abstract

A numerical method for passive scalar and self-advection dynamics, Lagrangian rearrangement, is proposed. This fully Lagrangian advection algorithm introduces no artificial numerical dissipation or interpolation of parcel values. In the zero-viscosity limit, it preserves all of the Casimir invariants associated with parcel rearrangement. In the two-dimensional case presented here, these invariants are arbitrary piecewise continuous functions of the vorticity and concentration fields. The initial parcel centroids are evolved in a Lagrangian frame, using the method of characteristics. At any time this Lagrangian solution may be viewed by projecting it onto an Eulerian grid using a rearrangement map. The resulting rearrangement of initial parcel values is accomplished with a weighted Bresenham algorithm, which identifies quasi-optimal, distributed paths along which chains of parcels are pushed to fill in nearby empty cells. The error introduced by this rearrangement does not propagate to future time steps.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15

Similar content being viewed by others

References

  1. Alam, J., Bowman, J.: Energy-conserving simulation of incompressible electro-osmotic and pressure-driven flow. Theoret. Comput. Fluid Dyn. 16, 1–18 (2002)

    Article  Google Scholar 

  2. Ames, W.: Numerical Methods for Partial Differential Equations. Academic Press, San Diego (1977)

    MATH  Google Scholar 

  3. Basse, S., Gelder, A.V.: Computer Algorithms. Introduction to Design and Analysis. Addison-Wesley, Ontario (2000)

    Google Scholar 

  4. Behrens, Mentrup: A conservative scheme for 2D and 3D adaptive semi-Lagrangian advection. In: Shi, Z.C., Chen, Z., Tang, T., Yu, D. (eds.) Recent Advances in Adaptive Computation, vol. 383, pp. 219–234. American Mathematical Society, Providence (2005)

    Google Scholar 

  5. Behrens, J.: A parallel adaptive finite-element semi-Lagrangian advection sheme for the shallow water equations. In: Modeling and Computation in Environmental Sciences. Proceedings of the First GAMM-Seminar at ICA Stuttgart, Notes on Numerical Fluid Mechanics, vol. 59, pp. 49–60. Vieweg, Braunschweig (1997)

  6. Bowman, J.C.: Casimir cascades in two-dimensional turbulence. J. Fluid Mech. 729, 364–376 (2013)

    Article  MATH  MathSciNet  Google Scholar 

  7. Bowman, J.C., Hammerlindl, A.: Asymptote: a vector graphics language. TUGboat Commun. Users Group 29(2), 288–294 (2008)

  8. Bramble, J.H.: Multigrid Methods. Longman Scientific and Technical, London (1993)

    MATH  Google Scholar 

  9. Bresenham, J.E.: Algorithm for computer control of a digital plotter. IBM Syst. J. 4, 25–30 (1965)

    Article  Google Scholar 

  10. Courant, R., Friedrichs, K., Lewy, H.: On the partial differential equations of mathematical physics. IBM J. Res. Dev. 11, 215–234 (1967)

    Article  MATH  MathSciNet  Google Scholar 

  11. Crabtree, H.J., Cheong, E.C., Tilroe, D.A., Backhouse, C.J.: Microchip injection and separation anomalies due to pressure effects. Anal. Chem. 73(17), 4079–4086 (2001)

    Article  Google Scholar 

  12. Dritschel, D.G.: Contour surgery: a topological reconnection scheme for extended integrations using contour dynamics. J. Comput. Phys. 77(1), 240–266 (1988)

    Article  MATH  MathSciNet  Google Scholar 

  13. Dritschel, D.G., Ambaum, M.H.: A contour-advective semi-lagrangian numerical algorithm for simulating fine-scale conservative dynamical fields. Q. J. R. Meteorol. Soc. 123(540), 1097–1130 (1997)

    Article  Google Scholar 

  14. Eyink, G.L.: Exact results on stationary turbulence in 2D: consequences of vorticity. Phys. D. 91, 97–142 (1996)

  15. Falkovich, G., Hanany, A.: Is 2D turbulence a conformal turbulence? Phys. Rev. Lett. 71, 3454–3457 (1993). doi:10.1103/PhysRevLett.71.3454

  16. Fraccarollo, L., Capart, H., Zech, Y.: A Godunov method for the computation of erosional shallow water transients. Int. J. Numer. Methods Fluids 41, 951–976 (2003)

    Article  MATH  Google Scholar 

  17. Gingold, R.A., Monaghan, J.J.: Smoothed particle hydrodynamics-theory and application to non-spherical stars. Month. Not. R. Astron. Soc. 181, 375–389 (1977)

    Article  MATH  Google Scholar 

  18. Godunov, S.: A finite difference method for the numerical computation of discontinuous solutions of the equations of fluid dynamics. Sbornik. Math. 47, 271–290 (1959)

    MathSciNet  Google Scholar 

  19. Gremaud, P.A., Kuster, C.M., Li, Z.: A study of numerical methods for the level set approach. Appl. Numer. Math. 57(5), 837–846 (2007)

    Article  MATH  MathSciNet  Google Scholar 

  20. Grigoryev, Y., Vshivkov, V., Fedoruk, M.: Numerical “Particle-in-Cell” Methods: Theory and Applications. Brill Academic Publishers, Utrecht (2002)

    Book  Google Scholar 

  21. Hackbusch, W.: Multi-Grid Methods and Applications. Series in Computational Mathematics. Springer, New York (1985)

    Book  Google Scholar 

  22. Hammerlindl, A., Bowman, J.C., Prince, R.T.: Asymptote: a descriptive vector graphics language (2004). http://asymptote.sourceforge.net

  23. Kees, C.E., Akkerman, I., Farthing, M.W., Bazilevs, Y.: A conservative level set method suitable for variable-order approximations and unstructured meshes. J. Comput. Phys. 230(12), 4536–4558 (2011)

    Article  MATH  MathSciNet  Google Scholar 

  24. Lax, P., Wendroff, B.: System of conservation laws. Commun. Pure Appl. Math. 13, 217–237 (1960)

    Article  MATH  MathSciNet  Google Scholar 

  25. Leboeuf, J., Tajima, T., Dawson, J.: Magnetohydrodynamics particle code for fluid simulation of plasmas. J. Comput. Phys. 31, 379–408 (1979)

    Article  MATH  MathSciNet  Google Scholar 

  26. Leslie, L.M., Purser, R.J.: Three-dimensional mass-conserving semi-Lagrangian scheme employing forward trajectories. Mon. Weather Rev. 123(8), 25 (1995)

    Article  Google Scholar 

  27. Marchandise, E., Remacle, J.F., Chevaugeon, N.: A quadrature-free discontinuous galerkin method for the level set equation. J. Comput. Phys. 212(1), 338–357 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  28. Morrison, P.J.: Hamiltonian description of the ideal fluid. Rev. Mod. Phys. 70, 467–521 (1998)

    Article  MATH  Google Scholar 

  29. Osher, S., Sethian, J.A.: Fronts propagating with curvature-dependent speed: algorithms based on Hamilton–Jacobi formulations. J. Comput. Phys. 79(1), 12–49 (1988)

    Article  MATH  MathSciNet  Google Scholar 

  30. Polyakov, A.: The theory of turbulence in two dimensions. Nucl. Phys. B 396, 367–385 (1993). doi:10.1016/0550-3213(93)90656-A

    Article  MathSciNet  Google Scholar 

  31. Press, W.H., Teukolsky, S.A., Vetterling, W.T., Flannery, B.P.: Numerical Recipes, The Art of Scientific Computing, 2nd edn. Cambridge Univ. Press, Cambridge (1992)

    Google Scholar 

  32. Rothstein, D.M., Lovelace, R.V.: Advection of magnetic fields in accretion disks: not so difficult after all. Astrophys. J. 677(2), 1221 (2008)

    Article  Google Scholar 

  33. Sheu, T.W., Yu, C.: Numerical simulation of free surface by an area-preserving level set method. Commun. Comput. Phys. 11(4), 1347 (2012)

    Google Scholar 

  34. Solenthaler, B., Pajarola, R.: Predictive-corrective incompressible sph. In: ACM Transactions on Graphics (TOG), vol. 28, p. 40. ACM (2009)

  35. Wang, H., Skamarock, W.C., Feingold, G.: Evaluation of scalar advection schemes in the advanced research WRF model using large-eddy simulations of aerosol–cloud interactions. Month. Weather Rev. 137(8) (2009)

  36. Wang, Y., Hutter, K.: Comparisons of numerical methods with respect to convectively-dominated problems. Int. J. Numer. Methods Fluids 37, 721–745 (2001)

    Article  MATH  Google Scholar 

  37. Woodward, P., Colella, P.: The numerical simulation of two-dimensional fluid flow with strong shocks. J. Comput. Phys. 54, 115–173 (1984)

    Article  MATH  MathSciNet  Google Scholar 

  38. Woodward, P., Colella, P.: The piecewise parabolic method (PPM) for gas-dynamical simulations. J. Comput. Phys. 54, 174–201 (1984)

    Article  MATH  MathSciNet  Google Scholar 

  39. Yong, Z., Benson, D.A., Meerschaert, M.M., Scheffler, H.P.: On using random walks to solve the space-fractional advection–dispersion equations. J. Stat. Phys. 123(1), 89–110 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  40. Zabusky, N.J., Hughes, M., Roberts, K.: Contour dynamics for the euler equations in two dimensions. J. Comput. Phys. 30(1), 96–106 (1979)

    Article  MATH  MathSciNet  Google Scholar 

  41. Zalesak, S.T.: Fully multidimensional flux-corrected transport algorithms for fluids. J. Comput. Phys. 31(3), 335–362 (1979)

    Article  MATH  MathSciNet  Google Scholar 

  42. Zhuang, P., Liu, F., Anh, V., Turner, I.: Numerical methods for the variable-order fractional advection–diffusion equation with a nonlinear source term. SIAM J. Numer. Anal. 47(3), 1760–1781 (2009)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to John C. Bowman.

Additional information

This work was supported by the Natural Sciences and Engineering Council (NSERC) of Canada.

Appendices

Appendix 1: Weighted Bresenham Algorithm

In our weighted version of the Bresenham algorithm, the choice of the next point in the path depends on the weight of the eligible neighbouring cells. Figure 16 shows eight cases depending on the location of the destination point. One seeks a neighbouring cell in the general direction of the path with the lowest weight. If the slope is zero, the cells to the north-east, east, and south-east of the current cell are searched. The north-east and east cells are searched if the slope is between zero and one, the north, north-east, and east cells are searched if the slope is one, and the north and north-east cells are searched if the slope is greater than one. If the slope is infinity, the cells to the north-west, north, and north-east of the current cell are searched. Should the weight of two or more cells be the same, the original Bresenham algorithm will be the tie-breaker. The following is Asymptote code (a vector graphics language for technical drawing [7, 22]), along with eight sample output paths, for our weighted Bresenham algorithm (optimized so that all cases are mapped to the first quadrant).

Fig. 16
figure 16

Paths of local minimal weight from the center circle to eight edge circles, as determined by the weighted Bresenham algorithm and the indicated numerical parcel weights

figure b

Appendix 2: Termination of Weighted Bresenham Algorithm

Theorem 1

(Termination of weighted Bresenham) The weighted Bresenham algorithm produces a finite path between any two points on a regular lattice. For a unit square lattice, at most \(\left\lceil 1.82x \right\rceil \) steps are needed to connect two points that are a distance \(x\) apart.

Proof

Let \(A\) and \(B\) be given on the grid. We want to find the desired path between them. For simplicity, we assume that \(B\) is inside or on the boundary of the first octant with respect to \(A\). Without loss of generality, consider a unit square lattice. As described before, depending on the position of \(B\), we have either two or three choices for the next cell to be included in the path. If one of these choices is the grid point \(B\), we are done; the algorithm terminates after choosing \(B\). Otherwise, in choosing one of the immediate neighbours of the current cell, we will take a step of size 1 or \(\sqrt{2}\). We must show that there exists a fixed number \(\delta > 0\) such that the distance to the point \(B\) in each step is always reduced by at least \(\delta \). The algorithm will then terminate in a finite number of steps.

Case (i): Assume \(B\) lies on the same horizontal line as \(A\), so that the slope of the line from \(A\) to \(B\) is zero, (\(m=0\)). In this case (Fig. 17), the next point in the path is one of the points \(C\), \(D\), or \(F\). If we choose \(D\), then since \(\overline{DB}=\overline{AB}-1\), a step of 1 is taken toward \(B\). Suppose instead that we choose \(C\). On letting \(x=\overline{AB} \ge 2\) and \(\delta =x-\overline{CB} =1+\overline{DB}-\overline{CB} < 1\) (since \(\overline{DB} < \overline{CB}\)), and noting that \(\delta =\overline{AD}+\overline{DB}-\overline{CB}= \overline{CD}+\overline{DB}-\overline{CB} > 0\), we find that

$$\begin{aligned} (x-\delta )^2=\overline{CB}^2= \overline{DB}^2+1= (\overline{AB}-1)^2+1 = \overline{AB}^2-2\overline{AB}+2=x^2-2x+2, \end{aligned}$$

so that \(-2x\delta +\delta ^2=-2x+2.\) We then deduce from \(x\ge 2\) that \( 2-\delta ^2=2x(1-\delta ) \ge 4(1-\delta ).\) Thus \(\delta ^2-4\delta +2 \le 0 \implies \delta \in \left[ 2-\sqrt{2},1\right) .\) The same argument of course also holds for the choice \(F\). The distance reduction in this case is thus at least \(2-\sqrt{2}\).

Fig. 17
figure 17

Case(i): \(m=0\)

Case (ii): Assume that the slope of the line from \(A\) to \(B\) is 1. In this case (Fig. 18), the next point in the path will be one of the points \(C\), \(D\), or \(F\). Here \(\overline{AB} = \overline{DB}-\sqrt{2}\). If we choose \(D\), we take a step of size \(\sqrt{2}\) toward \(B\). Suppose instead that we choose \(C\). We see that \(\overline{CH}=\overline{AH}=1/\sqrt{2}\). On letting \(x=\overline{AB}\), we obtain

$$\begin{aligned} (x-\delta )^2=\overline{CB}^2=\overline{HB}^2+\overline{CH}^2 =\left( x-\frac{1}{\sqrt{2}}\right) ^2+\frac{1}{2}= x^2-\sqrt{2}x+1. \end{aligned}$$

Thus \( -2x\delta +\delta ^2=-\sqrt{2}x+1.\) We know that \(x\ge 2\sqrt{2} \) since \(B\) is not one of the choices, so \(\delta ^2-1=x(2\delta -\sqrt{2})\ge 2\sqrt{2}(2\delta -\sqrt{2})=4\sqrt{2}\delta -4.\) Now \(\delta ^2-4\sqrt{2}\delta +3 \le 0 \implies \delta \ge 2\sqrt{2}-\sqrt{5}\). The same argument of course also holds for the choice \(F\). The distance reduction in this case is thus at least \(2\sqrt{2}-\sqrt{5}\).

Fig. 18
figure 18

Case(ii): \(m=1\)

Case (iii): Assume \(B\) lies inside the first octant (\(0<m<1\)). In this case, Fig. 19, the next point in the path is one of the two points \(C_1\) or \(C_2\). Let \(x=\overline{AB}\). Notice that \(x \ge \sqrt{5}\) since \(B\) is not one of the points \(C_1\) or \(C_2\). Let \(C\) be the point (\(C_1\) or \(C_2\)) that is selected, drop the perpendicular \(\overline{CH}\) to \(\overline{AB}\). Let \(y=\overline{CB}\) and \(z=\overline{AC}\) and note that \(z=1\) if \(C=C_1\) and \(z=\sqrt{2}\) if \(C=C_2\). Since \(0 < \angle CAH < \pi /4\), we know that \(\overline{AH}/z > 1/\sqrt{2}\). On letting \(\delta =x-\overline{CB}\), we find that

$$\begin{aligned} (x-\delta )^2&= \overline{CB}^2=\overline{HB}^2+\overline{CH}^2 = (\overline{AB}-\overline{AH})^2+\overline{AC}^2-\overline{AH}^2 \\&= x^2-2x\overline{AH}+z^2 < x^2-2x \frac{z}{\sqrt{2}}+z^2. \end{aligned}$$

Thus \(-2x\delta +\delta ^2 < -\sqrt{2}xz+z^2,\) so that \( z^2-\delta ^2 > x(\sqrt{2}z-2\delta ) \ge \sqrt{5}(\sqrt{2}z-2\delta ).\) Hence, \(\delta ^2 -2\sqrt{5}\delta +\sqrt{10} z-z^2 < 0\). For \(z=1\) this implies that \(\delta > \sqrt{5}-\sqrt{6-\sqrt{10}}\) and for \(z=\sqrt{2}\) this implies that \(\delta > \sqrt{5}-\sqrt{7-2\sqrt{5}}\).

Fig. 19
figure 19

Case(iii): \(0<m<1\)

In all cases, the distance between the point \(B\) and the new included point is thus always less than \(\overline{AB}\) by an amount

$$\begin{aligned} \delta&= \mathop {\mathrm{min}}\nolimits \left\{ 1, \sqrt{2}, 2-\sqrt{2}, 2\sqrt{2}-\sqrt{5}, \sqrt{5}-\sqrt{6-\sqrt{10}}, \sqrt{5}-\sqrt{7-2\sqrt{5}}\right\} \\&= \sqrt{5}-\sqrt{6-\sqrt{10}} > 0.551. \end{aligned}$$

That is, at most \(\left\lceil 1.82\overline{AB}\,\right\rceil \) steps will be required to reach the point \(B\). \(\square \)

Appendix 3: Multiple-Hole Expected Value

The expected number of holes in a shell \(k\) (with \(8k\) cells) containing a hole is

$$\begin{aligned} \left<j\right>= \frac{\sum _{j=1}^{8k} j {8k\atopwithdelims ()j} \left( 1-\frac{1}{e} \right) ^{8k-j} \left( \frac{1}{e}\right) ^j}{\sum _{j=1}^{8k} {8k\atopwithdelims ()j} \left( 1-\frac{1}{e} \right) ^{8k-j}\left( \frac{1}{e}\right) ^j}=\frac{\sum _{j=1}^{8k} j {8k\atopwithdelims ()j} r^j}{\sum _{j=1}^{8k} {8k\atopwithdelims ()j} r^j}, \end{aligned}$$

where \(r=1/(e-1)\). Since the probability of not having a hole in \(8k\) cells is \((1-1/e)^{8k}\), we get

$$\begin{aligned} \sum _{j=1}^{8k} {8k\atopwithdelims ()j} \left( 1-\frac{1}{e} \right) ^{8k-j}\left( \frac{1}{e}\right) ^j=1-\left( 1-\frac{1}{e}\right) ^{8k}, \end{aligned}$$

which on multiplying both sides by \((r+1)^{8k}=(1-1/e)^{-8k}\), can be written as

$$\begin{aligned} \sum _{j=1}^{8k} {8k\atopwithdelims ()j} r^j=(r+1)^{8k}-1. \end{aligned}$$

On differentiating both sides with respect to \(r\) and then multiplying by \(r\), it follows that

$$\begin{aligned} \sum _{j=1}^{8k} {8k\atopwithdelims ()j} jr^j=8kr(r+1)^{8k-1}. \end{aligned}$$

The expected number of holes thus evaluates to

$$\begin{aligned} \left<j\right>=\frac{\displaystyle 8kr(r+1)^{8k-1}}{(r+1)^{8k}-1} =\frac{\displaystyle 8k\left( 1-\frac{1}{r+1}\right) }{1-(r+1)^{-8k}} =\frac{\displaystyle 8k\left( \frac{1}{e}\right) }{\displaystyle 1-\left( 1-\frac{1}{e}\right) ^{8k}}. \end{aligned}$$

This of course is just the probability \(1/e\) of finding a hole times the number of holes, conditioned on the probability that the shell contains at least one hole.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Bowman, J.C., Yassaei, M.A. & Basu, A. A Fully Lagrangian Advection Scheme. J Sci Comput 64, 151–177 (2015). https://doi.org/10.1007/s10915-014-9928-8

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10915-014-9928-8

Keywords

Mathematics Subject Classification

Navigation