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   July 19, 2015, 07:18
Default
  #201
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Ok, I thought that there might be some reason why it doesn't suit to this purpose. I will give it a try and report about any problems
Flowkersma is offline   Reply With Quote

Old   August 13, 2015, 08:44
Default
  #202
Member
 
Camille Bilger
Join Date: Jul 2013
Posts: 43
Rep Power: 13
kmou is on a distinguished road
Hello Kalle, and others,

I have a blockMeshDict file which I can transform into a .obj file using "blockMesh -blockTopology"
I then can import this .obj file into Blender 3D (Using File, Import, Wavefront)

I can see the outline of my mesh/blocks, but I don't seem to find how to select it/edit it. If at all possible.
Can I change the dimensions,cell counts etc?
Thank you
kmou is offline   Reply With Quote

Old   August 13, 2015, 08:54
Default
  #203
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21
kalle is on a distinguished road
Interesting idea. Never thought of that, but it sounds good!

Else, this is a question of handling Blender. Normally, just press Tab key to enter Edit mode. There are plenty of tutorials on the web for learning Blender (which I really recommend to learn, not only for meshing)

K
kalle is offline   Reply With Quote

Old   August 13, 2015, 09:32
Default
  #204
Member
 
Camille Bilger
Join Date: Jul 2013
Posts: 43
Rep Power: 13
kmou is on a distinguished road
Hi Kalle,

Thank you for your quick reply,Yes I did put Edit mode ON, but I cannot seem to be able to do anything. I thought it would be worth asking if this was a common problem.
kmou is offline   Reply With Quote

Old   August 13, 2015, 10:14
Default
  #205
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Thanks for great tip! I did not know that it is so easy to import the blocking to Blender. I just tried it for pitzDaily and it seems to work perfectly. Here are the steps to import blocking from OpenFOAM:
1. run "blockMesh -blockTopology" which creates blockTopology.obj file
2. import the blockTopology.obj to Blender (File, Import, Wavefront)
3. Press the blockTopology active in the Outliner
4. Enable swiftBlock
5. Preview works now for me and I can change the blocking
wyldckat and aminem like this.

Last edited by Flowkersma; August 14, 2015 at 03:00.
Flowkersma is offline   Reply With Quote

Old   August 14, 2015, 06:04
Default
  #206
Member
 
Camille Bilger
Join Date: Jul 2013
Posts: 43
Rep Power: 13
kmou is on a distinguished road
Hi Flowkersma,

I'm glad that tip worked for you
I'm also trying to make it work with pitzDaily!
But I cannot...maybe you can help.

1/ I have pressed the blockTopology active in the Outliner.

2/ Should I then press the "cube" icon? underneath the Outline in the horizontal bar ?

3/ I do see Enable SwiftBlock, which I did.

4/ But I still cannot change from "Solid" view to "wireframe", or select faces etc.

Thank you for your help
kmou is offline   Reply With Quote

Old   August 14, 2015, 06:28
Default
  #207
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi kmou,

Modifying the geometry (vertices, edges and faces) has nothing to do with the swiftBlock addon thus when you have imported the blocking, you can straight start modifying the geometry (=blocking). After you're satisfied with the blocking, you can activate swiftBlock and modify the meshing parameters (cell size, grading etc.).

Maybe your cursor is in the wrong place when you're trying to switch from object mode to edit mode. Try to do everything with mouse:
1. Import the blocking
2. Activate the blockTopology in outliner
3. Press "Object Mode" dropdown list in the lower left corner of the 3D view and change it to "Edit Mode"
4. Now try to drag vertex/edge

Does it work?
Flowkersma is offline   Reply With Quote

Old   August 14, 2015, 06:41
Default
  #208
Member
 
Camille Bilger
Join Date: Jul 2013
Posts: 43
Rep Power: 13
kmou is on a distinguished road
Hi Flowkersma,

Thanks again for a prompt reply.

Ah that works, I can drag vertices and edges as you suggested.

But I still cannot move to "Solid" view and select Faces to Subdivide them - create more cells. Is that's the way to do it?

I know that I definitely have to learn more about using Blender and SwiftBlock...
kmou is offline   Reply With Quote

Old   August 14, 2015, 06:56
Default
  #209
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
First you'll have to understand the concept of blockMesh In Blender you are designing the blocking which is the "fishbone" of the mesh. Then with swiftBlock you'll choose resolution of the mesh by defining the mesh size on each edge of the blocking. If you're not satisfied with the rectangular cells, you can add grading to the edges thus make one side of the cell longer than the other. So I suggest you to first learn the concept of blockmesh and then how to make a blockMesh with Blender/SwiftBlock.

If you want to change from solid view to wireframe press the dropdown on the right "Object mode" dropdown and choose "wireframe".
Flowkersma is offline   Reply With Quote

Old   August 14, 2015, 07:30
Default
  #210
Member
 
Camille Bilger
Join Date: Jul 2013
Posts: 43
Rep Power: 13
kmou is on a distinguished road


Yes I have been meshing with blockMesh for a couple of years now, it's the Blender layout that I'm new to.

