View Issue Details

IDProjectCategoryView StatusLast Update
0003815OpenFOAMFeaturepublic2022-03-09 11:14
ReporterkasperbildeAssigned Tohenry 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version20.04
Product Versiondev 
Fixed in Versiondev 
Summary0003815: fluent3DMeshToFoam not able to read mesh from R2021
DescriptionHi,

I've previously used fluent3DMeshToFoam to convert Fluent meshes to Foam and I recently upgraded to Fluent R2021 R2. I created a mesh and got the following error due to square brackets in the .msh ASCII file.

/*---------------------------------------------------------------------------*\
  ========= |
  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
   \\ / O peration | Website: https://openfoam.org
    \\ / A nd | Version: dev
     \\/ M anipulation |
\*---------------------------------------------------------------------------*/
Build : dev-69858a80ec41
Exec : fluent3DMeshToFoam fluent3DmeshToFoam_bug.msh
Date : Mar 08 2022
Time : 14:31:14
Host : "DKAALT0912"
PID : 7777
I/O : uncollated
Case : /mnt/c/Users/dkaakbea/OpenFOAM/flocculatorDesign/basecase
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Reading header: "ANSYS(R) TGLib(TM) 3D, revision 18.1.0"
Reading header: "ANSYS(R) TGLib(TM) 3D, revision 18.1.0"
Dimension of grid: 3
Number of points: 8263
Number of faces: 12816
Number of cells: 2617
PointGroup: 64 start: 1274 end: 8262. Reading points...done.
PointGroup: 136 start: 0 end: 1273. Reading points...done.
FaceGroup: 62 start: 763 end: 12815. Reading mixed faces...done.
FaceGroup: 13 start: 0 end: 179. Reading mixed faces...done.
FaceGroup: 14 start: 180 end: 359. Reading mixed faces...done.
FaceGroup: 12 start: 360 end: 762. Reading mixed faces...done.
CellGroup: 60 start: 0 end: 2616 type: 1
Zone: 60 name: solid type: fluid. Reading zone data...done.
Zone: 12 name: walls type: wall. Reading zone data...done.
Zone: 14 name: outlet type: pressure-outlet. Reading zone data...done.
Zone: 13 name: inlet type: velocity-inlet. Reading zone data...done.
Zone: 62 name: interior--solid type: interior. Reading zone data...done.


