CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ...

How to convert a .msh file to open Foam?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree21Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   May 3, 2013, 08:44
Default
  #61
Super Moderator
 
-mAx-'s Avatar
 
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 2,793
Rep Power: 28
-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, 11:57
Default
  #62
Member
 
Evangelos
Join Date: Sep 2011
Posts: 66
Rep Power: 4
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, 15:21
Default
  #63
Member
 
sud
Join Date: May 2013
Posts: 64
Rep Power: 3
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, 5 views)
archeoptyrx is offline   Reply With Quote

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

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

Old   May 4, 2013, 00:37
Default
  #65
Member
 
sud
Join Date: May 2013
Posts: 64
Rep Power: 3
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, 00:59
Unhappy BlockMeshDict
  #66
Member
 
sud
Join Date: May 2013
Posts: 64
Rep Power: 3
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, 12:18
Default
  #67
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,088
Blog Entries: 32
Rep Power: 70
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
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, 02:17
Default
  #68
Member
 
sud
Join Date: May 2013
Posts: 64
Rep Power: 3
archeoptyrx is on a distinguished road
Bruno Santos , Yea that worked.... Thanks
archeoptyrx is offline   Reply With Quote

Old   May 8, 2013, 06:59
Default
  #69
New Member
 
Matteo Colli
Join Date: Mar 2013
Posts: 4
Rep Power: 3
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, 04:22
Default
  #70
New Member
 
胡长旭
Join Date: Aug 2013
Posts: 26
Rep Power: 3
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, 04:43
Default
  #71
New Member
 
payal
Join Date: Aug 2013
Location: banglore
Posts: 14
Rep Power: 3
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, 19:55
Default
  #72
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,088
Blog Entries: 32
Rep Power: 70
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
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, 19:58
Default
  #73
New Member
 
胡长旭
Join Date: Aug 2013
Posts: 26
Rep Power: 3
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, 20:59
Default
  #74
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,088
Blog Entries: 32
Rep Power: 70
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
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, 01:47
Default
  #75
New Member
 
胡长旭
Join Date: Aug 2013
Posts: 26
Rep Power: 3
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, 05:49
Default
  #76
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,088
Blog Entries: 32
Rep Power: 70
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
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: fluent3DMeshToFoam
wyldckat is offline   Reply With Quote

Old   August 25, 2013, 21:44
Post
  #77
New Member
 
胡长旭
Join Date: Aug 2013
Posts: 26
Rep Power: 3
hcx552362 is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Have you tried fluent3DMeshToFoam? Here's a thread on this topic: fluent3DMeshToFoam

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, 00:50
Default
  #78
Super Moderator
 
-mAx-'s Avatar
 
Maxime Perelli
Join Date: Mar 2009
Location: Switzerland
Posts: 2,793
Rep Power: 28
-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, 03:47
Default
  #79
New Member
 
胡长旭
Join Date: Aug 2013
Posts: 26
Rep Power: 3
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, 03:52
Default
  #80
Member
 
sonu
Join Date: Jul 2013
Location: delhi
Posts: 79
Rep Power: 3
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM 297 August 12, 2014 06:51
OpenFOAM 1.7.1 installation on LINUX UBUNTU 10.10 electrosin OpenFOAM Installation 39 July 1, 2014 07:55
Installation of OpenFOAM-1.6 on Ubuntu 9.10 marval OpenFOAM Installation 2 March 17, 2010 09:33
Version 15 on Mac OS X gschaider OpenFOAM Installation 120 December 2, 2009 10:23
Import gmsh msh to Foam adorean Open Source Meshers: Gmsh, Netgen, CGNS, ... 24 April 27, 2005 08:19


All times are GMT -4. The time now is 06:51.