CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Commercial meshers] How to convert a .msh file to open Foam?

Register Blogs Community New Posts Updated Threads Search

Like Tree22Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2013, 09:44
Default
  #61
Super Moderator
 
-mAx-'s Avatar
 
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41
-mAx- will become famous soon enough
try fluent3DMeshToFoam flat.msh
__________________
In memory of my friend Hervé: CFD engineer & freerider
-mAx- is offline   Reply With Quote

Old   May 3, 2013, 12:57
Default
  #62
Member
 
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15
Danath is on a distinguished road
what kind of erros?

if the geometry is 3D try fluent3DMeshToFoam flat.msh
Danath is offline   Reply With Quote

Old   May 3, 2013, 16:21
Default
  #63
Member
 
sandy
Join Date: May 2013
Posts: 91
Rep Power: 13
archeoptyrx is on a distinguished road
Its 2D mesh guys .

the flat plate is at the base of the domain . I created using meshing tool in Ansys workbench . And i saved it as fluent readable one using export option .
(flat.msh)

As i later on found that the .msh file should be in ASCII format but the meshing tool in ansys workbench saves .msh file in binary form.

So i found in one of the threads using dos2unix command to convert to ASCII in my linux system terminal ..

$ dos2unix flat.msh

It shows the following errors .

"binary at line 15
dos2unix is quitting "

What should i do now ?

thanks
sud
Attached Images
File Type: png da.PNG (48.2 KB, 11 views)
archeoptyrx is offline   Reply With Quote

Old   May 3, 2013, 17:41
Default
  #64
Member
 
Evangelos
Join Date: Sep 2011
Posts: 87
Rep Power: 15
Danath is on a distinguished road
try

http://searchitchannel.techtarget.co...ment-variables
Danath is offline   Reply With Quote

Old   May 4, 2013, 01:37
Default
  #65
Member
 
sandy
Join Date: May 2013
Posts: 91
Rep Power: 13
archeoptyrx is on a distinguished road
Hi Danath & Maxime Perelli ,

I finally got it converted to open foam readable format .
Now here comes the problem .

I tried running blockMesh after that . IT shows some errors .

I checked the Run/try/constant/polymesh folder for blockmeshdict file .
it has all files like
1.boundary
2.owner
3.faces
4.cellzones
5.facezones
6.pointzones
7.points

but it did not have blockmeshDict .

What should i do now ?

thanks
sud
archeoptyrx is offline   Reply With Quote

Old   May 4, 2013, 01:59
Unhappy BlockMeshDict
  #66
Member
 
sandy
Join Date: May 2013
Posts: 91
Rep Power: 13
archeoptyrx is on a distinguished road
Hi nimasam ,

ok . Now i should not type blockMesh in the terminal right ? .. I typ
ed checkMesh . It shows the following errors .



sudharsan@ubuntu:~/OpenFOAM/OpenFOAM-2.2.0/tutorials/incompressible/icoFoam/Cylinder ansysimport$ checkMesh
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.2.0
Exec : checkMesh
Date : May 03 2013
Time : 23:58:44
Host : "ubuntu"
PID : 4001
fileName::stripInvalid() called for invalid fileName /home/sudharsan/OpenFOAM/OpenFOAM-2.2.0/tutorials/incompressible/icoFoam/Cylinderansysimport
For debug level (= 2) > 1 this is considered fatal
Aborted (core dumped)




Quote:
Originally Posted by nimasam View Post
blockMeshDict is for once that you want to create your mesh in OpenFOAM,
when you import your file from gambit or some where else it is not necessary any more,
now the main file you maybe want to change is "boundary" file in constant/polyMesh
there, you can define your boundary name or type!

also as Max told, another tools are checkMesh and transportPoints

checkMesh is an utility which shows whether your mesh is suitable for OpenFOAM or not and return some essential results of your mesh.
archeoptyrx is offline   Reply With Quote

