CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Meshing & Mesh Conversion

SwiftSnap and SwiftBlock, GUIs for OpenFOAM's meshers

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree44Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   December 17, 2012, 12:45
Default
  #61
New Member
 
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 6
onyir is on a distinguished road
Thank you kalle, that did the trick
onyir is offline   Reply With Quote

Old   December 21, 2012, 11:31
Default nan in output blockMeshDict
  #62
qzt
New Member
 
Join Date: Aug 2012
Posts: 10
Rep Power: 4
qzt is on a distinguished road
Hi,

I am trying again with swiftBlock with a simple geometry built from blocks. I can get a nice block mesh when I press preview. However, when I write the file to blockMeshDict, it contains nan in the vertices' coordinates. As a result, blockMesh failed to read the dict file.

Can you have a look at the blender file and the output blockMeshDict ?

Thanks a lot,
Attached Files
File Type: zip nan in blockMeshDict.zip (84.1 KB, 6 views)
qzt is offline   Reply With Quote

Old   December 21, 2012, 13:15
Default
  #63
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
Hi,

There are 10 vertices in your mesh object "Plane.001" that I cannot see, and seems to be corrupted (Blender obviously say their coords are 'nan'). You can select them, by selecting all sound vertices, and then invert the selecting. Then just delete the bad ones. I've never seen this in Blender. Possibly I should add a check that vertices have finite values for their coords.

Please note that your block mesh structure will have internal baffles at the intersection, as you do not have block face matching there.


Kalle
kalle is offline   Reply With Quote

Old   December 21, 2012, 15:05
Default
  #64
qzt
New Member
 
Join Date: Aug 2012
Posts: 10
Rep Power: 4
qzt is on a distinguished road
Thanks Kalle.
After deleting those ghost vertices did solve this issue.
By the way, I guess the internal baffle you mentioned is the region marked by the white circle in the attach image. If so, how should I avoid them ?

I actually tried to remove those faces in blender (as shown in the 2nd attached image), but then the swiftBlock just don't mesh the whole geometry but just a part of it.

Cheers,
Attached Images
File Type: jpg internal baffle1.jpg (57.8 KB, 74 views)
File Type: jpg internal baffle2.jpg (47.2 KB, 67 views)
qzt is offline   Reply With Quote

Old   December 22, 2012, 06:21
Default
  #65
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
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

ps. I think the corrupted vertices are still there in the attached file. Remove them before trying to mesh.
Attached Files
File Type: gz nan.blend.gz (81.7 KB, 9 views)
kalle is offline   Reply With Quote

Old   December 29, 2012, 08:55
Default
  #66
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
Blender 2.65a is out! A quick test reveals that you have to replace the word "mergedist" on line 156 in utils.py for SwiftBlock with the word "threshold" to use the preview mesh function.

There might be other changes needed as well, and when I feel confident that I've found most of them, I'll update the repository.

Kalle
kalle is offline   Reply With Quote

Old   January 12, 2013, 23:02
Default Blender 2.65 swift utility installation
  #67
JFM
New Member
 
JFM's Avatar
 
John Anonymous
Join Date: Jan 2011
Location: Melbourne Australia
Posts: 18
Rep Power: 6
JFM is on a distinguished road
Hi Guys

Liking the util, Kalle keep up the good work.

Question - have just upgraded to blender 2.65 and cannot seem to get the swift functions to be found when creating the addon in the user preferences. I did have a semi-functional system under blender 2.64. I have downloaded the swift files from:
https://github.com/nogenmyr/swiftSnap
https://github.com/nogenmyr/swiftBlock

I have made sure that the files (in /scripts/addons/) are executable, but the .py files are not listed when trying to link to addons. Any ideas on what I am doing wrong.

Also I am working on a Minimum Energy Loss culvert model with OpenFOAM for my masters and being new to everything Linux are finding things to be a challenge at times - would anyone be willing to have a quick look at my blender model and make any suggestions?

Regards
JFM
JFM is offline   Reply With Quote

Old   January 13, 2013, 05:29
Default
  #68
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
I have just tried 2.65a quickly, and I imported settings from 2.64, so I did not have to do anything to enable the addons. If I enter the user preferences, they are there under the category "OpenFOAM". Note that you have to enable the "Support Level" "Community" to have access.

Or, do you mean that you do not find the actual user interface in Blender, even you have enabled them? Default they end up in the bottom of the "object" tab under the "properties" sub-window.

Also, be aware that you need to edit utils.py for 2.65 as mentioned above.

Let me know if you can get it to work.

K
kalle is offline   Reply With Quote

Old   February 1, 2013, 15:11
Default
  #69
kjw
New Member
 
Krzysztof Wołosz
Join Date: Oct 2010
Location: Poland
Posts: 14
Rep Power: 6
kjw is on a distinguished road
Well,
In the matter of fact I use your contribution all the time, and, to be honest, I do not want to test it with the newer version of blender. I had so many minor and major problems with too fast made upgrades of software that I would rather stay at good-working 2.64.
But, nonetheless, solute to you for the very good piece of work.

Regards
Krzysztof
kjw is offline   Reply With Quote

Old   February 3, 2013, 03:37
Default
  #70
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
Hi Krzysztof,

Thank you for your kind words. Glad they are appreciated, and can be of use!

As for Blender 2.65, I did not see any immediate benefits over 2.64 for these particular tools. 2.64 on the other hand had bugfixes that were necessary.

