Mesh generation software suitable for runs in code_saturne for aerodynamics

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
finzeo
Posts: 55
Joined: Fri Sep 09, 2022 4:23 pm

Mesh generation software suitable for runs in code_saturne for aerodynamics

Post by finzeo »

Hi all,

Currently (as I mentioned in other forum posts) I am doing simulations on heavy vehicle aerodynamics. When generating the mesh, very relevant and problematic topics are: (1) generating regular layers around the surface of the vehicle, and (2) correctly adapting the mesh in areas with small details, keeping a structured mesh away from the vehicle (for better results). I always used OpenFOAM (blockMesh + snappyHexMesh) to generate the mesh, because I have a lot of knowledge in the tools and their capabilities, but I see some inconsistencies when converting the mesh from OF to .med; I use the unofficial foamMeshToMED utility (https://github.com/mortbauer/foamMeshToMED).
My question is, primarily for those who generate meshes to solve similar problems in code_saturne, what meshing software do you recommend using? (take into account the two difficulties that I mentioned previously).
I tried very quickly using Salome, but I'm having difficulties getting a mostly structured mesh (this is easily done in OpenFOAM)

Thanks in advance.
Yvan Fournier
Posts: 4081
Joined: Mon Feb 20, 2012 3:25 pm

Re: Mesh generation software suitable for runs in code_saturne for aerodynamics

Post by Yvan Fournier »

Hello,

I can't answer for everyone, but tools used are quite varied.

Foam2MED seems to be used by quite a few people outside EDF (the original version is obsolete and does not work with recent MED libraries I have heard, but there are up to date forks).

To generate hex-dominant meshes in Salome, we mostly use blocking (which is best done with scripting if the geometry is complex), so this is not as automatic as "octree-type meshes" generated with SnappyHexMesh, but can lead to very good quality.

For tetrahedral, hex-core, or polyhedral meshes, both commercial meshers (those of ANSYS of SIEMENS CDF codes) are often used by engineering departments, and SALOME is also used extensively. Polyhedra are not yet availalble in SALOME but there is work in progress on that front).

I would welcome feedback on tools such as BoxerMesh, but have never had the chance to test it.

Best regards,

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

Re: Mesh generation software suitable for runs in code_saturne for aerodynamics

Post by MatthieuM »

Hello,

Related to previous posts, what kind of inconsistency are you talking about concerning the foamMeshToMED utility? Did it finally work on your side with latest versions of this tool?
Yvan Fournier wrote: Sun Jul 09, 2023 12:26 am
[...]

For tetrahedral, hex-core, or polyhedral meshes, both commercial meshers (those of ANSYS of SIEMENS CDF codes) are often used by engineering departments, and SALOME is also used extensively. Polyhedra are not yet availalble in SALOME but there is work in progress on that front).

[...]

Yvan
Unless I'm mistaken, I think in the latest version of SALOME (9.10), there is now a tool to produce polyhedra meshes via mid-point dual transformations of tetrahedral meshes (I didn't try it yet). But obviously it doesn't correspond to a mostly structured mesh if this is a requirement.

Best regards,
Matthieu
Yvan Fournier
Posts: 4081
Joined: Mon Feb 20, 2012 3:25 pm

Re: Mesh generation software suitable for runs in code_saturne for aerodynamics

Post by Yvan Fournier »

Hello,

There is work in progress in Salome to produce polyhedral meshes, but I do not think is is available in a Salome release yet (neither in 9.10, nor in 9.11, which is not on the web site yet, but already available at EDF).

Regarding inconsistencies for Foam2MED, I have not tested it myself, but those seem to be related to compiling the tool.
This version seems up to date https://github.com/oseen/foamMeshToMED

Also, the description mentions that OpenFoam can convert output meshes to EnSight Gold format, but that its patches are not read by code_saturne. Actually, we choose not to read those by default as the connectivity is disjoint, and thin wall could be inadvertently merged, but since this is rare, I could improve the code_saturne reader to handle this situation, if somebody posts a simple example with an EnSight Gold output with patches produced by OpenFoam (which would avoid the burden of going through an additional filter).

