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)

onyir December 17, 2012 11:45

Thank you kalle, that did the trick

qzt December 21, 2012 10:31

nan in output blockMeshDict
 
1 Attachment(s)
Hi,

I am trying again with swiftBlock with a simple geometry built from blocks. I can get a nice block mesh when I press preview. However, when I write the file to blockMeshDict, it contains nan in the vertices' coordinates. As a result, blockMesh failed to read the dict file.

Can you have a look at the blender file and the output blockMeshDict ?

Thanks a lot,

kalle December 21, 2012 12:15

Hi,

There are 10 vertices in your mesh object "Plane.001" that I cannot see, and seems to be corrupted (Blender obviously say their coords are 'nan'). You can select them, by selecting all sound vertices, and then invert the selecting. Then just delete the bad ones. I've never seen this in Blender. Possibly I should add a check that vertices have finite values for their coords.

Please note that your block mesh structure will have internal baffles at the intersection, as you do not have block face matching there.


Kalle

qzt December 21, 2012 14:05

2 Attachment(s)
Thanks Kalle.
After deleting those ghost vertices did solve this issue.
By the way, I guess the internal baffle you mentioned is the region marked by the white circle in the attach image. If so, how should I avoid them ?

I actually tried to remove those faces in blender (as shown in the 2nd attached image), but then the swiftBlock just don't mesh the whole geometry but just a part of it.

Cheers,

kalle December 22, 2012 05:21

1 Attachment(s)
You need a lot more blocks to mesh this geometry. When two blocks meet, you need to match their faces completely. This is basically the whole trick with block meshing, which makes it difficult, and hard to mesh some geometries. This geometry is however perfect for blockMesh, once you've figured out how to divide it. Please see the attached .blend file how I've split it.

Kalle

ps. I think the corrupted vertices are still there in the attached file. Remove them before trying to mesh.

kalle December 29, 2012 07:55

Blender 2.65a is out! A quick test reveals that you have to replace the word "mergedist" on line 156 in utils.py for SwiftBlock with the word "threshold" to use the preview mesh function.

There might be other changes needed as well, and when I feel confident that I've found most of them, I'll update the repository.

Kalle

JFM January 12, 2013 22:02

Blender 2.65 swift utility installation
 
Hi Guys

Liking the util, Kalle keep up the good work.

Question - have just upgraded to blender 2.65 and cannot seem to get the swift functions to be found when creating the addon in the user preferences. I did have a semi-functional system under blender 2.64. I have downloaded the swift files from:
https://github.com/nogenmyr/swiftSnap
https://github.com/nogenmyr/swiftBlock

I have made sure that the files (in /scripts/addons/) are executable, but the .py files are not listed when trying to link to addons. Any ideas on what I am doing wrong.

Also I am working on a Minimum Energy Loss culvert model with OpenFOAM for my masters and being new to everything Linux are finding things to be a challenge at times - would anyone be willing to have a quick look at my blender model and make any suggestions?

Regards
JFM

kalle January 13, 2013 04:29

I have just tried 2.65a quickly, and I imported settings from 2.64, so I did not have to do anything to enable the addons. If I enter the user preferences, they are there under the category "OpenFOAM". Note that you have to enable the "Support Level" "Community" to have access.

Or, do you mean that you do not find the actual user interface in Blender, even you have enabled them? Default they end up in the bottom of the "object" tab under the "properties" sub-window.

Also, be aware that you need to edit utils.py for 2.65 as mentioned above.

Let me know if you can get it to work.

K

kjw February 1, 2013 14:11

Well,
In the matter of fact I use your contribution all the time, and, to be honest, I do not want to test it with the newer version of blender. I had so many minor and major problems with too fast made upgrades of software that I would rather stay at good-working 2.64.
But, nonetheless, solute to you for the very good piece of work. :)

Regards
Krzysztof

kalle February 3, 2013 02:37

Hi Krzysztof,

Thank you for your kind words. Glad they are appreciated, and can be of use!

As for Blender 2.65, I did not see any immediate benefits over 2.64 for these particular tools. 2.64 on the other hand had bugfixes that were necessary.

Regards,
Kalle

Ship February 12, 2013 05:42

SwiftBlock, Coarse/Fine
 
