# Vortex Development - von Karman Instability ::::::{tab-set} :sync-group: lang :class: lang-tabs :::::{tab-item} En :sync: en The example shows the formation of vortices due to the von Karman instability. The geometry is a channel with a circular obstacle. The example is treated in two dimensions. 1. Open a terminal window and run: ``` bash $ single Job XXXX is submitted to default queue - interactive. Waiting for dispatch ... Starting on cnXX $ module load elmergui Loading qwt/6.0.2 Loading vtk/5.10.1 Loading ftgl/2.1.3-rc5 Loading qt/4.8.4 Loading paraview/3.98 Loading opencascade/6.5.5 Loading openmpi/1.8.1 Loading elmer/7.0 Loading elmergui/7.0 $ ElmerGUI ``` 2. In the ElmerGUI menu select: ``` bash File -> Open circle_in_channel.in2d ``` 3. Increase the mesh density ``` bash Mesh->Configure nglib / Max H: 0.02 Mesh Remesh ``` Once we have the mesh, we start defining the model, 4. Prepare the surfaces for specifying boundary conditions. As a boundary condition we want to set the temperature on the inner edge of the wider part of the cylindrical openings. This surface is defined by six faces, so we must select the surfaces shown in red in the figure (composed of six faces). Select the first face by double-clicking on it; to select the following ones, hold down the CTRL key while double-clicking on the selected face. If you select the wrong face, double-click on that face again (while holding down the CTRL key). The CTRL key allows adding previously selected faces to, or removing them from, the selection. If the object is not oriented correctly, it can also be rotated during selection, as described above. Once all boundary condition faces are selected, continue with: ``` bash Mesh -> Unify Surface ``` 5. We must also enter the model data. In doing so, we follow the items in the 'Model' drop-down menu in order (from top to bottom). The steps for our example are given below: 6. Define the general settings: ``` bash Model -> Setup Simulation Type = Transient Steady state max. Iter =1 Time Stepping Method = bdf BDF Order = 2 Time Step Intervals = 200 Time Step Sizes = $ 8/200 Apply ``` 7. Definition of equations: Select the relevant equations and parameters. In our example we use two solvers (called Equations in Elmer). For the fluid we use the fluid flow solver and the heat flow solver, and for the iron pipe only the heat flow solver. Since we know the mesh and know that the fluid is represented by Body 1 and the pipe by Body 2, we will assign the solvers (Equation) and material to this geometry already when defining them. ``` bash Model -> Equation Add Name = Navier-Stokes Apply to Bodies = 1 Select the 'Navier Stokes' tab and define: Active = on (i.e. tick the checkbox) Edit Solver Settings   Nonlinear system   Convergence tol. = 1.0e-4   Linear System   Convergence tol. = 1.0e-6   Add OK ``` ``` text Define the materials. To define the material properties of water (at room temperature) and iron, we use the library: : ``` 8. ``` bash Model -> Material Add Material library Watter – room temperature (select from the menu) Apply to bodies = Body 1 (tick the checkbox) Add New Material library Iron generic (select from the menu) Apply to bodies = Body 2 (tick the checkbox) Add OK OK ``` 9. Define the load: ``` bash Model -> Body force Add Select the Heat Equation tab Name = Heating Head Source = 0.01 Apply to bodies = Body 1 (tick the checkbox) Add OK ``` 10. Define the boundary conditions: ``` bash Model -> Boundary condition Add Name = HotInFlow Heat Equation Temperature = 350.0 Navier-Stokes Velocity 1 = 0.0 Velocity 2 = 0.0 Velocity 3 = Variable Coordinate; Real MATC "100.0*(1.0e-4-tx(0)^2-tx(1)^2)" Add New   Name = Outflow   NaviewStokes Use normal-tangential coordinate system = on   Velocity 2 = 0.0   Velocity 3 = 0.0   Add New   Name = NoSlip   Navier-Stokes   NoSlip Wall BC = on Add New   Name = Troom   Heat Equation   Temperatute = 300.0   Add OK OK OK OK ``` 11. To help determine the inlet face, activate the compass: ``` bash View -> Compas = on (tick the option in the View menu) ``` The inlet face should be the one whose normal points parallel to the axis.: 12. To specify boundary conditions using the graphical interface ``` bash Model -> Set boundary properties (select, i.e. tick the option) ``` 13. Double-click on the surface of the inlet line; a window for selecting boundary conditions opens. Under 'Boundary condition' select 'Inlet'. Double-click on the surface of the outlet line; a window for selecting boundary conditions opens. Under 'Boundary condition' select 'Outlet'. 14. Generate the input file for the 'ElmerSolver' program: ``` bash Sif -> Generate ``` The resulting file can be viewed by selecting from the menu: ``` bash Sif -> Edit ``` The file can then be edited, or closed with the command 'File-\>Quit'. 15. Save the project (project data can be saved at any stage of input): ``` bash File -> Save Project To save the project, choose any directory (e.g. the subdirectory 'ProjectFiles'). ``` Project data are loaded with: File -\> LoadProject, selecting the directory where the data were saved. 16. Compute the example: ``` bash Run -> Start solver ``` . 17. To view the results, start the postprocessor: ``` bash Run -> postprocesor ``` 18. To view all results in the postprocessor, we must reopen the file (File-Open). Pressing the All button loads the results of all time steps. A video of the simulation can then be viewed by pressing the Loop button in the Edit – Timestep Control menu. Below we show only the velocity distribution at time steps 20, 60, 100, 150 and 200.: ![](../../files/figs/elmer/instability-step-020.jpeg) Time step 20. ![](../../files/figs/elmer/instability-step-060.jpeg). Time step 60. ![](../../files/figs/elmer/instability-step-100.jpeg), Time step 100. ![](../../files/figs/elmer/instability-step-150.jpeg) Time step 150. ![](../../files/figs/elmer/instability-step-200.jpeg) Time step 200. ::::: :::::{tab-item} Slo :sync: sl **Razvoj vrtinčenja - von Karmanova nestabilnost** Primer prikazuje nastanek vrtinčenja ot von Karmanove nestabilsnoti. Geometrija je cev z krožno oviro. Primer obravnavamo dvodimenzionalno. 1. Odpremo terminalsko okno in zaženemo: ``` bash $ single Job XXXX is submitted to default queue - interactive. Waiting for dispatch ... Starting on cnXX $ module load elmergui Loading qwt/6.0.2 Loading vtk/5.10.1 Loading ftgl/2.1.3-rc5 Loading qt/4.8.4 Loading paraview/3.98 Loading opencascade/6.5.5 Loading openmpi/1.8.1 Loading elmer/7.0 Loading elmergui/7.0 $ ElmerGUI ``` 2. V meniju programa ElmerGUI izberemo: ``` bash File -> Open circle_in_channel.in2d ``` 3. Povečamo gostoto mreže ``` bash Mesh->Configure nglib / Max H: 0.02 Mesh Remesh ``` Ko imamo mrežo, začnemo z definicijo modela,  4. Pripravimo ploskve za določitev robnih pogojev.  Kot robni pogoj želimo nastaviti temperaturo na notranjem robu širšega dela valjastih odprtin. To površino definira šest ploskev, zato moramo izbrati na sliki rdeče prikazane površine (sestavljene so iz šestih ploskev). Prvo ploskev izberemo z dvojnim klikom nanjo, za izbor naslednjih pa moramo držati tipko CTRL in hkrati izvesti dvojni klik na izbrani ploskvi. Če izberemo napačno ploskev ponovimo dvojni klik na tej ploskvi (ob hkratnem držanji tipke CTRL). Tipka CTRL omogoča dodajanje ali odvzemanje predhodno izbranih ploskev k izboru. Če objekta ni pravilo orientiran, ga med izborom lahko tudi rotiramo, kot je opisano zgoraj. Ko izberemo vse ploskve robnih pogojev nadaljujemo z: ``` bash Mesh -> Unify Surface ``` 5. Podati moramo še podatke modela. Pri tem po vrsti (od vrha proti dnu) sledimo navedbam v padajočem meniju ‘Model’. V nadaljevanju podajamo korake našega priemra: 6. Definiramo splošne nastavitve: ``` bash Model -> Setup Simulation Type = Transient Steady state max. Iter =1 Time Stepping Method = bdf BDF Order = 2 Time Step Intervals = 200 Time Step Sizes = $ 8/200 Apply ``` 7. Definicija enačb: Izveremo relevantne enačbe in parametre. V našem primeru uporabimo dva solverja (v Elmerju imenovana Equations). Za tekočino uporabimo solver za pretk tekočine in solver za pretok toplote, za železno cev pa le solver za pretok toplote. Ker poznamo mrežo in vemo, da tekočino predstavlja Body 1, cev pa Body 2 bomo tej geomertiji dodelili solverje (Equation) in materialu že ob njihovi definiciji. ``` bash Model -> Equation Add Name = Navier-Stokes Apply to Bodies = 1 Izberemo jeziček 'Navier Stokes' in definiramo: Active = on (tj postavimo kljukico) Edit Solver Settings   Nonlinear system   Convergence tol. = 1.0e-4   Linear System   Convergence tol. = 1.0e-6   Add OK (V redu) ``` ``` text Definiramo materiala. Za definicijo materilanih lastnosti vode (sobne temperature) in železa uporabimo knjižnico: : ``` 8. ``` bash Model -> Material Add Material library Watter – room temperature (izberemo iz menija) Apply to bodies = Body 1 (postavimo kljukico) Add New Material library Iron generic (izberemo iz menija) Apply to bodies = Body 2 (postavimo kljukico) Add OK OK ``` 9. Definiramo obtežbo: ``` bash Model -> Body force Add Izberemo jeziček Heat Equation Name = Heating Head Source = 0.01 Apply to bodies = Body 1 (postavimo kljukico) Add OK (V redu) ``` 10. Definiramo robne pogoje: ``` bash Model -> Boundary condition Add Name = HotInFlow Heat Equation Temperature = 350.0 Navier-Stokes Velocity 1 = 0.0 Velocity 2 = 0.0 Velocity 3 = Variable Coordinate; Real MATC "100.0*(1.0e-4-tx(0)^2-tx(1)^2)" Add New   Name = Outflow   NaviewStokes Use normal-tangential coordinate system = on   Velocity 2 = 0.0   Velocity 3 = 0.0   Add New   Name = NoSlip   Navier-Stokes   NoSlip Wall BC = on Add New   Name = Troom   Heat Equation   Temperatute = 300.0   Add OK OK OK OK (V redu) ``` 11. Za pomoč pri določivi vhodne ploskve aktiviramo kompas: ``` bash View -> Compas = on (odkljukamo opcijo v meniju View) ``` Vhodna ploskev naj bo tista tatere normala kaže vzporedno z osi.: 12. Za določitev robnih pogjev s pomočjo grafičnega vmesnika ``` bash Model -> Set boundary properties (izberemo oz odkljukamo opcijo) ``` 13. Dvokiknemo na površino vhodne linije,  odpre se nam okno za izbiro robnih pogojev. Pod ‘Boundary condition’ izberemo ‘Inlet’. Dvokiknemo na površino izhodne linije,  odpre se nam okno za izbiro robnih pogojev. Pod ‘Boundary condition’ izberemo ‘Outlet’. 14. Generiramo vhodno datoteko za program ‘ElmerSolver’: ``` bash Sif -> Generate ``` Nastalo datoteko si lahko ogledamo z izbiro iz menija: ``` bash Sif -> Edit ``` Datoteko lahko nato uredimo, ali zapustimo z ukazom ‘File-\>Quit’. 15. Shranimo projekt (Podatke projekta lahko shranimo v poljubni vazi vnosa): ``` bash File -> Save Project Za shranjevanje projekta izberemo poljuben direktorij (npr. poddirektorij 'ProjectFiles'). ``` Podatke projekta prikličemo z: File -\> LoadProject in izberemo dorektorij, kamor smo podatke shranili. 16. Izračunamo primer: ``` bash Run -> Start solver ``` . 17. Za ogled rezultatov poženemo postprocesor: ``` bash Run -> postprocesor ``` 18. Da si v postprocesorju lahko ogledamo vse rezultate moramo ponovno odpreti datoteko (File-Open). Ob pritisku na gumb All se naložijo izračuni vseh časovnih korakov. Video simulacije si nato lahko ogledamo z pritiskom gumba Loop v meniju Edit – Timestep Control. V nadaljevanju prikazujemo le distribucijo hitrosti pri časovnih korakih 20, 60, 100, 150 in 200.: ![](../../files/figs/elmer/instability-step-020.jpeg) Časovni korak 20. ![](../../files/figs/elmer/instability-step-060.jpeg). Časovni korak 60. ![](../../files/figs/elmer/instability-step-100.jpeg), Časovni korak 100. ![](../../files/figs/elmer/instability-step-150.jpeg) Časovni korak 150. ![](../../files/figs/elmer/instability-step-200.jpeg) Časovni korak 200. ::::: ::::::