Contrib/SplitMeshWithSets

From OpenFOAMWiki

Valid versions: OF version 12.png OF version 13.png

1 Short description

Splitting a mesh like it is described in Importing a FLUENT mesh with internal walls has problems if it is to be done twice: because the original splitMesh renumbers the faces but the faceSets are not updated it is possible that the information in the faceSets is wrong. This utility updates the sets. The same applies for importing a mesh with internal walls from Gmsh.

2 Usage

The same as splitMesh. After the mesh was split all faceSets are updated in the following way

  • the faceSet that was used to split the mesh is erased (set to zero length)
  • all other faceSets are updated so that the renumbering of the faces is taken into account

another difference to the original behaviour of the original splitMesh is that boundaries with 0 faces are not erased.

The new, empty patches must be inserted after the regular boundary patches in the boundary file otherwise some very strange errors may occur.

3 Download

For OpenFOAM 1.2: The tar file with the sources

For OpenFOAM 1.3: The tar file with the sources

For OpenFOAM 1.4.1: The tar file with the sources provided by Bernhard

For OpenFOAM 2.1.x: splitMeshWithSets-2.1.x.tar.gz --El Safti (talk) 13:54, 9 January 2013 (CET)

3.1 OpenFOAM 1.3

There is a special version that compiles on Version 1.3. Please note when using this recipie that in OpenFOAM 1.3 empty patches without a starting face are treated differently: now the starting face must be one face after the last face. If it is left empty OpenFOAM assumes that it is zero.


3.2 Compilation problems

Some newer non-standard versions of OF version 12.png have the problem, that the constructor for attachDetach has changed. Change the call

 
    tm[0] =
        new attachDetach
        (
            "Splitter",
            0,
            pMesh,
            "membraneFaces",
            masterPatch,
            slavePatch,
            scalarField(1, runTime.value())
        );

to

 
    tm[0] =
        new attachDetach
        (
            "Splitter",
            0,
            pMesh.morphEngine(),
            "membraneFaces",
            masterPatch,
            slavePatch,
            scalarField(1, runTime.value())
        );

4 Note

If two faceSets are joined like a T some faces are dropped (which faces depends on the order you split these sets). The problem is described in detailed on the MessageBoard.

5 History

  • first Version added
  • 2006-04-03: Version for OpenFOAM 1.3 added

--Bgschaid 18:57, 27 Feb 2006 (CET)