iccsa-20-wind

git clone https://git.igankevich.com/iccsa-20-wind.git
Log | Files | Refs

commit b3f9e9803486997d450c57ed3d6e4448fe9aacce
parent ef2aeaab3cb1564f677436f16640c010a52a4d09
Author: Ivan Gankevich <i.gankevich@spbu.ru>
Date:   Fri, 26 Jun 2020 17:10:51 +0300

Slides.

Diffstat:
.gitignore | 1+
Makefile | 18++++++++++++++++++
gnuplot/aurora.gnuplot | 29+++++++++++++++++++++++++++++
gnuplot/cylinder.gnuplot | 22++++++++++++++++++++++
gnuplot/ship-roll-velocity.gnuplot | 24++++++++++++++++++++++++
slides.tex | 281+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
6 files changed, 369 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,4 +1,5 @@ /build +CoA_Medium.eps # Created by https://www.gitignore.io/api/vim,linux,latex # Edit at https://www.gitignore.io/?templates=vim,linux,latex diff --git a/Makefile b/Makefile @@ -26,6 +26,16 @@ build/$(NAME).pdf: @echo " LATEX $<" @-$(LATEXMK) $(FLAGS) -f main.tex +build/$(SLIDES).pdf: build/gnuplot/aurora.eps +build/$(SLIDES).pdf: build/gnuplot/cylinder-1.eps +build/$(SLIDES).pdf: build/gnuplot/cylinder-2.eps +build/$(SLIDES).pdf: build/gnuplot/openmp.svg +build/$(SLIDES).pdf: build/gnuplot/ship-roll.eps +build/$(SLIDES).pdf: build/gnuplot/ship-velocity.eps +build/$(SLIDES).pdf: build/inkscape/law-of-reflection.eps +build/$(SLIDES).pdf: build/ships/aurora.eps +build/$(SLIDES).pdf: build/ships/diogen.eps +build/$(SLIDES).pdf: build/ships/micw.eps build/$(SLIDES).pdf: slides.tex @echo " LATEX $<" @-$(LATEXMK) $(FLAGS) -xelatex -f $< @@ -41,6 +51,14 @@ build/gnuplot/%.svg: gnuplot/%.gnuplot @mkdir -p build/gnuplot gnuplot -d $< +build/gnuplot/cylinder-1.svg build/gnuplot/cylinder-2.svg: gnuplot/cylinder.gnuplot + @mkdir -p build/gnuplot + gnuplot -d $< + +build/gnuplot/ship-roll.svg build/gnuplot/ship-velocity.svg: gnuplot/ship-roll-velocity.gnuplot + @mkdir -p build/gnuplot + gnuplot -d $< + build/ships/diogen.svg: ships/diogen.gnuplot gnuplot/vessel.gnuplot @mkdir -p build/ships gnuplot -d -c gnuplot/vessel.gnuplot $< $@ Diogen diff --git a/gnuplot/aurora.gnuplot b/gnuplot/aurora.gnuplot @@ -0,0 +1,29 @@ +set terminal svg size 1920/4,1080/4 dynamic +set hidden3d back offset 0 trianglepattern 3 undefined 1 altdiagonal bentover +set view equal xyz +set view ,,4 +#set object 1 rectangle from screen -0.1,-0.1 to screen 1.1,1.1 fillcolor rgb "#f0f0f0" behind +unset key +set title 'Aurora' offset 0,-2 +#unset border +#unset xtics +#unset ytics +#unset ztics +#load 'gnuplot/rdbu.pal' +set ytics -20,20,20 +set ztics 0,10,40 +set palette gray +set pm3d +set style data pm3d +unset colorbox +set xrange [0:130] +set yrange [-20:20] +set zrange [*:20] +set xzeroaxis +set yzeroaxis +set zzeroaxis +set xlabel 'x, m' +set ylabel 'y, m' +set zlabel 'z, m' +set output 'build/gnuplot/aurora.svg' +splot 'ships/aurora.gnuplot' diff --git a/gnuplot/cylinder.gnuplot b/gnuplot/cylinder.gnuplot @@ -0,0 +1,22 @@ +set terminal svg dynamic size 1080/5, 1080/5 round enhanced font 'Liberation Sans, 10' +#set key outside top center +unset key +set xtics -50,25,50 out nomirror offset 0,0.5 +set ytics -50,25,50 out nomirror offset 0.5,0 +set xrange [-52:52] +set yrange [-52:52] +set border 1+2 +set size square +set size ratio -1 +load 'gnuplot/rdbu.pal' +set cbrange [0:100] +set xlabel 'x, m' offset 0,1 +set ylabel 'y, m' offset 1,0 +set cblabel 'Velocity, m/s' offset -1,0 +s = 0.05 +set object 1 circle front at 0,0 size 54.8858/2 fillcolor rgb "black" lw 0.5 +set output "build/gnuplot/cylinder-1.svg" +plot 'gnuplot/wind.orig' using 1:2:($3*s):($4*s):(sqrt($3**2+$4**2)) with vectors lw 0.1 lc palette +set output "build/gnuplot/cylinder-2.svg" +plot 'gnuplot/wind.our' using 1:2:($3*s):($4*s):(sqrt($3**2+$4**2)) with vectors lw 0.1 lc palette + diff --git a/gnuplot/ship-roll-velocity.gnuplot b/gnuplot/ship-roll-velocity.gnuplot @@ -0,0 +1,24 @@ +set terminal svg dynamic size 1080/6, 1080/6 round enhanced font 'Liberation Sans, 10' +s = 180.0/pi +#static_roll = 0.247885 +#static_roll = 0.246736 +static_roll = 0 + +unset key +set grid +set border 1+2 back +set xtics nomirror out offset 0,0.5 +set ytics nomirror out offset 0.5,0 +#set xrange [0:*] +#set yrange [0:*] +load 'gnuplot/rdbu.pal' + +set xlabel 'Wind velocity, m/s' offset 0,1 +set ylabel 'Roll angle, °' offset 1.5,0 +set output 'build/gnuplot/ship-roll.svg' +plot 'gnuplot/wind-aurora.dat' using 1:($3*s) with linespoints ls 1 lw 2 pt 7 ps 0.5 + +set ylabel 'Ship velocity, m/s' +set output 'build/gnuplot/ship-velocity.svg' +plot 'gnuplot/wind-aurora.dat' using 1:2 with linespoints ls 1 lw 2 pt 7 ps 0.5 + diff --git a/slides.tex b/slides.tex @@ -3,32 +3,301 @@ \setdefaultlanguage{english} \usetheme{SaintPetersburg} -\usepackage{textcomp} \usepackage{booktabs} +\usepackage{amsmath} +\usepackage{spbu-tikz} + +\tikzset{Arrow/.style={ + solid, + arrows={-Triangle[length=0.15cm,width=0.100cm]}, + draw=spbuDarkGray +}}% + +\tikzset{Dots/.style={ + draw=spbuDarkGray, + line cap=round, dash pattern=on 0pt off 4\pgflinewidth +}}% +\setbeamertemplate{itemize items}[circle] + +% metadata +\usepackage{textcomp} +\usepackage{hyperxmp} +\hypersetup{ + pdfcontactemail={i.gankevich@spbu.ru}, + pdfcontacturl={http://www.apmath.spbu.ru/en/staff/gankevich/index.html}, + pdfcontactaddress={Unversitetskii prospekt 35}, + pdfcontactcity={Petergof}, + pdfcontactregion={Saint Petersburg}, + pdfcontactpostcode={198504}, + pdfcontactcountry={Russia}, + pdflang={en}, + pdfmetalang={en}, + pdflicenseurl={http://creativecommons.org/licenses/by-sa/4.0/}, + pdfcopyright={Copyright \textcopyright{} 2020 Anton Gavrikov\xmpcomma{} Alexander Degtyarev\xmpcomma{} Denis Egorov\xmpcomma{} Ivan Gankevich\xmpcomma{} Artemii Grigorev\xmpcomma{} Vasily Khramushin\xmpcomma{} Ivan Petriakov}, + pdfsubject={Virtual Testbed: Simulation of air flow around ship hull and its effect +on ship motions}, +} + +\newcommand{\VectorR}[1]{\left[\begin{array}{r}#1\end{array}\right]} +\newcommand{\VectorL}[1]{\left[\begin{array}{l}#1\end{array}\right]} +\newcommand{\Length}[1]{\big|#1\big|} -\title{TODO} +\title{Virtual Testbed: Simulation of air flow around ship hull and its effect +on ship motions} \author{% A.\:Gavrikov \and A.\:Degtyarev \and D.\:Egorov \and - I.\:Gankevich \and + I.\:Gankevich\textsuperscript{*} \and A.\:Grigorev \and V.\:Khramushin \and I.\:Petriakov% } +\institute{Saint Petersburg State University} \date{July 2020} \begin{document} \frame{\maketitle} +\begin{frame}{Governing system of equations} + Continuity and motion equation for ideal fluid + \begin{columns} + \begin{column}{0.45\textwidth} + \begin{equation*} + \begin{aligned} + & \Delta\phi = 0; \qquad \vec\upsilon=\vec\nabla\phi; \\ + & \rho\frac{\partial\phi}{\partial{}t} + + \frac{1}{2}\rho\Length{\vec\nabla\phi}^2 + + p + \rho g z = p_0 + \end{aligned} + \end{equation*} + \end{column} + \begin{column}{0.45\textwidth} + \scriptsize + \begin{tabular}{ll} + \(p_0\) & atmospheric pressure \\ + \(g\) & gravitational acceleration \\ + \(\rho\) & air density \\ + \(p\) & pressure \\ + \(\phi\) & velocity potential \\ + \(\vec\upsilon\) & velocity \\ + \end{tabular} + \end{column} + \end{columns} + \vfill + Ship hull boundary condition + \begin{columns} + \begin{column}{0.45\textwidth} + \begin{equation*} + \vec\nabla\phi\cdot\vec{n} = 0; + \qquad + \vec{r} = \vec{S} + \end{equation*} + \end{column} + \begin{column}{0.45\textwidth} + \scriptsize + \begin{equation*} + \begin{aligned} + & \vec{r} = \left(x,y,z\right) \\ + & \vec{S}=\vec{S}\left(a,b,t\right); \quad a,b\in{}A=[0,1]; + \quad \vec{n}=\frac{\partial\vec S}{\partial a}\!\times\!\frac{\partial\vec S}{\partial b} + \end{aligned} + \end{equation*} + \end{column} + \end{columns} +\end{frame} + +\begin{frame}{The solution for uniform translational motion} + The law of reflection\newline + \vskip\baselineskip + \begin{center} + \begin{tikzpicture}[x=1mm,y=1mm] + \draw plot [smooth] coordinates + {(9.673,28.585) (17.173,35.433) (21.194,36.020) (27.064,35.433) (32.172,24.129)}; + \node at (20,30) {\tiny{}ship hull}; + \path[Arrow] (16.194,41.020) -- (21.194,36.020) {}; + \draw[Dots] (11.194,46.020) -- (21.194,36.020) {}; + \node[left] at (11.194,46.020) {\tiny{}incident air particle trajectory}; + \node[left] at (16.194,41.020) {\(\vec\upsilon_{\phantom{r}}\)}; + \path[Arrow] (21.194,36.020) -- (26.194,41.020) {}; + \draw[Dots] (21.194,36.020) -- (31.194,46.020) {}; + \node[right] at (31.194,46.020) {\tiny{}reflected air particle trajectory}; + \node[right] at (26.194,41.020) {\(\vec\upsilon_r = + \vec\upsilon - 2\left(\vec\upsilon\cdot\vec{n}\right)\vec{n}\)}; + \path[Arrow] (21.194,36.020) -- (21.194,41.020) {}; + \node[above] at (21.194,41.020) {\(\vec{n}\)}; + \end{tikzpicture} + \end{center} + \vfill + The solution \emph{on} the boundary + \begin{equation*} + \phi = \vec\upsilon\cdot\vec{r} + C \left(\vec\upsilon_r\cdot\vec{r}\right) + \qquad\Rightarrow\qquad + \vec\nabla\phi = \vec\upsilon + C\vec\upsilon_r = + \vec\upsilon + \vec\upsilon_r + \qquad + \text{\tiny{}(full derivation is in the paper)} + \end{equation*} + The solution \emph{near} the boundary + \begin{equation*} + \vec\nabla\phi = + \vec\upsilon + + \iint\limits_{a,b\,\in{}A} + \left( + \frac{1}{s} \vec\upsilon_r + - \frac{2}{s^2} \left(\vec\upsilon_r\cdot\vec{r}\right) \left(\vec{r}-\vec{S}\right) + \right) + da\,db; + \qquad + s = 1+\Length{\vec{r}-\vec{S}}^2. + \end{equation*} +\end{frame} + +\begin{frame}{Verification using potential flow around a cylinder} + \centering + \begin{tikzpicture}[x=1cm,y=-1.2cm] + \node[text width=4.4cm,fill=spbuWhite2] (s1) at (0,0) {{\tiny{}Known solution in Cartesian form\strut{}}\newline \(\phi(x,y) = U x \left(1 + \frac{R^2}{x^2+y^2}\right)\)}; + \node[text width=3.25cm,fill=spbuWhite2] (s2) at (8,0.5) {{\tiny{}Velocity on the boundary}\newline\(\vec\nabla\phi = \frac{2 U}{R^2}\VectorR{y^2 \\ -x y\phantom{^2}}\)}; + \node[text width=4.4cm,fill=spbuWhite2] (s3) at (0,1) {{\tiny{}Our solution\strut{}}\newline\(\phi = \vec\upsilon\cdot\vec{r} + \vec\upsilon_r\cdot\vec{r}\)}; + \node at (8,1.25) {\tiny{}(full derivation is in the paper)}; + \path[Arrow] (s1.east) -- node[above]{\tiny{}\(x^2+y^2=R^2\)} (s1.east -| s2.west) ; + \path[Arrow] (s3.east) -- node[below]{\tiny{}\(\vec{n}=(x/R,y/R)\), \(\vec\upsilon=(U,0)\)} (s3.east -| s2.west) ; + \end{tikzpicture} + \vfill + \begin{columns} + \begin{column}{0.32\textwidth} + \centering + Known solution + \includegraphics{build/gnuplot/cylinder-1.eps} + \end{column} + \begin{column}{0.32\textwidth} + \centering + Our solution + \includegraphics{build/gnuplot/cylinder-2.eps} + \end{column} + \begin{column}{0.32\textwidth} + \footnotesize + \begin{itemize} + \item Two solutions are equivalent \emph{on} the boundary! + \item Max. difference near the boundary is 11\% of maximum velocity. + \end{itemize} + \end{column} + \end{columns} +\end{frame} + +\begin{frame}{Ship roll angle and velocity} + \begin{columns} + \begin{column}{0.25\textwidth} + \centering + Roll angle + \includegraphics{build/gnuplot/ship-roll.eps} + \end{column} + \begin{column}{0.25\textwidth} + \centering + Velocity + \includegraphics{build/gnuplot/ship-velocity.eps} + \end{column} + \begin{column}{0.45\textwidth} + \footnotesize + \begin{itemize} + \item + We need \(\approx{}35\) m/s wind (a hurricane!) to produce 1\textdegree{} static roll angle. + \item We need to introduce reflection ratio \(\alpha\) for symmetric ships: + \begin{equation*} + \vec\upsilon_r = \vec\upsilon - + 2 \alpha \left(\vec\upsilon\cdot\vec{n}\right)\vec{n} + \end{equation*} + \begin{tabular}{ll} + \(\alpha=0\) & no reflection \\ + \(\alpha=1\) & full reflection \\ + \end{tabular} + \end{itemize} + \includegraphics[scale=0.5]{build/gnuplot/aurora.eps} + \end{column} + \end{columns} +\end{frame} + +\begin{frame}{Performance benchmarks in Virtual Testbed} + \small + Average time in milliseconds that is needed to compute wind field on the + ship hull and near the ship hull. + \vfill + \begin{tabular}{l@{\hskip 3mm}r@{\hskip 2mm}r@{\hskip 3mm}r@{\hskip 2mm}r@{\hskip 3mm}r@{\hskip 2mm}rl} + \toprule + & \multicolumn{2}{c}{Diogen} + & \multicolumn{2}{c}{Aurora} + & \multicolumn{2}{c}{MICW} \\ + \cmidrule(r){2-3} + \cmidrule(r){4-5} + \cmidrule(r){6-7} + Node & OpenMP & OpenCL + & OpenMP & OpenCL + & OpenMP & OpenCL \\ + \midrule + Duck + & 114 & 14.00 + & 164 & 16 + & 314 & 29 + & laptop + \\ + GPUlab + & 62 & 1.35 + & 90 & 2 + & 175 & 3 + & desktop + \\ + Capybara & 33 & 0.87 + & 48 & 1 + & 99 & 6 + & server + \\ + \bottomrule + \end{tabular} + \vfill + \begin{tikzpicture}[x=1cm,y=1cm] + \node at (-4,0) {\includegraphics[scale=0.50]{build/ships/diogen.eps}}; + \node at (0,0) {\includegraphics[scale=0.50]{build/ships/aurora.eps}}; + \node at (4,0) {\includegraphics[scale=0.50]{build/ships/micw.eps}}; + \end{tikzpicture} +\end{frame} + +\begin{frame}{Conclusion and future work} + \begin{itemize} + \item The proposed solution is equivalent to the known + formula for potential flow around a cylinder. + \item High computational performance, especially on graphical accelerators. + \item Future work is to incorporate turbulence and circular motion into the model. + \end{itemize} +\end{frame} + \begin{frame} + \centering + \begin{tabular}{lllrr} + \toprule + & & & \multicolumn{2}{c}{GPU GFLOPS} \\ + \cmidrule(r){4-5} + Node & CPU & GPU & Single & Double \\ + \midrule + Duck & Intel i7-3630QM & NVIDIA GT740M & 622 & \\ + GPUlab & AMD FX-8370 & NVIDIA GTX1060 & 4375 & 137 \\ + Capybara & Intel E5-2630 v4 & NVIDIA P5000 & 8873 & 277 \\ + \bottomrule + \end{tabular} +\end{frame} + +\begin{frame} + \vskip\baselineskip + \vskip\baselineskip + \vskip\baselineskip + \vskip\baselineskip \tiny\vfill - Copyright \textcopyright{} 2020 Ivan Petriakov - \texttt{\href{mailto:st047437@student.spbu.ru}{st047437@student.spbu.ru}}. \\ + Copyright \textcopyright{} 2020 Anton Gavrikov, Alexander Degtyarev, Denis + Egorov, Ivan Gankevich, Artemii Grigorev, Vasily Khramushin, Ivan Petriakov + \texttt{\href{mailto:i.gankevich@spbu.ru}{i.gankevich@spbu.ru}}. \\ \vskip\baselineskip \vskip\baselineskip - This work is licensed under a \alert{Creative Commons Attribution-ShareAlike 4.0 + This work is licensed under a \textit{Creative Commons Attribution-ShareAlike 4.0 International License}. The copy of the license is available at \url{https://creativecommons.org/licenses/by-sa/4.0/}. \end{frame}