CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swiftBlock/swiftSnap] SwiftSnap and SwiftBlock, GUIs for OpenFOAM's meshers (https://www.cfd-online.com/Forums/openfoam-community-contributions/100604-swiftsnap-swiftblock-guis-openfoams-meshers.html)

Balmer May 16, 2013 02:52

1 Attachment(s)
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

kalle May 16, 2013 03:35

1 Attachment(s)
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

Balmer May 18, 2013 04:07

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.

kalle May 18, 2013 05:55

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

zhengzh5 May 30, 2013 15:40

Sorry, problem solved when I updated blender and the script to 2.66a. Thanks!

Balmer July 16, 2013 01:32

Dimple Structure
 
1 Attachment(s)
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

kalle July 16, 2013 03:26

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 September 3, 2013 14:48

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

abacus++ September 5, 2013 03:20

Thank you very mutch for your work Kalle! :)
cheers

kalle September 5, 2013 15:43

Thank you!

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

K

kalle September 10, 2013 15:59

... 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

keepfit September 27, 2013 19:59

swiftSnap doesn't work for blender 2.68a
 
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

kalle September 28, 2013 04:36

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 October 5, 2013 12:00

Engrid...
 
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

kalle October 7, 2013 09:35

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 November 11, 2013 13:45

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

Shaney November 11, 2013 18:12

Swiftsnap not picking up all solids
 
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

kalle November 14, 2013 07:14

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

Shaney November 26, 2013 16:27

Snapping mesh
 
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 November 26, 2013 19:14

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.


All times are GMT -4. The time now is 09:43.