Gmsh for dolfyn tutorial (6)


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)

Sixth model (t6.geo)

Use the Gmsh tutorial "t6.geo":

Include "t1.geo";

// Delete the left line and create replace it with 3 new ones
Delete{ Surface{6}; Line{4}; }

p1 = newp; Point(p1) = {-0.05, 0.05, 0, lc};
p2 = newp; Point(p2) = {-0.05, 0.1, 0, lc};

l1 = newl; Line(l1) = {1, p1};
l2 = newl; Line(l2) = {p1, p2};
l3 = newl; Line(l3) = {p2, 4};

Line Loop(1) = {2, -1, l1, l2, l3, -3};
Plane Surface(1) = {1};

// Put 20 points with a refinement toward the extremities on curve 2
Transfinite Line{2} = 20 Using Bump 0.25;

// Put 20 points total on combination of curves l1, l2 and l3
Transfinite Line{l1} = 6;
Transfinite Line{l2} = 6;
Transfinite Line{l3} = 10;

// Put 30 points following a geometric progression on curve 1
// (reversed) and on curve 3 (progression 1.2 was just too much...)
Transfinite Line{-1,3} = 30 Using Progression 1.05;

// Define the Surface as transfinite, by specifying the four corners
// of the transfinite interpolation
Transfinite Surface{1} = {1,2,3,4};

// (Note that the list on the right hand side refers to points, not
// curves. When the surface has only 3 or 4 points on its boundary the
// list can be omitted. The way triangles are generated can be
// controlled by appending "Left", "Right" or "Alternate" after the
// list.)

// Recombine the triangles into quads
Recombine Surface{1};

// Apply an elliptic smoother to the grid
Mesh.Smoothing = 100;

Extrude {0,0,0.01} {Surface{1}; Layers{1}; Recombine; }

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

Physical Surface("Top") = {39};
Physical Surface("Left") = {35,31,27};
Physical Surface("Right") = {19};
Physical Surface("Bottom") = {23};
Physical Surface("Front") = {40};
Physical Surface("Back") = {1};

Start Gmsh and create the mesh with:

$ gmsh -3 t6.geo
Info : Running '../gmsh -3 t6.geo'

...

Info : Meshing 3D...
Info : Meshing volume 1 (extruded)
Info : Mesh 3D complete (0.004 s)
Info : 1200 vertices 1959 elements
Info : Writing 't6.msh'
Info : Wrote 't6.msh'
Info : Stopped on Thu Apr 16 14:57:06 2009


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

$ cp t6.msh t6d.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
t6d
Opening the Gmsh file
Reading MeshFormat
Reading PhysicalNames
Reading Nodes
Creating the dolfyn .vrt file
Total Gmsh elements to be read in: 1749
Creating the dolfyn .cel and .bnd files
Writing the .inp file
Done gmsh2dolfyn
$ preprocessor
Dolfyn PreProcessor
Input casename:
t4d
Using t3ad as input
Opening vertex file
Initialise vertex list
...
Region ID: 2 => Top
Region ID: 3 => Left
Region ID: 4 => Right
Region ID: 5 => Bottom
Region ID: 6 => Front
Region ID: 7 => Back
Type 1 regions found: 6 7
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 t6d contains:

title Test Gmsh t6.geo model
steps 50 1.e-3
opendx off
use gmsh

pref,10
solver,w,off
density,1.2
vislam 120.e-6

boundary,left
wall
noslip
0.0 0.0 0.0
adiabatic

boundary,right
wall
noslip
0.0 0.0 0.0
adiabatic

boundary,front
symp

boundary,back
symp

boundary,top
inlet
0.0 -0.1 0.0
1.2
293
inle
0.05 0.01

boundary,bottom
outlet
1.0

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

...

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

...

Done t6d

Finally start Gmsh with:

$ gmsh t6d.msh t6d_tc.msh

The result in Gmsh is:

t6d.png


<< First < Previous Next > Last >>



Cyclone www.dolfyn.net