|
[Sponsors] |
January 5, 2023, 01:20 |
ANSYS Fluent Polyhedral mesh to OpenFOAM
|
#1 |
Member
Join Date: May 2016
Posts: 40
Rep Power: 10 |
Hi All,
I have been struggling to import .msh files from fluent to OpenFOAM. please note this is different from the mesh generated in the ANSYS Workbench mesh module. The reason is Workbench mesh doesn't have Polyhedral. So I produce the mesh via Fluent and write it from fluent mesh in msh file. When imported in OpenFOAM and applying the fluent3DMeshToFoam command, I get the following message. Has anyone else faced the same problem? --> FOAM FATAL ERROR: (openfoam-2206) Do not understand characters: � on line 1 From virtual int yyFlexLexer::yylex() in file fluent3DMeshToFoam.L at line 765. FOAM exiting I copy a simple mesh file attached if you could check will be appreciated to see if you get the same message. Thanks in advance |
|
January 5, 2023, 02:14 |
|
#2 |
Senior Member
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13 |
Had a similar problem once, does dos2unix on the .msh file help?
Also make sure to not zip the meshing file when exporting from Fluent. |
|
January 5, 2023, 03:16 |
|
#3 |
Member
Join Date: May 2016
Posts: 40
Rep Power: 10 |
Much appreciated for the tip, you are my savior. Yes it appears to be working now.
procedures for the future - once you generated your mesh in WB => open fluent file and read the mesh and convert to Polyhedral mesh within fluent => save a case file *.cas - now launch Fluent from windows (not in WB), and select its Meshing module (not the solution) - file-->write -->mesh ... Un-tick the "write binary file" box to ensure your file will be in ASCII format. and per AtoHM guides above, don't select the type as compressed file. in the version I have it's called CFF Mesh Files (*.msh.h5). - import the {name}.msh file into OpenFOAM - type command dos2unix {name}.msh (in case you don't have that command run sudo apt install dos2unix) now your mesh is ready for fluent3DMeshToFoam {name}.msh |
|
October 18, 2023, 13:29 |
|
#4 |
Senior Member
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8 |
Hi,
I'm going to import fluent mesh to openfoam like yours. I'm following your steps, but I have come up with the below error! whoud you please tell me how can I fix it? Thanks. Code:
myfoam@DESKTOP-TK3D7CI:~$ cd $FOAM_RUN/tutorials/incompressible/pimpleFoam/laminar/cylinder2D/ myfoam@DESKTOP-TK3D7CI:~/OpenFOAM/myfoam-v2112/run/tutorials/incompressible/pimpleFoam/laminar/cylinder2D$ ls 0.orig clean constant ff.msh.h5 foam.foam run system myfoam@DESKTOP-TK3D7CI:~/OpenFOAM/myfoam-v2112/run/tutorials/incompressible/pimpleFoam/laminar/cylinder2D$ dos2unix ff.msh.h5 dos2unix: Binary symbol 0x1A found at line 2 dos2unix: Skipping binary file ff.msh.h5 myfoam@DESKTOP-TK3D7CI:~/OpenFOAM/myfoam-v2112/run/tutorials/incompressible/pimpleFoam/laminar/cylinder2D$ fluent3DMeshToFoam ff.msh /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : _6e1fca0e-20220610 OPENFOAM=2112 patch=220610 version=2112 Arch : "LSB;label=32;scalar=64" Exec : fluent3DMeshToFoam ff.msh Date : Oct 18 2023 Time : 19:49:32 Host : DESKTOP-TK3D7CI PID : 1671 I/O : uncollated Case : /home/myfoam/OpenFOAM/myfoam-v2112/run/tutorials/incompressible/pimpleFoam/laminar/cylinder2D nProcs : 1 trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time --> FOAM Warning : From void* Foam::dlLibraryTable::openLibrary(const Foam::fileName&, bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 188 Could not load "libadaptiveFvMesh.so" libadaptiveFvMesh.so: cannot open shared object file: No such file or directory --> FOAM FATAL ERROR: (openfoam-2112 patch=220610) : file "ff.msh" not found From int main(int, char**) in file fluent3DMeshToFoam.L at line 844. FOAM exiting myfoam@DESKTOP-TK3D7CI:~/OpenFOAM/myfoam-v2112/run/tutorials/incompressible/pimpleFoam/laminar/cylinder2D$ |
|
October 18, 2023, 14:17 |
|
#5 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66 |
OpenFOAM can't find a common library. You have an installation error. Check all your environmental variables.
|
|
October 18, 2023, 14:29 |
|
#6 |
Senior Member
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8 |
Dear LuckyTran, thanks for reply.
Do you mean there is a problem with installation of dos2unix or other? Because I can run through current library with blockmesh! |
|
October 18, 2023, 16:22 |
|
#7 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66 |
Well it is true that you do have an openfoam installation error but it may be unrelated. You may run into more errors one day depending on which tools you use.
You have a binary .msh file and it needs to be ascii to work. |
|
October 19, 2023, 03:07 |
|
#8 |
Senior Member
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8 |
The key point is in preference/Default format for I/O must be Legacy, and when we want to export mesh we should follow as below:
Mesh file: mesh.msh files of type: *.msh.h5 Then copy mesh.msh into your openfoam library and execute fluent3DMeshToFoam mesh.msh. you will come up with the error: Code:
--> FOAM FATAL ERROR: (openfoam-2112 patch=220610) Do not understand characters: [ on line 431473 From virtual int yyFlexLexer::yylex() in file fluent3DMeshToFoam.L at line 764. FOAM exiting |
|
February 26, 2024, 17:09 |
Surface mesh
|
#9 |
New Member
Shiva Sudhan R
Join Date: Dec 2022
Location: Bengaluru, India
Posts: 1
Rep Power: 0 |
It seems to me as if the surface mesh is also imported, which is visible in Paraview. How can I fix this? It overlaps with the volume mesh.
|
|
May 24, 2024, 09:41 |
|
#10 |
New Member
HP
Join Date: Jul 2022
Posts: 4
Rep Power: 4 |
did u find how to hide the surface mesh view in the paraview?
? |
|
September 30, 2024, 01:48 |
|
#11 |
New Member
Hung
Join Date: Dec 2021
Posts: 4
Rep Power: 4 |
For those who may concern,
I think the problem is you are using very latest version of Ansys Fluent. You can solve the problem as follows: Try meshing in latest version (etc., Ansys fluent 2024) -> export .msh file in legacy format in ascii mode (.msh.gz) -> use Ansys fluent 2017 to import the .msh file -> export .cas using 2017 version. Now you can import to OpenFOAM using fluent3DToFoam .cas file. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] [Request] OpenFOAM mesh to 2D Ansys fluent mesh | anon_q | OpenFOAM Community Contributions | 6 | July 3, 2023 06:24 |
Error: WorkBench Error: Could not handle event: SolutionStatusUpdate | Kieyo | Fluent Multiphase | 0 | November 10, 2022 00:58 |
[Other] OpenFoam Mesh to Fluent Mesh, 2D | lordvon | ANSYS Meshing & Geometry | 1 | January 14, 2022 13:20 |
[ANSYS Meshing] polyhedral mesh which is generated directly in Workbench Poly Meshing for Fluent | teguhtf | ANSYS Meshing & Geometry | 0 | January 24, 2019 23:04 |
[Commercial meshers] OpenFoam Mesh to Fluent Mesh in parallel case | DominicTNC | OpenFOAM Meshing & Mesh Conversion | 3 | November 22, 2017 10:19 |