CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swiftBlock/swiftSnap] SwiftSnap and SwiftBlock, GUIs for OpenFOAM's meshers

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

Like Tree70Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 15, 2012, 02:08
Default
  #21
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Hi!

1. Actually this particular one works in range 2.60-2.63. I am still facing some issues in making swiftSnap multi-compatible, though.

2. "aug" just stands for August... maybe I should start using version numbers...

Regards,
K
kalle is offline   Reply With Quote

Old   August 15, 2012, 06:46
Default
  #22
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Kalle,

OK, I've updated the wiki page for SwiftBlock to reflect the new version (well, only about the Blender version and file name ) and moved the older one to a list at the bottom for the older versions.

I didn't even remember that "aug" could stand for August... I was mesmerized by the similarity with Archlinux's "AUR"

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 20, 2012, 14:06
Default
  #23
New Member
 
Join Date: Mar 2012
Posts: 23
Rep Power: 14
matthiass is on a distinguished road
Hi Kalle, hi Bruno,

I am really interested in the use of this add-on swiftBlock. The examples look really nice.
But I have a bit problems in understanding how to use it. I already used Blender for postprocessing of openFOAM-simulations, but I wouldn' call me experienced.
I installed the add-on and tried to understand the T-jiunction example.
Did you create only the faces at the inlet, outlet and stream and then the blocks are calculated or did you build all the blocks by yourself?

Best regards,
Matthias
matthiass is offline   Reply With Quote

Old   August 20, 2012, 15:37
Default
  #24
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Hi!

Glad to hear about your interest!

Well, I wish it was that easy to create block structures! The whole intellectual part in block structured meshes is about the creation of those blocks, and the clever choices of dividing the domain into blocks. Though I've heard about algorithms doing that, I've never studied them, nor implemented them myself. The swiftBlock plugin let's the user focus on creating that structure, rather than thinking on how to put tons of integers/scalars in the right position in a Dict-file.

In the particular example you looked at, I first created the block structure, and at the end, I put Blender faces on the inlet/outlet boundaries. Other boundaries I left for the blockMesh application to put automatically into defaultFaces.

Good luck on trying. Let us know if you run into trouble!

Regards,
Kalle
kalle is offline   Reply With Quote

Old   August 20, 2012, 16:56
Default
  #25
New Member
 
Join Date: Mar 2012
Posts: 23
Rep Power: 14
matthiass is on a distinguished road
Hi Kalle,

thanks for your fast reply!
So, I did understand it right, that you first divide your wanted design into blocks, then you define the patches and at the end you write the blockMeshDict. And you use an algorithm so that polysplines for the blockMeshDict are created to fit the shape of the wanted design. Am I right?
What is the "Diagnose"-button for? It isn't explained in the wikki.
Where can I get the presentation of your talk from the OF-workshop?

@Bruno: In another thread you mentioned the tutorial for snappyHexMesh of Eugene de Villiers with a link to 7th OF-workshop. This link isn't valid anymore and I'm really interested in this tutorial. Do you know another link, where I can get it?

Thanks in advance for you answers and best regards,
Matthias
matthiass is offline   Reply With Quote

Old   August 20, 2012, 17:16
Default
  #26
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by matthiass View Post
@Bruno: In another thread you mentioned the tutorial for snappyHexMesh of Eugene de Villiers with a link to 7th OF-workshop. This link isn't valid anymore and I'm really interested in this tutorial. Do you know another link, where I can get it?
http://www.cfd-online.com/Forums/ope...pyhexmesh.html -> http://openfoamwiki.net/index.php/Sn...als_and_Guides

Have fun
__________________
wyldckat is offline   Reply With Quote

Old   August 21, 2012, 15:15
Default
  #27
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Hi Matthias,

Actally there are two algorithms, one for detecting the blocks in the wire-frame structure, and one other for digging out the polyLines.

The Diagnose button was added recently, as I found out that it is easy to make mistakes in the block structure which are not discovered until blockMesh is run. Then it can be a lengthy process to find out what is wrong. The diagnose button directly points out what may be wrong by highlighting edges in the structure which are not found to be participating in forming blocks.

Tip: By letting the mouse pointer rest over items in Blender, users normally get some extra information.

