Skip to content

ccmToFoam -merge option leads to negative volume mesh

Summary

When use the option -merge with ccmToFoam, negative volume mesh will be generated near the merged interface. Without -merge option, there would be no problem. The reason has been found, and you might fix it in next version.

Environment information

  • OpenFOAM version : v2012
  • Operating system : openSUSE
  • Hardware info :
  • Compiler : gcc

Possible fixes

The probem is caused by the generation and usage of mergedPointMap in line 1937 and line 1953 of the file ccmReaderMesh.C. I added several lines to modify mergedPointMap between them, and then the problem vanished. The added lines look like

        labelList pointRemap;
        pointRemap.setSize(mergedPointMap.size());
        pointRemap = -1;
        forAll(mergedPointMap, i)
        {
            if (pointRemap[mergedPointMap[i]] < 0)
            {
                pointRemap[mergedPointMap[i]] = i;
            }
        }
        forAll(mergedPointMap, i)
        {
            mergedPointMap[i] = pointRemap[mergedPointMap[i]];
        }

I know it is absolutely not the best the solution, but may help you to know the reason better. Thank you!