# Lightning Solvers for Potential Flows

## Abstract

**:**

## 1. Introduction

`laplace.m`available at [39]. The reported solve times are based on computations performed on a 2015 MacBook Pro with a 2.9 GHz processor.

## 2. Method

#### 2.1. The Lightning Method

Algorithm 1: Laplace lightning solver (Gopal and Trefethen, 2019 [6]). |

#### 2.2. Compression of Solutions

## 3. Results and Discussion

#### 3.1. Potential Flows

#### 3.2. Periodic Domains

#### 3.3. The Kutta Condition

#### 3.4. Vortex Dynamics

#### 3.5. Free-Streamline Flows

## 4. Conclusions

## Funding

## Acknowledgments

## Conflicts of Interest

## References

- Lehman, R. Developments at an analytic corner of solutions of elliptic partial differential equations. Indiana Univ. Math. J.
**1959**, 8, 727–760. [Google Scholar] [CrossRef] - Arndt, D.; Bangerth, W.; Blais, B.; Clevenger, T.C.; Fehling, M.; Grayver, A.V.; Heister, T.; Heltai, L.; Kronbichler, M.; Maier, M.; et al. The deal.II library, Version 9.2. J. Numer. Math.
**2020**, 28, 131–146. [Google Scholar] [CrossRef] - Logg, A.; Mardal, K.A.; Wells, G.N. Automated Solution of Differential Equations by the Finite Element Method; Lecture Notes in Computational Science and Engineering; Springer: Berlin/Heidelberg, Germany, 2012; Volume 84 LNCSE, pp. 1–736. [Google Scholar] [CrossRef]
- Aliabadi, M.H.; Wen, P.H. Boundary element methods in engineering course. Eng. Anal.
**1984**, 1, 61–62. [Google Scholar] [CrossRef] - Serkh, K.; Rokhlin, V. On the solution of elliptic partial differential equations on regions with corners. J. Comput. Phys.
**2016**, 305, 150–171. [Google Scholar] [CrossRef] [Green Version] - Gopal, A.; Trefethen, L.N. Solving Laplace problems with corner singularities via rational functions. SIAM J. Numer. Anal.
**2019**, 57, 2074–2094. [Google Scholar] [CrossRef] - Gopal, A.; Trefethen, L.N. New Laplace and Helmholtz solvers. Proc. Natl. Acad. Sci. USA
**2019**, 116, 10223–10225. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Joukowski, N. Über die Konturen der Tragflächen der Drachenflieger. Z. Flugtech. Mot.
**1910**, 1, 281–284. [Google Scholar] - Theodorsen, T. General Theory of Aerodynamic Instability and the Mechanism of Flutter; National Aeronautics and Space Administration: Washington, DC, USA, 1979; pp. 291–311.
- Sears, W.R. Some Aspects of Non-Stationary Airfoil Theory and Its Practical Application. J. Aeronaut. Sci.
**1941**, 8, 104–108. [Google Scholar] [CrossRef] - Wu, T.Y.T. Swimming of a waving plate. J. Fluid Mech.
**1961**, 10, 321–344. [Google Scholar] [CrossRef] - Cordes, U.; Kampers, G.; Meiner, T.; Tropea, C.; Peinke, J.; Hölling, M. Note on the limitations of the Theodorsen and Sears functions. J. Fluid Mech.
**2017**, 811, R11–R111. [Google Scholar] [CrossRef] - Wei, N.J.; Kissing, J.; Wester, T.T.; Wegt, S.; Schiffmann, K.; Jakirlic, S.; Hölling, M.; Peinke, J.; Tropea, C. Insights into the periodic gust responseA ofA airfoils. J. Fluid Mech.
**2019**, 876, 237–263. [Google Scholar] [CrossRef] [Green Version] - Van Dyke, M. Perturbation Methods in Fluid Mechanics; Academic Press: New York, NY, USA, 1964. [Google Scholar]
- Brown, C.E.; Michael, W.H. Effect of leading-edge separation on the lift of a delta wing. J. Aeronaut. Sci.
**1954**, 21, 690–694. [Google Scholar] [CrossRef] - Michelin, S.; Llewellyn Smith, S.G. An unsteady point vortex method for coupled fluid-solid problems. Theor. Comput. Fluid Dyn.
**2009**, 23, 127–153. [Google Scholar] [CrossRef] [Green Version] - Southwick, O.R.; Johnson, E.R.; McDonald, N.R. A point vortex model for the formation of ocean eddies by flow separation. Phys. Fluids
**2015**, 27, 16604. [Google Scholar] [CrossRef] [Green Version] - Manela, A.; Halachmi, M. Mechanisms of sound amplification and sound reduction in the flapping flight of side-by-side airfoils. J. Sound. Vib.
**2015**, 346, 216–228. [Google Scholar] [CrossRef] - Pullin, D. Contour Dynamics Methods. Annu. Rev. Fluid Mech.
**1992**, 24, 89–115. [Google Scholar] [CrossRef] - Krasny, R. Desingularization of periodic vortex sheet roll-up. J. Comput. Phys.
**1986**, 65, 292–313. [Google Scholar] [CrossRef] - Wu, T.Y.T. A wake model for free-streamline flow theory: Part 1. Fully and partially developed wake flows past an oblique flat plate. J. Fluid Mech.
**1962**, 13, 161–181. [Google Scholar] [CrossRef] - Hassenpflug, W.C. Free-streamlines. Comput. Math. Appl.
**1998**, 36, 69–129. [Google Scholar] [CrossRef] [Green Version] - Driscoll, T.A.; Trefethen, L.N. Schwarz-Christoffel Mapping; Cambridge University Press: Cambridge, UK, 2002. [Google Scholar]
- Crowdy, D.G.; Marshall, J. Conformal mappings between canonical multiply connected domains. Comput. Methods Funct. Theory
**2006**, 6, 59–76. [Google Scholar] [CrossRef] - Nehari, Z. Conformal Mapping; McGraw-Hill: New York, NY, USA, 1952. [Google Scholar]
- Crowdy, D.G. Solving problems in multiply connected domains. In SIAM CBMS-NSF Regional Conference Series in Applied Mathematics; SIAM: Philadelphia, PA, USA, 2020. [Google Scholar]
- Crowdy, D.G. A new calculus for two-dimensional vortex dynamics. Theor. Comput. Fluid Dyn.
**2010**, 24, 9–24. [Google Scholar] [CrossRef] - Baddoo, P.J.; Ayton, L.J. A calculus for flows in periodic domains. Theor. Comput. Fluid Dyn.
**2020**, arXiv:2001.00859. [Google Scholar] [CrossRef] - Crowdy, D.G.; Kropf, E.H.; Green, C.C.; Nasser, M.M.S. The Schottky-Klein prime function: A theoretical and computational tool for applications. IMA J. Appl. Math.
**2016**, 81, 589–628. [Google Scholar] [CrossRef] [Green Version] - Lin, C.C. On the motion of vortices in two dimensions: I. Existence of the Kirchhoff–Routh function. Proc. Natl. Acad. Sci. USA
**1941**, 27, 575–577. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Crowdy, D.G.; Marshall, J. Analytical formulae for the Kirchhoff-Routh path function in multiply connected domains. Proc. R. Soc. A Math. Phys. Eng. Sci.
**2005**, 461, 2477–2501. [Google Scholar] [CrossRef] - Baddoo, P.J.; Ayton, L.J. Potential flow through a cascade of aerofoils: Direct and inverse problems. Proc. R. Soc. A Math. Phys. Eng. Sci.
**2018**, 474, 20180065. [Google Scholar] [CrossRef] [Green Version] - Hajian, R.; Jaworski, J.W. The steady aerodynamics of aerofoils with porosity gradients. Proc. R. Soc. A Math. Phys. Eng. Sci.
**2017**, 473, 20170266. [Google Scholar] [CrossRef] - Moore, M.N.J. Riemann–Hilbert problems for the shapes formed by bodies dissolving, melting, and eroding in fluid flows. Commun. Pure Appl. Math.
**2017**, 70, 1810–1831. [Google Scholar] [CrossRef] - Crighton, D.G. The Kutta condition in unsteady flow. Annu. Rev. Fluid Mech.
**1985**, 17, 411–445. [Google Scholar] [CrossRef] - Eldredge, J.D. Mathematical Modeling of Unsteady Inviscid Flows; Interdisciplinary Applied Mathematics; Springer International Publishing: New York, NY, USA, 2019; Volume 50, p. 461. [Google Scholar] [CrossRef]
- Ramesh, K.; Gopalarathnam, A.; Granlund, K.; Ol, M.V.; Edwards, J.R. Discrete-vortex method with novel shedding criterion for unsteady aerofoil flows with intermittent leading-edge vortex shedding. J. Fluid Mech.
**2014**, 751, 500–538. [Google Scholar] [CrossRef] - Darakananda, D.; da Silva, A.F.d.C.; Colonius, T.; Eldredge, J.D. Data-assimilated low-order vortex modeling of separated flows. Phys. Rev. Fluids
**2018**, 3, 124701. [Google Scholar] [CrossRef] - Trefethen, L.N. Lightning Laplace Software. 2020. Available online: https://people.maths.ox.ac.uk/trefethen/lightning (accessed on 21 November 2020).
- Trefethen, L.N. Approximation Theory and Approximation Practice, Extended Edition; SIAM: Philadelphia, PA, USA, 2019. [Google Scholar]
- Newman, D.J. Rational approximation to |x|. Mich. Math. J.
**1964**, 11, 11–14. [Google Scholar] [CrossRef] - Trefethen, L.N.; Nakatsukasa, Y.; Weideman, J.A.C. Exponential Node Clustering at Singularities for Rational Approximation, Quadrature, and PDEs. Numer. Math.
**2020**, in press. [Google Scholar] - Brubeck, P.D.; Nakatsukasa, Y.; Trefethen, L.N. Vandermonde with Arnoldi. SIAM Rev.
**2020**, in press. [Google Scholar] - Fairweather, G.; Karageorghis, A. The method of fundamental solutions for elliptic boundary value problems. Adv. Comput. Math.
**1998**, 9, 69–95. [Google Scholar] [CrossRef] - Mathon, R.; Johnston, R.L. The approximate solution of elliptic boundary-value problems by fundamental solutions. SIAM J. Numer. Anal.
**1977**, 14, 638–650. [Google Scholar] [CrossRef] - Kupradze, V.D.; Aleksidze, M.A. The method of functional equations for the approximate solution of certain boundary value problems. USSR Comput. Math. Math. Phys.
**1964**, 4, 82–126. [Google Scholar] [CrossRef] - Nakatsukasa, Y.; Sète, O.; Trefethen, L.N. The AAA algorithm for rational approximation. SIAM J. Sci. Comput.
**2018**, 40, A1494–A1522. [Google Scholar] [CrossRef] - Nakatsukasa, Y.; Trefethen, L.N. An algorithm for real and complex rational minimax approximation. SIAM J. Sci. Comput.
**2020**, 42, A3157–A3179. [Google Scholar] [CrossRef] - Driscoll, T.A.; Hale, N.; Trefethen, L.N. Chebfun Guide; Pafnuty Publications: Oxford, UK, 2014. [Google Scholar]
- Baddoo, P.J. The AAAtrig algorithm for rational approximation of periodic functions. arXiv
**2020**, arXiv:2008.05446. [Google Scholar] - Gopal, A.; Trefethen, L.N. Representation of conformal maps by rational functions. Numer. Math.
**2019**, 142, 359–382. [Google Scholar] [CrossRef] [Green Version] - Howell, L.H. Numerical conformal mapping of circular arc polygons. J. Comput. Appl. Math.
**1993**, 46, 7–28. [Google Scholar] [CrossRef] [Green Version] - Crowdy, D.G. Effective slip lengths for immobilized superhydrophobic surfaces. J. Fluid Mech.
**2017**, 825, R2. [Google Scholar] [CrossRef] [Green Version] - Vasconcelos, G.L. Multiple bubbles and fingers in a Hele-Shaw channel: Complete set of steady solutions. J. Fluid Mech.
**2015**, 780, 299–326. [Google Scholar] [CrossRef] [Green Version] - Baddoo, P.J.; Crowdy, D.G. Periodic Schwarz–Christoffel mappings with multiple boundaries per period. Proc. R. Soc. A
**2019**, 475. [Google Scholar] [CrossRef] [Green Version] - Llewellyn Smith, S.G. How do singularities move in potential flow? Phys. D Nonlinear Phenom.
**2011**, 240, 1644–1651. [Google Scholar] [CrossRef] [Green Version] - Aref, H. Point vortex dynamics: A classical mathematics playground. J. Math. Phys.
**2007**, 48, 065401. [Google Scholar] [CrossRef] [Green Version] - Saffman, P.G. Vortex Dynamics; Cambridge University Press: Cambridge, UK, 1993. [Google Scholar]
- Crowdy, D.G. The Schwarz–Christoffel mapping to bounded multiply connected polygonal domains. Proc. R. Soc. A Math. Phys. Eng. Sci.
**2005**, 461, 2653–2678. [Google Scholar] [CrossRef] - Trefethen, L.N. Numerical conformal mapping with rational functions. Comput. Methods Funct. Theory
**2020**, 20, 369–387. [Google Scholar] [CrossRef] - Howe, M.S. Theory of Vortex Sound; Cambridge University Press: Cambridge, UK, 2003; p. 216. [Google Scholar]
- Lin, C.C. On the Motion of Vortices in Two Dimensions: II. Some Further Investigations on the Kirchhoff-Routh Function. Proc. Natl. Acad. Sci. USA
**1941**, 27, 575–577. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Elcrat, A.R.; Trefethen, L.N. Classical free-streamline flow over a polygonal obstacle. J. Comput. Appl. Math.
**1986**, 14, 251–265. [Google Scholar] [CrossRef] [Green Version] - Hureau, J.; Brunon, E.; Legallais, P. Ideal free streamline flow over a curved obstacle. J. Comput. Appl. Math.
**1996**, 72, 193–214. [Google Scholar] [CrossRef] [Green Version]

