Using GiD mesh in OpenFOAM

Moderator: GiD Team

Hosam
Posts: 10
Joined: Thu Mar 12, 2015 10:13 am

Using GiD mesh in OpenFOAM

Postby Hosam » Thu Mar 12, 2015 10:22 am

Hello,

I have a GiD mesh (.msh) file that I can import with GiD. From your experience, which export option will make it possible to use the same mesh in OpenFOAM? (preferably without another intermediate CAD or meshing package).

Thanks,
Hosam
User avatar
escolano
Posts: 1566
Joined: Thu Sep 18, 2014 3:31 pm

Re: Using GiD mesh in OpenFOAM

Postby escolano » Thu Mar 12, 2015 12:55 pm

There is a GiD-OpenFOAM problemtype available (it is a very basical interface only)
To use it go to GiD menu
Data->Problemtype->OpenFOAM
(the first time it offer to download this problemtype from our repository)
Then a few 'conditions' are defined in order to apply the information to each part.
Data->Zones definition->3D
Then you can export the mesh and boundary conditions in OpenFOAM format with
Calculate->Calculate
(the solver OpenFOAM itself won't be started, to do it the .bat file of the problemtype must be modified)
or
Files->Export->Calculation file

Note: the normal way to work with GiD is create or import the geometry, apply on it the boundary conditions, generate the mesh and calculate. if in your case do you have only the mesh but not the geometry you must apply the boundary conditions directly to mesh entities
Hosam
Posts: 10
Joined: Thu Mar 12, 2015 10:13 am

Re: Using GiD mesh in OpenFOAM

Postby Hosam » Thu Mar 12, 2015 1:40 pm

Thank you very much for the quick reply!
will give it a try.

Hosam
Hosam
Posts: 10
Joined: Thu Mar 12, 2015 10:13 am

Re: Using GiD mesh in OpenFOAM

Postby Hosam » Fri Mar 13, 2015 5:28 pm

Hi,

I received now the ".gid" file (geometry and mesh are already created).
After assigning the boundary conditions, I tried using "calculate" without remeshing, I got this error message:
https://dl.dropboxusercontent.com/u/32336583/Error.png

So I performed mesh generation (CTRL+g), after meshing I repeated "calculate" and got the same error message.
I thought that I need maybe to modify element-type assignment, but I do not want to change the meshing settings already set in the model (the target is get the exact mesh in OpenFOAM).

Will appreciate your advice,
Hosam

PS:
- I am using GiDx64 11.1.0d
- I've tried a simple test case to create a domain, mesh it, and convert the mesh from GiD to OF, and it works (using my version of the problemType).
User avatar
escolano
Posts: 1566
Joined: Thu Sep 18, 2014 3:31 pm

Re: Using GiD mesh in OpenFOAM

Postby escolano » Fri Mar 13, 2015 6:14 pm

The image is complaining about the existence of triangle elements.
The problemtype GiD-OpenFOAM is only made for 3D cases, and only volume elements must exists (e.g. tetrahedra)

Probably do you have some isolated surface (not belonging to any volume boundary) and it is creating triangles.
In this case you must delete the surface and re-mesh
Of maybe you have set the meshing criteria to mesh the surfaces of the volumes, then reset this mesh criteria to the default.
(or in preferences -> Meshing - Other -Mesh always by default: Uncheck the surfaces)
Hosam
Posts: 10
Joined: Thu Mar 12, 2015 10:13 am

Re: Using GiD mesh in OpenFOAM

Postby Hosam » Mon Mar 16, 2015 1:53 pm

I used Mesh -> No mesh -> Surface, and selected all the 49 surfaces to skip meshing them.
It worked!

Thanks!
Hosam
Hosam
Posts: 10
Joined: Thu Mar 12, 2015 10:13 am

Re: Using GiD mesh in OpenFOAM

Postby Hosam » Thu Feb 11, 2016 11:46 am

Hi,

I am posting again in this thread to ask about a new issue regarding using GiD mesh in OpenFOAM.

I used the exact previously-working approach using the exact same GiD version. Namely I used Mesh -> No mesh -> Surface to skip meshing surfaces.

After clicking on calculate, It execute for a while showing this:
https://dl.dropboxusercontent.com/u/323 ... rors/1.png

Then an error message appears "Error in computing face numbers. Please correct this":
https://dl.dropboxusercontent.com/u/323 ... rors/2.png

And the conversion stops:
https://dl.dropboxusercontent.com/u/323 ... rors/3.png

The "calculate" command resulted in writing out "points" and "faces" data files which are not enough to use as OpenFOAM mesh. The rest of the files: "owner", "boundary", and "neighbor" are not written. Any explanation or guidance would be appreciated.

Best,
Hosam
Hosam
Posts: 10
Joined: Thu Mar 12, 2015 10:13 am

Re: Using GiD mesh in OpenFOAM

Postby Hosam » Thu Feb 11, 2016 1:41 pm

Sorry, did not notice that I did not reassign the BC from Data->Zones definition->3D

Problem solved!

Return to “Import/Export”

Who is online

Users browsing this forum: No registered users and 1 guest