Old   May 4, 2013, 13:18
Default
  #67
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@archeoptyrx: Rename the folder "Cylinder ansysimport" to "Cylinder_ansysimport", because OpenFOAM doesn't like spaces in folder/file names.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 6, 2013, 03:17
Default
  #68
Member
 
sandy
Join Date: May 2013
Posts: 91
Rep Power: 13
archeoptyrx is on a distinguished road
Bruno Santos , Yea that worked.... Thanks
archeoptyrx is offline   Reply With Quote

Old   May 8, 2013, 07:59
Default
  #69
New Member
 
Matteo Colli
Join Date: Mar 2013
Posts: 4
Rep Power: 13
supercolli is on a distinguished road
Quote:
Originally Posted by archeoptyrx View Post
Hi Danath & Maxime Perelli ,

I finally got it converted to open foam readable format .
Now here comes the problem .
Hi, may I ask you how did you get the problem solved? I'm in the same situation, I can't convert my msh file using dos2unix because it is recognized as binary.
Matteo
supercolli is offline   Reply With Quote

Old   August 24, 2013, 05:22
Default
  #70
New Member
 
胡长旭
Join Date: Aug 2013
Posts: 26
Rep Power: 13
hcx552362 is on a distinguished road
Quote:
Originally Posted by -mAx- View Post
it depends on what you want to solve
Choose and copy a tutorial from OF folder (tutorials are sorted with solver).
Then if your mesh is full hexa, you can use following command to import your mesh
>fluentMeshToFoam your_mesh.msh
If your mesh constains any hanging nodes (typical with tetra-hexcore), you need to use the tpoly conversion within fluent, and then in OF use following command:
>fluent3DMeshToFoam your_mesh.msh

Once your mesh is well imported (use checkMesh to be sure everything is ok), you can modify the boundary files in /0 folder
hi Max:
I have the same question. When I run fluentMeshToFoam /...../..msh. it will appear
Form FATAL IO ERROR
cannot find file
file:/home/hu/system/controldict at line 0
from.....and so on


what is the matter? I think you can help me.
Have a nice day
hcx552362 is offline   Reply With Quote

Old   August 24, 2013, 05:43
Default
  #71
New Member
 
payal
Join Date: Aug 2013
Location: banglore
Posts: 14
Rep Power: 13
payal05 is on a distinguished road
helo ,
can you tell me hw you are converting means which command are you using and where you had kept your mesh files .???
payal05 is offline   Reply With Quote

Old   August 24, 2013, 20:55
Default
  #72
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@hcx552362:
Quote:
Originally Posted by hcx552362 View Post
When I run fluentMeshToFoam /...../..msh. it will appear
Form FATAL IO ERROR
cannot find file
file:/home/hu/system/controldict at line 0
from.....and so on
Although you quoted Max's post, you did not follow all of the instructions, more specifically this one:
Quote:
Originally Posted by -mAx- View Post
Choose and copy a tutorial from OF folder (tutorials are sorted with solver).
If you do not know what tutorials Max was talking about, I suggest you start reading the OpenFOAM User Guide from the beginning of chapter 2: http://www.openfoam.org/docs/user/tutorials.php

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 24, 2013, 20:58
Default
  #73
New Member
 
胡长旭
Join Date: Aug 2013
Posts: 26
Rep Power: 13
hcx552362 is on a distinguished road
Quote:
Originally Posted by payal05 View Post
helo ,
can you tell me hw you are converting means which command are you using and where you had kept your mesh files .???
Hi payal05:
firstly, I copy a msh file and put it in the .../tutorials/incompressible/icoFoam/cavity.
secondly, run the code: fluentMeshToFoam/OpenFOAM/hu2.1.x/run/tutorials/incompressible/icoFoam/cavity/hu.msh

above error will appear.
hcx552362 is offline   Reply With Quote

