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 Tree70Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 16, 2013, 03:52
Default
  #101
New Member
 
Ryan Balmer
Join Date: Apr 2013
Posts: 6
Rep Power: 12
Balmer is on a distinguished road
Thankyou for all your help so far,
I feel I am really making great progress.
I have tried attempted numerous trials following the examples in this post closely such as cylinder , quarter cylinder and the swiftblock example, but most cause blender to crash etc.
I did manage to get a blockMeshDict on one the trials but seem to be going backwards now. I have attached some files and was hoping you could point me in the right direction with generating a good blockmeshfile

(* I could only fit the .blend file that I have been using as a foundation and the blockMeshDic that was produced during a trial.)

cheers
Attached Files
File Type: zip Starting file + mesh.zip (77.1 KB, 7 views)
Balmer is offline   Reply With Quote

Old   May 16, 2013, 04:35
Default
  #102
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
I believe this is what you want.

I made this in 2.67, so I do not know how well it opens in older blender versions. swiftblock seems to run smooth in 2.67 so far.

K
Attached Files
File Type: zip Mesh_structure(beg).zip (75.0 KB, 22 views)
Balmer likes this.
kalle is offline   Reply With Quote

Old   May 18, 2013, 05:07
Default
  #103
New Member
 
Ryan Balmer
Join Date: Apr 2013
Posts: 6
Rep Power: 12
Balmer is on a distinguished road
That is brilliant, thnakyou so much.

I now have created a new bump profile as before , but a much finer STL import, but following same foundation as the last file you sent me, I keep getting "preview mesh is empty, too few vertices selected or broken mesh structure". What would be the cause for this or solution etc.

Also
1. what is the limit or factors that cause a higher resolution to crash.
2. is is possible to just set the lower wall (bump) to a much greater resloution.

Thnx in advance.
Balmer is offline   Reply With Quote

Old   May 18, 2013, 06:55
Default
  #104
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
You can chose to preview just a subset of the mesh by selecting vertices. If too few are selected or your block structure is broken you get the warning. It is a bit stupid that swiftblock has edge selection mode after the warning. By that, you do not immediatly see which vertices you have selected. I'll change it such that it ends in vertex selection mode. I'll push to repo soon.

1. The limit is uncertain. Blender crashes if the meshes becomes too large, but I do not know if there is a certain max. This is also one of the reasons you can preview a subset of the mesh. If you want higher resolution, you can preview using a coarse mesh, and then write blockmeshdict with your target resolution. During blockmeshdict writing, there is no limit on resolution.

2. Not sure what you mean with this. block structured meshes have certain limitations that swiftblock/blockmesh cannot circumvent. You can however refine subsets of the mesh using "refineHexMesh" after running blockmesh. Then your resulting mesh will not be a pure hexahedral block structured mesh (but that is still fine with openfoam)

K
kalle is offline   Reply With Quote

Old   May 30, 2013, 16:40
Default
  #105
Member
 
Jace
Join Date: Oct 2012
Posts: 77
Rep Power: 15
zhengzh5 is on a distinguished road
Sorry, problem solved when I updated blender and the script to 2.66a. Thanks!
zhengzh5 is offline   Reply With Quote

Old   July 16, 2013, 02:32
Default Dimple Structure
  #106
New Member
 
Ryan Balmer
Join Date: Apr 2013
Posts: 6
Rep Power: 12
Balmer is on a distinguished road
Kalle you have been more than accommodating with all my queries so far, and for that i cannot thank you enough. My Supervisor and I are quite pleased with the mesh generation produced with the blender software for the bump structure you helped me with before. I was now wondering if I was to add say dimple structures to this bump would blender be able to cope and produce a suitable blockmesh.dic. I have included a rough example to illustrate what I mean that i have not been able to get up a running as of yet.

Thnx
Attached Files
File Type: zip dimple.zip (82.7 KB, 15 views)
Balmer is offline   Reply With Quote

