View Issue Details

IDProjectCategoryView StatusLast Update
0001826OpenFOAMBugpublic2015-09-02 14:36
Reporterjkau Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Summary0001826: fluentMeshToFoam exits with segmentation fault
Descriptionwhen converting a fluent msh file to OpenFOAM format fluentMeshToFoam exits with segmentation fault. Import in other software (e.g. starccm+) works. The msh file is in ascii format and was converted via dos2unix.
Steps To ReproduceDownload attached block.msh file.
execute fluentMeshToFoam block.msh
TagsNo tags attached.

Activities

jkau

2015-08-12 22:53

reporter  

block.tgz (1,934,791 bytes)

jkau

2015-08-13 16:18

reporter   ~0005230

Maybe worth to mention: with same topology but hex or tetra cells works well, segmentation fault only happens when using polycells

wyldckat

2015-08-13 18:58

updater   ~0005233

Last edited: 2015-08-13 19:06

Thanks for the sample mesh!
I've taken a look at the "block.msh" file and there are 2 important details:

  1- "fluent3DMeshToFoam" is the correct utility to be used for this kind of mesh file. I'm not 100% certain, but I think that "fluentMeshToFoam" is meant for 2D mesh files.

  2- The parser that is used in both "fluentMeshToFoam" and "fluent3DMeshToFoam" isn't prepared for some of the new characters that are being used in this file you provided. Some examples: commas "," and pipes "|".


If you remove from the first line the comma; then remove the lines including and after this line:

  (0 "TGrid variables:")

it should work just fine with "fluent3DMeshToFoam".


I honestly am not 100% sure if this is worth fixing. You stated that generating meshes with hex and tetra cells works well. Can you please provide the ".msh" files for each one of those meshes? I ask this to ascertain where is the difference in file formatting coming from.

jkau

2015-08-13 23:13

reporter  

blockTetra.tgz (1,160,613 bytes)

jkau

2015-08-13 23:23

reporter   ~0005239

Thanks Bruno for having a look. I have uploaded also a mesh containing tetras. I can not see any difference.

But I do not agree, fluentMeshToFoam can be used for 3D. If I use fluent3DMesh with the tetra-mesh it also complains about the pipe character. Anyway with fluentMeshToFoam it works.

wyldckat

2015-08-23 00:20

updater   ~0005284

I did some digging into the history of OpenFOAM's source code and ended up pinpointing why fluent3DMeshToFoam was introduced, and I quote from the release notes for 1.4.1: http://www.openfoam.org/download/version1.4.1.php

    New fluent3DMeshToFoam converter for 3D meshes from Fluent format to OpenFOAM format including full support for all BCs, zones etc.;

I've compiled further details at openfoamwiki.net:

  - https://openfoamwiki.net/index.php/FluentMeshToFoam#Limitations
  - https://openfoamwiki.net/index.php/Fluent3DMeshToFoam#Comparison_between_fluentMeshToFoam_and_fluent3DMeshToFoam

But the main detail is that fluentMeshToFoam cannot handle polyhedral cells, it can only deal with: tet, hex, pyramid, prism

I'll check what needs to be fixed in fluent3DMeshToFoam for parsing properly the meshes you've provided.

wyldckat

2015-08-23 00:55

updater  

fluent3DMeshToFoam.L (41,225 bytes)

wyldckat

2015-08-23 01:04

updater   ~0005285

Last edited: 2015-08-23 01:06

Attached is the file "fluent3DMeshToFoam.L", for the folder "applications/utilities/mesh/conversion/fluent3DMeshToFoam", tested with 2.4.x, with the following main modifications:

 - Handles headers with commas and pipes (vertical bars) in the text as well.

 - Ignores blocks that also have commas and pipes (vertical bars).

I've tested with both of the provided meshes and it seems to have imported them correctly.


Nonetheless, I'm a bit concerned about what "checkMesh -constant" tells us for the polyhedral mesh that is inside "block.tgz":

  Checking topology...
      Boundary definition OK.
      Cell to face addressing OK.
      Point usage OK.
    <<Found 100 neighbouring cells with multiple inbetween faces.
      Upper triangular ordering OK.
    <<Writing 204 unordered faces to set upperTriangularFace
      Face vertices OK.
      Number of regions: 1 (OK).

I'm not sure what to make of it. I'll attach the full log file, for reference. (edit: "log.checkMesh.block.msh")

wyldckat

2015-08-23 01:06

updater  

henry

2015-08-24 17:51

manager   ~0005292

Thanks for the patch Bruno. I have applied the changes to both 2.4.x and dev.
Resolved by commit ee9849afbf365d44af168e51984758940fb21e1a

Issue History

Date Modified Username Field Change
2015-08-12 22:53 jkau New Issue
2015-08-12 22:53 jkau File Added: block.tgz
2015-08-13 16:18 jkau Note Added: 0005230
2015-08-13 18:58 wyldckat Note Added: 0005233
2015-08-13 19:06 wyldckat Note Edited: 0005233
2015-08-13 23:13 jkau File Added: blockTetra.tgz
2015-08-13 23:23 jkau Note Added: 0005239
2015-08-23 00:20 wyldckat Note Added: 0005284
2015-08-23 00:55 wyldckat File Added: fluent3DMeshToFoam.L
2015-08-23 01:04 wyldckat Note Added: 0005285
2015-08-23 01:06 wyldckat File Added: log.checkMesh.block.msh
2015-08-23 01:06 wyldckat Note Edited: 0005285
2015-08-24 17:51 henry Note Added: 0005292
2015-08-24 17:51 henry Status new => resolved
2015-08-24 17:51 henry Resolution open => fixed
2015-08-24 17:51 henry Assigned To => henry