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 17, 2016, 13:13
Default
  #241
Member
 
Roman Gobitz-Pfeifer
Join Date: Dec 2009
Location: Stuttgart
Posts: 83
Rep Power: 16
Wikie is on a distinguished road
Hi,

is it possible that swiftBlock doesn't work on windows machines? I have to work with the windows version of openFOAM and therefore I want to create my blockMesh with blender and swiftBlock. Although everything is installed poperly, blender is not able to show my any grid when pressing the review button (no blockMesh found).
I assume that the path to blockmesh isn't set in the system variables. Anybody facing the same problem?

cheers
wikie
Wikie is offline   Reply With Quote

Old   November 18, 2016, 05:00
Default
  #242
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Hi,

you are using Mikko's version, so I'll let him answer this. He has the advantage of supporting multigrading, but his preview function relies on blockMesh itself for generating a preview outside of blender.

My version does not support multigrading, but my preview function is done within blender. I have almost exclusively been running swiftblock in windows without problems.

Regards,
Kalle
kalle is offline   Reply With Quote

Old   November 18, 2016, 05:04
Default
  #243
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi Roman,

Sorry, I have never tried blockMesh/Blender/OpenFOAM on Windows. This version should work with Windows because it is not calling blockMesh in the background.

Otherwise, I think you should run Blender from command prompt where you have firstly loaded the OpenFOAM environment. Additionally, maybe you will have to change in the preview.py file the "blockMesh" command to "blockMesh.exe" (2 times).

Best,
Mikko
Flowkersma is offline   Reply With Quote

Old   November 18, 2016, 08:10
Default
  #244
Member
 
Roman Gobitz-Pfeifer
Join Date: Dec 2009
Location: Stuttgart
Posts: 83
Rep Power: 16
Wikie is on a distinguished road
Thanks Kalle and Mikko for your fast reply.
I'm working with blender 2.75-windows64 and I installed the version from Mikko (https://github.com/flowkersma/swiftBlock).
I'll give the version from Kalle a try.
Thanks
Roman
Wikie is offline   Reply With Quote

Old   November 18, 2016, 08:57
Default
  #245
Member
 
Roman Gobitz-Pfeifer
Join Date: Dec 2009
Location: Stuttgart
Posts: 83
Rep Power: 16
Wikie is on a distinguished road
Kalle's version is working on my windows machine.

I also tried to replace the "blockMesh" command with "blockMesh.exe" in Mikko's version as recommended which doesn't solve the problem
Wikie is offline   Reply With Quote

Old   November 24, 2016, 10:09
Default wedge type mesh in swiftBlock?
  #246
Member
 
Roman Gobitz-Pfeifer
Join Date: Dec 2009
Location: Stuttgart
Posts: 83
Rep Power: 16
Wikie is on a distinguished road
swiftBlock is great!! I aleady set up some smaller cases (mainly pipes and other simple geometries) for practise and it's working perfect.

Is it possible to create a wedge type mesh using swiftBlock? I'm still playing around and want to simulate the flow through a pipe by using the symmetry axis of the pipe to fasten the simulation. If so, does anybody have any tutorials or other tipps and tricks?

cheers
Roman
Wikie is offline   Reply With Quote

Old   November 24, 2016, 10:17
Default
  #247
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Thanks!

Well, you cannot do wedges, but I had the same problem as you. I made a 2D flat mesh, and used this tool to create a wedge:

https://openfoamwiki.net/index.php/C.../MakeAxialMesh

Also see this:

https://openfoamwiki.net/index.php/Contrib/SwiftBlock

K
kalle is offline   Reply With Quote

Old   July 19, 2017, 06:37
Default
  #248
Member
 
Join Date: Mar 2014
Posts: 39
Rep Power: 12
Traction is on a distinguished road
First and foremost: Great work from both of you Karl and Mikko !
I am currently testing Blender with the swiftBlock addon and it seems to work well. My current configuration where I succeeded in doing some tutorials is Blender 2.78c (and also 2.75a) with OpenFOAM-3.0.1 and the swiftBlock fork of flowkersma.