So if I understand correctly, once blocking is done, and I proceed with the SwiftBlock settings, I need to select an edge on the 3D object, and then modify number of cells on it, and edgeGrading.
And repeat for every single edge?


For the "Method to Display" the 3D object, yes I am trying to switch but it does not work. It's weird, it works for the Default Cube but not the imported blockTopology.

My main need while switching to using blender is to hopefully create an internal baffle, by selecting a set of faces.

kmou is offline   Reply With Quote

Old   August 14, 2015, 08:40
Default
  #211
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Ok, sorry I got it wrong about your blockMesh skills.

At the moment there are two ways to define the cell size. You can define a global cell size for all the edges with the "Resolution" input or you can force a number of cells to an edge/edges by first selecting the edge/edges and then defining "# cells" and pushing "force resolution" button. Latter is also the way to define grading.

Note that when you import the blocking there are no faces at all and therefore the two views look the same. The faces are only necessary if you want to define boundary conditions. To create a face, select the 4 edges or vertices of the face and press "F". There are a few tutorial videos which could be helpful if you haven't already watched them.
Flowkersma is offline   Reply With Quote

Old   August 14, 2015, 08:45
Default
  #212
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
BTW I have been developing the blockMesh's new multi-grading feature to SwiftBlock. It is almost ready and it will be released soon (1-2 weeks). It also supports defining the grading to all parallel edges at the same time.
kalle, ssss and NRAE like this.
Flowkersma is offline   Reply With Quote

Old   September 2, 2015, 13:05
Default
  #213
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
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
wyldckat, nlc, lourencosm and 2 others like this.
Flowkersma is offline   Reply With Quote

Old   September 2, 2015, 13:47
Default
  #214
Member
 
Join Date: Aug 2012
Posts: 68
Blog Entries: 1
Rep Power: 14
Nucleophobe is on a distinguished road
Flowkersma,

It looks like you made some excellent additions to swiftBlock! Looking forward to trying this out myself.

Nice work!
-Nuc
Nucleophobe is offline   Reply With Quote

Old   September 4, 2015, 05:50
Default
  #215
kjw
New Member
 
Krzysztof Wołosz
Join Date: Oct 2010
Location: Poland
Posts: 15
Rep Power: 16
kjw is on a distinguished road
Mikko,
You do a great job!
I only have a question on version of Blender.
You made the fork for blender 2.75 only?
Can lower version be used as well?

Regards

Krzysztof
kjw is offline   Reply With Quote

Old   September 4, 2015, 06:12
Default
  #216
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Thank you, I hope it's working for you and I'm eager to get some feedback if you try it.

Krzysztof,
I must say that I have only used it successively with Blender 2.75. I know from this thread that it will not work with versions older than 2.73 (ensure_lookup_table function). The fork uses Bmesh module which was implemented in version 2.6 so I think with slight modifications it could be used with that version.

-Mikko
Flowkersma is offline   Reply With Quote

Old   September 4, 2015, 20:05
Default
  #217
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
@Mikko: I've added a few more details to the wiki page, to include a link to your fork and to your examples: http://openfoamwiki.net/index.php/Contrib/SwiftBlock - feel free to update the wiki page!
wyldckat is offline   Reply With Quote

Old   September 9, 2015, 05:33
Default
  #218
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Thanks Bruno, I will update the page next week when I'll have again time for this.

I updated the code a bit so it works now at least with the Blender 2.69 version (on Ubuntu). Note that there is a dependency on Numpy as well which was included to Blender on different versions depending on OS.
Flowkersma is offline   Reply With Quote

Old   October 26, 2015, 20:12
Default
  #219
Member
 
Zhifang Hu
Join Date: Sep 2015
Location: Brisbane
Posts: 54
Rep Power: 11
ce73stargazer is on a distinguished road
Hi there

I am new to SwiftSnap, could any one give me some guide on how to do a simple geometry using SwiftSnap.

I tired to create a cylinder using blender, applied 'Make Base Mesh' and set locationInMesh being outside of cylinder, as i want all the rest geometry be meshed and leaving the cylinder hollow. However after i click Write, only a snappyHexMeshDict file was generated and it does not look like the geometry i wanted.

Anyone can give me some suggestion on the steps i need to follow to make SwiftSnap working properly.
ce73stargazer is offline   Reply With Quote

Old   November 1, 2015, 21:31
Default
  #220
Member
 
Zhifang Hu
Join Date: Sep 2015
Location: Brisbane
Posts: 54
Rep Power: 11
ce73stargazer is on a distinguished road
I tried to create a geometry using swiftblock, however when i try diagnose it, it shows there is some problem with the mesh. I dont know whats the problem. Could anyone give me a help.

The attachment is the picture of the geometry I interested and the blender file.
Attached Images
File Type: jpg Screenshot from 2015-11-02 11:27:20.jpg (83.6 KB, 99 views)
Attached Files
File Type: gz FirstPipeTest.blend.tar.gz (70.8 KB, 11 views)
ce73stargazer 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 12:59.