{ "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)2014 Lorena A. Barba, Pi-Yueh Chuang. Thanks: NSF for support via CAREER award #1149784." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Source Distribution on an Airfoil" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In [Lesson 3](03_Lesson03_doublet.ipynb) of *AeroPython*, you learned that it is possible to represent potential flow around a circular cylinder using the superposition of a doublet singularity and a free stream. But potential flow is even more powerful: you can represent the flow around *any* shape. How is it possible, you might ask?\n", "\n", "For non-lifting bodies, you can use a source distribution on the body surface, superposed with a free stream. In this assignment, you will build the flow around a NACA0012 airfoil, using a set of sources.\n", "\n", "Before you start, take a moment to think: in flow around a symmetric airfoil at $0^{\\circ}$ angle of attack,\n", "\n", "* Where is the point of maximum pressure?\n", "* What do we call that point?\n", "* Will the airfoil generate any lift?\n", "\n", "At the end of this assignment, come back to these questions, and see if it all makes sense." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Problem Setup" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You will read data files containing information about the location and the strength of a set of sources located on the surface of a NACA0012 airfoil. \n", "\n", "There are three data files: NACA0012_x.txt, NACA0012_y.txt, and NACA0012_sigma.txt. To load each file into a NumPy array, you need the function [`numpy.loadtxt`](http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html). The files should be found in the `resources` folder of the `lessons`. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Using 51 mesh points in each direction, and a domain $[-1, 2]\\times[-0.5, 0.5]$, compute the velocity due to the set of sources plus a free stream in the $x$-direction with $U_{\\infty}=1$. Also compute the coefficient of pressure on your grid points." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Questions:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1. What is the value of maximum pressure coefficient, $C_p$?\n", "2. What are the array indices for the maximum value of $C_p$?\n", "\n", "Make the following plots to visualize and inspect the resulting flow pattern:\n", "\n", "* Stream lines in the domain and the profile of our NACA0012 airfoil, in one plot\n", "* Distribution of the pressure coefficient and a single marker on the location of the maximum pressure" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Hint**: You might use the following NumPy functions: [`numpy.unravel_index`](http://docs.scipy.org/doc/numpy/reference/generated/numpy.unravel_index.html) and [`numpy.argmax`](http://docs.scipy.org/doc/numpy/reference/generated/numpy.argmax.html)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Think" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1. Do the stream lines look like you expected?\n", "2. What does the distribution of pressure tell you about lift generated by the airfoil?\n", "3. Does the location of the point of maximum pressure seem right to you?" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.core.display import HTML\n", "def css_styling(filepath):\n", " styles = open(filepath, 'r').read()\n", " return HTML(styles)\n", "css_styling('../styles/custom.css')" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.1" } }, "nbformat": 4, "nbformat_minor": 1 }