CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   How to import mesh file in OpenFOAM,created in Hypermesh (http://www.cfd-online.com/Forums/openfoam/70528-how-import-mesh-file-openfoam-created-hypermesh.html)

devesh.baghel November 26, 2009 14:52

How to import mesh file in OpenFOAM,created in Hypermesh
 
Hi all,

I am doing meshing in Hypermesh. Can some one please help me, how to import that mesh (xyz.hm) file in OpenFOAM ?...... I read userguide but din't find option for importing Hypermesh files.

it was urgently required.....:(

Please....it will be appreciable, if somebody help me,,,,,,,,,,

thanks alot

florian_krause November 26, 2009 15:40

Hi,

it depends a bit on your hypermesh version... but normally in hypermesh switch to the cfd user profile, then export your *.hm file as a fluent *.cas file

then use the openfoam import routine for fluent files

fluentMeshToFoam <your *.cas file> -scale ...

there you go!

Best,
Florian

devesh.baghel November 30, 2009 04:40

Hiii
thanks for your reply.....
as per suggestions....first I did export one Hypermesh file in .inp format as well file was saved as .hm files.

I tried to import in OpenFOAM but in the PolyMesh folder there were not boundary elements / nodes found in files inside the polymesh folder. As well as patches were blank wherever required.

i just made collectors & put boundary elements in respective collectors. so i was guessing that it should come into patches.

Am I doing something wrong. ....Please help me...
suggestions would be appreciable,,,,,,,,
thanks alot

florian_krause November 30, 2009 08:27

hello!

maybe it was a misunderstanding, but I did not suggest to export your *.hm file into a *.inp file.

1) in hypermesh go to preferences -> user profiles and switch to CFD

2.) go to CFD I/O options in the utility menu (next to model browser)

3.) then go to write fluent *.cas file

for the boundary patches put your 2D elements in different collectors according to your patches and also put the 3D elements in one seperated collector.

then use fluentMeshToFoam or fluent3DMeshToFoam (might be better for real 3D grids) as I described in my first post.

enjoy!

guido_adriaensen December 1, 2009 05:25

Direct export
 
Hello,

As suggested by Florian, export through Fluent format works good.

I have been in contact with Altair Engineering (the company providing Hypermesh) for direct export of the mesh to OF. Currently they are working on this feature. I have provided them with some mesh-format examples and documentation from OF. I just received the first testfiles from them yesterday. I could open the mesh-files, but there are still some errors in the mesh. Maybe in the near future it will be introduced in hypermesh.

kind regards,
Guido

devesh.baghel December 8, 2009 09:03

Unable to get animation file even by following User Guide
 
first of all.....Thanks alot ........for your responce.
now I got clear picture about the mesh conversion. It was really helpful for me.

Thank you so much.....

Here I am facing another problem while trying to make animation......

I am facing some problem while I want to make animation file & snapshot too. Here I am getting some kinda error pasted below..
Error: GLXBadContext 154
Extension: 144 (Uknown extension)
Minor opcode: 5 (Unknown request)
Resource id: 0x5d
X Error: GLXBadContext 154
Extension: 144 (Uknown extension)
Minor opcode: 5 (Unknown request)
Resource id: 0x5d
X Error: GLXBadContext 154
Extension: 144 (Uknown extension)
Minor opcode: 5 (Unknown request)
Resource id: 0x5d
X Error: GLXBadContext 154
Extension: 144 (Uknown extension)
Minor opcode: 5 (Unknown request)
Resource id: 0x5d
/data/OpenFOAM/OpenFOAM-1.6/bin/paraFoam: line 109: 29512 Segmentation fault paraview --data="$caseFile"
...............
these are the messages I am getting while attempting the same command as given in USER GUIDE. :(

Please any one can help me to sort out these problems....

Thank you so much for your suggestions / advice......thanks alot

claco January 24, 2011 06:53

Quote:

Originally Posted by guido_adriaensen (Post 238290)
Hello,

As suggested by Florian, export through Fluent format works good.

I have been in contact with Altair Engineering (the company providing Hypermesh) for direct export of the mesh to OF. Currently they are working on this feature. I have provided them with some mesh-format examples and documentation from OF. I just received the first testfiles from them yesterday. I could open the mesh-files, but there are still some errors in the mesh. Maybe in the near future it will be introduced in hypermesh.

kind regards,
Guido


Dear Sir,

I have the same problem. I would like to export a mesh (and its patches) from Hypermesh to Openfoam, but I cannot. As a matter of fact, if I export a .cas file, I cannot import it with fluentMeshToFoam application, since the latter requires a .msh to work properly. Could You help me please?
Yours Sincerely.

Claudio Comis

Lodda January 25, 2011 04:17

I managed the Mesh export for a simple pipe (Inlet, Outlet, Wall) like this:

The Geometry was imported from Pro/E

1) Create Surface-Mesh in HyperMesh (I have created a quad mesh on the surface)