Old   August 24, 2013, 21:59
Default
  #74
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by hcx552362 View Post
firstly, I copy a msh file and put it in the .../tutorials/incompressible/icoFoam/cavity.
secondly, run the code: fluentMeshToFoam/OpenFOAM/hu2.1.x/run/tutorials/incompressible/icoFoam/cavity/hu.msh
From your description, it looks like you did not run the fluentMeshToFoam from within the "cavity" folder. For example:
Code:
cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
fluentMeshToFoam hu.msh
__________________
wyldckat is offline   Reply With Quote

Old   August 25, 2013, 02:47
Default
  #75
New Member
 
胡长旭
Join Date: Aug 2013
Posts: 26
Rep Power: 13
hcx552362 is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
From your description, it looks like you did not run the fluentMeshToFoam from within the "cavity" folder. For example:
Code:
cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
fluentMeshToFoam hu.msh
hi, Thanks for your reply!
I think my .msh from my gambit has some questions. When I use other .msh from other gambit. fluentMeshToFoam works. but I do not know the reason with my gambit?
Have a nice day
hcx552362 is offline   Reply With Quote

Old   August 25, 2013, 06:49
Default
  #76
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by hcx552362 View Post
but I do not know the reason with my gambit?
Have you tried fluent3DMeshToFoam? Here's a thread on this topic: http://www.cfd-online.com/Forums/ope...eshtofoam.html
__________________
wyldckat is offline   Reply With Quote

Old   August 25, 2013, 22:44
Post
  #77
New Member
 
胡长旭
Join Date: Aug 2013
Posts: 26
Rep Power: 13
hcx552362 is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Have you tried fluent3DMeshToFoam? Here's a thread on this topic: http://www.cfd-online.com/Forums/ope...eshtofoam.html

Hi
yes, I also use fluent3DToFoam, and the same errpr appears. by the way, my mesh is 2D. I think my mesh has some questions. Can you tell me, what should i do when writing my mesh with gambit tool.
Thank you very much. Have a nice day.
hcx552362 is offline   Reply With Quote

Old   August 26, 2013, 01:50
Default
  #78
Super Moderator
 
-mAx-'s Avatar
 
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 3,297
Rep Power: 41
-mAx- will become famous soon enough
you cannot work with 2d in OF.
In Gambit extrude your 2d geometry, and export the 3d mesh in OF with fluent3DMeshToFoam
For the BC, check for instance airFoil2D (incompressible/simpleFoam)
__________________
In memory of my friend Hervé: CFD engineer & freerider
-mAx- is offline   Reply With Quote

Old   August 26, 2013, 04:47
Default
  #79
New Member
 
胡长旭
Join Date: Aug 2013
Posts: 26
Rep Power: 13
hcx552362 is on a distinguished road
Quote:
Originally Posted by -mAx- View Post
you cannot work with 2d in OF.
In Gambit extrude your 2d geometry, and export the 3d mesh in OF with fluent3DMeshToFoam
For the BC, check for instance airFoil2D (incompressible/simpleFoam)
Hi Max.Thanks for your reply.
firstly, I creat a 2D mesh in the gambit.(choose the solver:Fluent 5/6)
secondly, use the fluent3DMeshToFoam to transfer my mesh.
Is it right?
or
firstly, I must creat 3D mesh in the gambit.(choose the solver :Fluent 5/6)
secondly, use the fluent3DMeshToFoam to transfer my mesh.
Which step is right? Thank you!
Have a nice day!
hcx552362 is offline   Reply With Quote

Old   August 26, 2013, 04:52
Default
  #80
Member
 
sonu
Join Date: Jul 2013
Location: delhi
Posts: 92
Rep Power: 13
yash.aesi is on a distinguished road
helo ,
your case is 2D or 3D ?? if it is 2D then why you are giving command fluent3DMeshToFoam when you have created 2D mesh in gambit ...? try with fluentMeshToFoam

hope it will work
yash.aesi is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 04:30
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 19:13
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 11:03
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 14:59
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18


All times are GMT -4. The time now is 00:53.