import meshes from OpenFOAM

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
MatthieuM
Posts: 17
Joined: Thu May 19, 2022 10:44 am

Re: import meshes from OpenFOAM

Post by MatthieuM »

Hello Yvan,

Thanks for your help. After some debugging, it appears that concerning the id of the generated med file, it is necessary to use the med library type "med_idt" instead of "int" as was the case in the existing tool. As you mention, this "med_idt" type probably depends of the MED library build concerning the integer sizes.

Now the tool works fine. I join the 2 files I modified from the initial tool available on https://github.com/mortbauer/foamMeshToMED. As a reminder if there are interested people, my configuration is :
- Ubuntu 18.04 LTS
- Openfoam 9
- MED 4.1.0
- hdf5-1.10.6

Best regards,
Matthieu
Attachments
MEDMesh.C
(24.48 KiB) Downloaded 91 times
MEDMesh.H
(10.08 KiB) Downloaded 89 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: import meshes from OpenFOAM

Post by Yvan Fournier »

Hello,

Thanks for the feedback. And yes, I confirm that med_idt is can be 32-bit or 64-bit depending on build options (and did not exist/was equivalent to med_int in older MED versions).

Since FoamtoMed does not seem to be maintained anymore, but some users reported similar issues (https://github.com/mortbauer/foamMeshToMED/issues/3), I guess one of us may need to fork the tool to make the update available. If you handle it, that is perfect for me. Otherwise, I'll try to do it in the coming weeks.

Best regards,

Yvan
MatthieuM
Posts: 17
Joined: Thu May 19, 2022 10:44 am

Re: import meshes from OpenFOAM

Post by MatthieuM »

Hello,

After checking, it seems I missed a recent fork concerning issues I just mentioned and solved (https://github.com/robertodavia/foamMeshToMED), my apologies about that. It's indicated for OpenFOAM 8, but it's perfectly functional with OpenFOAM 9 + configuration I previously mentioned, and similar to modifications I made. Consequently I don't think it's necessary to create a new fork at this time.

To finish and just for information, I also noticed this foamMeshToMED tool apparently doesn't work with the OpenCFD release OpenFOAM v2112 (some functions are missing), it is necessary to use the openFOAM foundation versions (I don't know concerning the foam-extend fork).

Best regards,
Matthieu
finzeo
Posts: 53
Joined: Fri Sep 09, 2022 4:23 pm

Re: import meshes from OpenFOAM

Post by finzeo »

Hello everyone,

Is there any news regarding this topic?
I suspect that I am having problems working with foamMeshToMED + OF v1812 (I need to use the com version because of the extra features it has to generate the mesh, over the org version)
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: import meshes from OpenFOAM

Post by Yvan Fournier »

Hello,

No, this is in our TODO/wish list, but with many things higher on the list, so we have not worked on this.

I just answered you other post (related) with a few suggestions: viewtopic.php?f=2&t=3099&p=17007#p17007

Best regards,

Yvan
Post Reply