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 2, 2015, 14:26
Default
  #221
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi,

You have two objects in your blender file (Cube and Cylinder). Seems like you want to mesh the Cube. You have created the geometry but you are missing the blocking which is necessary for the mesh.

Regards,
Mikko
Flowkersma is offline   Reply With Quote

Old   November 2, 2015, 20:01
Default
  #222
Member
 
Zhifang Hu
Join Date: Sep 2015
Location: Brisbane
Posts: 54
Rep Power: 11
ce73stargazer is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
Hi,

You have two objects in your blender file (Cube and Cylinder). Seems like you want to mesh the Cube. You have created the geometry but you are missing the blocking which is necessary for the mesh.

Regards,
Mikko
Thanks for the reply, i've played around it again yesterday. It looks working atm, but it has a really werid mesh structure, i am not sure why.
I dont know why there is a cone shape on the top, the the bottom one looks weird as well
Attached Images
File Type: jpg Screenshot from 2015-11-03 09:55:47.jpg (101.5 KB, 69 views)
Attached Files
File Type: gz BaseGeo.blend.tar.gz (68.7 KB, 2 views)
ce73stargazer is offline   Reply With Quote

Old   November 3, 2015, 03:45
Default
  #223
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
SwiftBlock is snapping to the geometry in a way you are not expecting. Use "straight" feature for the edges that you don't want snapping. Also I think you don't want mesh inside the pipe and therefore you should define a "disabled" group in which you put the vertices of the pipe block.
Flowkersma is offline   Reply With Quote

Old   December 12, 2015, 11:13
Default BlockMesh PATH?
  #224
New Member
 
Seokwon Whang
Join Date: May 2012
Posts: 25
Rep Power: 14
hswzzz is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
Hi everyone,

Here is my fork of the SwiftBlock (https://github.com/flowkersma/swiftBlock). It supports the new BlockMesh multi-grading feature. I found a couple of bugs in the new multi-grading feature which has been fixed in the latest OpenFOAM repository release (OpenFOAM 2.4.x). Thus, the latest repository release is required for this fork. It also launches the BlockMesh in the background when previewing the mesh and therefore the BlockMesh must be in the PATH.

The new meshing parameters are:
  • "dx1", "dx2" first cell sizes at the two ends of an edge
  • "exp1", "exp2" cell expansion ratio at the two ends of an edge
  • "maxdx" maximum cell size
  • "Copy to parallel edges" copies the meshing parameters to all parallel edges

I made a short example video which shows how to use the multi-grading and copy to parallel edges https://www.youtube.com/watch?v=bwrfuQVQ7gI

I made another video which shows how to mesh bended pipe with o-grid http://youtu.be/ZY7WDP6w7YA

Please let me know what you think about it

I don't understand "Thus, the latest repository release is required for this fork. It also launches the BlockMesh in the background when previewing the mesh and therefore the BlockMesh must be in the PATH. "

When I press 'preview' button, the error occurs from...

(
class PreviewMesh():
def __init__(self, tempdir=None):
if not shutil.which('blockMesh'):
raise RuntimeError('ERROR: No BlockMesh Found!')
)
hswzzz is offline   Reply With Quote

Old   December 13, 2015, 04:19
Default
  #225
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Seems like you don't have blockMesh in your PATH environment variable. Probably if you launch Blender from terminal it will help. SwiftBlock with multi-grading works with OpenFOAM 3.0.
Flowkersma is offline   Reply With Quote

Old   December 13, 2015, 20:29
Default
  #226
New Member
 
Seokwon Whang
Join Date: May 2012
Posts: 25
Rep Power: 14
hswzzz is on a distinguished road
yes.. I use OF230... I will try it with OF300.
Thank you!
hswzzz is offline   Reply With Quote

Old   January 4, 2016, 00:25
Default
  #227
Member
 
Zhifang Hu
Join Date: Sep 2015
Location: Brisbane
Posts: 54
Rep Power: 11
ce73stargazer is on a distinguished road
Hi there

Happy new year.

I was using swiftblock fine last year, however when i tried the same thing this year, it turned out some weird problem with the preview function (show in the pic).

The picture shows the example case and i get the same error for my own case. So i thought its not the problem caused by my own setup.

I know nothing about python, hence i dont have the ability to track down the problem myself. Anyone have any suggestion on how i can overcome this problem?

Many Thanks.
Attached Images
File Type: jpg Screenshot from 2016-01-04 14:14:26.jpg (94.6 KB, 68 views)
File Type: jpg Picture1.jpg (43.5 KB, 44 views)
ce73stargazer is offline   Reply With Quote

Old   January 4, 2016, 11:03
Default
  #228
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Hi!

Ok, some 16-year-too-late millennium bug :-) You are using Flowkersma's code, https://github.com/flowkersma/swiftBlock, and the error relates to code specific to that version. I leave it to him to answer this.

