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 Members List Search Today's Posts Mark Forums Read

Like Tree67Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2017, 05:26
Default
  #261
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 178
Rep Power: 7
Flowkersma is on a distinguished road
Hi,


@Vignesh, this error is related to NumPy. You have too old version.

@Eero, your testcase works well on my computer. Can you look at the blockMeshDict file and see if the projections are listed there?

Regards, Mikko
Flowkersma is offline   Reply With Quote

Old   November 8, 2017, 08:28
Default
  #262
New Member
 
Eero Kokkonen
Join Date: Nov 2010
Posts: 4
Rep Power: 10
ekeero is on a distinguished road
I finally got it working, but only with blender_2.76.b+dfsg0-3build1, I did not got it working with 2.77, 2.78 or 2.79 Blender versions.

The blockMeshDict is showing the projections.

I saved the mesh with Blender 2.76 and with 2.79 from the same test case.
- both created the very same blockMeshDict (checked with diff)

I ran the blockMesh with the constant/geometry/Sphere.stl for both cases
- case generated with 2.76 succeeded in the projections correctly as the preview mesh in Blender
- case generated with 2.79 did not

So this means that the problem is in the Sphere.stl which 2.79 generates because the BlockMeshDicts are exactly same...

BR.
Eero
ekeero is offline   Reply With Quote

Old   November 8, 2017, 10:00
Default
  #263
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 178
Rep Power: 7
Flowkersma is on a distinguished road
Ok, thanks!

A new argument "use_selection" for the stl export has been introduced in the new Blender versions which was causing the bug. I just pushed a bug fix which resolves this.
Flowkersma is offline   Reply With Quote

Old   November 8, 2017, 10:10
Default
  #264
New Member
 
Eero Kokkonen
Join Date: Nov 2010
Posts: 4
Rep Power: 10
ekeero is on a distinguished road
Great, now it's all good!

Thanks for the very quick fix, the tool is great!

BR.
Eero
Flowkersma likes this.
ekeero is offline   Reply With Quote

Old   November 8, 2017, 15:04
Default
  #265
Member
 
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 66
Rep Power: 8
vigneshTG is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
Hi,


@Vignesh, this error is related to NumPy. You have too old version.

@Eero, your testcase works well on my computer. Can you look at the blockMeshDict file and see if the projections are listed there?

Regards, Mikko

Hi Mikko,
Thanks for the quick reply, i updated to the latest numpy (1.8.2). I don't get errors when i use Eero's file and i am able to build the mesh succesfully.

But when i try the sphere meshing tutorial from scratch, i get the same error as below.
(when i click build blocks the error starts showing.)

Code:
Traceback (most recent call last):
  File "/home/vignesh/blender/2.79/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/vignesh/blender/2.79/scripts/addons/swiftBlock/blockBuilder.py", line 105, in blockFinder
    tmp_v,tmp_e = cycleFinder(edges,range(len(vertices_coord)))
  File "/home/vignesh/blender/2.79/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'
Attached Files
File Type: gz sphere.tar.gz (96.5 KB, 0 views)
__________________
Thanks and Regards

Vignesh
vigneshTG is offline   Reply With Quote

Old   November 9, 2017, 05:16
Default
  #266
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 178
Rep Power: 7
Flowkersma is on a distinguished road
Hi Vignesh,

The latest numpy version is 1.13 and only that version has the axis argument for the numpy.unique function. When I have the time I will remove this dependency so that SwiftBlock works also with older versions of numpy.
Flowkersma is offline   Reply With Quote

Old   November 11, 2017, 06:06
Default
  #267
Member
 
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 66
Rep Power: 8
vigneshTG is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
Hi Vignesh,

The latest numpy version is 1.13 and only that version has the axis argument for the numpy.unique function. When I have the time I will remove this dependency so that SwiftBlock works also with older versions of numpy.
Hi Mikko,

I was finally able to solve the problem and get the mesh done. The error happens even if the numpy is updated to the latest version. It can be rectified by