In an coming update, the addon uses Blender's own shortest-path algorithm, which is a lot faster for some cases. Currently a bug in Blender makes this unreliable, but the bug is reported and solved, so I hope 2.64 will make this possible. Then I will also update the wiki, and maybe add an updated version of the presentation I gave. The presentation does not really give any more info than what is present on the wiki.


Today, I saw that swiftSnap has a bug, which makes the convertToMeters setting unusable. I am working on a fix.
kalle is offline   Reply With Quote

Old   August 21, 2012, 16:30
Default
  #28
New Member
 
Join Date: Mar 2012
Posts: 23
Rep Power: 14
matthiass is on a distinguished road
Hi Bruno, hi Kalle,

thanks for your answers. I will try to build my mesh with swiftBlock and have a look at the SHM-tutorials.

Best regards,
Matthias
matthiass is offline   Reply With Quote

Old   August 22, 2012, 15:33
Default
  #29
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Good luck! Get back here if yo run into trouble.

I have hopefully fixed the bug with the convertToMeters setting in swiftSnap. I just put it on the wiki.

K
kalle is offline   Reply With Quote

Old   August 22, 2012, 15:36
Default
  #30
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
l_r_mcglashan will become famous soon enough
Nice work!

Any chance of putting the code up on github/bitbucket? Makes it easier to update and get changes.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   August 22, 2012, 17:26
Default
  #31
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
FYI: I've also updated the wiki page similarly to how I did to SwiftBlock, i.e., older versions are now listed in the end of the page.

Just to confirm, this new update, does it work with Blender 2.63?

Last but not least: Kalle, you can upload files with the same name, because the wiki also provides history tracking of files, if I remember correctly. What it doesn't allow is renaming files...
__________________
wyldckat is offline   Reply With Quote

Old   August 24, 2012, 03:38
Default
  #32
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Thanks for the tips. I guess the best would be to open a github account to manage files.

No, the current version does not support 2.63. I am reluctant to make this code multicompatible, as there would be too many try/except statements. I am awaiting 2.64 which contains some important bugfixes (for swiftBlock). Then I'll update the codes for that version (which then will be the only supported).

If anyone want to make their private copy compatible for some Blender 2.5x+ version it is normally rather easy to change the code (by googling error messages).

K
kalle is offline   Reply With Quote

Old   August 25, 2012, 08:30
Default
  #33
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Ok folks,

I followed the excellent advices to create a github account. I have also rewritten quite a lot in swiftBlock to make it more robust. There are some complications with Blender versions unfortunately. This swiftBlock is compatible with 2.62, but the shortest path algorithm there does not work very well for some cases. One example is the pipe bend example on the wiki. Then there is a bug in release version of 2.63 making this addon unusable. This was fixed some days ago, and with daily builds it works again. Hence, such a Blender is optimal for this swiftBlock.

You find it here: https://github.com/nogenmyr/swiftBlock.git


swiftSnap is also available under git. The current version is compatible with 2.62, but each line, totally 5, that need a change for working with 2.63 has a comment on how to change it.

You find it here: https://github.com/nogenmyr/swiftSnap.git

K
wyldckat likes this.
kalle is offline   Reply With Quote

Old   September 1, 2012, 18:22
Default swiftBlock strange behaviour with Polylines
  #34
New Member
 
Join Date: Mar 2009
Posts: 5
Rep Power: 17
gskillas is on a distinguished road
Hello Kalle

I am trying to learn to use swiftBlock and I am observing some strange blockMesh behaviour related to the polylines. I am attaching the created blockMeshDict, facesFound.obj and log.swiftblock.

blockMeshDict.gz

facesFound.obj.gz

log.swiftblock.gz

I can send you the blender file as well, it is too big to be posted here. Is there a remedy to the problem? I guess it has to do with orientation issues. I am using blender 2.62 .

Best regards,

George
gskillas is offline   Reply With Quote

Old   September 4, 2012, 12:59
Default
  #35
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Indeed your polyLines looks messed up. I have sent you a private message, where you can send me the .blend file!

Regards,
K
kalle is offline   Reply With Quote