I noticed that I cannot simply change the cubes resolution in x, y, z by applying a varying maxdx to a single edge + parallel edges. After setting the maxdx I see the correct edge resolution when using "Get edges" but the mesh doesn´t change like required. Looks like the block gets divided into the same number of cells in each direction regardless of my specific edge resolution which should lead to different cell counts in x, y and z !? What puzzles me is the fact that the grading feature is working as expected.

Right now I modify the blockMeshDict afterwards to modify the number of cells in each direction. Is that feature not a current part of swiftBlock or am I missing something ?

Quote:
Originally Posted by Flowkersma View Post
I made another video which shows how to mesh bended pipe with o-grid http://youtu.be/ZY7WDP6w7YA
Can you please reupload this one ?
Traction is offline   Reply With Quote

Old   July 30, 2017, 18:39
Default
  #249
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi Traction,

I merged my fork of SwiftBlock with another repository in the beginning of the month and changed also a bit my code. I did not test the new code properly and it is very possible that there were errors. Sorry about that! For now, I rollbacked to the old release. I have been lately developing swiftBlock a bit and I plan to soon publish what I have done. I will make a new video then as well.

Best, Mikko
Traction likes this.
Flowkersma is offline   Reply With Quote

Old   September 13, 2017, 07:29
Default
  #250
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi,

