iccsa-20-wind

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

commit 31c2212c8ce359ecafdd1c9dae46416d94847632
parent a40c8e83f2016532e87b22f58496e6e2a5176e17
Author: Ivan Gankevich <i.gankevich@spbu.ru>
Date:   Sun, 15 Mar 2020 10:46:56 +0300

Update plots.

Diffstat:
Makefile | 4+++-
gnuplot/velocity.gnuplot | 6+++---
gnuplot/verification.gnuplot | 6++++--
main.tex | 18++++++++++--------
python/wind-diff.py | 29+++++++++++++++++++++++++++++
5 files changed, 49 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile @@ -44,5 +44,7 @@ build: clean: @rm -rf build -.PHONY: build clean +diff: + @python3 python/wind-diff.py +.PHONY: build clean diff diff --git a/gnuplot/velocity.gnuplot b/gnuplot/velocity.gnuplot @@ -7,15 +7,15 @@ static_roll = 0.246736 unset key set grid set border 1+2 back -set xtics nomirror out -set ytics nomirror out +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 multiplot layout 1,2 -set xlabel 'Wind velocity, m/s' +set xlabel 'Wind velocity, m/s' offset 0,1 set ylabel 'Roll angle, °' offset 1.5,0 plot 'gnuplot/roll' using 1:(($2-static_roll)*s) with lines smooth csplines ls 1 lw 2 diff --git a/gnuplot/verification.gnuplot b/gnuplot/verification.gnuplot @@ -2,8 +2,8 @@ set terminal svg dynamic size 1080/4*1.9, 1080/4 round enhanced font 'Liberation set output "build/gnuplot/verification.svg" #set key outside top center unset key -set xtics -50,25,50 out nomirror -set ytics -50,25,50 out nomirror +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 @@ -11,6 +11,8 @@ set size square set size ratio -1 load 'gnuplot/rdbu.pal' set cbrange [0:100] +set xlabel 'x' offset 0,1 +set ylabel 'y' offset 1,0 s = 0.05 set multiplot layout 1,2 set object 1 circle front at 0,0 size 54.8858/2 fillcolor rgb "black" lw 0.5 diff --git a/main.tex b/main.tex @@ -302,14 +302,9 @@ vector in cartesian coordinates). Then the solution is written as and reduces to general form of the solution for potential flow around a cylinder given in~\eqref{eq-solution-cylinder}. -In order to be compatible with the surface of any object, solution near the -boundary \eqref{eq-solution-near-the-boundary} uses different term \(s\) than -the solution for potential flow around a cylinder which makes reflected -velocity term reach maximum value for the point on the boundary, and for the -point near the boundary the solution includes reflected velocity vectors for -each panel. We compared both solutions (see fig.~\ref{fig-verification}) for a -cylinder with \(R=27.4429\), and discovered that maximum root square error -between the two is less than 1\%. +We compared both solutions (see fig.~\ref{fig-verification}) for a cylinder +with \(R=27.4429\), and discovered that maximum distance between velocity +fields produced from both of them is 11\%. \begin{figure} \centering @@ -372,6 +367,13 @@ opposite directions and cancel each other out. At top-most and bottom-most point incident and reflected particle velocities have the same direction and total velocity is two times larger than the velocity of the flow. +In order to be compatible with the surface of any object, solution near the +boundary \eqref{eq-solution-near-the-boundary} uses different term \(s\) than +the solution for potential flow around a cylinder which makes reflected +velocity term reach maximum value for the point on the boundary, and for the +point near the boundary the solution includes reflected velocity vectors for +each panel. + \section{Conclusion} diff --git a/python/wind-diff.py b/python/wind-diff.py @@ -0,0 +1,29 @@ +import math + +def read_last_column(filename): + result = [] + with open(filename) as f1: + result = [[float(p[0]),float(p[1])] for p in + [line.split()[2:4] for line in f1.readlines()]] + return result + +def length(v): + return math.sqrt(v[0]*v[0]+v[1]*v[1]) + +w1 = read_last_column('gnuplot/wind.orig') +w2 = read_last_column('gnuplot/wind.our') + +diff_max = 0 +length_max = 0 +for wind_orig, wind_our in zip(w1,w2): + len1 = length(wind_orig) + len2 = length(wind_our) + #diff = (abs(100-(len2 / len1 * 100))) + diff = abs(len2 - len1) + if (len1 > length_max): length_max = len1 + if (len2 > length_max): length_max = len2 + if (diff > diff_max): diff_max = diff + +print('Max. velocity: {}'.format(length_max)) +print('Max. difference: {}'.format(diff_max)) +print('Max. error: {}'.format(diff_max/length_max*100))