Using GiD mesh in OpenFOAM

Moderator: GiD Team

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

Using GiD mesh in OpenFOAM

Post by Hosam »

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: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Using GiD mesh in OpenFOAM

Post by escolano »

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

Post by Hosam »

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

Post by Hosam »

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: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Using GiD mesh in OpenFOAM

Post by escolano »

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

Post by Hosam »

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

Post by Hosam »

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

Post by Hosam »

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

Problem solved!
AndreaPhD
Posts: 5
Joined: Tue Dec 10, 2019 5:28 pm

Re: Using GiD mesh in OpenFOAM

Post by AndreaPhD »

Dear all,
I'm trying to export a multi-domain GiD mesh for OpenFoam. I'm starting from a multi solid geometry, I'm defining continuum type for all solids, and then I assign boundary type for each surface. I'm meshing just the volumes, ending up with just thetraedrals elements. When I export it, it throws out the usual error: "Error in computing face numbers".
I have just one surface shared by two connected solids, do I have to duplicete them? What is the problem?
thanks in advance
PS: a more detailed error traceback system can help us a lot!
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Using GiD mesh in OpenFOAM

Post by escolano »

The GiD-OpenFoam is a relativelly simple problemtype, implemented with Tcl scripting.

Attach a zip with the GiD example (as small as possible) to try to fix the bug of this problemtype
Post Reply