A new version of my fork is available. It has several new features which are described on the GitHub page. It supports the new surface projection algorithm of blockMesh (also Kalle's blockMeshBodyFit). Unfortunately, it currently has a dependency to the latest Numpy 1.13. I have rewritten most of the code and changed the GUI quite bit. Let me now if you try it!

Example video how to mesh a sphere

Happy meshing!
romainRH, Traction and lourencosm like this.
Flowkersma is offline   Reply With Quote

Old   September 13, 2017, 08:52
Default
  #251
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Impressed! Really good work, Mikko! This is definitely an alternative to commercial block meshing software... I am sure it is also a lot faster too. Great work with the GUI. Nice with edge direction visualization!

Kalle
romainRH, Traction and lourencosm like this.
kalle is offline   Reply With Quote

Old   September 13, 2017, 10:44
Default
  #252
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Thanks Kalle! The more I learn Blender, the more I understand how powerful it is. It is also a lot of fun to work with.
Flowkersma is offline   Reply With Quote

Old   November 3, 2017, 09:48
Default swiftBlock
  #253
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
Hi All

I have installed blender 2.78c, plus the GitHub version of swiftBlock. Once installed I opened a terminal and enabled OF 5.0 environment (alias as I have several version of OF/foam installed) and in the same terminal I then started blender 2.78 and installed swiftBlock as per the GitHub page instructions (including python and numpy) and tried swiftBlock.

Then I took the blender mesh of the domain and selected blockMesh -> Build Blocking, this returned several blocks however it did not generate all blocks in domain (refer to figures).

Before trying to generate the blocks I ensured that all redundant faces, edges and faces had been removed. Also confirmed there are no non-manifold edges or loose geometry.

I have tried both the blockMeshMG and blockMeshBofyFit options with and without Numba activated. With Numba activated I receive the following error message.

Code:
Beginning automatic block detection
Traceback (most recent call last):
  File "/home/jfm/.config/blender/2.78/scripts/addons/swiftBlock/__init__.py", line 396, in invoke
    log, block_verts, block_edges, face_info, all_edges, faces_as_list_of_nodes = blockBuilder.blockFinder(edges, verts, disabled = disabled, numba = ob.useNumba)
  File "/home/jfm/.config/blender/2.78/scripts/addons/swiftBlock/blockBuilder.py", line 102, in blockFinder
    from . import cycleFinderNumba
  File "/home/jfm/.config/blender/2.78/scripts/addons/swiftBlock/cycleFinderNumba.py", line 1, in <module>
    from numba import jit
ImportError: No module named 'numba'
Any assistance to resolve this issue will be welcome.

Regards
JFM
Attached Images
File Type: png blenderMesh.png (118.9 KB, 37 views)
File Type: png blenderBlocks.png (41.7 KB, 31 views)
JFM is offline   Reply With Quote

Old   November 3, 2017, 10:05
Default
  #254
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi John,

How many blocks do you have on the list in the SwiftBlock panel? Is it only the six blocks that are visible or more?

You should not use numba unless the block detection (build blocking) algorithm is taking too long. Then you will have to install the numba Python library. You should use blockMeshMG and I will take the other option away in the next release.

Best, Mikko
Flowkersma is offline   Reply With Quote

Old   November 3, 2017, 10:23
Default swiftBlock
  #255
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
Hi Mikko

Thanks for replying - there is only 6 blocks listed. I have attached the blender file for information.

Regards
John
Attached Files
File Type: gz model4_lE_5_noGeometry.blend.tar.gz (83.4 KB, 3 views)
JFM is offline   Reply With Quote

Old   November 3, 2017, 10:46
Default
  #256
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi John,

You are missing the internal edges and that is why SwiftBlock cannot find the blocks. Each block must always have 8 vertices and 12 edges. I have implemented an operator "extrude blocks" which retains the internal edges. You can find it by pressing ALT+E.

I attached a modified file which can now find 111 blocks. However, the measures might be wrong. I just removed the top surface of the blocking and extruded the lower surface 1.726m to the normal direction.

Best, Mikko
Attached Files
File Type: gz model4_lE_5_noGeometry_mf.blend.tar.gz (95.2 KB, 1 views)
Flowkersma is offline   Reply With Quote

Old   November 6, 2017, 18:43
Default The projection to object fails for me
  #257
New Member
 
Eero Kokkonen
Join Date: Nov 2010
Posts: 4
Rep Power: 15
ekeero is on a distinguished road
Hi!

I switched to the new fork and tried the 'flow around a sphere' example mentioned by flowkersma without succeeding in the projection of the mesh to the sphere. I am running Blender 2.79 (also tried with previous ones without any help), I have OF-dev from this week and I followed the install instructions from the README file.

I only get this: Screenshot_20171107_003609.jpg

Wonder where's the problem...
ekeero is offline   Reply With Quote

Old   November 7, 2017, 05:09
Default
  #258
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi Eero,

If you don't see any errors, then the installation should be OK. Can you see the projections on the list of the SwiftBlock panel (there should be 6 faces, 12 edges and 8 vertices for cube to sphere projection)?

Regards, Mikko
Flowkersma is offline   Reply With Quote

Old   November 7, 2017, 06:32
Default
  #259
New Member
 
Eero Kokkonen
Join Date: Nov 2010
Posts: 4
Rep Power: 15
ekeero is on a distinguished road
Hi Mikko,

Yes to my understanding it should be ok and work. Please find my test case attached: test.blend.tar.gz
ekeero is offline   Reply With Quote

Old   November 8, 2017, 06:15
Default
  #260
Member
 
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 66
Rep Power: 14
vigneshTG is on a distinguished road
Hi Mikko,

I am trying the meshing sphere in block tutorial. To begin with i just stopped after creating the sphere inside the block (see the attached pic) not extending it as you did. Then i initialized swiftblock, when i click blockMeshMG, i get the following error


Code:
Beginning automatic block detection
Traceback (most recent call last):
  File "/home/local/CSI/guru/blender/2.77/scripts/addons/swiftBlock/__init__.py", line 396, in invoke
    log, block_verts, block_edges, face_info, all_edges, faces_as_list_of_nodes = blockBuilder.blockFinder(edges, verts, disabled = disabled, numba = ob.useNumba)
  File "/home/local/CSI/guru/blender/2.77/scripts/addons/swiftBlock/blockBuilder.py", line 105, in blockFinder
    tmp_v,tmp_e = cycleFinder(edges,range(len(vertices_coord)))
  File "/home/local/CSI/guru/blender/2.77/scripts/addons/swiftBlock/blockBuilder.py", line 59, in cycleFinder
    temp, u = np.unique(np.sort(faces), axis=0, return_index=True)
TypeError: unique() got an unexpected keyword argument 'axis'

location: <unknown location>:-1

location: <unknown location>:-1
There are no blocks listed in the swiftblock panel.

Can you tell me what i am doing wrong and how to rectify it ?

PS: I am using Blender-2.77 with openfoam 5

Regards
Vignesh
Attached Images
File Type: jpg Sphere_21.jpg (114.3 KB, 25 views)
__________________
Thanks and Regards

Vignesh
vigneshTG 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 17:25.