Personal tools
You are here: Home Forum Extension of the platform Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Up to Extension of the platform

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by William Tougeron at November 29. 2012

Hello everybody,

As a CFD engineer using frequently Salome, I developed some Python functions to accelerate 2D hybrid meshing like shown in enclosed picture.

This kind of mesh becomes very easy to generate with my script.

Besides, the script provides some other functions dealing with:

- the copy of geometrical groups from one object to another,
> - the copy of mesh configurations (copy of all parameters of the mesh and subshapes from a mesh to another),<br> - the export of meshes in AMSH format compatible with Edge (http://www.foi.se/edge).

The 2D shapes created thanks to this script can be used also for 3D meshing, since they can be extruded or filled. I am now meshing a 3D fan domain thanks to it.

The script is now available from this page:

http://www.vzlu.cz/en/results-transfer/software-r/free-software-download#navigace_bottom

Its name is Cfdmsh. It is the last one of the table (for the moment).

All the installation process is given in the user manual (you just have to copy a file in a folder), or in the HTML documentation (included into the ZIP file) in which there are in addition detailed tutorials about CFD meshing in 2D and 3D, as well as Python scripting in Salome.

If you find some problems using it, please contact me. I am neither a programmer nor a Salome developer. I am just a Salome user. So I can make mistakes.

But I hope it will help many people which frequently deal with 2D/3D CFD meshing like me. Personally, it helps me a lot!

Best regards,

William

Attachments

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by William Tougeron at July 02. 2013

Hi all,

The new version of cfdmsh is now available: cfdmsh 2.2

Downloadable from this page (look for "Cfdmsh 2.2"):

http://www.vzlu.cz/en/results-transfer/software-r/free-software-download

Cfdmsh 2.2 is, among other things:

    - 13 new functions of which 5 are 3D funtions.

    - Improved group management: fixed bugs, possibility to choose which groups to copy/export/import, accelerated copy of groups between huge geometries.

    - Increased ergonomics: shortened argument names, possibility to call functions using their acronym.

    - Redesigned HTML documentation with new tutorials and more explanation about the installation and use of the cfdmsh script.

Please, look at the enclosed screenshot to see on what kind of geometry it can be used to create viscous layer blocking in few steps.

Best regards,

William

Attachments

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by Ricardo at July 02. 2013

Hi William,

Nice job! It seems very interesting. I'm definetly giving it a try.

 

By the way, the post-processing picture at the end of tutorial3 is awesome. May I ask how you did that?

 

Regards,

 

Ricardo.

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by William Tougeron at July 02. 2013

Well, I used Paraview. :) (ParaVis should give the same results)

I computed the solution under Edge and imported the data from EngSight format.

Then, when you import data in Paraview/ParaVis, you can use the Extract Block filter to isolate only the wing or the symmetry (or anything else), so as to display them with different settings.

Then the transparency of the field plot can be setup clicking on the Edit Color Map icon (the horizontal rainbow legend with the green disk up to it), then displaying the advanced properties (by clicking on the gearwheel icon) and checking Enable Opacity Function.

Add a cut (Slice icon) and some streamlines (Stream Tracer icon), and you have it! :)

Very simple to do :)

Happy you are interested into cfdmsh. Don't hesitate to give some feedback. :)

Best regards,

William

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by Ricardo at July 03. 2013

Hi William,

 

I'm not able to find that opacity option you mention. I can't find that gearwhell icon. Where is it?

 

Thanks.

Regards,

 

Ricardo

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by William Tougeron at July 04. 2013

Hi Ricardo, :)

I enclose a tutorial. I used Salome 7.2.0.

Best regards,

William

Attachments

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by Ricardo at July 08. 2013

Hi William,

After doing your tutorials, I'm trying to mesh my own geometry. I'm facing a problem when trying to close the boundary layer: the closing gets rotated, so it's in a perpendicular plane.

I can fix it by rotating the curve around the wire.

I think it's related to the wire at the end of the boundary layer been straight.

 

Regards,

Ricardo

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by William Tougeron at July 08. 2013

Hello

Yes, the direction of the closure is by default the OXY plane. The viscous layer end is always straight, so the CloseViscousLayer function cannot see the viscous layer direction. So you can use the plane or the face argument to define the closure direction. See the documentation to have illustrations and script examples.

Best regards,

William

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by Ricardo at July 09. 2013
Hi William,
 
