Contrib AlignMeshSurf

From OpenFOAMWiki
Revision as of 17:25, 22 November 2006 by Rpasiok (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Valid versions: OF version 13.png

1 Short description

Moves mesh points in the Z direction so that the bottom and top faces are aligned with provided surfaces,

2 Usage

Needs two inputs:

  1. lower and
  2. upper surface file name


The code assumes the following about the original mesh and the surfaces:

  • both surfaces have to cover original mesh in the XY-plane - it needs surfaces height Z for XY-position of each mesh point
  • internal mesh points keep their relative distance between bottom and top faces - the original relative distance is based on mesh bounding box rather than local faces height. It is good idea to have your original top and bottom faces flat (const Z).


The command

alignMeshSurf . alignMeshTest bottomSurf.stl topSurf.ftr

will :

  • take alignMeshTest case mesh for startFrom time,
  • align the bottom mesh face with bottomSurf.stl surface and the top mesh face with topSurf.ftr surface
  • move internal mesh points vertically and
  • write the new mesh for next time step

3 Example

Original mesh (only a cut) and surfaces of a test case

AlignMeshSurf oldMesh.jpg

and the aligned mesh

AlignMeshSurf newMesh.jpg

4 Download

The tar file with the sources. Works with OpenFOAM 1.3.

And the Test case.


--Rpasiok 18:25, 22 Nov 2006 (CET)