Regards,
Kalle
kalle is offline   Reply With Quote

Old   February 12, 2013, 06:42
Default SwiftBlock, Coarse/Fine
  #71
New Member
 
Patrik J.
Join Date: Feb 2013
Location: Finland
Posts: 4
Rep Power: 4
Ship is on a distinguished road
Hello

Please be informed that we are working on mesh intened for a ship in Blender. Now we need to understand how to use the Coarse/Fine buttons in the SwiftBlock meny. I have read the OpenFoamWiki SwiftBlock guide. The following instruction I do not understand:

"You can also choose wich cells on the graded edge that should meet the target resolution; select Fine or Coarse before pressing "Set grading".

Clould somebody advice me how to use the "Coarse/Fine " buttons....


Best regards
Patrik J.
Ship is offline   Reply With Quote

Old   February 12, 2013, 06:55
Default
  #72
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
The utility tries to make all cells meet the desired target resolution, and to maintain an aspect ratio of unity. However, if you want to use grading, you do not want/get aspect ratio unity. Still for each edge the utility needs to set the number of cells. For a graded edge, the user can then specify if it should be the cells on the coarse end that meet the target resolution, or if the fine end cells are supposed to meet the target resolution.

If you still have doubts, try playing around with a simple one-block mesh and see the result with the preview function, or ask here again.

K
kalle is offline   Reply With Quote

Old   February 12, 2013, 09:32
Default
  #73
New Member
 
Patrik J.
Join Date: Feb 2013
Location: Finland
Posts: 4
Rep Power: 4
Ship is on a distinguished road
Hello

Thanks a lot Kalle!!
-P
Ship is offline   Reply With Quote

Old   February 18, 2013, 03:31
Default SwiftBlock, Cylinder example \ Mesh
  #74
New Member
 
Patrik J.
Join Date: Feb 2013
Location: Finland
Posts: 4
Rep Power: 4
Ship is on a distinguished road
Hello

Please be informed that I have reproduced the cylinder case as distributed earlier as follows:

1. First I used Rhinoceros 4.0 to make two closed polyline curves with 32 points each, (shaped like a circle).
2. Then I exported the two closed curves in form of a *.obj format.
3. In blender I imported the two closed curves and I used commands alt+c and Ctrl+J.
4. Then I made the block structure as in earlier example.

My question is now how do I get the mesh uniformly all over the cylinder, please see enclosed file for more information. The mesh seems to bee "doubled"??

Best regards
Patrik J.
Helsinki


Attached Files
File Type: zip cylinder_PJo5.zip (80.6 KB, 5 views)
Ship is offline   Reply With Quote

Old   February 18, 2013, 06:52
Default
  #75
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
Hi,

your circles are broken, in that they are not fully connected, which causes the shortest-path algorithm to take an unexpected path. Select one vertex in the circle and press and hold Ctrl+NumPad+, and you will see where the missing edge should be.

K
kalle is offline   Reply With Quote

Old   February 18, 2013, 08:44
Default
  #76
New Member
 
Patrik J.
Join Date: Feb 2013
Location: Finland
Posts: 4
Rep Power: 4
Ship is on a distinguished road
Thanks
I found the gap... (good command)
-Patrik
Ship is offline   Reply With Quote

Old   March 10, 2013, 08:43
Default
  #77
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
Folks,

Blender 2.66 was released recently. I have not found any new tools useful for the plug-ins, but I decided to update the two tools to make them compatible with the most recent version anyway. I have not looked at the new snappyHexMesh 2.2, but there might be some changes in the setup, so I do not know how well swiftSnap works with the new version.

I have disabled logging by default in swiftBlock. If you want to write the logs, you can click to enable them in the write dialogue.

swiftBlock has now a new hidden feature. Select two or more edges in your block structure and press space with the mouse pointer in the 3D view port. Write "Insert smoother" in the pop-up and press Enter. Now a smooth profile will be added for each edge to the Blender object carrying your polyLines. This feature makes most sense for O-block structures, as shown in the attached image.

Kalle
Attached Images
File Type: jpg smoothOblock.jpg (31.5 KB, 61 views)
kalle is offline   Reply With Quote

Old   March 10, 2013, 09:06
Default
  #78
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Kalle,

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
wyldckat is offline   Reply With Quote

Old   March 10, 2013, 14:50
Default A little swiftBlock problem
  #79
kjw
New Member
 
Krzysztof Wołosz
Join Date: Oct 2010
Location: Poland
Posts: 14
Rep Power: 6
kjw is on a distinguished road
Hello,
As in title there is a little problem during preview mesh or when writing blockMeshDict.
Perhaps someone could explain me what the following blender info means:

Code:
Traceback (most recent call last):
  File "/home/kjw/bin/blender-2.64a-linux-glibc27-x86_64/2.64/scripts/addons/snapBlock/__init__.py", line 790, in execute
    N = obj['bevelToResMap'][str(round(e.bevel_weight*100))]
KeyError: 'key not in subgroup dict'

location:<unknown location>:-1
Thanks in advance

Krzysztof
kjw is offline   Reply With Quote

Old   March 10, 2013, 15:30
Default
  #80
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 252
Rep Power: 12
kalle is on a distinguished road
I see that you use Blender 2.64a. Which version of swiftBlock are you using?

K
kalle is offline   Reply With Quote

Reply

Thread Tools
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 06:20.