Old   July 16, 2013, 04:26
Default
  #107
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Thank you for your kind words.

The geometry you attached is actually not that easy to mesh with a block structured mesher. In the case of standard blockMesh it is not even possible to mesh a sphere with a nice mesh, due to lacking body fit capability. (there is a body fit development blockMesh available, but it is still too slow to be used in practice: http://www.cfd-online.com/Forums/ope...tml#post435668)

For the case you presented, I would go for snappyHexMesh. There are also other open source alternatives such as enGrid to produce tet- or polyhedral meshes.

If you go for snappyHexMesh, swiftSnap may help you out well, since you are already familiar with Blender.

Good luck,
Kalle
kalle is offline   Reply With Quote

Old   September 3, 2013, 15:48
Default
  #108
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Dear all,

I just pushed an updated swiftSnap. You can now chose to export surfaces as either obj or stl. Default setting is obj.

Both my tools seems to run smooth also on 2.68a.

Happy meshing,
K
wyldckat, romant and abacus++ like this.
kalle is offline   Reply With Quote

Old   September 5, 2013, 04:20
Default
  #109
New Member
 
Florent Henon
Join Date: Dec 2012
Posts: 7
Rep Power: 13
abacus++ is on a distinguished road
Thank you very mutch for your work Kalle!
cheers
abacus++ is offline   Reply With Quote

Old   September 5, 2013, 16:43
Default
  #110
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Thank you!

Looks like the newer sHM supports specification of patch types... I'll try to add when I get the time.

K
wyldckat likes this.
kalle is offline   Reply With Quote

Old   September 10, 2013, 16:59
Default
  #111
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
... so patch type settings added to SwiftSnap. You can chose from patch, wall and cyclicAMI. Did I miss any useful type? 2D types like empty and wedge I left out, since sHM is a 3D mesher. cyclic and symmetryPlane are banned (according to developers)

Note: This is not backwards compatible with .blend files saved with previous SwiftSnap due to extra info now stored in materials. If you do want reuse old case, you can manually set all the patches again, and it should be alright.

Edit: The example at the wiki was updated
kalle is offline   Reply With Quote

Old   September 27, 2013, 20:59
Default swiftSnap doesn't work for blender 2.68a
  #112
Senior Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 13
keepfit is on a distinguished road
Error info as follows:

Quote:
connect failed: No such file or directory
Read new prefs: /home/dao/.config/blender/2.68/config/userpref.blend
fake_module: addon missing 'bl_info' gives bad performance!: '/home/dao/.config/blender/2.68/scripts/addons/swiftSnap/__init__.py'
fake_module: addon missing 'bl_info' gives bad performance!: '/home/dao/.config/blender/2.68/scripts/addons/utils.py'
and the snappyHexMesh.dict like this: (expected pathch STL: top, walls and bottom)

Quote:
geometry
{
top.stl
{
type triSurfaceMesh;
name top;
}
top.stl
{
type triSurfaceMesh;
name top;
}
top.stl
{
type triSurfaceMesh;
name top;
}
....
};
When I copy the old version of 2.66 to the 2.68 addons folder, only 1 STL file can be generated (last patch).

How to figure out this?

Best,

David
keepfit is offline   Reply With Quote

Old   September 28, 2013, 05:36
Default
  #113
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Hi,

Can you try to get a fresh version of swiftsnap from the git repo? I cannot seem to repeat your problem on my machine.

Kalle
kalle is offline   Reply With Quote

Old   October 5, 2013, 13:00
Default Engrid...
  #114
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Engrid is also a nice mesher. And it's Blender import format is very easy. Therefore I decided to add some lines to SwiftSnap, such that it will output a file called "engrid.begc" in the same directory as snappyHexMeshDict. The lines comes almost entirely from the Blender addon shipped with Engrid.

Hence, you can now export to Engrid from just one Blender mesh object, where the individual patches are tracked in Blender using different materials, rather than having each patch as a separate object in Blender.

This might be handy when you want to give Engrid a try as an alternative to snappyHexMesh. The polyhedral feature seems interesting.

Kalle
wyldckat likes this.
kalle is offline   Reply With Quote

Old   October 7, 2013, 10:35
Default
  #115
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
A change in Blender's python API made SwiftBlock fail on finding shortest path. A try/except should make SwiftBlock compatible with Blender 2.66-2.68 series.

K
kalle is offline   Reply With Quote

Old   November 11, 2013, 14:45
Default
  #116
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
If you've had problems defining feature edges in SwiftSnap, it might have been because you happened to click "Enable" while being in edit mode. That is now fixed with the last commit. For fixing existing Blender SwiftSnap models, enable storing of edge crease and edge bevel under Geometry Data under the Object data tab. After deleting all feature settings, you should be good to go.

Sorry for the inconvenience.

Kalle
wyldckat likes this.
kalle is offline   Reply With Quote

Old   November 11, 2013, 19:12
Default Swiftsnap not picking up all solids
  #117
New Member
 
Shane Slater
Join Date: Nov 2013
Posts: 7
Rep Power: 12
Shaney is on a distinguished road
Hi Kalle,

Thanks so much for creating Swiftsnap - I'm new to it and blender but after today I am getting the hang of it. Its such a useful tool, well done!

One problem I cannot solve: I am doing tests creating simple meshes in Blender e.g. a cube and a cylinder, then joining them with ctrl-J,

Swiftmesh allows you to add patches as required anywhere on the resulting object, but when you export the OpenFoam files, it seems that only one of the original meshes gets used by snappyHexMesh.

So for example, when I have a cube, with a pipe going in, representing an inlet, and another pipe representing an outlet, the resulting mesh from sHM is just the cube, but with slight depressions where the cylinders were....

Have you any ideas
Thanks
Shane
Shaney is offline   Reply With Quote

Old   November 14, 2013, 08:14
Default
  #118
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Thanks for the kind words!

I think your problem is that you simply joined the two objects with Ctrl-J. You should do a boolean operation to join them instead. As it is now, you probably have internal faces in our Blender model, which will cause sHM to only fill up the region accessible without passing any walls around our "locationInMesh". You have to make your model in Blender fully open inside. Normally a boolean union operation will do this for you.

If you cannot solve this, you can send or post the .blend file.

Regards,
Kalle
kalle is offline   Reply With Quote

Old   November 26, 2013, 17:27
Default Snapping mesh
  #119
New Member
 
Shane Slater
Join Date: Nov 2013
Posts: 7
Rep Power: 12
Shaney is on a distinguished road
Hi Kalle

I am completely stuck!

Having tested swiftsnap successfully, I now am stuck. blender is not writing a mesh to use in "castellated mesh controls" (and there is no setting in castellated mesh controls in the sNH.dict . So all that happens our of sNH is you get a cartesian grid with some cells removed, but no record of surfaces.

Its wierd because your pipebend case works fine (cells snapping to surfaces) so I cannot see the setting that makes this work!
Have you any idea what I could be doing wrong? I am sure I got it working on a test case but I cannot repeat that success!


Please help.;
THanks
Shane
Shaney is offline   Reply With Quote

Old   November 26, 2013, 20:14
Default
  #120
New Member
 
Shane Slater
Join Date: Nov 2013
Posts: 7
Rep Power: 12
Shaney is on a distinguished road
Hi Kalle,

I've tried to sort it tonight but failed.

while I can get feature snapping to work fine, it is the surface snapping that does not work. So I end up with castellated meshes. In my working directory, sNH does not make a 0/ directory, so all the snapped cells never get made.

In the sHM dict, the "snapping" and "add layers" is true. I just cannot see what the problem is, either in the sHM.dict file or in the swiftSnap interface...

any ideas greatly welcome.
Shaney 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 Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 22:00.