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

[snappyHexMesh] How to create an O-grid mesh for flow in a pipe using OpenFOAM?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Teresa.Z

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 27, 2021, 21:51
Question How to create an O-grid mesh for flow in a pipe using OpenFOAM?
  #1
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
Hello dear CFDonline community.


I'm wondering if anybody can tell me, please, how to create an O-grid mesh in OpenFoam (for flow in a circular pipe obviously).


So far, I tried this tutorial. That helped me a lot. I managed to create an O-grid mesh using blockMeshDict. But then I wanted to add inflation layers. I did it via snappyHesMeshDict. And after running it I didn't get inflation layers and got some unstructured mesh closer to the walls instead.


What is the general procedure of getting an O-grid mesh in OpenFOAM?


Thank you in advance.


Ivan



Please see attached picture: I want to get the same thing in OpenFOAM.
nepomnyi is offline   Reply With Quote

Old   October 28, 2021, 04:01
Lightbulb
  #2
New Member
 
Join Date: Aug 2021
Posts: 11
Rep Power: 4
Daniel_C is on a distinguished road
Hallo Ivan,

I highly suggest you to have a look at blender and the swiftBlock add-on. It gave me gave nice Hexa meshes. As you can see from an early attempt with an airfoil, it does its job pretty well. It is knda ICEM, and comparable in usage. And most important, it is totally free to use!

swiftBlock

swiftblock.readthedocs.io/en/latest/

blender
http://www.blender.org/

Greetings

Daniel


PS: Don't judge the mesh, I canceled work on it because I just wanted a quick look inside the tool. :-)
Attached Images
File Type: jpg Airfoil2.jpg (190.3 KB, 153 views)
File Type: jpg Airfoil.jpg (72.0 KB, 87 views)
Daniel_C is offline   Reply With Quote

Old   October 28, 2021, 11:13
Default
  #3
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
Quote:
Originally Posted by Daniel_C View Post
Hallo Ivan,

I highly suggest you to have a look at blender and the swiftBlock add-on. It gave me gave nice Hexa meshes. As you can see from an early attempt with an airfoil, it does its job pretty well. It is knda ICEM, and comparable in usage. And most important, it is totally free to use!

swiftBlock

swiftblock.readthedocs.io/en/latest/

blender
http://www.blender.org/

Greetings

Daniel


PS: Don't judge the mesh, I canceled work on it because I just wanted a quick look inside the tool. :-)

Thank you Daniel.
I know about Blender. I even have SpaceClaim which can do the job exceptionally well.
But I, specifically, want to know how to do it using OpenFOAM native tools.
In other words, the goal behind my question is not to do the job quickly by any means, but rather learn how to do it in OpenFOAM.

Ivan
nepomnyi is offline   Reply With Quote

Old   October 28, 2021, 15:04
Default
  #4
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 555
Rep Power: 27
linnemann will become famous soon enough
Hi


This is just my personal oppinon so take is as you want.


Dont spend too much time learning how to use Blockmesh unless is some very niche cases.


As soon as you go into industry (expect you will) you wont have time to deal with the perfect mesh every time. Then you start looking into trends of design changes and will only deep dive into the setup to make sorta sure that you follow best practice guidelines.


Learn automated meshing strategies to make rapid design changes and optimization loops. Here is a small comparison for builtin meshers for OpenFOAM Automatic meshing strategies


Would also advice you to learn how to use Salome as it is a very powerfull tool for making simple meshes and surface STL files for OpenFOAM.


I can do what you want in Salome in about 10min but would probably use cfmesh if I were to thoose the mesher.
Attached Images
File Type: png Salome.png (136.7 KB, 162 views)
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   October 29, 2021, 07:53
Default
  #5
New Member
 
Join Date: Aug 2021
Posts: 11
Rep Power: 4
Daniel_C is on a distinguished road
Hallo Ivan,

well if you already know how to use blender, then siftBlock Add-on is your friend :-)