**Figure 1.**Incompressible, irrotational (i.e., potential) flow past a square circular sector removed. The problem takes 0.5 s to solve to six digits of accuracy and 5 s for eight digits. In (

**a**) the black dots represent the poles. The background colour in (

**a**) represents the horizontal velocity of the perturbation to the flow from uniformity. Note that in (

**b**) the y-axis is on a log scale whereas the x-axis is $\sqrt{n}$, so that a straight line indicates root-exponential convergence.

**Figure 2.**An example of AAA compression for the flow past a rectangle with a reentrant corner. The black dots in (

**a**) and (

**b**) indicate the poles used to represent the full and compressed solutions respectively.

**Figure 3.**Uniform flow past the polycircular domain from [52] with embedded point vortices. The lines are the streamlines and background color is the horizontal perturbation velocity. The black dots represent the prescribed poles of the rational function. The solution converges to five digits of accuracy in 0.8 s and 8 digits in 6 s.

**Figure 4.**Uniform flow past a periodic array of boundaries with embedded point vortices. The black dots represent the prescribed poles of the rational function. The solution converges to 9 digits of accuracy in 0.8 s.

**Figure 5.**An illustration of the effects of the Kutta condition on the flow past a bullet-shaped object. The solutions are computed to 6 digits of accuracy; in (

**a**) the solver takes 0.3 s and in (

**b**) the solver takes 0.8 s. The color scale is the same in both figures.

**Figure 6.**An example of a conformal map computed using the method of [60]. The red dots indicate the poles of the map and their size is proportional to their residue.

**Figure 7.**The trajectories of 30 vortices computed with the lightning method. The circulations of the vortices are randomly distributed in the interval $[-1,1]$. The initial positions of the vortices are equispaced on a circle, as indicated by the coloured dots. The background flow is set to $U=0$.

**Figure 8.**The separated flow past a flat plate at angle of attack $-\pi /8$. The lines are the streamlines and the colour represents the vertical velocity component.

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2020 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Baddoo, P.J.
Lightning Solvers for Potential Flows. *Fluids* **2020**, *5*, 227.
https://doi.org/10.3390/fluids5040227

**AMA Style**

Baddoo PJ.
Lightning Solvers for Potential Flows. *Fluids*. 2020; 5(4):227.
https://doi.org/10.3390/fluids5040227

**Chicago/Turabian Style**

Baddoo, Peter J.
2020. "Lightning Solvers for Potential Flows" *Fluids* 5, no. 4: 227.
https://doi.org/10.3390/fluids5040227