--> FOAM FATAL ERROR:
Do not understand characters: [
    on line 21154

    From function virtual int yyFlexLexer::yylex()
    in file fluent3DMeshToFoam.L at line 749.

FOAM exiting

Not sure whether this was introduced in an earlier version of Fluent, but I can confirm it was working well with Fluent 2019 R3.

When removing the square brackets from the ASCII file, fluent3DMeshToFoam functions again.

sed -e 's/\|\[0-9\]//g' -i fluent3DmeshToFoam_bug.msh
fluent3DMeshToFoam -scale 0.001 fluent3DmeshToFoam_bug.msh
Steps To ReproduceReproduce error:
1. Insert fluent3DmeshToFoam_bug.msh in a case.
2. fluent3DMeshToFoam fluent3DmeshToFoam_bug.msh

Fix by removing square brackets from ASCII .msh file.
1. sed -e 's/\|\[0-9\]//g' -i fluent3DmeshToFoam_bug.msh
2. fluent3DMeshToFoam fluent3DmeshToFoam_bug.msh
TagsNo tags attached.

Activities

kasperbilde

2022-03-08 13:34

reporter  

fluent3DmeshToFoam_bug.msh (911,619 bytes)

henry

2022-03-08 13:49

manager   ~0012520

Last edited: 2022-03-08 13:59

View 2 revisions

We have no access to Fluent and so no way to maintain the converter. Can you supply a patch which ensures the converter works with the current AND previous Fluent releases?

I tested the .msh file you attached but it converted fine and does not contain any square brackets.

kasperbilde

2022-03-08 14:24

reporter   ~0012521

I'll look into it. It might take a while, as I haven't got so much time at the moment. I don't know if you can put it "on hold" or something. If anyone else encounters this from Google search, they can simply remove the brackets from the .msh-file until a patch is made.

henry

2022-03-08 14:38

manager   ~0012522

I couldn't find any square brackets in the .msh file you sent and it converts fine.

henry

2022-03-08 14:47

manager   ~0012523

Here is the log I get when I convert the file attached here:
Create time

Reading header: "ANSYS(R) TGLib(TM) 3D, revision 18.1.0"
Reading header: "ANSYS(R) TGLib(TM) 3D, revision 18.1.0"
Dimension of grid: 3
Number of points: 8263
Number of faces: 12816
Number of cells: 2617
PointGroup: 64 start: 1274 end: 8262. Reading points...done.
PointGroup: 136 start: 0 end: 1273. Reading points...done.
FaceGroup: 62 start: 763 end: 12815. Reading mixed faces...done.
FaceGroup: 13 start: 0 end: 179. Reading mixed faces...done.
FaceGroup: 14 start: 180 end: 359. Reading mixed faces...done.
FaceGroup: 12 start: 360 end: 762. Reading mixed faces...done.
CellGroup: 60 start: 0 end: 2616 type: 1
Zone: 60 name: solid type: fluid. Reading zone data...done.
Zone: 12 name: walls type: wall. Reading zone data...done.
Zone: 14 name: outlet type: pressure-outlet. Reading zone data...done.
Zone: 13 name: inlet type: velocity-inlet. Reading zone data...done.
Zone: 62 name: interior--solid type: interior. Reading zone data...done.
--> FOAM Warning : Found unknown block of type: "73"
    on line 22257

FINISHED LEXING

Creating patch 0 for zone: 13 name: inlet type: velocity-inlet
Creating patch 1 for zone: 14 name: outlet type: pressure-outlet
Creating patch 2 for zone: 12 name: walls type: wall
Creating cellZone 0 name: solid type: fluid
Creating faceZone 0 name: interior--solid type: interior
faceZone from Fluent indices: 763 to: 12815 type: interior
patch 0 from Fluent indices: 0 to: 179 type: velocity-inlet
patch 1 from Fluent indices: 180 to: 359 type: pressure-outlet
patch 2 from Fluent indices: 360 to: 762 type: wall

Writing mesh to "constant/region0"

kasperbilde

2022-03-08 18:32

reporter   ~0012524

I accidentally attached the file where the brackets had already been removed. This is the right one.

fluent3DmeshToFoam_bug-2.msh (911,624 bytes)

henry

2022-03-08 21:32

manager   ~0012525

I have played around with the text parsing and the attached version parses your case but I don't have many .msh files to test it on to make sure it is backward compatible. Could you test it before I commit it to OpenFOAM-dev?

fluent3DMeshToFoam.L (43,055 bytes)

kasperbilde

2022-03-09 09:45

reporter   ~0012526

Ah, that was quick! I have tested the updated mesh converter on .msh files generated by Fluent 2019 R3, Fluent 2020 R1 and Fluent 2021 R2. I, unfortunately, don't have licenses for previous versions. The updated converter works for all meshes tested.

henry

2022-03-09 11:14

manager   ~0012527

Resolved by commit 318f78b660ba2aa8dc5f4ed1e7643997f47546e6

Issue History

Date Modified Username Field Change
2022-03-08 13:34 kasperbilde New Issue
2022-03-08 13:34 kasperbilde File Added: fluent3DmeshToFoam_bug.msh
2022-03-08 13:49 henry Note Added: 0012520
2022-03-08 13:59 henry Note Edited: 0012520 View Revisions
2022-03-08 14:24 kasperbilde Note Added: 0012521
2022-03-08 14:38 henry Note Added: 0012522
2022-03-08 14:47 henry Note Added: 0012523
2022-03-08 18:32 kasperbilde File Added: fluent3DmeshToFoam_bug-2.msh
2022-03-08 18:32 kasperbilde Note Added: 0012524
2022-03-08 21:32 henry File Added: fluent3DMeshToFoam.L
2022-03-08 21:32 henry Note Added: 0012525
2022-03-09 09:45 kasperbilde Note Added: 0012526
2022-03-09 11:14 henry Category Bug => Feature
2022-03-09 11:14 henry Assigned To => henry
2022-03-09 11:14 henry Status new => resolved
2022-03-09 11:14 henry Resolution open => fixed
2022-03-09 11:14 henry Fixed in Version => dev
2022-03-09 11:14 henry Note Added: 0012527