CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swiftBlock/swiftSnap] SwiftSnap and SwiftBlock, GUIs for OpenFOAM's meshers (https://www.cfd-online.com/Forums/openfoam-community-contributions/100604-swiftsnap-swiftblock-guis-openfoams-meshers.html)

kalle August 15, 2012 01:08

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

wyldckat August 15, 2012 05:46

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

matthiass August 20, 2012 13:06

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

kalle August 20, 2012 14:37

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

matthiass August 20, 2012 15:56

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

wyldckat August 20, 2012 16:16

Quote:

Originally Posted by matthiass (Post 377845)
@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 ;)

kalle August 21, 2012 14:15

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.

matthiass August 21, 2012 15:30

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

kalle August 22, 2012 14:33

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

l_r_mcglashan August 22, 2012 14:36

Nice work!

Any chance of putting the code up on github/bitbucket? Makes it easier to update and get changes.

wyldckat August 22, 2012 16:26

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...

kalle August 24, 2012 02:38

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 August 25, 2012 07:30

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

gskillas September 1, 2012 17:22

swiftBlock strange behaviour with Polylines
 
3 Attachment(s)
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.

Attachment 15506

Attachment 15507

Attachment 15508

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

kalle September 4, 2012 11:59

Indeed your polyLines looks messed up. I have sent you a private message, where you can send me the .blend file!

Regards,
K

kalle September 15, 2012 11:38

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 September 23, 2012 16:07

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

sivakumar October 7, 2012 05:38

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

kalle October 7, 2012 09:35

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

sivakumar October 7, 2012 11:37

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


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