next up previous contents
Next: Post-processing and Visualisation Up: The Gerris FAQ Previous: Physics and dimensioning   Contents

Representation of solid boundaries

How do I import my geometry into Gerris?

You need to convert your geometry into a set of triangulated surfaces and be able to export it in the GTS format (very simple, described here) or alternatively in the STL format (which can be converted to GTS using the stl2gts program).

The tricky bit is that the surfaces you export must represent proper solid objects i.e. they must be orientable, closed, manifold and non self-intersecting surfaces.

What CAD package can I use to export STL/GTS files?

Blender can do that and is open-source, also have a look at ac3d, k3d and Pro/Engineer, Rhino. There are plenty of others.

Do I need to tessellate (increase the number of triangles of) my surface before importing it into GTS?

If your solid boundary is exactly defined using a few triangles, there is no need to use more. In short, the mesh size generated by Gerris is completely independent from the ``triangle size'' of the input surface (in contrast to what happens in ``classical'' unstructured mesh solvers).

If for example, you want to resolve the boundary layers around your solid, you could tell Gerris to use a ``fine enough'' mesh like this:

GfsRefineSolid 10
which tells Gerris to use 10 levels of refinement near the solid surface. ``Fine enough'' is going to depend on the details of the physics (most importantly Reynolds number) and on the constraints in term of computational time, memory size etc...

Which part of the parameter file tells Gerris where the half-cylinder is placed? How do I alter it?

The position of the solid object is defined (obviously) through the coordinates of its vertices. If you created it using a CAD or similar program, you can translate, rotate etc...the object using this same program.

Alternatively, you can use the transform program which comes with GTS.

% transform -h
will give you a summary of the transformations you can make, currently
Usage: transform [OPTION] < file.gts
Apply geometric transformations to the input.

  -r ANGLE  --rx=ANGLE      rotate around x-axis
  -m ANGLE  --ry=ANGLE      rotate around y-axis
  -n ANGLE  --rz=ANGLE      rotate around z-axis
  -s FACTOR --scale=FACTOR  scale by FACTOR
  -R FACTOR --sx=FACTOR     scale x-axis by FACTOR
  -M FACTOR --sy=FACTOR     scale y-axis by FACTOR
  -N FACTOR --sz=FACTOR     scale z-axis by FACTOR
  -t V      --tx=V          translate of V along x-axis
  -u V      --ty=V          translate of V along y-axis
  -w V      --tz=V          translate of V along z-axis
  -i        --revert        turn surface inside out
  -o        --normalize     fit the resulting surface in a cube of
                            size 1 centered at the origin
  -v        --verbose       print statistics about the surface
  -h        --help          display this help and exit

Reports bugs to popinet@users.sourceforge.net
The resulting (transformed) object is written on the standard output.

For example, if you want the half-cylinder in the second cell do:

% transform -t 1 < half-cylinder.gts > half-cylinder1.gts
and use half-cylinder1.gts in the parameter file.

Are there any tools for converting format-X (not STL) files (generated via a CAD system) to a GTS-format file?

The GTS file format is described here. It is very simple. You should be able to write your own filter using your favourite scripting language. You might want to have a look at the cleanup utility which comes with GTS (in the examples/ directory) It will allow you to link unlinked faces, remove duplicate vertices etc...

Gerris seem to allow only one solid body, is this correct?

No, there is no limitation on the number and/or complexity of solid bodies (as long as they are properly oriented, manifold geometrical surfaces). Multiple bodies are possible, either as a single GTS file containing multiple separate bodies or as multiple calls to GtsSurface in the parameter file with several non-intersecting GTS surfaces.

GtsSurfaceFile box_1.gts
GtsSurfaceFile box_2.gts
Note however that the solids cannot intersect.

How do I orient my solid surfaces properly?

The orientation of the faces of your solid defines where the fluid side is (by convention the counter-clockwise (CCW) normal direction to a face points toward the solid side). If your solid is not oriented properly you can use the -revert or -i option of transform to turn it ``inside out''.

It looks like all STL files need to be turned ``inside out''. I don't understand why, but transform -i fixed the problem.

It is just a matter of different conventions. The program you use has chosen to orient the CCW face normals toward the ``outside'' of the solid object.

Can solids intersect?

No, you first need to use the ``boolean operations'' or ``constructive solid geometry'' operations of your solid modeller to generate the union of your solids.

This may change in the future.

We have a problem inserting some GTS files generated from STL files and even inserting the standard GTS files found on the GTS samples site?

The samples files on the GTS site are not necessarily describing consistent geometric surfaces (i.e. they can be open, non-manifold etc...)



Subsections
next up previous contents
Next: Post-processing and Visualisation Up: The Gerris FAQ Previous: Physics and dimensioning   Contents