Gmsh for dolfyn tutorial (1)


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)

First model

Use the Gmsh tutorial and edit the file "t1.geo" (note the comments have been stripped):

lc = 0.0125;

Point(1) = {0, 0, 0, lc};
Point(2) = {.1, 0, 0, lc} ;
Point(3) = {.1, .3, 0, lc} ;
Point(4) = {0, .3, 0, lc} ;

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

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

//
// note comment out the next lines:
//
// Physical Point(1) = {1,2} ;
// MyLine = 99;
// Physical Line(MyLine) = {1,2,4} ;
// Physical Surface(100) = {6} ;

"t1.geo" is read in by "t2.geo":

Include "t1.geo";

Point(5) = {0, .6, 0, lc};
Line(5) = {4, 5};

Translate {-0.05, 0, 0} { Point{3}; }
tmp[] = Translate {0, 0.3, 0} { Duplicata{ Point{3}; } } ;

Line(7) = {3,tmp[0]};
Line(8) = {tmp[0],5};
Line Loop(10) = {5,-8,-7,3};
Plane Surface(11) = {10};

h = 0.12;
Translate {0, 0, h} { Duplicata{ Surface{6}; } }

Line(106) = {1,8};
Line(107) = {2,12};
Line(108) = {3,16};
Line(109) = {4,7};

Line Loop(110) = {1,107,-14,-106}; Plane Surface(111) = {110};
Line Loop(112) = {2,107,15,-108}; Plane Surface(113) = {112};
Line Loop(114) = {3,109,-16,-108}; Plane Surface(115) = {114};
Line Loop(116) = {4,106,-13,-109}; Plane Surface(117) = {116};

Surface Loop(118) = {117,-6,113,-12,111,115};
Volume(119) = {118};

Extrude {0, 0, h} { Surface{11}; }
Characteristic Length {tmp[0], 2, 12, 3, 16, 6, 22} = lc * 2;

//
// Note these Physical Volume and Surfaces:
// volume:

Physical Volume ("Fluid") = {119,120};
Physical Surface("Inlet") = {111};
Physical Surface("Outlet") = {132};

Note the two "Physical Surfaces" ("Inlet" and "Outlet").

Start Gmsh and create the mesh with:

$ gmsh -3 -optimize t2.geo
Info : Running '../gmsh -3 -optimize t2.geo'
Info : Started on Thu Apr 16 13:04:53 2009
Info : Reading 't2.geo'
Info : Reading 't1.geo'
Info : Read 't1.geo'
Info : Read 't2.geo'
Info : Meshing 1D...
Info : Meshing curve 1 (Line)

...

Info : Opti : 0.80 < QUAL < 0.90 : 305 elements
Info : Opti : 0.90 < QUAL < 1.00 : 28 elements
Info : Mesh 3D optimization complete (0.204012 s)
Info : 1438 vertices 7671 elements
Info : Writing 't2.msh'
Info : Wrote 't2.msh'
Info : Stopped on Thu Apr 16 13:04:55 2009


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

$ cp t2.msh t2d.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
t2d
Opening the Gmsh file
Reading MeshFormat
Reading PhysicalNames
Reading Nodes
Creating the dolfyn .vrt file
Total Gmsh elements to be read in: 5841
Creating the dolfyn .cel and .bnd files
Writing the .inp file
Done gmsh2dolfyn
$ preprocessor
Dolfyn PreProcessor
Input casename:
t2d
Using t2d as input
Opening vertex file
Initialise vertex list
...
Region ID: 2 => Inlet
Region ID: 3 => Outlet
Type 1 regions found: 2 3
WARNING: check inp-file
Enter scaling factor (1.0):
1.0
Using: 1.000000
Enter format of geometry file (bin|ascii):
bin
Dump binary geometry file
Done

The *.din file for t2d contains:

title Test Gmsh t2.geo model
steps 200 1.e-3

opendx off
use gmsh

vislam 20.e-6
density 1.2
relax 0.5 0.25 0.5

thermal on
turbulence ke 0.01
init,field,0.0 0.0 0.0,,1.e-4,1e-4

scheme UVW LUX 0.8
scheme KEPS UD
scheme T GAMMA

slope UVW vnf
slope P vnf
slope KEPS vnf
slope T vnf

post t cell

boundary,0
wall
noslip
0.0 0.0 0.0
fixed
273 - 20 0.0

boundary,inlet
inlet
0.0 0.1 0.0
1.2
273 + 20
inle
0.05 0.01

boundary,outlet
outlet
1.0

Note the the boundaries are simply called "inlet" and "outlet" (lowercase, corresponding to the contents of "t2.geo").

$ 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:
t2d
Using case: t2d
Appending echo to file t2d.txt
t2d.geo binary

...

Writing Gmsh data file... 102
Writing Gmsh data vectors cell
Writing Gmsh data pressure cell
Writing Gmsh data pressure vertex
Writing GMSH data temperature cell relative to 273.0000
Writing GMSH data temperature vertex relative to 273.0000
Done

...

Done t2d

Finally start Gmsh with:

$ gmsh t2.msh t2d_pv.msh t2d_uvwc.msh

The result in Gmsh is:

t2d.png


<< First < Previous Next > Last >>



Cyclone www.dolfyn.net