2) Create Collectors for needed patches (Inlet, Outlet, Wall)
-> Collectors -> Create -> Components

3) Link Surfaces with the above defined Components (Inlet, Outlet,Wall)
-> Tool -> organize -> elements -> dest component
(you have to check one Element surface on the patch)
-> check element selection -> by face
repeat this step for all patches

4) Create Volume Mesh
Main Menu -> 3D -> tetramesh -> CFD
For Boundary Layer creation -> fixed with boundary layer -> comps
-> select your Wall component
Setup your Boundary Layer
-> number of layers
-> first layer thickness
-> growth rate
Create the Volume-Mesh

5) Two new Components appeare
-> CFD_Boundary_Layer
-> CFD_tetramesh_Layer
Delete all Components exepting the two new ones
-> Rename CFD_tetramesh_Layer into Fluid
-> Put the CFD_Boundary_Layer into the Fluid Component
At this Point you have only one Component -> Fluid

8) Find all Faces of the Fluid Component
-> tool -> faces -> comps (Fluid) -> find faces

7) Repeat steps 2) and 3) to define your new patchs (i think this point can be solved much more elegant, but this is the way i took)

9) Export your Date to Fluent-File-Format
-> utility -> CFD i/O -> Fluent CAS/MSH File -> Write
A window with a compatibility advice will appear -> check OK
A window with a question about the usage of cas file will appeare
(i dont exactly remember what this windows say :confused:) -> Check NO!

The exported Data now can be translated into OpenFOAM Format by using
the fluent3Dmeshtofoam utility.

I have to check which version of HyperMesh i have used.

Best regards

Lodda

claco January 25, 2011 05:10

Quote:

Originally Posted by Lodda (Post 292026)
I managed the Mesh export for a simple pipe (Inlet, Outlet, Wall) like this:

The Geometry was imported from Pro/E

1) Create Surface-Mesh in HyperMesh (I have created a quad mesh on the surface)

2) Create Collectors for needed patches (Inlet, Outlet, Wall)
-> Collectors -> Create -> Components

3) Link Surfaces with the above defined Components (Inlet, Outlet,Wall)
-> Tool -> organize -> elements -> dest component
(you have to check one Element surface on the patch)
-> check element selection -> by face
repeat this step for all patches

4) Create Volume Mesh
Main Menu -> 3D -> tetramesh -> CFD
For Boundary Layer creation -> fixed with boundary layer -> comps
-> select your Wall component
Setup your Boundary Layer
-> number of layers
-> first layer thickness
-> growth rate
Create the Volume-Mesh

5) Two new Components appeare
-> CFD_Boundary_Layer
-> CFD_tetramesh_Layer
Delete all Components exepting the two new ones
-> Rename CFD_tetramesh_Layer into Fluid
-> Put the CFD_Boundary_Layer into the Fluid Component
At this Point you have only one Component -> Fluid

8) Find all Faces of the Fluid Component
-> tool -> faces -> comps (Fluid) -> find faces

7) Repeat steps 2) and 3) to define your new patchs (i think this point can be solved much more elegant, but this is the way i took)

9) Export your Date to Fluent-File-Format
-> utility -> CFD i/O -> Fluent CAS/MSH File -> Write
A window with a compatibility advice will appear -> check OK
A window with a question about the usage of cas file will appeare
(i dont exactly remember what this windows say :confused:) -> Check NO!

The exported Data now can be translated into OpenFOAM Format by using
the fluent3Dmeshtofoam utility.

