{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "###### Content provided under a Creative Commons Attribution license, CC-BY 4.0; code under BSD 3-Clause license (c)2015 L.A. Barba, Pi-Yueh Chuang." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Joukowski Transformation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is your [_AeroPython_](https://github.com/barbagroup/AeroPython) assignment for the second course module, titled **\"Potential vortices and lift.\"** The first course module, \"Building blocks of potential flow\" (first three IPython Notebooks of the series) ended with the representation of potential flow around a 2D cylinder by means of superposing a doublet singularity and a free stream. And in the second module, you learned that adding a vortex singularity, you can get lift around the cylinder. You may ask: *is all this useful?* \n", "\n", "Here's how it all starts getting useful. Using some simple techniques from complex-variable calculus, we can generate the flow around some airfoils starting with the flow around 2D cylinders. The trick is to use a [*conformal map*](http://en.wikipedia.org/wiki/Conformal_map) (a complex function that preserves angles) to move from the cylinder plane to the airfoil plane. \n", "\n", "Let's explore this classic method!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Introduction" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You learned how to construct potential flow over a cylinder via superposition of a free stream and a [doublet](03_Lesson03_doublet.ipynb) singularity. You also learned that adding a vortex can generate [lift on the cylinder](06_Lesson06_vortexLift.ipynb) But what's the big deal? Why is this important to us? What can we do with this potential cylinder flow?\n", "\n", "Back in the years when computers were not available, fluid dynamicists and mathematicians used a powerful tool—complex analysis—to study potential flows without directly solving partial-differential governing equations. With the magic of complex analysis and the known solution of potential flow over a cylinder, they could easily obtain many kinds of external potential flows, including flows over several types of airfoils.\n", "\n", "Nowadays, though, we no longer use these magical tools. But, not just out of nostalgia, it's still interesting to know the basic concept behind the magic: conformal mappings. In this assignment, we will guide you step by step to obtain potential flow over an airfoil starting with the flow over a cylinder and the famous conformal mapping called the **Joukowski transformation**. You will realize how important potential cylinder flow is in the history of aerodynamics!\n", "\n", "Don't worry. We won't talk too much about the mathematics. And you don't have to calculate by hand as the pioneers of aerodynamics did. Just follow the steps and let Python do the heavy lifting." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Complex numbers in Python" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's start with two complex planes, one defined by points $z = x + iy$, and the other defined by points $\\xi = \\xi_x+i\\xi_y$. The Joukowski transformation takes a point in the $z$-plane and \"maps\" it to the $\\xi$-plane by:\n", "\n", "$$\n", "\\begin{equation}\n", "\\xi = z + \\frac{c^2}{z}\n", "\\end{equation}\n", "$$\n", "\n", "where $c$ is a constant parameter. Before we discuss the Joukowski transformation, let's gain some practice with complex numbers in Python.\n", "\n", "Using complex numbers, your function for the Joukowski transformation will look \n", "very simple, and you won't have to calculate the real and imaginary parts separately. \n", "\n", "Python (and therefore, NumPy) can deal with complex numbers right out of the box. But the imaginary number, $i=\\sqrt{-1}$, is represented by `j`, *not* `i`, to avoid clashes with the common use of `i` in iterations. \n", "\n", "\n", "If you haven't used them before, try some simple manipulations of complex numbers now. For example, enter the following in a cell block:\n", "\n", "```Python\n", "3 + 2j\n", "```\n", "\n", "Now try:\n", "\n", "```Python\n", "a = 3\n", "b = 3\n", "z = a + b * 1j\n", "print('z = ', z)\n", "print('The type of the variable is ', type(z))\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise\n", "\n", "Get familiar with complex-number operations in Python by answering the following:\n", "\n", "1. $(2.75+3.69i)\\times(8.55-6.13i)=$ \n", "2. $1.4\\times e^{i5.32}=$ \n", "3. $\\frac{7.51-9.15i}{4.43+9.64i}=$\n", "\n", "Don't forget to enter your answers on [Open edX](https://openedx.seas.gwu.edu/courses/course-v1:MAE+MAE6226+2017/about).\n", "(Notes: you will need to enter your results with a 2-digit precision after the decimal point in the auto-graded section.)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Shapes created by the Joukowski transformation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Start by writing a Python function that takes `z` and `c` as parameters, and returns the Joukowski transformation of `z`.\n", "\n", "We can generate several patterns using Joukowski transforms. Use your Python function to perform the calculations described below and answer the questions.\n", "\n", "Just take $c=1$ here for simplicity.\n", "\n", "\n", "1. On the $z$-plane, place a circle with radius $R$ larger than $c=1$, say $R=1.5$, centered at the origin. What does the shape look like when mapped on the $\\xi$-plane?\n", " 1. circle\n", " 2. ellipse\n", " 3. symmetric airfoil\n", " 4. cambered airfoil\n", "2. Now, place a circle on the $z$-plane with radius such that $c \\lt R \\lt 2c$ (e.g., $c=1$; $R=1.2$), centered at $(x_c,y_c)=(c-R, 0)$. What does the shape look like on the $\\xi$-plane?\n", " 1. circle\n", " 2. ellipse\n", " 3. symmetric airfoil\n", " 4. cambered airfoil\n", "3. Put a circle at $(x_c, y_c)=(-\\Delta x, \\Delta y)$, where $\\Delta x$ and $\\Delta y$ are small positive numbers, e.g. $\\Delta x=0.1$ and $\\Delta y=0.1$. The radius $R$ of the circle is $R = \\sqrt{(c - x_c)^2 + y_c^2}$. What does the shape on $\\xi$-plane look like?\n", " 1. circle\n", " 2. ellipse\n", " 3. symmetric airfoil\n", " 4. cambered airfoil\n", "4. Consider the case when you obtain a symmetric airfoil. In polar coordinates, $(\\theta, r=R)$, which point on the circle corresponds to the trailing edge of the airfoil?\n", " * $\\theta=$?\n", "\n", "Don't forget to enter your answers on [Open edX](https://openedx.seas.gwu.edu/courses/course-v1:MAE+MAE6226+2017/about).\n", "(Notes: you will need to enter your results with a 2-digit precision after the decimal point in the auto-graded section.)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. Grid points on the $z$-plane using polar coordinates" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By the Joukowski transformation, a point on the $z$-plane corresponds to a point on the $\\xi$-plane. As you saw in the previous section, this transformation sometimes gives a shape that looks quite a lot like an airfoil. _What's the use of this?_\n", "\n", "It turns out that in complex analysis, when you have a solution to Laplace's equation on the complex plane and apply a [conformal mapping](http://en.wikipedia.org/wiki/Conformal_map), the transformed function is still a solution of the Laplace equation.\n", "\n", "This means that we can map the potential function and the streamlines of flow over a cylinder on the $z$-plane to the $\\xi$-plane, and obtain the streamlines of flow over an airfoil. The stream function around the airfoil will be given by:\n", "\n", "$$\n", "\\begin{equation}\n", "\\psi(\\xi_x, \\xi_y) = \\psi(\\xi_x(x, y), \\xi_y(x, y))\n", "\\end{equation}\n", "$$\n", "\n", "where the complex coordinates of $\\xi$, $\\xi_x$ and $\\xi_y$, are obtained from the Joukowski transformation of $z=x+iy$.\n", "\n", "In this exercise, you will obtain the flow over a symmetric Joukowski airfoil with zero and non-zero angle of attack. We obtain the shape of our target airfoil by placing a cylinder centered at $(x_c, y_c)=(-0.15, 0)$ with radius $R = 1.15$ and parameter $c=1$. You'll reach the goal step-by-step with problems (3) to (6).\n", "\n", "First, build a set of grid points on the $z$-plane and see how these points look like on the $\\xi$-plane. Use polar coordinates to build your grid on the $z$-plane. If you place grid points inside the cylinder, they will end up outside the airfoil after a Joukowski transformation (try it for yourself!). This is a problem. The streamlines inside the cylinder are not physical anyway, so we'll just ignore this region." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise\n", "\n", "1. Build a grid in polar coordinates in the $z$-plane. Use $N_r = 100$ points in the radial direction, within the range $R \\le r \\le 5$, and $N_\\theta = 145$ points in the axial direction, within the range $0 \\le \\theta \\le 2\\pi$.\n", "2. Use the Joukowski transformation to map the grid into the $\\xi$-plane.\n", "3. Plot the grid points in both planes using the function `pyplot.scatter()`.\n", "\n", "You should obtain figures that look like this:\n", "\n", "