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 Community New Posts Updated Threads Search

Like Tree83Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2013, 07:04
Default
  #121
New Member
 
Shane Slater
Join Date: Nov 2013
Posts: 7
Rep Power: 13
Shaney is on a distinguished road
Oh dear, do I have a lot to learn or what!

Just realised that the finer, snapped mesh which is in another directory, you need to tell paraFoam to go to that "time" to use those cell layers. You could see the snapped mesh in there.

blimey. steep learning curve.
Shaney is offline   Reply With Quote

Old   November 27, 2013, 09:14
Default
  #122
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Good to hear you solved it! I did not have any immediate clue what was going on...

K
kalle is offline   Reply With Quote

Old   November 27, 2013, 09:46
Default
  #123
New Member
 
Shane Slater
Join Date: Nov 2013
Posts: 7
Rep Power: 13
Shaney is on a distinguished road
Kalle,

if you are still online, perhaps you could advise on this:

in swiftsnap, is it important to specify boundary patches which:
a) do not overlap (in other words, that STL triangles are not shared between patches
b) together cover the whole surface?

I think A) must be true, otherwise OF will get confused. The reason I ask is that swiftsnap seems to start with all mesh surfaces by default in the defaultname wall. So, I believe I have to deselect mesh surfaces that would be used in other patches, such as an inlet?

For B) it would be much easier just to identify the inlet/outlet patches, and then hopefully OF treats everything else as a default wall patch. So, I could not have the defaultname wall patch, and just make inlet and outlet patches. However I do not see a way to remove the defaultname patch from the list of patches....?

Thanks
Shane
Shaney is offline   Reply With Quote

Old   November 27, 2013, 14:55
Default
  #124
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Hi

A) True, you cannot have overlapping STLs. As SwiftSnap handles the whole geometry in one Blender mesh object, this comes naturally. Different patches are handled in Blender using Blender materials (with different colors). Upon initialization, all the objects faces are given the material named "defaultName". The user should then select faces and assign them proper names, hence defining the patches.

B) For sHM, there are no default patches, except those that are remaining from the blockMesh-mesh. For external flows, this is natural and wanted. For such flows, the user has to create the blockMeshDict (maybe using SwiftBlock), and define patches, like inlet and outlet. For internal flows, like the pipe bend example, none of the patches from the blockMesh-mesh remains in the final mesh. Then the user should define patches in the SwiftSnap Blender object, like described in A). Further, like you ask, the Blender object has to be "water tight", otherwise, mesh will "leak" out (or leak in, in the case of external flow), and fill parts of the domain, which the user did not intend to be meshed.

Hope things got clearer, otherwise post again!

Kalle
kalle is offline   Reply With Quote

Old   November 27, 2013, 17:55
Default
  #125
New Member
 
Shane Slater
Join Date: Nov 2013
Posts: 7
Rep Power: 13
Shaney is on a distinguished road
Thanks Kalle,

actually this is surprisingly easy to do. Blender just confused me.

For anyone else that had the same problem (maybe not many!):

when you first go to the patch settings, all of the stl faces will be highlighted as being part of the defaultName.

To make an inlet you input the patch name, say its a patch, but then you need to DESELECT ALL (faces) before choosing the inlet faces you want. Probably obvious to the blenders out there but not to me!

This is the case for all subsequent patches, should you want to make a new patch, you have to deselect the previous faces before choosing those to be in the new patch.

Kalle, I have to say, that one of the biggest problems I've seen with an openfoam workflow, is to take a single STL mesh and define the boundary patches for Openfoam. (In other words, as per the previous posts, break it into non overlapping stl meshes). I now see that you've done this in blender. I've spent a while trying to find a workflow for this, thanks so much.