It generates native openFoam blockMesh dictionary, that you can study and learn from. Beside SALOME tool, that is all I know, how to generate HEXA mesh within openFoam environment.

Greetings

Daniel
Daniel_C is offline   Reply With Quote

Old   November 26, 2021, 19:06
Default
  #6
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
Thank you @Daniel_C and @linnemann.


To sum up, I did my best trying to make blockMesh and snappyHexMesh give me what I need and I failed. I can make nice inflation layers (i.e. those expanding circles at the boundary) with unstructured mesh in the middle or I can make the structured block mesh that I showed in my question but without the inflation layers. For the life of me, I can't figure out how to make both inflation layers and the structured block mesh that I showed in my original question.


Therefore, at this point I conclude that it is impossible to do what I want using OpenFOAM native tools (which I regret a lot because I hate learning new GUIs and like very much the programmatic approach to meshing used in blockMesh).


But I still have to do the job.


I tried Blender with that add-on suggested by Daniel_C and I didn't like it at the first glance.


Then I moved to cfmesh. Didn't work for me as well. That's because cfmesh comes with the openfoam.com. But I use openfoam.org. And it turned out to be a great pain to integrate it with my OpenFOAM.



And then I moved to SALOME. I liked it more than Blender at the first glance because its GUI looks like any other GUI of any other piece of CAD software. I found this tutorial showing how to make structured mesh in SALOME. But even with the help of that tutorial I failed to generate the mesh I wanted. Primarily because I didn't figure out how to create those planes when I didn't have that cube around my pipe.


Therefore, in order to close my question I'm wondering if you @linnemann can be so kind to share the way you created the block mesh please. I don't need the cross, just a circular pipe.


Thank you in advance.


Ivan
nepomnyi is offline   Reply With Quote

Old   November 27, 2021, 05:44
Default
  #7
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by nepomnyi View Post
Then I moved to cfmesh. Didn't work for me as well. That's because cfmesh comes with the openfoam.com. But I use openfoam.org. And it turned out to be a great pain to integrate it with my OpenFOAM.
I won't bother with why you use openfoam.org, but you should keep in mind that there are still a variety of ways that you can integrate openfoam.com and cfmesh into your workflow (depending on your system). If you are using fedora/centos/opensuse/ubuntu you can quickly install the latest (currently openfoam2106) packages. Once they are installed, can simply use the included shell session to fire off a single command without additional sourcing etc.
Another alternative could be the dockerized version of openfoam2106, which also includes cfmesh and can also be used to fire off a single command.
olesen is offline   Reply With Quote

Old   July 15, 2022, 17:04
Default How to do it in Salome
  #8
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
I figured out how to do what I want in Salome (in case anybody is interested).