I have to check which version of HyperMesh i have used.

Best regards

Lodda



Thank You very much Lodda.
And, in the case I want (I have to) to import a .bdf file into Openfoam, what can You suggest me? (Please consider that I don't want to use Ansys softwares to convert this format .bdf, but only Open source codes)
Kindest regards.

Claudio Comis

Lodda January 25, 2011 05:23

Hallo Claudio,

i've never worked with Nastran so i cant help you at this point. Sorry

Best regards

Lodda

claco January 25, 2011 06:19

Ok Lodda.

I would like to export the .cas in batch mode, via a TCL or a Hypermesh script. However, at the moment of exporting the mesh in .cas format (in batch mode, via the feinputwithdata command), an error occurs, due to the answers I have to give to the code (that I cannot give since I am not in GUI mode; this problem doesn't occur when exporting a .bdf file, which, in turn, cannot be read by Openfoam).
How can I bypass this problem?

Thank You.

Claudio Comis

bluebase June 29, 2011 11:21

Hello guys,
in the new release v11 of hypermesh an option to export directly to openfoam is implemented. Though, i haven't tried it yet.

Amiga500 July 8, 2011 07:01

Quote:

Originally Posted by bluebase (Post 314075)
Hello guys,
in the new release v11 of hypermesh an option to export directly to openfoam is implemented. Though, i haven't tried it yet.

Hi all,

What is the status of this? :)


The company I'm working with are considering Hyperworks for many things right now across the CAE range. The ability to mesh and export directly to OpenFoam* would be a major plus point.


*Particularly with multi-subdomain meshes - unlike the current fluent2foam convert which doesn't do multi-subdomain.

Ralph M August 6, 2011 08:03

Hi all,

Just a short question; did you used Hypermesh on a Linux or windows machine?

After generating a mesh in windows (with hypermesh) I get an arror in linux when trying the use fluent3DMeshToFoam: syntax error near unexpected token `newline'

Has someone a clue how to solve this? Btw: I tried to use dos2unix but this conversion doesn't seem to change the .cas (mesh)file.

Thanks!

Ralph

Ralph M August 6, 2011 09:47

Well, I found that the base of my error was located somewhere else.

I used the command "fluent3DMeshToFoam <mymesh.msh>". Obviously the "<" and ">" shouldn't be there.

The final step that Lodda missed (which wasn't clear for me) is to put the .msh-file in a new openfoam-calculation directory which already consists of "0", "constant" and complete "system" folders. Then browse form within your terminal to the folder and do the conversion!

Three more tips:
-when the mesh is made in windows check the linux-compatibility:
cat -v somefile.msh
-when "^M" is shown you have to convert the file to a linux type with the following command:
dos2unix somefile.msh
-however, for Ubuntu 10.04 this command doens't work (you can't install it under that name), use "sudo aptitude install tofrodos" to install and run:
fromdos somefile.msh

Enjoy!

Nilesh_87 October 10, 2011 14:41

Conversion problem from Fluent to OF
 
Dear all,
i am very new in OpenFoam. as per the userguide of OF i typed in terminal fluentToFoam <car_nilesh.cas> file. the error is 'syntax error near unexpected token `newline'. Plz help me.

ck7 January 12, 2012 13:58

Quote:

Originally Posted by florian_krause (Post 238171)
hello!

maybe it was a misunderstanding, but I did not suggest to export your *.hm file into a *.inp file.

1) in hypermesh go to preferences -> user profiles and switch to CFD

2.) go to CFD I/O options in the utility menu (next to model browser)

3.) then go to write fluent *.cas file

for the boundary patches put your 2D elements in different collectors according to your patches and also put the 3D elements in one seperated collector.

then use fluentMeshToFoam or fluent3DMeshToFoam (might be better for real 3D grids) as I described in my first post.

enjoy!

I am using a CFD software, which creates mesh without lables (like inlet , outlet, etc) i can export this into .nas format to be read into fluent. I would like to assign label or face names by importing the exported nas file in hypermesh . if this works i can create msh file that can be read both in fluent and openfoam.

( Currently i am using a single component for meshing)

Please provide with few suggestion how to go about this.


All times are GMT -4. The time now is 08:02.