Thanks for your help. I'm meshing a wing with a kink and it works like a charm.
 
Regards,
 
Ricardo

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by benoit paillard at February 10. 2014

Hi William,

 

I just wanted to say hi and thanks for the great tool !

 

Ben

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by William Tougeron at February 10. 2014

Hello Benoit,

Thank you very much! :)

Next version is in process. I hope I will find time to clean it and publish it.

Best regards :)

William

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by taxalian at February 28. 2014

Hi William,

                   As being new user of Salome. This is exactly i would like to ask in the salome community to have a kind of hybrid meshing approach. Is this tool Cfdmsh generic one, can be used with openfoam and how to incorporate this in existing Salome V7.3.0.


Thanks and regards,

Taxalian

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by William Tougeron at February 28. 2014

Hello,

Cfdmsh 2.2 is fully compatible with Salome 7.3.0. Everything is explained in the documentation.

To export hybrid volume meshes in OpenFOAM, you can use the script of Nicolas: http://www.salome-platform.org/forum/forum_12/23863165#686106236

This script allows to export pyramids, which are not supported by the UNV format but are present in 3D hybrid meshes.

Best regards,

William

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by taxalian at February 28. 2014

Hi William,

                    That sounds great i will give it a try and let you know about that. I am trying to mesh an Ahmed body in Salome.

Regards,

Taxlian

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by benoit paillard at June 12. 2014

Hi William,

 

I'm considering using salome instead of snappy for wind turbines blades. Before I start anything I wanted to ask you a question.

 

From the tutorial it looks like cfdmsh can only handle 3D shapes which are linear evolutions from one shape to another. Can it handle complex, twisted 3d blades ? Does it "snap" along the surface ?

 

Thank you.

 

Benoit

 

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by William Tougeron at June 12. 2014

Hello Benoit,

Cfdmsh is today quiet limited in 3D. You can handle without problem viscous layer blockings around extruded geometries or shapes of revolution. You can also use it around "twisted" wings, but only if lines linking wing sections are all straight.

Here is what I mean: http://img4.hostingpics.net/pics/255269twistedwings.png

Now, I just discovered that there is a new tool in Salome called extrusion along a path using different sections. Playing with this tool, I could create manually something looking like a blocking on a simplified "double twisted" wing, using cfdmsh only for the wing boundaries:

http://img4.hostingpics.net/pics/723823twistedblocking.png

I think I will take advantage of this new tool in a future version of cfdmsh. But not before a while because I am going to publish the new version soon and I don't want to delay it.

Here is an example of meshable blocking around a bended simplified wing:

http://www.petit-fichier.fr/2014/06/12/bended-wing-blocking-hdf/bended-wing-blocking-hdf.zip

Best regards,

William

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by benoit paillard at August 07. 2014

HI william,

I tried today your latest cfdmsh 3.0, and there are some changes that make all my script crash. For instance in makeEdgeOffset you reversed parameter order, going from (edge,dist) to (dist,edge).

Any way you can revert that ??

thanks ! and the 3D features look pretty good...

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by William Tougeron at August 07. 2014

Hello,

Yes, I modified the order of arguments because of the new GUI selection possibilities, to optimize Cfdmsh for a use from the GUI (it is quicker and more intuitive to type makeEdgeOffset(10) than makeEdgeOffset(dist=10)).

I am very sorry for that complication. I knew it would make some problem with old scripts and had a long reflexion about that... But finally I decided to do it.

If you really want to adapt Cfdmsh 3.0 to your script, so you can edit the cfdmsh.py file, look for the function definition line (eg. def MakeEdgeOffset( ... )) and change the order of arguments between brackets.

Just respect the Python rules: arguments without default value must be placed at the beginning of the argument list (so, to move the dist argument at the second position of MakeEdgeOffset, just give it a default value, eg. dist=0.02). Just avoid to remove existing default values.

If I have time, I will develop a bash script reverting the order of arguments back to the 2.2 style and publish it on this forum.

For the moment, please, don't use Cfdmsh 3.0 with old scripts or adapt it manually as explained above.

Thank you very much!

Best regards,

William

Re: Cfdmsh, a Python library for hybrid meshing with Salome is available

Posted by benoit paillard at August 08. 2014

No problem, it won't take long any way. I knew there was a good reason for that. Thanks for the good work !!

Ben

Powered by Ploneboard
Document Actions