# Interactive Joukowski airfoil

The image below is an interactive demonstration of a Joukowski airfoil. Try moving the *flow angle* and *thickness* sliders, and you can apply the Joukowski transform by checking the box.

This demo is written in JavaScript and you can see the code in this Observable notebook.

The flow is modelled, using complex potentials, as inviscid and incompressible. The solution for the flow around a cylinder (with imposed circulation) is obtained by summing the potentials for uniform flow at angle alpha, a doublet and a line vortex. The initial grid is a regular mesh in polar coordinates (with a little clustering at the cylinder surface). We then use the Joukowski transform to map the geometry from a cylinder to an airfoil.

In this implementation, the grid and flow solution are evaluated on the CPU and the rendering is done on the GPU using WebGL. Data at each mesh point (position of the point, pressure value, grid i-value and j-value) are sent as vertex attributes. The fragment shader handles the colour shading, and also the streamline and grid plotting using some helpful built-in GLSL functions (thank you Ricky Reusser).

The dynamic visualization enables us to experiment with the cylinder and airfoil. Experimentation is a great way to learn. For example, from this interactive Joukowski airfoil we obtain an understanding of the squashing-stretching nature of the Joukowski transform, and also the linkage between streamline curvature and pressure gradient.