Gmsh for dolfyn tutorial (7)


Contents


Introduction and Files
First tutorial (t2.geo)
Second and third tutorial (t3a.geo and t3b.geo)
Fourth tutorial (t4.geo)
Fifth tutorial (t5.geo)
Sixth tutorial (t6.geo)
Seventh tutorial (STL file of a man)
Eighth tutorial (Von Karman vortex street)

Seventh tutorial (STL file of a man)

man.jpg

File needed:


(warning: the model will be big)

Use the Gmsh geometry file "man.geo":

Geometry.Tolerance = 1.e-6;
MeshSize = 2. ;
StdSize = 10. ;

Merge "man_model.stl" ;

//
// a wind tunnel:
//
Point(1) = { 1.5 * StdSize,-13.0, 1 * StdSize, MeshSize};
Point(2) = {-1.5 * StdSize,-13.0, 1 * StdSize, MeshSize};
Point(3) = {-1.5 * StdSize,-13.0,-2 * StdSize, MeshSize};
Point(4) = { 1.5 * StdSize,-13.0,-2 * StdSize, MeshSize};

Line(1) = {1 , 2};
Line(2) = {2 , 3};
Line(3) = {3 , 4};
Line(4) = {4 , 1};


Line Loop(1) = {1, 2, 3, 4};
Plane Surface(2) = {1};

Extrude{0, 3.0 * StdSize, 0 }{ Surface{2}; }

Surface Loop(1) = {1};
Surface Loop(2) = { 2, 13, 17, 21, 25, 26};

Volume(2) = {2,1};

Physical Surface("Man ") = {1};
Physical Surface("Floor") = {2};
Physical Surface("Inlet") = {13};
Physical Surface("Outlet") = {21};
Physical Surface("Walls") = {17, 25, 26};

Physical Volume("Fluid") = {2};

man_in_gmsh.jpg

Start Gmsh and create the mesh with (mesh optimization is necessary):

$ gmsh -3 man.geo -optimize_netgen man.geo
Info : Running '../gmsh -3 -optimize_netgen man.geo'

...

Info : Reading 'man_model.stl'
Info : 13898 facets in solid 0
Info : Read 'man_model.stl'
Info : Read 'man.geo'

...

Info : ImproveMesh Info : Total badness = 314148 Info : Total badness = 312526 Info : Mesh 3D optimization with Netgen complete (45.31 s) Info : 54631 vertices 337413 elements
Info : Writing 'man.msh'
Info : Wrote 'man.msh'
Info : Stopped on Fri May 29 14:50:56 2009


Copy the *.msh file and start the translator followed by the preprocessor:

$ cp man.msh mand.msh
$ gmsh2dolfyn
Gmsh2Dolfyn: Converts a Gmsh mesh file to Dolfyn format.
(Input must be in Gmsh version 2.0 ascii format.
Output is in Dolfyn version Jan 2009 format.)

Input Gmsh filename, excluding the .msh suffix
mand
Opening the Gmsh file
Reading MeshFormat
Reading PhysicalNames
Reading Nodes
Creating the dolfyn .vrt file
Total Gmsh elements to be read in:         337237
Creating the dolfyn .cel and .bnd files
Writing the .inp file
Done gmsh2dolfyn
$ preprocessor
Dolfyn PreProcessor
Input casename:
mand
Using mand as input
Opening vertex file
Initialise vertex list
...
Region ID: 2 => Man
Region ID: 3 => Floor
Region ID: 4 => Inlet
Region ID: 5 => Outlet
Region ID: 6 => Walls
Type 1 regions found: 5 6
WARNING: check inp-file
Enter scaling factor (1.0):
0.1                                                 <= NOTE!
Using: 1.000000
Enter format of geometry file (bin|ascii):
bin
Dump binary geometry file
Done

Gmsh does not produce the same mesh when it is rerun with the same parameters. This randomness feature can not be switched off. The only consequence is that the location of the reference pressure (where the relative pressure equals zero) has to be set by hand. Find in Gmsh an appropriate cell (e.g. in one of the corners) by zooming in and switching 'volume labels' on. Use the 'volume label' in the *.din file for the 'pref' command.

set_pref.jpg

The *.din file for mand contains:

title Test Gmsh man model
steps 200 1.e-5

#opendx off
#use gmsh
use vtk
save cpu 1 h
output every 25

density,1.0
vislam 18.6e-6
pref,85562                   <= NOTE adapt!

relax 0.4 0.1 0.4 0.8
#turbulence ke 0.001
#thermal on
init,field,0.0 0.0 -0.1,,1.e-4,1e-4

scheme UVW GAMMA 1.0

slope UVW vnf
slope P vnf
slope KEPS vnf

limit uvw lower -10.0
limit uvw upper 10.0

post p vert

boundary,man
wall
noslip
0.0 0.0 0.0
fixed
273 + 38 0.0

boundary,inlet
inlet
0.0 0.0 -1.0
1.0
293
inle
0.25 0.01

boundary,outlet
outlet
1.0

boundary,floor
symp

boundary,walls
symp

Start dolfyn:.

$ dolfyn
This is dolfyn version 0.524
Copyright(C) 2002-2009 Cyclone Fluid Dynamics BV
NL-5583 XM, Waalre, The Netherlands
see http://www.cyclone.nl and http://www.dolfyn.net
Using Sparsekit2 by Yousef Saad
(C) 2005, the Regents of the University of Minnesota
Modules with patches (C) 2004-2008 by B. Tuinstra
see http://www.home.zonnet.nl/bouke_1/dolfyn
Tecplot interface (C) 2006 by S.B. Kuang
VTK interface updated (C) 2007 by J. Jacobs


Enter case:
mand
Using case: mand
Appending echo to file mand.txt
mand.geo binary

...

Writing Gmsh data file... 1198
Writing Gmsh data vectors cell
Writing Gmsh data pressure cell
Done

...

Done mand

Finally start VisIt (or your favourite postprocessor) with:

$ visit &

The result is:

gmshman.png


<< First < Previous Next > Last >>



Cyclone www.dolfyn.net