(PS one reason I had a problem - aside from being a bit thick, is that my ubuntu version of blender is on a virtual machine, and it has terrible problems with windows changing sizes and jumping around a lot. Something to do with 3D acceleration. I've done the above in the windows partition and its easy.)
cheers
Shane
Shaney is offline   Reply With Quote

Old   December 1, 2013, 10:55
Default
  #126
New Member
 
Zhong, Hong Min
Join Date: Oct 2012
Location: UESTC, Chengdu in China
Posts: 8
Rep Power: 14
iamacloud is on a distinguished road
Hi Kalle and anybody,
I am a newer for blender and swiftBlock&swiftSnap, My blender is 2.69.2 and my openfoam is 2.2.2. , and I can run your tutorial example such as SwiftBlockExample.tar. But I don't know how "block" is create in your example. In addition, if I have a STL geometric file, could I get blockMeshDist by swiftBlock+blender?
Thank you,
HM, Zhong.
iamacloud is offline   Reply With Quote

Old   December 1, 2013, 20:09
Default
  #127
New Member
 
Shane Slater
Join Date: Nov 2013
Posts: 7
Rep Power: 13
Shaney is on a distinguished road
Hi,

well as I've just been doing this recently then I may answer.

Yes, in swiftsnap you need to tick the box "make base mesh". That writes a blockmesh.dict using the bounding box for the active swiftsnap mesh.

When you write the files you need to put things in the right directories.
So:
blockmesh.dict = constant/polymesh/
snappyHexmesh.dict = system/
trisurface directory should be in constant/

if you have a STL file that you want to mesh inside (like the pipe example) then you can do it all in swiftsnap. if you want to build a big box mesh around your STL (like a wind tunnel), the you could still use swiftsnap, then when blockmesh.dict is written, just go in and change the dimensions to the ones you want. Maybe this is easier in swiftblock, but I've never used that.
cheers
Shane
Shaney is offline   Reply With Quote

Old   December 3, 2013, 01:02
Question
  #128
New Member
 
Zhong, Hong Min
Join Date: Oct 2012
Location: UESTC, Chengdu in China
Posts: 8
Rep Power: 14
iamacloud is on a distinguished road
Hi, Shane,
Thank you for your quick reply.

I re-scanned the thread just now, and notice several key points about creating "block" which are mainly from Kalle:
Quote:
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.

You are right, this is no tool for automatically constructing block structures. You still have to provide that "intellectual" part of the work yourself. The efficiency is largely dependent on how comfortable the user is with blender. It has its fairly steep learning curve, but there is also a lot of help availble online, for instance on youtube. I myself use extruding a lot, but there are as many habits as there are users, I'd guess.
For a 2D structure like this, I would create 2D block structure and then extrude it.
Kalle

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

Hi,
I see. Your blender object "DXFmesh" does not contain the block structure. You should create your block structure in a separate blender object, and then use "DXFmesh" to provide polyLines for your block's edges. I started in one corner for you, but you have to completely fill your computational domain with blocks. The block structure is in the object "Cube". I guess you can get a pretty good block mesh here, but it takes some thinking on how to place the blocks.
K
Well, my main question is how to create a block structure in a separate blender object. My understanding (If not right, please correct) is that this is just a question about blender or a blender's Addon, if so, can you give the details of the operation steps ( I have done search with Google.com, but not get the results I want).

In addition, my interest is wind-turbine simulating in a tunnel, my tunnel includes a nozzle and a collector, not wind-turbine because an ALM method is used. I try to mesh them by using the fluent3DMeshToFoam(get based-Mesh) and snappHexMesh tools, and in my snappHexMeshDist (created manually) there are both STL geometries of the nozzle and collector. But the result seems not correct (see the attachments, checkMesh -allGeometry -allTopology ), and in paraview I found the regions around the nozzle and collector sufaces cannot always refined (maybe this leads to bad results).

Thanks,

HM, Zhong.
Attached Files
File Type: txt snappyHexMeshDict.txt (4.9 KB, 8 views)
File Type: txt log.checkMesh-snappyHexMeshDict.txt (5.1 KB, 1 views)
iamacloud is offline   Reply With Quote

Old   January 14, 2014, 09:46
Question swiftBlock usage
  #129
JFM
Member
 
JFM's Avatar
 
John Anonymous
Join Date: Jan 2011
Location: Melbourne Australia
Posts: 37
Rep Power: 15
JFM is on a distinguished road
Send a message via Skype™ to JFM
Good day All

I have been using Pointwise for my meshing until recently and now need to find an alternate method to generate meshes. I have been 'playing' with Salome, enGrid and more recently Blender in combination with swiftBlock / swiftSnap.

Blender and swiftBlock / Snap appear to be the most versatile and I would like to (and need to for study purposes) use these packages for my investigation. I should indicate that I am using Blender 2.69.8 and the latest version of swiftBlock/Snap from git.

However, I am not following the workflow required to generate a mesh using swiftBlock (hex mesh is desired). Based upon forums and my own interpretation I have undertaken the following:
  • import stl file and create single object
  • activate swiftBlock on properties panel
  • convertToMeters 1 (no scaling)
  • resolution set to (preliminary) desired default mesh scale
  • generate material type in swiftBlock
  • assign a patch type to each material
  • set edges (entered object name in tree)

I do not understand what is required with the remainder of the edge settings. I understand that grading etc are required to be set however I cannot see how these grading (etc) are attributed to each boundary as defined by the user specified materials. Could someone please provide some concise points / comments on the remainder of the procedure to generate a mesh.

A copy of the blender file I am using can be downloaded from:
https://skydrive.live.com/redir?resi...92D8AD0%214201

A brief description on how to blockMesh this MEL culvert with, for instance, a higher grading resolution over the weir would be beneficial.

Any assistance will be greatly appreciated, and hopefully I can return the favour one day.

Kind regards
JFM

Last edited by JFM; January 14, 2014 at 09:47. Reason: grammar
JFM is offline   Reply With Quote

Old   January 15, 2014, 00:59
Default Help making swiftBlock/swiftSnap appear in Add-ons Menu
  #130
New Member
 
Richard
Join Date: Jan 2014
Posts: 5
Rep Power: 12
pirsquared is on a distinguished road
Hi,

I am relatively experienced in 3d modeling but am new to Ubuntu/OpenFOAM/Blender. My challenge is that after copying swiftBlock and swiftSnap files to the blender/2.69/scripts/addons/swiftBlock and /swiftSnap folder, I cannot find the scripts in the Add-ons Community menu. The path up to the swiftBlock and swiftSnap folders is the same as the add-ons that do appear in the window.

I tried this in blender 2.66a and 2.69/Ubuntu 13.10... no luck with either version. What am I doing wrong?

Thanks!

-Richard
Attached Images
File Type: jpg Screenshot.jpg (56.0 KB, 32 views)

Last edited by pirsquared; January 15, 2014 at 01:05. Reason: clarity
pirsquared is offline   Reply With Quote

Old   January 16, 2014, 05:32
Default
  #131
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
John,

it sounds as if you have clicked "enable swiftblock" on your imported STL object. Is so, please have a look at the examples to find out that the geometry/edges carrying object (your stl-object) is a different object than the block-structure-carrying object.

Rickard,

To the left in your screen dump you have the Categories list. Can you find OpenFOAM in that list? If so, the addons should be visible if click it.

Let me know how you progress, guys.

Kalle
kalle is offline   Reply With Quote

Old   January 21, 2014, 09:48
Default swiftBlock/swiftSnap installation
  #132
New Member
 
Richard
Join Date: Jan 2014
Posts: 5
Rep Power: 12
pirsquared is on a distinguished road
Kalle,

No luck getting openFoam to appear int eh Categories on Blender versions 2.63, 2.66a and 2.69.

I did successfully install and use the enGrid blender add-ons for v. 2.63. Not sure why I can't see the swift scripts though.

Thanks,

Richard
pirsquared is offline   Reply With Quote

Old   January 21, 2014, 10:44
Default
  #133
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Hmm.. strange. I have no clue what could be wrong. The Engrid addon is not under the OpenFOAM category, but sorts under "Mesh". You could try to manually edit the __init__.py files. It is easy. Compare with the Engrid addon and see if you can get it to work!

K
kalle is offline   Reply With Quote

Old   February 26, 2014, 03:58
Default
  #134
New Member
 
Andrew
Join Date: Feb 2014
Location: Russia
Posts: 20
Rep Power: 12
Antech is on a distinguished road
kalle

Thanks for your SwiftSnap scripts. I found them really useful. But may I ask a question?
When I importing STL geometry in Blender (2.68 with upt-to-date swiftsnap) I can assign patch names and write snappyHexMeshDict + STL geometry for OpenFOAM with your tool. But when the meshing with snappy is done I can't load the mesh into paraFoam (OpenFOAM 2.2) because patch names in geometry STL files and in mesh are different (as a result, paraFoam reports several errors). The reason is that STL files generated with script begin with line "solid Exported from Blender-2.68 (sub 0)" instean of just "solid". I've inspected your scripts and have not a clue where this string is generated so I think that Blender generetes it itself when exporting to STL. Is there any workaround to avoid editing STL's "by hand" or the only way is to processing them with "sed" or some other stream editor to remove "Exported..." trails?

pirsquared
Had similar difficulties. Installing add-on from Blender GUI didn't work. I had to copy directories (not just files) with swiftblock and swiftsnap to Blender add-on dir (scripts/addons) to make them work (Blender 2.63, 2.66 and 2.68 tested with corresponding versions of swift tools).

Thanks for attention... Sorry if there are any language problems, my native is russian...

Last edited by Antech; February 26, 2014 at 04:02. Reason: Update
Antech is offline   Reply With Quote

Old   March 7, 2014, 14:51
Default
  #135
New Member
 
Zhong, Hong Min
Join Date: Oct 2012
Location: UESTC, Chengdu in China
Posts: 8
Rep Power: 14
iamacloud is on a distinguished road
Let myself answer the question about "create a block" in floor 128.
In fact, creating a block is the same as creating a geometrical model, just ensure no seperate points and faces in the block. If any, you should remove them with the "fusing" commands in blender.

hope useful to some guys.
iamacloud is offline   Reply With Quote

Old   March 8, 2014, 14:32
Default
  #136
New Member
 
Zhong, Hong Min
Join Date: Oct 2012
Location: UESTC, Chengdu in China
Posts: 8
Rep Power: 14
iamacloud is on a distinguished road
Hi, Andrew,
You can alter your script files, i.e. several line codes starting from line 190 in "/usr/share/blender/2.69/scripts/addons/io_mesh_stl/stl_utils.py" to what you want. Of course, if you just confront a few files you maybe modify them manually,

zhm
iamacloud is offline   Reply With Quote

Old   March 11, 2014, 02:20
Default
  #137
New Member
 
Andrew
Join Date: Feb 2014
Location: Russia
Posts: 20
Rep Power: 12
Antech is on a distinguished road
iamacloud
Thanks! I've found the lines around 190 in stl_utils.py and I see that keyword "solid" is followed by a "header" that is a version info of Blender. File slt_utils.py in my case located in other directory, not /usr/share... (because I just unpacked official Blender archive and it is running OK, I didn't "install" it). I'll edit these lines nex time I use Blender for meshing.
Antech is offline   Reply With Quote

Old   March 12, 2014, 09:37
Default
  #138
New Member
 
romainRH
Join Date: Jul 2012
Posts: 24
Rep Power: 14
romainRH is on a distinguished road
Hi.
I would like to try swiftblock. I have both blender 2.62 and 2.70.
I am just starting with blender so it took me few minutes to found how to activate the addons.
Now i am looking for the swiftblock in the propertie tab of the object but there is nothing.
Could someone post a screenshot to show me where swiftblock is located in blender ?

Thanks
romainRH is offline   Reply With Quote

Old   March 13, 2014, 02:22
Default
  #139
New Member
 
Andrew
Join Date: Feb 2014
Location: Russia
Posts: 20
Rep Power: 12
Antech is on a distinguished road
romianRH
If you have activated Swift addons in User preferences, you just need to click on the cube (Object) in the right toolbar in Blender, scroll down and click "Enable SwiftBlock" button.
Antech is offline   Reply With Quote

Old   March 13, 2014, 02:28
Default
  #140
New Member
 
romainRH
Join Date: Jul 2012
Posts: 24
Rep Power: 14
romainRH is on a distinguished road
Hi Antech.
That is exactly wath I was looking for.
Thank you
romainRH 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



All times are GMT -4. The time now is 21:59.