{ "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": [ "# Exercise: Derivation of the vortex-source panel method" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The potential at location $(x, y)$ induced by an uniform flow, a source sheet, and a vortex sheet can be represented as" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$\n", "\\begin{equation}\n", "\\begin{split}\n", "\\phi(x, y) \n", "&= \\phi_{uniform\\ flow}(x, y) \\\\ \n", "&+ \\phi_{source\\ sheet}(x, y) + \\phi_{vortex\\ sheet}(x, y)\n", "\\end{split}\n", "\\end{equation}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "That is" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$\n", "\\begin{equation}\n", "\\begin{split}\n", "\\phi(x, y) &= xU_{\\infty}\\cos(\\alpha) + yU_{\\infty}\\sin(\\alpha) \\\\\n", "&+\n", "\\frac{1}{2\\pi} \\int_{sheet} \\sigma(s)\\ln\\left[(x-\\xi(s))^2+(y-\\eta(s))^2\\right]^{\\frac{1}{2}}ds \\\\\n", "&-\n", "\\frac{1}{2\\pi} \\int_{sheet} \\gamma(s)\\tan^{-1} \\frac{y-\\eta(s)}{x-\\xi(s)}ds\n", "\\end{split}\n", "\\end{equation}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "where $s$ is local coordinate on the sheet, and $\\xi(s)$ and $\\eta(s)$ are coordinate of the infinite source and vortex on the sheet. In the above equation, we assume the source sheet and the vortex sheet overlap." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "------------------------------------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Q1:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we discretize the sheet into $N$ panels, re-write the above equation using discretized integral. Assume $l_j$ represents the length of the panel $j$. And so that\n", "\n", "$$\n", "\\begin{equation}\n", "\\left\\{\n", "\\begin{array}{l}\n", "\\xi_j(s)=x_j-s\\sin\\beta_j \\\\\n", "\\eta_j(s)=y_j+s\\cos\\beta_j\n", "\\end{array}\n", ",\\ \\ \\ \n", "0\\le s \\le l_j\n", "\\right.\n", "\\end{equation}\n", "$$\n", "\n", "The following figure shows the panel $j$:\n", "\n", "
\n", "\n", "HINT: for example, consider the integral $\\int_0^L f(x) dx$, if we discretize the domain $0\\sim L$ into 3 panels, the integral can be writen as:\n", "\n", "$$\n", "\\int_0^L f(x) dx = \\int_0^{L/3} f(x)dx+\\int_{L/3}^{2L/3} f(x)dx+\\int_{2L/3}^{L} f(x)dx \\\\\n", "= \\sum_{j=1}^3 \\int_{l_j}f(x)dx\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "----------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now let's assume\n", "\n", "1. $\\sigma_j(s) = constant = \\sigma_j$\n", "2. $\\gamma_1(s) = \\gamma_2(s) = ... = \\gamma_N(s) = \\gamma$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "------------------------------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Q2:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Apply the above assumption into the equation of $\\phi(x, y)$ you derived in Q1." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The normal velocity $U_n$ can be derived from the chain rule:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$\n", "\\begin{equation}\n", "\\begin{split}\n", "U_n &= \\frac{\\partial \\phi}{\\partial \\vec{n}} \\\\\n", "&=\n", "\\frac{\\partial \\phi}{\\partial x}\\frac{\\partial x}{\\partial \\vec{n}}\n", "+\n", "\\frac{\\partial \\phi}{\\partial y}\\frac{\\partial y}{\\partial \\vec{n}} \\\\\n", "&=\n", "\\frac{\\partial \\phi}{\\partial x}\\nabla x\\cdot \\vec{n}\n", "+\n", "\\frac{\\partial \\phi}{\\partial y}\\nabla y\\cdot \\vec{n} \\\\\n", "&=\n", "\\frac{\\partial \\phi}{\\partial x}n_x\n", "+\n", "\\frac{\\partial \\phi}{\\partial y}n_y\n", "\\end{split}\n", "\\end{equation}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The tangential velocity can also be obtained using the same technique. So we can have the normal and tangential velocity at the point $(x, y)$ using:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$\n", "\\begin{equation}\n", "\\left\\{\n", "\\begin{array}{l}\n", "U_n(x, y)=\\frac{\\partial \\phi}{\\partial x}(x, y) n_x(x, y)+\\frac{\\partial \\phi}{\\partial y}(x, y) n_y(x, y) \\\\\n", "U_t(x, y)=\\frac{\\partial \\phi}{\\partial x}(x, y) t_x(x, y)+\\frac{\\partial \\phi}{\\partial y}(x, y) t_y(x, y)\n", "\\end{array}\n", "\\right.\n", "\\end{equation}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "-------------------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Q3:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Using the above equation, derive the $U_n(x,y)$ and $U_t(x,y)$ from the equation you obtained in Q2." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "-----------------------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Q4:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Consider the normal velocity at the center of $i$-th panel, i.e., $(x_{c,i}, y_{c,i})$, after replacing $(x_{c,i}, y_{c,i})$ with $(x, y)$ in the equation you derived in the Q3, we can re-write the equation in matrix form: " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$\n", "\\begin{equation}\n", "\\begin{split}\n", "U_n(x_{c,i}, y_{c,i}) &= U_{n,i} \\\\\n", "&= b^n_i + \\left[\\begin{matrix} A^n_{i1} && A^n_{i2} && ... && A^n_{iN}\\end{matrix}\\right]\\left[\\begin{matrix} \\sigma_1 \\\\ \\sigma_2 \\\\ \\vdots \\\\ \\sigma_N \\end{matrix}\\right] + \\left(\\sum_{j=1}^N B^n_{ij}\\right)\\gamma \\\\\n", "&= b^n_i + \\left[\\begin{matrix} A^n_{i1} && A^n_{i2} && ... && A^n_{iN} && \\left(\\sum_{j=1}^N B^n_{ij}\\right) \\end{matrix}\\right]\\left[\\begin{matrix} \\sigma_1 \\\\ \\sigma_2 \\\\ \\vdots \\\\ \\sigma_N \\\\ \\gamma \\end{matrix}\\right]\n", "\\end{split}\n", "\\end{equation}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$\n", "\\begin{equation}\n", "\\begin{split}\n", "U_t(x_{c,i}, y_{c,i}) &= U_{t,i} \\\\\n", "&= b^t_i + \\left[\\begin{matrix} A^t_{i1} && A^t_{i2} && ... && A^t_{iN}\\end{matrix}\\right]\\left[\\begin{matrix} \\sigma_1 \\\\ \\sigma_2 \\\\ \\vdots \\\\ \\sigma_N \\end{matrix}\\right] + \\left(\\sum_{j=1}^N B^t_{ij}\\right)\\gamma \\\\\n", "&= b^t_i + \\left[\\begin{matrix} A^t_{i1} && A^t_{i2} && ... && A^t_{iN} && \\left(\\sum_{j=1}^N B^t_{ij}\\right) \\end{matrix}\\right]\\left[\\begin{matrix} \\sigma_1 \\\\ \\sigma_2 \\\\ \\vdots \\\\ \\sigma_N \\\\ \\gamma \\end{matrix}\\right]\n", "\\end{split}\n", "\\end{equation}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "What are the $b^n_i$, $A^n_{ij}$, $B^n_{ij}$, $b^t_i$, $A^t_{ij}$, and $B^t_{ij}$? " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "-----------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Given the fact that (from the Fig. 1) \n", "\n", "$$\n", "\\begin{equation}\n", "\\left\\{\\begin{matrix} \\vec{n}_i=n_{x,i}\\vec{i}+n_{y,i}\\vec{j} = \\cos(\\beta_i)\\vec{i}+\\sin(\\beta_i)\\vec{j} \\\\ \\vec{t}_i=t_{x,i}\\vec{i}+t_{y,i}\\vec{j} = -\\sin(\\beta_i)\\vec{i}+\\cos(\\beta_i)\\vec{j} \\end{matrix}\\right.\n", "\\end{equation}\n", "$$\n", "\n", "we have\n", "\n", "$$\n", "\\begin{equation}\n", "\\left\\{\n", "\\begin{matrix}\n", "n_{x,i}=t_{y,i} \\\\\n", "n_{y,i}=-t_{x,i}\n", "\\end{matrix}\n", "\\right.\n", ",\\ or\\ \n", "\\left\\{\n", "\\begin{matrix}\n", "t_{x,i}=-n_{y,i} \\\\\n", "t_{y,i}=n_{x,i}\n", "\\end{matrix}\n", "\\right.\n", "\\end{equation}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "-----------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Q5:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Applying the above relationship between $\\vec{n}_i$ and $\\vec{t}_i$ to your answer of the Q4, you should find that relationships exist between $B^n_{ij}$ and $A^t_{ij}$ and between $B^t_{ij}$ and $A^n_{ij}$. This means, in your codes, you don't have to actually calculate the $B^n_{ij}$ and $B^t_{ij}$. What are the relationship?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "-------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, note that when $i=j$, there is a singular point in the integration domain when calculating $A^n_{ii}$ and $A^t_{ii}$. This singular point occurs when $s=l_i/2$, i.e., $\\xi_i(l_i/2)=x_{c,i}$ and $\\eta_i(l_i/2)=y_{c,i}$. This means we need to calculate $A^n_{ii}$ and $A^t_{ii}$ analytically." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "--------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Q6:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "What is the exact values of $A^n_{ii}$ and $A^t_{ii}$?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "------------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In our problem, there are $N+1$ unknowns, that is, $\\sigma_1, \\sigma_2, ..., \\sigma_N, \\gamma$. We'll need $N+1$ linear equations to solve the unknowns. The first $N$ linear equations can be obtained from the non-penetration condition on the center of each panel. That is\n", "\n", "$$\n", "\\begin{equation}\n", "\\begin{split}\n", "U_{n,i} &= 0 \\\\\n", "&= b^n_i + \\left[\\begin{matrix} A^n_{i1} && A^n_{i2} && ... && A^n_{iN} && \\left(\\sum_{j=1}^N B^n_{ij}\\right) \\end{matrix}\\right]\\left[\\begin{matrix} \\sigma_1 \\\\ \\sigma_2 \\\\ \\vdots \\\\ \\sigma_N \\\\ \\gamma \\end{matrix}\\right] \\\\\n", "&,\\ \\ for\\ i=1\\sim N\n", "\\end{split}\n", "\\end{equation}\n", "$$\n", "\n", "or\n", "\n", "$$\n", "\\begin{equation}\n", "\\begin{split}\n", "&\\left[\\begin{matrix} A^n_{i1} && A^n_{i2} && ... && A^n_{iN} && \\left(\\sum_{j=1}^N B^n_{ij}\\right) \\end{matrix}\\right]\\left[\\begin{matrix} \\sigma_1 \\\\ \\sigma_2 \\\\ \\vdots \\\\ \\sigma_N \\\\ \\gamma \\end{matrix}\\right] =-b^n_i \\\\\n", "&,\\ \\ for\\ i=1\\sim N\n", "\\end{split}\n", "\\end{equation}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For the last equation, we use Kutta-condition to obtain that.\n", "\n", "$$\n", "\\begin{equation}\n", "U_{t,1} = - U_{t,N}\n", "\\end{equation}\n", "$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "----------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Q7:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Apply the matrix form of the $U_{t,i}$ and $U_{t,N}$ to the Kutta-condition and obtain the last linear equation. Re-arrange the equation so that unknowns are always on the LHS while the knowns on RHS." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Q8:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now you have $N+1$ linear equations and can solve the $N+1$ unknowns. Try to combine the first $N$ linear equations and the last one (i.e. the Kutta-condition) in the Q7 and obtain the matrix form of the whole system of linear equations." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "----------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The equations can be solved now! This is the vortex-source panel method." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "--------------------" ] }, { "cell_type": "raw", "metadata": {}, "source": [ "Please ignore the cell below. It just loads our style for the notebook." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\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 }