Kalle
kalle is offline   Reply With Quote

Old   January 4, 2016, 15:59
Default
  #229
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi,

Seems like you have created the blocking with the original swiftBlock and now you are trying to open it with my fork. To overcome this you may copy the blocking to a new object and then enable the swiftBlock again. You can copy the blocking to a new object by first selecting all in edit mode (press A) and then pressing P and choose selection.

Mikko
Flowkersma is offline   Reply With Quote

Old   January 15, 2016, 11:01
Default
  #230
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
Hi,

Seems like you have created the blocking with the original swiftBlock and now you are trying to open it with my fork. To overcome this you may copy the blocking to a new object and then enable the swiftBlock again. You can copy the blocking to a new object by first selecting all in edit mode (press A) and then pressing P and choose selection.

Mikko
There is a easier solution for this. Just click space and search for function "Enable Swiftblock" and then it should work.
Flowkersma is offline   Reply With Quote

Old   February 1, 2016, 10:16
Default
  #231
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 14
Maimouna is on a distinguished road
Hi all,

I'm just trying to use swiftBlock in order to use it for such OpenFOAM cases. How could extract swiftBlock to addons directory? If you have any useful tutorial that would be great. As I'm new in blender and swiftBlock, I need to understand the way of work step by step.

Many thanks in advanced.

Maimouna
Maimouna is offline   Reply With Quote

Old   February 1, 2016, 18:59
Default
  #232
Member
 
Zhifang Hu
Join Date: Sep 2015
Location: Brisbane
Posts: 54
Rep Power: 11
ce73stargazer is on a distinguished road
Quote:
Originally Posted by Maimouna View Post
Hi all,

I'm just trying to use swiftBlock in order to use it for such OpenFOAM cases. How could extract swiftBlock to addons directory? If you have any useful tutorial that would be great. As I'm new in blender and swiftBlock, I need to understand the way of work step by step.

Many thanks in advanced.

Maimouna
Hi

I was learning swiftblock and blender few months ago, Here is the link i found on youtube for swiftblock tutorial

https://www.youtube.com/watch?v=a3ULmJe8I1o

Its not that easy to follow, but after you watch it few times, it explains itself. Hopefully thats helpful.
ce73stargazer is offline   Reply With Quote

Old   February 2, 2016, 06:55
Default
  #233
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 14
Maimouna is on a distinguished road
Quote:
Originally Posted by ce73stargazer View Post
Hi

I was learning swiftblock and blender few months ago, Here is the link i found on youtube for swiftblock tutorial

https://www.youtube.com/watch?v=a3ULmJe8I1o

Its not that easy to follow, but after you watch it few times, it explains itself. Hopefully thats helpful.
HiZhifang Hu,

many thanks for your reply. But before this step, I couldn't able to extract swiftBlock to addons directory. Any help please? Send me please your way to install blender and then extract swiftBlock. May be I did someting wrong during installation.

lots of thanks in advanced.

Maimouna
Maimouna is offline   Reply With Quote

Old   February 2, 2016, 09:10
Default
  #234
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi,

Here are the steps for Linux:
  1. Download the latest version of Blender from www.blender.org
  2. Go to your blender/2.7x/scripts/addons/ directory
  3. write "git clone https://github.com/nogenmyr/swiftBlock" or "git clone https://github.com/flowkersma/swiftBlock" depending on which version you want
  4. Open your Blender and then activate SwiftBlock by opening user preferences (CTRL+ALT+U), Add-ons tab, OpenFOAM category on left and then check the enable add-on box next to OpenFOAM: SwiftBlock.
I just updated my fork for a bit. Now the Repair function should work again.


Regards, Mikko
Flowkersma is offline   Reply With Quote

Old   February 2, 2016, 12:13
Default
  #235
Senior Member
 
ok
Join Date: Oct 2013
Posts: 346
Rep Power: 14
Maimouna is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
Hi,

