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.
Similar content being viewed by others
References
Alam, J., Bowman, J.: Energy-conserving simulation of incompressible electro-osmotic and pressure-driven flow. Theoret. Comput. Fluid Dyn. 16, 1–18 (2002)
Ames, W.: Numerical Methods for Partial Differential Equations. Academic Press, San Diego (1977)
Basse, S., Gelder, A.V.: Computer Algorithms. Introduction to Design and Analysis. Addison-Wesley, Ontario (2000)
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)
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)
Bowman, J.C.: Casimir cascades in two-dimensional turbulence. J. Fluid Mech. 729, 364–376 (2013)
Bowman, J.C., Hammerlindl, A.: Asymptote: a vector graphics language. TUGboat Commun. Users Group 29(2), 288–294 (2008)
Bramble, J.H.: Multigrid Methods. Longman Scientific and Technical, London (1993)
Bresenham, J.E.: Algorithm for computer control of a digital plotter. IBM Syst. J. 4, 25–30 (1965)
Courant, R., Friedrichs, K., Lewy, H.: On the partial differential equations of mathematical physics. IBM J. Res. Dev. 11, 215–234 (1967)
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)
Dritschel, D.G.: Contour surgery: a topological reconnection scheme for extended integrations using contour dynamics. J. Comput. Phys. 77(1), 240–266 (1988)
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)
Eyink, G.L.: Exact results on stationary turbulence in 2D: consequences of vorticity. Phys. D. 91, 97–142 (1996)
Falkovich, G., Hanany, A.: Is 2D turbulence a conformal turbulence? Phys. Rev. Lett. 71, 3454–3457 (1993). doi:10.1103/PhysRevLett.71.3454
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)
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)
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)
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)
Grigoryev, Y., Vshivkov, V., Fedoruk, M.: Numerical “Particle-in-Cell” Methods: Theory and Applications. Brill Academic Publishers, Utrecht (2002)
Hackbusch, W.: Multi-Grid Methods and Applications. Series in Computational Mathematics. Springer, New York (1985)
Hammerlindl, A., Bowman, J.C., Prince, R.T.: Asymptote: a descriptive vector graphics language (2004). http://asymptote.sourceforge.net
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)
Lax, P., Wendroff, B.: System of conservation laws. Commun. Pure Appl. Math. 13, 217–237 (1960)
Leboeuf, J., Tajima, T., Dawson, J.: Magnetohydrodynamics particle code for fluid simulation of plasmas. J. Comput. Phys. 31, 379–408 (1979)
Leslie, L.M., Purser, R.J.: Three-dimensional mass-conserving semi-Lagrangian scheme employing forward trajectories. Mon. Weather Rev. 123(8), 25 (1995)
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)
Morrison, P.J.: Hamiltonian description of the ideal fluid. Rev. Mod. Phys. 70, 467–521 (1998)
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)
Polyakov, A.: The theory of turbulence in two dimensions. Nucl. Phys. B 396, 367–385 (1993). doi:10.1016/0550-3213(93)90656-A
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)
Rothstein, D.M., Lovelace, R.V.: Advection of magnetic fields in accretion disks: not so difficult after all. Astrophys. J. 677(2), 1221 (2008)
Sheu, T.W., Yu, C.: Numerical simulation of free surface by an area-preserving level set method. Commun. Comput. Phys. 11(4), 1347 (2012)
Solenthaler, B., Pajarola, R.: Predictive-corrective incompressible sph. In: ACM Transactions on Graphics (TOG), vol. 28, p. 40. ACM (2009)
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)
Wang, Y., Hutter, K.: Comparisons of numerical methods with respect to convectively-dominated problems. Int. J. Numer. Methods Fluids 37, 721–745 (2001)
Woodward, P., Colella, P.: The numerical simulation of two-dimensional fluid flow with strong shocks. J. Comput. Phys. 54, 115–173 (1984)
Woodward, P., Colella, P.: The piecewise parabolic method (PPM) for gas-dynamical simulations. J. Comput. Phys. 54, 174–201 (1984)
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)
Zabusky, N.J., Hughes, M., Roberts, K.: Contour dynamics for the euler equations in two dimensions. J. Comput. Phys. 30(1), 96–106 (1979)
Zalesak, S.T.: Fully multidimensional flux-corrected transport algorithms for fluids. J. Comput. Phys. 31(3), 335–362 (1979)
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)
Author information
Authors and Affiliations
Corresponding author
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).
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
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}\).
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
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}\).
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
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}}\).
In all cases, the distance between the point \(B\) and the new included point is thus always less than \(\overline{AB}\) by an amount
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
where \(r=1/(e-1)\). Since the probability of not having a hole in \(8k\) cells is \((1-1/e)^{8k}\), we get
which on multiplying both sides by \((r+1)^{8k}=(1-1/e)^{-8k}\), can be written as
On differentiating both sides with respect to \(r\) and then multiplying by \(r\), it follows that
The expected number of holes thus evaluates to
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
About this article
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
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10915-014-9928-8
Keywords
- Incompressible viscous fluids
- Lagrangian advection
- Casimir invariants
- Parcel rearrangement
- Relabelling symmetry