Old   September 15, 2012, 12:38
Default
  #36
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
I still did not hear from you George so I have not been able to resolve this. I saw however today a similar issue. I appeared when I used the "spin" function in Blender to generate the object defining the polyLines. When you do a 360 degree spin, Blender will not connect the vertex at 0 degrees to the one at 360. The mesh looks complete, but a careful check reveals that there are co-located vertices at 0/360 degrees. Doing a "remove doubles" on the polyLines object resolved the issue in my case.

K
kalle is offline   Reply With Quote

Old   September 23, 2012, 17:07
Default
  #37
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Tonight I pushed an updated version of swiftBlock to github;

Release notes:

  • The block detection algorithm has a much more efficient implementation now. On the pipeBend example a factor 12 was observed. That meant 10 sec instead of 2 min on my machine.
  • The python shortest path algorithm was omitted in favor for Blender's internal C implementation. This also gives a speed up, especially on dense polyLine objects. This feature relies on Blender code which have had some bugs. Therefore you need to have a daily build of the 2.63 version. The official release from May 2012 is not working, nor is 2.62, but due to another bug.
  • Block edge's lengths are used when determining how many cells to use. Earlier all edges where determined as simple straight lines. This was not accurate for general polyLines of course. Now the true length is used.
  • I have ported parts of blockMesh code into python to enable mesh previewing. This gives a faster workflow as you do not need to use Paraview to see the result. This was particulary annoying when the Dict generation was so slow. You can also chose to preview single block(s).
  • You can diagnose the block structure by pressing a button. Edges that for some reason does not participate in forming blocks are highlighted. Usually this is because some double vertices, missing edges, blocks formed by more than 8 vertices, or other block structure inconsistencies. This help to identify problems early.
  • You can force a specific number of cells on edges. This is particulary useful when creating 2D meshes, where you only want one cell in the non-used direction. This setting overrides the default resolution determined by edge lengths and target resolution.
  • You can specify grading and select which cells on the graded edge that should have the target resolution; the cells on the fine end, or the cells on the coarse end.
Please let me know if the scripts crashes at anytime in your Blender. It is not supposed to do that, and I have not experienced many such occasions myselft, but different habits of using Blender may trigger bugs that I have not discovered.

I've also updated the wiki to describe how to use the new features!

Kalle
kalle is offline   Reply With Quote

Old   October 7, 2012, 06:38
Default
  #38
Senior Member
 
sivakumar selvaraju
Join Date: Mar 2009
Location: India
Posts: 205
Rep Power: 18
sivakumar is on a distinguished road
Send a message via Skype™ to sivakumar
Dear Seniors,
I am happy that there is a possibilities generate mesh using blockMesh for complex geometry. Regarding that I have received the reply from Bruno.

Since I am completely new for blender and python, I have some simple questions.

1) where do i need to start?
2) can you people give me some bench mark tutorials and materials?

actually I am planning to mesh fan passage, it is a twisted blade.

Please guide me.

with Regards,
Siva
sivakumar is offline   Reply With Quote

Old   October 7, 2012, 10:35
Default
  #39
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Dear Siva,

You do not need to know any python to work with the tools. Download Blender and follow the instructions here:

http://openfoamwiki.net/index.php/SwiftBlock

There you will also find some example cases. It can be wise to get familiar with Blender first, there are plenty of help on the web, including on youtube.

Also be aware that you need the most latest blender: i.e. a daily build of 2.63. You may work in either windows or Linux.

Please also be aware that blockMesh cannot snap to surfaces; surfaces are only defined by their edges (which you can define with swiftBlock). As long as you can mesh your geometry under that constraint, you should be fine.

Regards,
K
kalle is offline   Reply With Quote

Old   October 7, 2012, 12:37
Default
  #40
Senior Member
 
sivakumar selvaraju
Join Date: Mar 2009
Location: India
Posts: 205
Rep Power: 18
sivakumar is on a distinguished road
Send a message via Skype™ to sivakumar
Dear Kalle,
Thanks for your reply, I have installed blender 2.62, I was planning to install 2.64, just typed sudo apt-get install blender. it seems that I have installed 2.62.
I need to reinstall it.

thanks and regards,
Siva
sivakumar is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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



All times are GMT -4. The time now is 05:31.