Here are the steps for Linux:
  1. Download the latest version of Blender from www.blender.org
  2. Go to your blender/2.7x/scripts/addons/ directory
  3. write "git clone https://github.com/nogenmyr/swiftBlock" or "git clone https://github.com/flowkersma/swiftBlock" depending on which version you want
  4. Open your Blender and then activate SwiftBlock by opening user preferences (CTRL+ALT+U), Add-ons tab, OpenFOAM category on left and then check the enable add-on box next to OpenFOAM: SwiftBlock.
I just updated my fork for a bit. Now the Repair function should work again.


Regards, Mikko
Manny thanks Mikko, all done.

Now, I could start learning swiftBlock how its work.

Best regards

Maimouna
Maimouna is offline   Reply With Quote

Old   July 28, 2016, 15:34
Default 3D tank with a floating cylinder
  #236
Member
 
Gautami Erukulla
Join Date: Mar 2009
Posts: 71
Rep Power: 17
gautami is on a distinguished road
P { margin-bottom: 0.08in; }A:link { } Dear All,


I was able to successfully download blender and swiftBlock and work on the example tutorial following the directions as given by Mr. Flowkersma. Thank you for detailed explanation.
(OpenFOAM version 2.3, blender version 2.66a and swiftBlock was from the following link:https://github.com/nogenmyr/swiftBlock.git)


Kindly can anyone please guide me as to how to create a 3D tank with a 3D floating object using swiftBlock. Similar to the the computational domain as in 'floatingObject' tutorial where in the 'topoSet' option was used.

How to create a cylinder in a 3D tank (cube/cuboid) using swiftBlock?. Thank you.


Most&More,
Gautami Erukulla.
gautami is offline   Reply With Quote

Old   September 27, 2016, 11:38
Default
  #237
New Member
 
Simon Johansson
Join Date: Sep 2011
Posts: 15
Rep Power: 15
Simjoh is on a distinguished road
I just found the swiftblock and really appreciate the work done. However I struggle to get it to work in blender 2.77. And I've already done the mistake to not using git clone so I think I installed it the correct way now.
Can anyone please confirm that it works with this blender version. For me it doesn't.
I'm a beginner of blender as well but I've been able do dig through my error messages and I think I found the error and I think it is the the lines 89-92 in __init__.py that causes the problem
Code:
            try:
                bpy.ops.mesh.select_vertex_path(type='EDGE_LENGTH')
            except:
                bpy.ops.mesh.shortest_path_select(use_length=True)
I can only guess but the try and except are probably used to handle different blender version. And to version 2.77 the function bpy.ops.mesh.shortest_path_select() need some more parameters.
I tried
Code:
            try:
                bpy.ops.mesh.select_vertex_path(type='EDGE_LENGTH')
            except:
                bpy.ops.mesh.shortest_path_select(use_face_step=False, use_topology_distance=False, nth=inf, skip=1, offset=0)
which are the API default settings. But since I'm too much of a beginner with the blender terminology I'm stuck here.

Also since the try and except doesn't allow multiple exceptions without more sophisticated error handling it might be an idea to check for different blender versions.

I save you some googling by attaching the links. The functions are marked in yellow in both links.
https://www.blender.org/api/blender_...st_path_select

https://www.blender.org/api/blender_...st_path_select

Really appreciate any help or guidance
Simon
Simjoh is offline   Reply With Quote

Old   September 27, 2016, 12:11
Default
  #238
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi Simon,

I got the same error as you did so it seems like SwiftBlock is not compatible with Blender 2.77. However, as you suggested, by replacing
Code:
bpy.ops.mesh.shortest_path_select(use_length=True)
with
Code:
bpy.ops.mesh.shortest_path_select()
it seems to work again. Actually, this should work with older versions of Blender as well because use_length=True is the default value.
Best,
Mikko
Flowkersma is offline   Reply With Quote

Old   September 27, 2016, 15:48
Default
  #239
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Errors like these are very typical when taking addons to a new version. Blender's API is constantly changing. Finding all these issues is a rather lengthy process to carry out, and is the major reason why I do not update the addons along with Blender. Old versions of Blender are also easily available, and newer versions do not provide any advantages when it comes to these addons... afterall, this is not the stuff Blender was designed for :-)

Get back if you have more trouble!

Kalle
kalle is offline   Reply With Quote

Old   September 27, 2016, 16:06
Default
  #240
New Member
 
Simon Johansson
Join Date: Sep 2011
Posts: 15
Rep Power: 15
Simjoh is on a distinguished road
I fully understand your point Kalle. I might install a slightly older version of blender then. Just thought that it might be a simple task too update.
But I can see that it is hard too keep the script updated for each and every single update of blender. Thanks for a great job!
Simjoh 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.