Code:
copying the numpy folder  from the lib/python3.x/site-packages subdirectory of 
your local Python 3.x installation into the scripts/modules subdirectory of Blender
 (not into the python/lib/python3.2/site-packages subdirectory
This solves the problem.
__________________
Thanks and Regards

Vignesh
vigneshTG is offline   Reply With Quote

Old   November 13, 2017, 03:13
Default
  #268
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 178
Rep Power: 7
Flowkersma is on a distinguished road
Hi Vignesh,

I am glad to hear that you got SwiftBlock finally working!

I should have been more explicit with the installation. The numpy that Blender uses must be updated to latest version. Depending on your installation, Blender may use local numpy or it may come with its own numpy. The numpy version that Blender uses can be found by writing following to the Blender Python console:

Code:
import numpy; print(numpy.__version__)
Regards, Mikko
Flowkersma is offline   Reply With Quote

Old   April 9, 2019, 06:01
Smile Upgrade SwiftBlock to Blender 2.8?
  #269
New Member
 
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 10
Rep Power: 10
tkeskita is on a distinguished road
Hello @Flowkersma and @kalle,

I just tested Mikko's SwiftBlock version on Blender 2.79 with Numpy 1.16.2 and OpenFOAM.org 6. Great work! Does either one of you intend to upgrade your code to Blender 2.8? I recently made a snappyHexMesh GUI addon for Blender 2.8, and I'm thinking about trying to upgrade swiftBlock as well.

BR,
Tuomo
wyldckat likes this.
tkeskita is offline   Reply With Quote

Old   April 11, 2019, 03:41
Default
  #270
New Member
 
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 10
Rep Power: 10
tkeskita is on a distinguished road
Hello @Flowkersma and @kalle,


your github repositories seem to lack specification of license for your codes, although some single files include GPL headers. Could you please add an explicit LICENSE file to your repositories to make it clear, thanks!
wyldckat likes this.
tkeskita is offline   Reply With Quote

Old   April 28, 2019, 05:35
Default SwiftBlock upgraded to Blender 2.8 series
  #271
New Member
 
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 10
Rep Power: 10
tkeskita is on a distinguished road
Hello all,

I got license confirmation from @kalle, and now also Flowkersma repository has updated explicit LICENSE file (GPL v3). Thanks!

I went ahead and upgraded Flowkersma version of SwiftBlock to Blender 2.8 series (currently Blender 2.80 beta). The add-on source code and documentation is available at https://github.com/tkeskita/swiftBlock.


I hope to finetune a few more things in the add-on, but it should be working OK already now.


Happy meshing!
tkeskita is offline   Reply With Quote

Old   June 24, 2019, 07:27
Default
  #272
New Member
 
Tuomo Keskitalo
Join Date: Oct 2010
Posts: 10
Rep Power: 10
tkeskita is on a distinguished road
FYI: I've fixed one Blender API change in swiftBlock add-on. Since Blender 2.80 is getting ready I hope we will see less of these. You can post here if the add-on seems to be broken, thanks!
tkeskita is offline   Reply With Quote

Old   July 6, 2019, 12:47
Default blockMesh for blade Wind Turbine
  #273
New Member
 
Lazaro Alejandro Guillen Campos
Join Date: Mar 2019
Posts: 1
Rep Power: 0
l.guillen is on a distinguished road
Hello to the CFD community.

I have been understanding and using the SwiftBlock addon of Flowkersma for some time. I think it's really good, a great contribution. thanks to Kelly also for thinking about it.

I have little experience in OpenFOAM. I'm trying to make good meshes.

My job is that I'm trying to make wind turbine blades, a very complicated problem. Making the geometry of a blade carries a deep geometric analysis.

I have achieved with their SwiftBlock addon, do wonders to say it in some way, something that I can not do by hand.

At the moment I am trying to use SwiftBlock, to generate the blocks of a shovel from a Nrel benchmark, the Phase VI case.

I have found that the algorithm is very slow when looking for many blocks. I need to have the domain divided into many blocks because I need to make a mesh smoothing around the profile in each section, this generates hundreds and even more than a thousand blocks in the blade.


smoth profile.jpg

I have thought of several manual solutions, how to use the blocks from the profile to the type O domain, and add splines of the remaining vertices inside blockMeshDict or generate driving surfaces along the blade, from the profile to the domain type O.

I have tried SwiftBlock, for hours to find the blocks of a wind turbine blade but it does not work. It is possible that the algorithm fails when the number of blocks increases. I do not know either programming in python or blender python but it would be good to optimize it for large numbers of blocks.


bladeWindTurbine_many blocks.jpg

My idea is to look in the direction from the center of the figure to the outside, as if climbing, or in my case to start at the bottom of the profile and go up, and save the blocks each section of the blade and so consecutively.


approach.jpg

Sorry to extend, but I would like SwiftBlock addon to generate blocks much faster.

Regards of cuba
l.guillen is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On



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