Hello

Please be informed that we are working on mesh intened for a ship in Blender. Now we need to understand how to use the Coarse/Fine buttons in the SwiftBlock meny. I have read the OpenFoamWiki SwiftBlock guide. The following instruction I do not understand:

"You can also choose wich cells on the graded edge that should meet the target resolution; select Fine or Coarse before pressing "Set grading".

Clould somebody advice me how to use the "Coarse/Fine " buttons....


Best regards
Patrik J.

kalle February 12, 2013 05:55

The utility tries to make all cells meet the desired target resolution, and to maintain an aspect ratio of unity. However, if you want to use grading, you do not want/get aspect ratio unity. Still for each edge the utility needs to set the number of cells. For a graded edge, the user can then specify if it should be the cells on the coarse end that meet the target resolution, or if the fine end cells are supposed to meet the target resolution.

If you still have doubts, try playing around with a simple one-block mesh and see the result with the preview function, or ask here again.

K

Ship February 12, 2013 08:32

Hello

Thanks a lot Kalle!!
-P

Ship February 18, 2013 02:31

SwiftBlock, Cylinder example \ Mesh
 
1 Attachment(s)
Hello

Please be informed that I have reproduced the cylinder case as distributed earlier as follows:

1. First I used Rhinoceros 4.0 to make two closed polyline curves with 32 points each, (shaped like a circle).
2. Then I exported the two closed curves in form of a *.obj format.
3. In blender I imported the two closed curves and I used commands alt+c and Ctrl+J.
4. Then I made the block structure as in earlier example.

My question is now how do I get the mesh uniformly all over the cylinder, please see enclosed file for more information. The mesh seems to bee "doubled"??

Best regards
Patrik J.
Helsinki



kalle February 18, 2013 05:52

Hi,

your circles are broken, in that they are not fully connected, which causes the shortest-path algorithm to take an unexpected path. Select one vertex in the circle and press and hold Ctrl+NumPad+, and you will see where the missing edge should be.

K

Ship February 18, 2013 07:44

Thanks
I found the gap... (good command)
-Patrik

kalle March 10, 2013 07:43

1 Attachment(s)
Folks,

Blender 2.66 was released recently. I have not found any new tools useful for the plug-ins, but I decided to update the two tools to make them compatible with the most recent version anyway. I have not looked at the new snappyHexMesh 2.2, but there might be some changes in the setup, so I do not know how well swiftSnap works with the new version.

I have disabled logging by default in swiftBlock. If you want to write the logs, you can click to enable them in the write dialogue.

swiftBlock has now a new hidden feature. Select two or more edges in your block structure and press space with the mouse pointer in the 3D view port. Write "Insert smoother" in the pop-up and press Enter. Now a smooth profile will be added for each edge to the Blender object carrying your polyLines. This feature makes most sense for O-block structures, as shown in the attached image.

Kalle

wyldckat March 10, 2013 08:06

Hi Kalle,

:eek: Nice!

Although I have a little request: could you git tag the commits for changes related to a specific Blender version?
For example, I think you can tag the previous commit on SwiftBlock as follows:
Code:

git tag -a v2.64a f42ea8c909a26cf9ea560eab10caf912acdc0aea
Then push the tag to the online repository like this:
Code:

git push origin v2.64a
Or if you have more than one tag and don't mind pushing all tags you've got:
Code:

git push origin --tags
For more on git tags: http://learn.github.com/p/tagging.html

Many thanks! Best regards,
Bruno

kjw March 10, 2013 13:50

A little swiftBlock problem
 
Hello,
As in title there is a little problem during preview mesh or when writing blockMeshDict.
Perhaps someone could explain me what the following blender info means:

Code:

Traceback (most recent call last):
  File "/home/kjw/bin/blender-2.64a-linux-glibc27-x86_64/2.64/scripts/addons/snapBlock/__init__.py", line 790, in execute
    N = obj['bevelToResMap'][str(round(e.bevel_weight*100))]
KeyError: 'key not in subgroup dict'

location:<unknown location>:-1

Thanks in advance

Krzysztof

kalle March 10, 2013 14:30

I see that you use Blender 2.64a. Which version of swiftBlock are you using?

K


All times are GMT -4. The time now is 17:48.