CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: blockMesh (https://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/)
-   -   Tool Block generation with blender (https://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/61765-tool-block-generation-blender.html)

wikstrom December 19, 2008 10:19

Hi, since snappy came to li
 
Hi,

since snappy came to life, blockMesh has become a more interesting tool. Therefore I have written a small blender plugin to help in the tedious generation of the blockMeshDict block structure.

The plugin is in an early stage, and lacks exception handling and gui, but it can be used as follows (blender should be launched from terminal so messages from the plugin can be seen):

1) Create the block topology in blender (Must be orhtogonal blocks) All blocks must reside in the same blender object.
2) Assert there are no duplicate vertices (remove doubles in edit mode).
3) In edit mode, select 8 vertices forming your first block.
4) Export to a file using the attached plugin.
5) Select 8 vertices forming your second block.
6) Export to the same file using the attached plugin (it will be appended to).
7) Repeat for all blocks.
8) OPTIONAL: To produce a skewed block structure, move the nodes in blender and export to a new file. Then replace the vertices in the first file with the vertices in this new file.
9) Hand edit the blockMesh file.

NOTE: Since I haven't grasped how to handle tolerances in blender yet, the exported vertices only include 3 decimal digits!

I know this is not very userfriendly, but hand editing blockMeshDict is worse by far, imho.

To install a blender plugin, simply put it in $HOME/.blender/scripts/

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif exportBlockMeshVertices.py

Please feel free to enhance this embryo of a tool.

cheers
Niklas

wikstrom December 19, 2008 10:22

And a new version: http://
 
And a new version:

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif blockMeshExporter.py

N.

wikstrom December 22, 2008 10:09

And a GUI version: 1) Creat
 
And a GUI version:

1) Create block topology (orthogonal blocks!)
2) Remove duplicate vertices
3) Open a "Scripts Window" in blender
3) Select from Scripts->Export menu "BlockMesh Export GUI" (Some buttons should appear)
4) Select output file, or accept default
5) In edit mode select 8 vertices forming a block
6) Press "Register block"
7) Repeat 5) and 6) until all blocks are registred
8) Optional: Now, you can move the vertices around, to create a "skewed" block structure.
8) Press "Write and quit"

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif blockMeshExporterGUI.py

/N
It takes about 1 minute to create

wikstrom December 29, 2008 09:05

Some enhancements and changes.
 
Some enhancements and changes.

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif blockMeshExporterGUI.py

/N

wikstrom December 29, 2008 11:50

Later updates can be fetched a
 
Later updates can be fetched at

http://nikwik.webfactional.com/public.html

/n

braennstroem July 27, 2009 15:25

Hi Niklas,

nice approach. Could you suggest some tutorials for hex mesh creation in blender in combination with your scripts?

Thanks!
Fabian

henrik July 28, 2009 07:10

Dear All,

I had a go with blender, but I haven't tried creating blockMesh files with it. It's all very interesting and I just want to make sure that you are aware of this presentation:

http://www.imac.unavarra.es/Cursos/A...FOAMCharts.pdf

Douglas released the code. Maybe somebody can post up-to-date pointers.

Henrik

Ahmed August 12, 2009 17:03

Quote:

Originally Posted by henrik (Post 224373)
Dear All,

I had a go with blender, but I haven't tried creating blockMesh files with it. It's all very interesting and I just want to make sure that you are aware of this presentation:

http://www.imac.unavarra.es/Cursos/A...FOAMCharts.pdf

Douglas released the code. Maybe somebody can post up-to-date pointers.

Henrik

Could you please check/update the link
Thanks and good luck

henrik August 12, 2009 17:09

Just did. Works for me. Henrik


All times are GMT -4. The time now is 22:16.