Best regards,

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

Re: Mesh generation software suitable for runs in code_saturne for aerodynamics

Post by MatthieuM »

Hello,

Concerning Salome, I read the 9.10 release notes with the following section :
Polyhedral meshing
SMESH is now capable of producing Polyhedral meshes, we produce these via mid-point Dual
transformations of tetrahedral meshes. Polyhedral meshes which are gaining in popularity in various
numerical methods (FVM, VEM, HHO, FEM, ..), as such these meshes can be generated in
SALOME.
To produce such mesh
o mesh your geometry with any tetrahedral algorithm of choice
o click on the mesh or the sub mesh and go to 'Mesh > Create Dual Mesh', fill in the details in
the dialog box (cf. screen-shot below)
Figure 1: Dual mesh dialog
o a new mesh with prefix 'dual_' will appear in the 'Object Browser' (see screen-shot below
of a torus mesh)
But I admit I didn't take the time to test it, maybe the tool is more limited I believe?

Regarding FoamMeshtoMED utility, I confirm there are current versions on github which are, on my knowledge, operational with both OpenFOAM foundation (openfoam 9, 10 & 11) and OpenFOAM ESI (v2012, v2112, v2212) forks (not tested on my side with foam-extend fork). In any case, the compilation is OK, and up to now, I didn't notice inconsistencies or reading problems from code_saturne (7.0.0 and 8.0.0).

However, it would be useful to have the possibility to directly read the EnSight output produced by OpenFOAM in code_saturne, as the current available tool foamMeshToMED is not official and without any guarantee of future updates.
As you proposed, you will find attached a simple example (a cube with 6 patches Xmin/Xmax/Ymin/Ymax/Zmin/Zmax) created with OpenFOAM v2212 (blockMesh) and exported in EnSight format (command foamToEnsight). Don't hesitate to specify if you need anything else.

Best regards,

Matthieu
Attachments
Ensight_ascii.tar.gz
(2.73 KiB) Downloaded 37 times
Ensight_bin.tar.gz
(2.26 KiB) Downloaded 35 times
finzeo
Posts: 55
Joined: Fri Sep 09, 2022 4:23 pm

Re: Mesh generation software suitable for runs in code_saturne for aerodynamics

Post by finzeo »

Yvan Fournier wrote: Sun Jul 09, 2023 12:26 am Hello,

I can't answer for everyone, but tools used are quite varied.

Foam2MED seems to be used by quite a few people outside EDF (the original version is obsolete and does not work with recent MED libraries I have heard, but there are up to date forks).

To generate hex-dominant meshes in Salome, we mostly use blocking (which is best done with scripting if the geometry is complex), so this is not as automatic as "octree-type meshes" generated with SnappyHexMesh, but can lead to very good quality.

For tetrahedral, hex-core, or polyhedral meshes, both commercial meshers (those of ANSYS of SIEMENS CDF codes) are often used by engineering departments, and SALOME is also used extensively. Polyhedra are not yet availalble in SALOME but there is work in progress on that front).

I would welcome feedback on tools such as BoxerMesh, but have never had the chance to test it.

Best regards,

Yvan
Hi Yvan,

Thank you.

Some colleagues recommended me to use GridPro for these cases. Do you see appropriate the use of GridPro for vehicle aerodynamics? Is it compatible to use a mesh made there in code_saturne?
Yvan Fournier
Posts: 4081
Joined: Mon Feb 20, 2012 3:25 pm

Re: Mesh generation software suitable for runs in code_saturne for aerodynamics

Post by Yvan Fournier »

Hello,

I have heard of this tool in the past, but do not know of any recent use with code_saturne. In many cases, the quality of the obtained mesh depends as much on the person using the meshing tool as the tool itself, so if you can export data to the CGNS format for example (oe another format directly or indirectly handled by code_saturne), that should be good,

Best regards,

Yvan
Post Reply