1. Home
  2. Tutorial
  3. Tutorial 3: Symmetry & Temperature
  4. Meshing and Simulating

Meshing and Simulating

Meshing

Start Gmsh and create the mesh with:

gmsh -3 t4.geo

Possible output

Start Gmsh and create the mesh with:

gmsh -3 t4.geo
Info    : Running 'gmsh -3 t4.geo' [Gmsh 4.0.4, 1 node, max. 1 thread]
Info    : Started on Mon Nov 12 12:38:17 2018
Info    : Reading 't4.geo'...
Info    : Done reading 't4.geo'
Info    : Meshing 1D...
Info    : Meshing curve 1 (Line)
. . .
Info    : Meshing curve 120 (extruded)
Info    : Done meshing 1D (0.03125 s)
Info    : Meshing 2D...
Info    : Meshing surface 24 (Plane, Delaunay)
Info    : Blossom: 1734 internal 168 closed
Info    : Blossom completed (0.03 s):   590 quads     0 triangles 0 invalid quads  0 quads with Q < 0.1 Avg Q = 0.741 Min Q 0.391
Info    : Meshing surface 49 (extruded)
. . .
Info    : Meshing surface 126 (extruded)
Info    : Done meshing 2D (0.0625 s)
Info    : Meshing 3D...
Info    : Meshing volume 1 (extruded)
Info    : Done meshing 3D (0 s)
Info    : Optimizing 3D mesh...
Info    : Done optimizing 3D mesh (0 s)
Info    : 1358 vertices 2344 elements
Info    : Writing 't4.msh'...
Info    : Done writing 't4.msh'
Info    : Stopped on Mon Nov 12 12:38:18 2018

Opening t4.msh will show something similar to:

As can be seen, the Recombine command generates both triangles as well as quadrangles on the surface. This results in  different prisms. Also, we can see a huge difference in cell volumes: close to the edge the elements are much larger than close to the smooth curves.

Copying mesh

Again, to make sure the mesh file will not be overwritten by the results, we copy and rename the files:

cp t4.msh t4d.msh

Converting to dolfyn input

We now convert the mesh into *.cel, a  *.vrt, a  *.bnd, and optionally an  *.inp file using gmsh2dolfyn, and selecting the correct file to convert, in our case: t4d.

gmsh2dolfyn t4d

Possible output

Start gmsh2dolfyn converter with:

gmsh2dolfyn t4d
 Gmsh2Dolfyn: Converts a Gmsh mesh file to Dolfyn format.
 Input must be in Gmsh version 2.0, 2.1, 2.2 or 4 ascii format.
 Opening the Gmsh file
 File t4d.msh opened
 Reading MeshFormat
 MeshFormat: 4 0 8
 Reading PhysicalNames
 Name            2 -> Swall                                                       
 Name            3 -> Sin                                                         
 Name            4 -> Sout                                                        
 Name            5 -> Ssym1                                                       
 Name            6 -> Ssym2                                                       
 Name            1 -> Fluid                                                       
 Entities
 Entity           24  surface            5 Ssym1                                  
  . . .
 Entity          126  surface            6 Ssym2                                  
 Entity            1  volume             1 Fluid                                  
 Physical entities found           23
 Reading Nodes
 Number of entity blocks:         103  Nodes:        1348
 Creating the dolfyn .vrt file
 File t4d.vrt opened
 Point              1  Node            1
  . . .
 Surface          126  Nodes         506
 Nodes written         1348
 Gmsh 4: Total Gmsh Entity Blocks to be read in:          23
 Gmsh 4: Total Gmsh elements to be read in:        1938
 Creating the dolfyn .cel and .bnd files          14          23
 File t4d.cel opened
 File t4d.bnd opened
 Element           24 Ssym1    Type            3         590
  . . .
 Element            1 Fluid    Type            5         590
 Quad boundaries:             1348
 Hexahedral cells:             590
 Writing the .inp file
 File t4d.inp opened
 inp:           2 Swall        T
 inp:           3 Sin          T
 inp:           4 Sout         T
 inp:           5 Ssym1        T
 inp:           6 Ssym2        T
 Done gmsh2dolfyn 2018

Running Pre-Processor

Now we will run the pre-processor.

dolgeo -s 1.0 -b t4d

If no options are given with the dolgeo command, you will be prompted for them. Fill in case name t4d, scaling factor of 1.0 (default) and bin as format of geometry file.

Possible output

The pre-processor is run with:

dolgeo -s 1.0 -b t4d
 Dolfyn PreProcessor
 t4d                              T T T F
 Using command line arguments
 Using t4d as input
 Opening vertex file
 Initialise vertex list
 . . .
 Region ID:            2  => Swall
 Region ID:            3  => Sin
 Region ID:            4  => Sout
 Region ID:            5  => Ssym1
 Region ID:            6  => Ssym2
 Type 1 regions found:           5           6
 WARNING: check inp-file
 Using:    1.00000000      binary
 Dump binary geometry file
 Done

Running Simulation

Finaly we will run the dolfyn simulations.

dolfyn t4d

If no case name is inputted directly, you will be prompted. If so, enter case name t4d.

Possible output

The pre-processor is run with:

dolfyn t4d
 This is dolfyn version 0.607
 Copyright(C) 2002-2016 Cyclone Fluid Dynamics BV
 NL-5583 XM, Waalre, The Netherlands
 see http://www.cyclone.nl and https://www.dolfyn.net

 Using Sparsekit2 by Yousef Saad
 (C) 2005, the Regents of the University of Minnesota
 Modules with patches (C) 2004-2010 by B. Tuinstra
 see http://www.home.zonnet.nl/bouke_1/dolfyn
 Tecplot interface (tecplt.f90) (C) 2006-2012 by
 S.B. Kuang, UNSW, Sydney, Australia
 VTK interface updated (C) 2007 by J. Jacobs
 Static boundary conditions (C) 2011 by J. JoJo
 MKL contributions and suggestions by Runar


 Using case: t4d
 Calling dolfyn t4d .dge
 t4d.dge binary
. . .
 Number of requested steps done.          200


 Opening restart file
 File t4d.rst
 Restartfile 400 written

 Writing Full Gmsh file...
 Done
 Maximum change in PP:   1.17175070E-07   1357.51599       9.99999975E-05
 Arrays cleaned up
 Done t4d
 Bye!

That’s it! Now all the calculations have been carried out, we can start to analyze the output.

Was this article helpful to you? Yes No

How can we help?