CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] Tool Block generation with blender

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 19, 2008, 09:19
Default Tool Block generation with blender
  #1
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 86
Rep Power: 17
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, 09:22
Default And a new version: http://
  #2
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 86
Rep Power: 17
wikstrom is on a distinguished road
And a new version:

blockMeshExporter.py

N.
wikstrom is offline   Reply With Quote

Old   December 22, 2008, 09:09
Default And a GUI version: 1) Creat
  #3
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 86
Rep Power: 17
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, 08:05
Default Some enhancements and changes.
  #4
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 86
Rep Power: 17
wikstrom is on a distinguished road
Some enhancements and changes.

blockMeshExporterGUI.py

/N
wikstrom is offline   Reply With Quote

Old   December 29, 2008, 10:50
Default Later updates can be fetched a
  #5
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 86
Rep Power: 17
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: 19
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: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
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: 251
Rep Power: 18
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: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
Just did. Works for me. Henrik
henrik is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swiftBlock/swiftSnap] SwiftSnap and SwiftBlock, GUIs for OpenFOAM's meshers kalle OpenFOAM Community Contributions 292 May 20, 2023 09:50
[ICEM] Replay not working properly - Creating the mesh for Free Block. Wingman ANSYS Meshing & Geometry 4 January 17, 2017 03:57
[blockMesh] blockMesh error - Negative Volume Block adoledin OpenFOAM Meshing & Mesh Conversion 2 June 22, 2016 10:44
[ICEM] Quest for seemingly simple Blocking (degenerate block) la7low ANSYS Meshing & Geometry 0 July 12, 2011 19:48
Latest news in mesh generation Robert Schneiders Main CFD Forum 0 March 2, 1999 04:07


All times are GMT -4. The time now is 11:07.