You can do it two ways:
  1. draw the cylinder first and mesh it afterwards,
  2. draw the base of the cylinder, mesh it and extrude the mesh (this one's nice).
Now let's see how to do each one of those.
  1. For the first method, you'll need two tutorials. First, use this tutorial to create a cylinder (first draw a sketch of a circle with the O-grid pattern in it, then extrude it to get the cylinder). Then use this tutorial to create a mesh. Note the issue Cyprien is talking about starting the 9th minute. He found a way around, but, actually, Salome has an option to delete that extra edge. That option is implemented in the Geometry module, the Shaper module doesn't have it. Therefore, if you followed the first video to create the cylinder and you used the Shaper module, you'll have to convert your Shaper study to Geometry study first. To do the conversion, left click once on your part in the tree to highlight it. Then go to Features->export to GEOM. Then activate the Geometry module. Left click once on the name of your part in the tree (or on the name of the partition if you used partitions like Cyprien did). Then go to Repair->remove extra edges.Then you can proceed with meshing.
  2. For the second method, you'll have to register on the Salome's forum and read this post. If the link doesn't work, then log in to your account on the Salome's forum and find the post by its name: "Generating o type grid by Salome". The post was created by Isaiah on the 19th of June, 2022. You can find the main response and my clarifying remarks there.

Last edited by nepomnyi; July 15, 2022 at 17:15. Reason: Add the link to the Salome's website.
nepomnyi is offline   Reply With Quote

Old   September 1, 2022, 12:55
Default
  #9
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
Actually, my guide on how to do it in Salome is not complete and leaves some unanswered questions.


Here's the better post to read if you want to learn how to do the O-grid mesh in Salome. That's Salome's forum. A really good forum. I highly recommend it for any Salome related questions.


And to complete the answer, see this tutorial (starting the 18:54min) on how to export the mesh to OpenFOAM from Salome.
nepomnyi is offline   Reply With Quote

Old   September 2, 2022, 12:34
Default
  #10
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
Quote:
Originally Posted by nepomnyi View Post
To sum up, I did my best trying to make blockMesh and snappyHexMesh give me what I need and I failed. I can make nice inflation layers (i.e. those expanding circles at the boundary) with unstructured mesh in the middle or I can make the structured block mesh that I showed in my question but without the inflation layers. For the life of me, I can't figure out how to make both inflation layers and the structured block mesh that I showed in my original question.


Therefore, at this point I conclude that it is impossible to do what I want using OpenFOAM native tools (which I regret a lot because I hate learning new GUIs and like very much the programmatic approach to meshing used in blockMesh).

Turns out, I was wrong. One can do that in OpenFOAM blockMesh! The solution is offered by the awesome folks from Wolf Dynamics. Here's their awesome presentation on how to do O-grid mesh in a round pipe (see the last slides). Even though inflation layers are not implemented there, they say one can change mesh stretching to get more cells close to the wall. That will look like an inflation layer (like the one I posted the picture of in my question). I'm going to play with that and I'm going to post the detailed guide here once I'm done. Huge thank you to Wolf Dynamics!
nepomnyi is offline   Reply With Quote

Old   July 12, 2023, 17:39
Default
  #11
New Member
 
Join Date: Aug 2021
Posts: 1
Rep Power: 0
Teresa.Z is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Hi


This is just my personal oppinon so take is as you want.


Dont spend too much time learning how to use Blockmesh unless is some very niche cases.


As soon as you go into industry (expect you will) you wont have time to deal with the perfect mesh every time. Then you start looking into trends of design changes and will only deep dive into the setup to make sorta sure that you follow best practice guidelines.


Learn automated meshing strategies to make rapid design changes and optimization loops. Here is a small comparison for builtin meshers for OpenFOAM Automatic meshing strategies


Would also advice you to learn how to use Salome as it is a very powerfull tool for making simple meshes and surface STL files for OpenFOAM.


I can do what you want in Salome in about 10min but would probably use cfmesh if I were to thoose the mesher.
@linnemann and @nepomnyi,

thanks for sharing your knowledge on mesh generation. Based on your discussion, I can create O-grid mesh for one pipe with Salome and blockMesh. But I'm stuck on how to do it for T-connecting pipes. If I saw it correctly, linnermann already achieved it with Salome. Could you give me some advice? Thanks in advance.

Teresa
efalpha likes this.
Teresa.Z is offline   Reply With Quote

Reply

Tags
blockmesh boundary layers, blockmesh cylinder, mesh 3d, openfoam 1.7.1, snappyhexmesh hex


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
FFD shape deformation for 3D wing not changing the mesh lwc24 SU2 Shape Design 5 August 1, 2019 15:17
[Other] How to Create and mesh a pipe with a porous tube insert mizzou OpenFOAM Meshing & Mesh Conversion 0 June 6, 2017 22:38
Gambit problems Althea FLUENT 22 January 4, 2017 03:19
Suggestion for a new sub-forum at OpenFOAM's Forum wyldckat Site Help, Feedback & Discussions 20 October 28, 2014 09:04
[ICEM] Using a hybrid mesh for a simple pipe Udio_NT ANSYS Meshing & Geometry 17 October 18, 2012 14:42


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