[Gmsh] Some questions on tutorial 5

dolfyn info at dolfyn.net
Fri Apr 3 13:10:54 CEST 2009


Dear all,

Still learning all about Gmsh. 

Tutorial t1, t2, t3 (two versions; one with prisms, one with 
tetrahedra), t4 (beautiful prism/hex example) run.

(btw there seems to be a difference in the t3-postprocessing: in the 
tet-version all the velocity vectors show up, in the prism-version 
only at the model surfaces).

Tutorial 5 was slightly adapted because 'physical volume' 
and 'physical surfaces' names are important. The changes:

lcar2 = .05;          (just a bit different)
lcar3 = .02;

In the function after "Surface Loop(theloops[t]) = ":

  Physical Surface(Sprintf("Sphere_%g",t)) = theloops[t];

In the For-loop delete/switch off:

  // Physical Volume (t) = thehole ; (do not want the holes)

And finally instead of "Physical Volume (10) = 186 ;":

Physical Volume ("Fluid")  = 186 ;
Physical Surface("Floor")  = {27};
Physical Surface("Wall_1") = {29};
Physical Surface("Wall_2") = {31};
Physical Surface("Wall_3") = {33};
Physical Surface("Wall_4") = {37};
Physical Surface("Roof")   = {35};
Physical Surface("Box")    = {25,39,23};

The status of the workflow so far:

$ gmsh t5.geo         (hit mesh 3d and save mesh)
$ mv t5.msh t5d.msh   (important renaming)
$ gmsh2dolfyn
t5d                   (creates dolfyn geom. files and t5d.inp)
$ cat t5d.inp
rname,7,Floor
rname,8,Wall_1
rname,9,Wall_2
rname,10,Wall_3
rname,11,Wall_4
rname,12,Roof
rname,13,Box
$ ../../../solver/vs0500/preprocessor
t5d
1.0                  (creates t5d.geo, the reason to rename!)
bin
$ ../../../solver/vs0500/dolfyn
t5d
$ gmsh t5d.msh 
$

the result is shown in the figure.

HOWEVER there is 1 small glitch... the saved file of gmsh shows:

$ more t5.msh
$MeshFormat
2 0 8
$EndMeshFormat
$PhysicalNames
13
1 "Sphere_1"
2 "Sphere_2"
3 "Sphere_3"
4 "Sphere_4"
5 "Sphere_5"
6 "Fluid"
7 "Floor"
8 "Wall_1"
9 "Wall_2"
10 "Wall_3"
11 "Wall_4"
12 "Roof"
13 "Box"
$EndPhysicalNames
$Nodes
4955
1 0.5 0.5 0.5
...

So the Sphere surfaces are there; named correctly. But in 
the 'element' section they do not show up (and dolfyn puts them in 
the 'default surface' 0). And because gmsh2dolfyn does not find the 
five Sphere surfaces in the msh file they are not exported.

A beautiful aspect of this workflow is that one can use 
the 'physical surface' names in the control file for dolfyn as 
well:

...

thermal on
gravity 0 0 -9.81

post t cell
post t vert

set T0 273.0

# safety first
boundary,0
wall
noslip
0.0 0.0 0.0
fixed 
$T0 + 50 0.0

boundary,floor
wall
noslip
0.0 0.0 0.0
fixed 
$T0 + 20 0.0

boundary,wall_1
wall
noslip
0.0 0.0 0.0
fixed 
$T0 + 20 0.0

...

The two questions:
1) where are the Sphere_i surfaces gone in the msh file?
2) I finally went for:
   
   Physical Surface(Sprintf("Sphere_%g",t)) = theloops[t];
 
   Other constructs like using a string array

   Names[] = "s1","s2","s3" ;
 
   or before 'Call CheeseHole'

   s = Sprintf(s,"Sphere_%g",t);
   Physical Surface(s);
 
   Do not work.

What am I missing here?

Thanks in advance!
Henk

ps: enjoying gmsh! and I guess that some users will enjoy the 
combination of gmsh+dolfyn (esp. on windows and mac).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t5d.png
Type: image/png
Size: 69924 bytes
Desc: not available
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20090403/c35d9956/attachment.png>