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

Comsol mesh to openFOAM

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

Like Tree1Likes
  • 1 Post By wouter

Reply
 
LinkBack Thread Tools Display Modes
Old   April 15, 2010, 07:30
Default Comsol mesh to openFOAM
  #1
Member
 
Rasoul
Join Date: Feb 2010
Posts: 32
Rep Power: 7
aut_iut is on a distinguished road
Hello everybody!

I wanna export the meshes from Comsol multiphysics to the openfoam!
Is there any straight solution for me?

Thanks
aut_iut is offline   Reply With Quote

Old   April 17, 2010, 04:54
Default
  #2
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11
sega is on a distinguished road
Quote:
Originally Posted by aut_iut View Post
Hello everybody!

I wanna export the meshes from Comsol multiphysics to the openfoam!
Is there any straight solution for me?

Thanks
I can't think of a "straight" solution.

COMSOL can export the mesh to text (*.mphtxt) or binary (*.mphbin) files.
If you look at these files you will see they contain all mesh points and further informations concerning the elements.

Maybe the element informations are usefull to tell OpenFOAM how to make cells out of them (OpenFOAM is a finite-volume-code and COMOLS is a finite-element-code).

You will have to do the link between all COMSOL mesh points and the OpenFOAM mesh. Don't think of something blockMesh-stylish - look at the mesh files you will get after the mesh is created from the blockMesh.

Keep in mind that OpenFOAM only supports 3D-cartesien meshes and COMSOL supports far more!
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   April 17, 2010, 06:11
Default
  #3
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
Quote:
Originally Posted by sega View Post
Keep in mind that OpenFOAM only supports 3D-cartesien meshes and COMSOL supports far more!
eeh...wrong.
foam can handle any type of mesh.
niklas is offline   Reply With Quote

Old   April 17, 2010, 07:28
Default
  #4
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 11
sega is on a distinguished road
Quote:
Originally Posted by niklas View Post
eeh...wrong.
foam can handle any type of mesh.
He is right. Let me put this straight.
COMSOL supports other solvers than 3D cartesian and the meshes are adapted to the solver.
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   March 28, 2012, 08:21
Default Any new information on converting from Comsol to OpenFoam?
  #5
New Member
 
Join Date: Feb 2012
Posts: 11
Rep Power: 5
franzi_ is on a distinguished road
Hello,

the reply didn't really help me so I hoped that maybe somebody can give me any good hints if it is possible to convert meshes from Comsol to OpenFoam???

Is it even possible to convert from FEM to FVM mesh?

I would be really glad about any kind of hint or experiences on that topic!!!!

Thanks a lot in advance!

Cheers, Franzi

PS: I tried to mesh also with Salome but the program isn't really stable. Any hints for a better mesher would be helpful, too
franzi_ is offline   Reply With Quote

Old   April 23, 2012, 09:59
Default
  #6
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 577
Blog Entries: 5
Rep Power: 13
elvis is on a distinguished road
Hi,
http://www.uk.comsol.com/products/formats
shows that sections Mesh & MCAD is poor for export
File Format Read Write
NASTRAN Bulk Data (.nas, .bdf, .nastran, .dat) Yes No
VRML, v1 (.vrml, .vrl) Yes No
STL (.stl) Yes No
STEP (.step)2 Yes No
IGES (.iges)2 Yes No
CATIA® V5 (.CATPart, .CATProduct)5 Yes No
VRML, v1 (.vrml, .vrl) Yes No
STL (.stl) Yes No

It depends on what you are looking for! Opensource: engrid or http://www.discretizer.org/
elvis is offline   Reply With Quote

Old   June 4, 2014, 07:49
Default
  #7
Member
 
Jamal
Join Date: May 2012
Location: Freiburg
Posts: 54
Rep Power: 4
aujamal20 is an unknown quantity at this point
Hey Foamers,

Have anyone of you guys succedded in importing geometry files from Comsol to OpenFOAM..... I will be doing that stuff very soon. Looking for hint and thanks in advance.

Thanks

Jamal
aujamal20 is offline   Reply With Quote

Old   June 6, 2014, 17:08
Default
  #8
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 130
Rep Power: 8
wouter is on a distinguished road
Hello aujamal20,
Last year I have written a program loosly based on cfx4toFoam that can read a comsol 4.2a mphtxt or mphbin file and convert it into an Openfoam mesh. To get the boundary names you need to make a reportfile (.html) in comsol, minimum is geometry, mesh units I think ( a full report is the best thing).
It can read 3D and 2D and axial meshes.
There is a warning that the boundaries are all going to the default, this is not true but I did not know how to prevent this warning.
The program is not finished, domains are all merged to one domain.
The boundary information for the 0 directory is not yet collected.
This project of mine is stopped because I do not have access to Comsol anymore, so I do not know if it works with newer Comsol versions.

http://www.filedropper.com/comsoltofoamtar

just unpack files in a source directory (eg OpenFOAM/user-xxx/run/applications/utilities/mesh/conversion/comsolToFoam )
run wmake.
(NB. Because I did not plan to publish this I did not use the OpenFoam conventions for programming. I am very old school so part of it is c not c++ ).
Hope you can use this, let me know if you can improve the program.
Best regards
Wouter
Attached Files
File Type: gz comsolToFoam.tar.gz (10.3 KB, 25 views)
Prosper likes this.

Last edited by wouter; June 10, 2014 at 17:20. Reason: trimed file
wouter is offline   Reply With Quote

Old   April 23, 2015, 17:25
Default
  #9
Member
 
Join Date: Feb 2014
Posts: 34
Rep Power: 3
Prosper is on a distinguished road
Quote:
Originally Posted by wouter View Post
Hello aujamal20,
Last year I have written a program loosly based on cfx4toFoam that can read a comsol 4.2a mphtxt or mphbin file and convert it into an Openfoam mesh. To get the boundary names you need to make a reportfile (.html) in comsol, minimum is geometry, mesh units I think ( a full report is the best thing).
It can read 3D and 2D and axial meshes.
There is a warning that the boundaries are all going to the default, this is not true but I did not know how to prevent this warning.
The program is not finished, domains are all merged to one domain.
The boundary information for the 0 directory is not yet collected.
This project of mine is stopped because I do not have access to Comsol anymore, so I do not know if it works with newer Comsol versions.

http://www.filedropper.com/comsoltofoamtar

just unpack files in a source directory (eg OpenFOAM/user-xxx/run/applications/utilities/mesh/conversion/comsolToFoam )
run wmake.
(NB. Because I did not plan to publish this I did not use the OpenFoam conventions for programming. I am very old school so part of it is c not c++ ).
Hope you can use this, let me know if you can improve the program.
Best regards
Wouter
This might be helpful! Worth a try!
Prosper 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
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
[ICEM] Hexa mesh, curve mesh setup, bunching law Anorky ANSYS Meshing & Geometry 4 November 12, 2014 01:27
mesh from ANSA to OpenFOAM bephi OpenFOAM Meshing & Mesh Conversion 18 April 8, 2013 07:14
[ICEM] Unstructure Meshing Around Imported Plot3D Structured Mesh ICEM kawamatt2 ANSYS Meshing & Geometry 17 December 20, 2011 12:45
Error converting Gmsh mesh to OpenFOAM format Martin_ OpenFOAM Meshing & Mesh Conversion 3 December 9, 2009 10:35


All times are GMT -4. The time now is 01:04.