User Tools

Site Tools


tornadobox

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tornadobox [2025/03/19 13:11] – admintornadobox [2025/04/13 07:58] (current) – admin
Line 1: Line 1:
-==== Tornado Box====+==== 3-D Fortran CFD code for tornado-like vortices ====
  
-This page provides the Fortran program used for +Grab the code: [[https://github.com/bfiedler/tornadobox | tornadobox at gitbub]]. 
 + 
 +This page describes the Fortran program used for 
 {{ :tornadobox:suction_vortices_and_spiral_breakdown_in_numerical.pdf | my 2009 QJ article}}. {{ :tornadobox:suction_vortices_and_spiral_breakdown_in_numerical.pdf | my 2009 QJ article}}.
 I also still offer [[https://12characters.net/suction/|a more ancient page]] I also still offer [[https://12characters.net/suction/|a more ancient page]]
 that provides some results and animation, but no Fortran program. that provides some results and animation, but no Fortran program.
  
-The coding style evolved from a program passed down to Prof. Fiedler by his dissertation adviser, in the late 1970s. Notable ancient features are the Fortran 77 style, for the ''.f'' files, and the use of deprecated common blocks. Incidentally, the name of the array used to store all the parameters also has ancient roots: ''ap'' comes from the dissertation adviser. +The coding style evolved from a program passed down to Prof. Fiedler by his dissertation adviser, in the late 1970s. Notable ancient features are the Fortran 77 style, for the ''.f'' files, and the use of deprecated common blocks. Incidentally, the name of the array used to store all the parameters also has ancient roots: ''ap'' comes from the dissertation adviser. Feel free to  
 +see the Fortran code at [[https://12characters.net/tornadoboxbrowser/ | tornadobox browser]]. 
  
 === FORTRAN === === FORTRAN ===
Line 75: Line 78:
  
 The program ''cubit'' was used in the past as a needed precursor to interpolating to the Cartesian grids that were required by the deprecated [[https://en.wikipedia.org/wiki/Vis5D | Vis5d]], which had been used for the renderings.  Here we used ''python'' and the module ''pyvista'' for the renderings.  The program ''cubit'' was used in the past as a needed precursor to interpolating to the Cartesian grids that were required by the deprecated [[https://en.wikipedia.org/wiki/Vis5D | Vis5d]], which had been used for the renderings.  Here we used ''python'' and the module ''pyvista'' for the renderings. 
 +
 +Make your own browser with [[https://github.com/bfiedler/f90tohtml|f90tohtml]]:
 +<code>
 +f90tohtml tornadobox.f2h
 +</code>
  
 === An example case === === An example case ===
Line 218: Line 226:
   enter 'case' ,num, 'newcase'    enter 'case' ,num, 'newcase' 
 'bf10',015000,'bF10' 'bf10',015000,'bF10'
-</code> 
 $ ln -s bF10E015000.sav restart.sav $ ln -s bF10E015000.sav restart.sav
 $ makefiletimes.py 0 202 .05 > filetimes.txt $ makefiletimes.py 0 202 .05 > filetimes.txt
Line 281: Line 288:
 $ sav2pkl.py b*.sav $ sav2pkl.py b*.sav
 </code> </code>
 +If your python does not have the ''pyvista'' module, you will need to install it.
 To make the times tidy and complete, let's rename a file: To make the times tidy and complete, let's rename a file:
 <code> <code>
-mv bF10E015000.pkl bF10D015000.pkl+$ mv bF10E015000.pkl bF10D015000.pkl 
 +$ pkl2png.py -s -hg -vg   bF10D01500
 </code> </code>
 +Note that ''pkl2png.py'' will do the glob of ''bF10D01500*.pkl'', in this case finding one ''.pkl'' file.
 +The ''-s'' option should have shown the image do the screen, like the first one at the top of this page.
 +
 +Next we zoom in to 25% of the camera distance, and plot at $t=30$:
 +<code>
 +$ pkl2png.py -s -hg -c .25 bF10D030000
 +</code>
 +And add a $w$ isosurface:
 +<code>
 +$ pkl2png.py -s -hg -w -c .25 bF10D030000
 +</code>
 +$ Now we go for it, and plot the frames for movie.  No ''-s'' option:
 +<code>
 +$ mkdir pngs
 +$ pkl2png.py -hg -w -c .25 bF10D0 pngs
 +</code>
 +That required 10 minutes on my computer to produce 301 ''.png'' files.
 +<code>
 +$ cd pngs
 +$ eog bF10D015000.png
 +</code>
 +The ''eog'' image viewer allows for the right arrow key to rapidly step through the images.
 +<code>
 +$ cd ~/boxout
 +$ maketitle.py pngs/bF10D015000.png 
 +$ pip install moviepy
 +$ png2mp4.py -t title.png pngs/bF10D
 +$ mpv video.mp4
 +</code>
 +**FINISHED!**
 +
  
  
  
tornadobox.1742407900.txt.gz · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki