CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: blockMesh

Tool Block generation with blender

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 19, 2008, 10:19
Default Hi, since snappy came to li
  #1
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 85
Rep Power: 8
wikstrom is on a distinguished road
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/

exportBlockMeshVertices.py

Please feel free to enhance this embryo of a tool.

cheers
Niklas
wikstrom is offline   Reply With Quote

Old   December 19, 2008, 10:22
Default And a new version: http://
  #2
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 85
Rep Power: 8
wikstrom is on a distinguished road
And a new version:

blockMeshExporter.py

N.
wikstrom is offline   Reply With Quote

Old   December 22, 2008, 10:09
Default And a GUI version: 1) Creat
  #3
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 85
Rep Power: 8
wikstrom is on a distinguished road
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"

blockMeshExporterGUI.py

/N
It takes about 1 minute to create
wikstrom is offline   Reply With Quote

Old   December 29, 2008, 09:05
Default Some enhancements and changes.
  #4
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 85
Rep Power: 8
wikstrom is on a distinguished road
Some enhancements and changes.

blockMeshExporterGUI.py

/N
wikstrom is offline   Reply With Quote

Old   December 29, 2008, 11:50
Default Later updates can be fetched a
  #5
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 85
Rep Power: 8
wikstrom is on a distinguished road
Later updates can be fetched at

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

/n
wikstrom is offline   Reply With Quote

Old   July 27, 2009, 15:25
Default
  #6
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 10
braennstroem is on a distinguished road
Hi Niklas,

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

Thanks!
Fabian
braennstroem is offline   Reply With Quote

Old   July 28, 2009, 07:10
Default
  #7
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Braunschweig, Niedersachsen, Germany
Posts: 275
Rep Power: 9
henrik is on a distinguished road
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
henrik is offline   Reply With Quote

Old   August 12, 2009, 17:03
Default
  #8
Senior Member
 
Ahmed
Join Date: Mar 2009
Location: NY
Posts: 249
Rep Power: 9
Ahmed is on a distinguished road
Quote:
Originally Posted by henrik View Post
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
Ahmed is offline   Reply With Quote

Old   August 12, 2009, 17:09
Default
  #9
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Braunschweig, Niedersachsen, Germany
Posts: 275
Rep Power: 9
henrik is on a distinguished road
Just did. Works for me. Henrik
henrik is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Blender Calculix he8 polyMesh gdbaldw OpenFOAM Meshing & Mesh Conversion 3 October 2, 2008 11:33
block generation problem by PROSTAR Mehdi CD-adapco 0 April 26, 2006 05:34
multi-block grid generation Kashan Main CFD Forum 0 December 19, 2004 14:02
Looking for Excellent mesh generation tool Pete Main CFD Forum 9 March 22, 2003 01:06
block structured grid generation Márcio Ricardo Pivello Main CFD Forum 6 February 21, 2002 08:44


All times are GMT -4. The time now is 02:34.