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)

kjw March 11, 2013 02:40

The heading from __init__.py says:
Code:

bl_info = {
    "name": "SwiftBlock",
    "author": "Karl-Johan Nogenmyr",
    "version": (0, 1),
    "blender": (2, 6, 4),
    "api": 44000,
    "location": "Tool Shelf",
    "description": "Writes block geometry as blockMeshDict file",
    "warning": "not much tested yet",
    "wiki_url": "http://openfoamwiki.net/index.php/SwiftBlock",
    "tracker_url": "",
    "support": 'COMMUNITY',
    "category": "OpenFOAM"}

so I think that i use a right version.

KJW

Quote:

Originally Posted by kalle (Post 412968)
I see that you use Blender 2.64a. Which version of swiftBlock are you using?

K


kalle March 11, 2013 02:57

Good... obj['bevelToResMap'] is a python dictionary, which maps a string (str(round(e.bevel_weight*100))) to an integer. The integer tells how many cells you have requested on edge "e". For book-keeping, I use the Blender native edge feature "bevel_weight". For this reason it is important that the user does not manually edit edge's properties (floats bevel_weight and crease are used, as well as boolean use_edge_sharp). I do not know what happened in this particular case, but you should be able to reset bevel_weight by selecting all your block structure and forcing 0 cells on all edges. 0 cells means disabling forced edge resolution. If you do want to force some edges, you'll have to repeat that procedure.

Let me know if you get through.

K

kjw March 11, 2013 05:10

Thanks a lot,
Your explanation lit my brain up ;)
Now, at least I can correct my errors.

kjw

kalle March 11, 2013 11:19

Thanks for you input, Bruno. I'll have a look at it! Good git usage is not one of my strengths :-)

Quote:

Originally Posted by wyldckat (Post 412922)
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


kalle March 13, 2013 14:37

There was a bug in the new insert smoother feature, which was revealed when objects were scaled. Should be fixed now.

K

abacus++ March 29, 2013 11:47

quarter cylinder
 
1 Attachment(s)
P { margin-bottom: 0.21cm; } Hello Kalle,


P { margin-bottom: 0.21cm; }
I am trying to learn to use swiftBlock and based on your cylinder example, I would like to create a quarter cylinder. I am attaching the created blender file.

P { margin-bottom: 0.21cm; }
When generating the blockMeshDict, the « fetching edge's polyLines from Circle » step is not considered. I guess this is due to the fact that, for a quarter cylinder, the Circle object is not closed. Is there a solution ? :eek:

P { margin-bottom: 0.21cm; }
Thanks in advance for your help.

kalle March 29, 2013 13:59

1 Attachment(s)
I see... I took the freedom to adjust your model somewhat...

K

abacus++ March 29, 2013 14:11

quarter cylinder
 
Thank you very much Kall,
I test your new blender file ;)

abacus++ March 29, 2013 14:24

quarter cylinder
 
There seems to be errors during the generation of the blockMeshDict. The blockMeshDict, and log.swiftblock remain empty ... :confused:
I use Blender 2.62. Do you have the same problem?
cheers

kalle March 29, 2013 14:27

Please use 2.66 and the latest swiftblock, as I used that for saving the blend file.

K

abacus++ March 29, 2013 14:33

Ok, sorry ... :p

Thank you so much! ;)

Haces April 4, 2013 06:58

Hi! I have some problems with the installation of the addons.

I have downloaded blender 2.66 and also the SwiftBlock .py documents. I've compressed all of them in a .zip. Then, in blender, in userpreferences addons I selected install from file and I select the .zip I've created before. I think this extracts the .py files in the folder - /home/$user/.config/blender/$version/scripts/addons. Still, is not working.

Does anybody have the same problem?

kalle April 4, 2013 08:31

Hi,

I've never tried such an installation procedure. I always simply do like I wrote on the wiki

Quote:

Under your Blender installation directory locate the /scripts/addons directory. There create directory swiftBlock. Put the *.py files in there. In Blender's User Preferences, enable 'Community' addons, and locate SwiftBlock under the OpenFOAM category. Click to enable and return to 3D view.
K

kalle April 22, 2013 10:26

I just pushed a new SwiftBlock to the repo. Now there is a button which, when clicked, allows you to delete internal patch faces and add missing patch faces to your block structure. Internal patches is merely an aesthetic problem, but it can be nice to clean them anyway. External patch faces is on the other hand tedious to create, which is also reflected in the pipe bend example, where I just left them out. Now they can be created with just a few clicks. I have not changed the old pipe bend example at the wiki, so you can try it on that case.

Kalle

p.s. there were some issues with book keeping of (forced) edge resolution and grading, which meant that you could effectively set a few different gradings. Now should be able to have up to 100 individual grading/resolution settings.

Balmer May 13, 2013 23:26

Swiftblock Aid
 
Hey all

I am interested in using swiftblock to help me create a mesh for flow over a bump. But sadly I am a blender noob (and openfoam). So far I can only import a stl that I created in solidworks. How can I go about learning swiftblock.

Thnx for your time

kalle May 14, 2013 01:26

Hi,

I would recommend first to get familiar with blender. They have a lot of good stuff on their website. You can also find good info on youtube. You'll have to be able to do some mesh editing.

Then, I'd advice you to read the page on openfoamwiki, and download the examples there to get an idea of the concept.

Good luck, and get back here if you run into trouble.

K

Balmer May 14, 2013 22:19

1 Attachment(s)
Thankyou for reply

I have been looking into the things you have mentioned, especially examples such as pipeblock and quarter cylinder.

With my bump profile (pretty much a cross section of an airfoil) it is quite defined, and my question is is this type of structure applicable to swiftblock. I have attached an image.

Thankyou in advance

kalle May 15, 2013 03:05

Sure, that is easily done with just one single block.

I guess you run this problem in 2D. If so, remember that OpenFOAM still needs a 3D mesh, but only one cell in the non-solved-for direction, and "empty" as boundary type for patches normal to that direction.

K

Balmer May 15, 2013 04:25

Sorry for the bad picture but it is a 3D structure.
I will be working on it over the next week. One thing I am struggling with is the select edges option, and when I hit preview the warning that preview mesh is empty to few vertices selected or broken block structue/ or cannot find object for edges . Sorry for all the noob like questions but my supervisor and I are interested in the swiftblock add-on and can see loads of potential.

kalle May 15, 2013 04:40

I see. I looks like you have enabled swiftblock for the blender object that actually carries the geometry. You have to have two separate blender objects. One object carries the block structure, and the other object (the one from your CAD software) carries the mesh that will be used to construct the block's edges... I know this is a little confusing, but I had to implement it this way to get a working addon.

If you open the "structural part" example, you can see that there are two blender objects present, and that the object carrying the block structure has ticked the "set edges" and the name of the object carrying the geometry is given there.

You should not click "enable swiftblock" on the geometry object.

K


All times are GMT -4. The time now is 14:26.