CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

Boundary layers on an inlet/outlet for a pipe

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

Like Tree2Likes
  • 2 Post By timbojones

Reply
 
LinkBack Thread Tools Display Modes
Old   July 4, 2011, 09:43
Talking Boundary layers on an inlet/outlet for a pipe
  #1
Member
 
Eysteinn Helgason
Join Date: Sep 2009
Location: Gothenburg, Sweden
Posts: 52
Rep Power: 7
eysteinn is on a distinguished road
Hi all,

I'm currently working on meshing a pipe using snappyHexMesh.

Is there someone who knows how to get the boundary layers to
connect to the inlet and outlet?
Similiar as can be seen in the first image in this post:
snappyHexMesh - layers in 3d pipe bifurcation


Best regards,
Eysteinn
eysteinn is offline   Reply With Quote

Old   July 15, 2011, 16:14
Default Try refineWallLayer
  #2
New Member
 
Join Date: Jun 2011
Posts: 17
Rep Power: 5
timbojones is on a distinguished road
I struggled with this for the last day. The best I've been able to come up with so far is to use the refineWallLayer utility that comes with OF. My method is the following...

In creating the mesh with sHM, I don't try to resolve the near-wall mesh. Once I get a mesh I'm happy with, I add the near-wall region by running:

refineWallLayer <wall-patch-name> <edge-weight>

The edge weight tells the utility what fraction of the cell adjacent to the wall should be divided. For now, I just use 0.5. My models have been relatively simple to date so I only have one wall patch to which I want to attach a bounary layer. However, I think you can run the command sequentially for each wall patch (or multiple times for successive refinement of a given wall patch) to get he mesh you want. You can also use the -overwrite option to replace the current mesh with the refined-wall-layer mesh...Hope this helps.
gimba86 and s.m like this.
timbojones is offline   Reply With Quote

Old   July 21, 2011, 07:02
Default
  #3
Member
 
Ben Vernieres
Join Date: Jul 2011
Location: Valencia, Spain
Posts: 42
Rep Power: 5
bouclette is on a distinguished road
Send a message via Skype™ to bouclette
Hi Tim,

When I do the refineWallLayer command on my geometry (a simple wing) I end up with inverted cells, even after run it once.

Eysteinn, try to change in your boundary file that is in constant/polymesh the type of inlet and outlet to "empty" and run sHM again. I think that should do the trick but you'll need to change back the boundaries to out/inlet once meshed.

Thx,

Ben
bouclette is offline   Reply With Quote

Old   July 21, 2011, 08:57
Default
  #4
New Member
 
Join Date: Jun 2011
Posts: 17
Rep Power: 5
timbojones is on a distinguished road
Hey Ben,

Thanks a lot for the reply to my post. Maybe the cell inversion has to do with local curvature. I think your way offers the level of control I'd like to have over the near-wall mesh refinement. Plus, it's more in the spirit of the layer addition scheme offered by sHM. I'm going to try it and hope that it works for me, too.

Thanks,
Tim
timbojones is offline   Reply With Quote

Old   July 22, 2011, 12:26
Default
  #5
New Member
 
Join Date: Jun 2011
Posts: 17
Rep Power: 5
timbojones is on a distinguished road
Hi Ben,

I tried your suggestion of changing the boundary type of the inlet/outlet patches to "empty" as well as "patch" and "symmetry", but none of these resulted in a mesh where the layers added at the pipe wall were imprinted to the inlet/outlet faces. Do you have an example .stl and SnappyHexMeshDict that could offer a bit more guidance?

Thanks,
Tim
timbojones is offline   Reply With Quote

Old   July 22, 2011, 13:20
Default
  #6
Member
 
Ben Vernieres
Join Date: Jul 2011
Location: Valencia, Spain
Posts: 42
Rep Power: 5
bouclette is on a distinguished road
Send a message via Skype™ to bouclette
Hi Tim,

I've made a tube quickly to check if that trick did work and it seems to work. See pic. attached.

If that is what you want (sort of...) then the sHM dict file might help you (attached).

I have changed the boundary of in/outlets to empty after the snapping step (in folder 2 if u don't do -overwrite) and it meshed the tube ends correctly. If you leave as a patch, it will not mesh on the in/outlet.

I can't post the stl file because it is too big but its a cylinder anyway... can probably be done without using stl I guess.

Not sure I'm making myself very clear...

Regards,

Ben

Edit: the sHMDict file might be a bit messy because I'm trying to play around with the settings in order to get a correct BL on a wing - which I can't do for the moment - so some settings might not be very wise / good...
Attached Images
File Type: jpg t1.jpg (40.5 KB, 369 views)
Attached Files
File Type: txt snappyHexMeshDict.txt (10.3 KB, 255 views)

Last edited by bouclette; July 22, 2011 at 13:25. Reason: added extra comments
bouclette is offline   Reply With Quote

Old   July 22, 2011, 15:17
Default
  #7
New Member
 
Join Date: Jun 2011
Posts: 17
Rep Power: 5
timbojones is on a distinguished road
Ben,

Thanks for taking the time to put together the sample sHMDict file.

Thanks,
Tim
timbojones is offline   Reply With Quote

Old   July 23, 2011, 16:02
Default
  #8
New Member
 
Join Date: Jun 2011
Posts: 17
Rep Power: 5
timbojones is on a distinguished road
OK! After messing around most of the afternoon, I discovered that the problem was in how my blockMeshDict was set up. In my original setup, I had the z-axis limits one unit away from the inlet and outlet of my z-axis aligned pipe. Once I moved the z-axis limits in closer, the "empty" BC trick worked perfectly and with the new feature edge function in OF 2.0.

Thanks for talking me through it...

The important thing for others is to know that this method works great and if it's not working for you, try adjusting the initial background mesh. This will be particularly important if you have an inlet/outlet that is on the interior of the mesh and you can't have it hanging outside of the background mesh to make sure the feature is preserved.

Thanks,
Tim
timbojones is offline   Reply With Quote

Old   July 27, 2011, 12:08
Default
  #9
Member
 
Eysteinn Helgason
Join Date: Sep 2009
Location: Gothenburg, Sweden
Posts: 52
Rep Power: 7
eysteinn is on a distinguished road
Hi Ben and Tim

and thank you for the replies. Sorry for my late reply, have been out of internet for a few days and was unable to test this.

This seems to work
I only have a small problem with the type of the inlet and outlet.
I get two entries for inlet, one as wall(nFaces=0) and one as empty so I removed the one with the wall definition.

I also get duplicate entries in 3/pointLevel and cellLevel
One of type empty and one calculated in pointLevel and zeroGradient in cellLevel.
Should I remove one of them and leave one as patch or calculated (and then zeroGradient in cellLevel) ??

When you mesh the pipe you start by creating a box in blockMesh and create a patch wall for all sides, right?
I always get my inlet default as wall when I continue with snappyHexMesh and have to changed it in constant/polyMesh/boundary
Do you define the patch type of your inlets/outlets in blockMeshDict or somewhere else?

Thank you for your help!

Best regards,
Eysteinn
eysteinn is offline   Reply With Quote

Old   August 12, 2011, 07:17
Default
  #10
New Member
 
Join Date: Jun 2011
Posts: 17
Rep Power: 5
timbojones is on a distinguished road
Eysteinn,

Sorry for the delay in responding to your post.

When I create my model with SHM, I don't give too much thought to the BCs applied to the bounding surfaces of the original background mesh to be made with blockMesh. Once the meshing process is completed, these surface patches should have zero faces in them and can be deleted from the boundary definition file (with appropriate reduction in the number of boundary patches at the top of the file).

As for defining the inlet/outle/walls, I make sure these surfaces are in the interior of my background mesh and use the boundary snapping feature included in the OF 2.0 version of SHM. With this procedure these surface patches will be created by SHM and one needs to edit the boundary file to ensure they have the right types for the desired simulation activity.

I hope this answers your question...Assuming you still have any given the time that's elapsed between your post and my response...Again, my sincere apologies for the delay.

TimboJones
timbojones is offline   Reply With Quote

Old   August 22, 2011, 03:54
Default
  #11
Member
 
Eysteinn Helgason
Join Date: Sep 2009
Location: Gothenburg, Sweden
Posts: 52
Rep Power: 7
eysteinn is on a distinguished road
Thank you for your answer Tim.

I have been trying this for a couple of days now and can't get the cells on
the inlet or outlet to snap to the edge, so that it makes a smooth circle with
sharp edges.
You mentioned boundary snapping feature in OF2.0, is that automatically
on or do you create an edge mesh or something else?

Thanks
Eysteinn
eysteinn is offline   Reply With Quote

Old   August 22, 2011, 17:10
Default
  #12
New Member
 
Join Date: Jun 2011
Posts: 17
Rep Power: 5
timbojones is on a distinguished road
Eysteinn,

You have to create the edge mesh. I did this using one of the OF-supplied utilities...I think it was surfaceFeatureExtract, but I can't remember right now the exact recipe I used for the extraction.

One other trick that I *do* remember is the following. In the tutorials that come with OpenFOAM, the number of iterations for feature snapping is set to zero in the snappyHexMeshDict. Even with the extracted features, SHM will not snap to the features unless this number of iterations is increased.

Tim

Last edited by timbojones; August 22, 2011 at 17:12. Reason: Incorrectly wrote "Even with extracted surface mesh..." in last sentence.
timbojones is offline   Reply With Quote

Old   August 24, 2011, 12:41
Default
  #13
Member
 
Eysteinn Helgason
Join Date: Sep 2009
Location: Gothenburg, Sweden
Posts: 52
Rep Power: 7
eysteinn is on a distinguished road
Thank you Tim

Finally got this working.
Nice!

/Eysteinn
eysteinn is offline   Reply With Quote

Old   April 11, 2013, 01:58
Smile
  #14
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 5
s.m is on a distinguished road
Quote:
Originally Posted by timbojones View Post
I struggled with this for the last day. The best I've been able to come up with so far is to use the refineWallLayer utility that comes with OF. My method is the following...

In creating the mesh with sHM, I don't try to resolve the near-wall mesh. Once I get a mesh I'm happy with, I add the near-wall region by running:

refineWallLayer <wall-patch-name> <edge-weight>

The edge weight tells the utility what fraction of the cell adjacent to the wall should be divided. For now, I just use 0.5. My models have been relatively simple to date so I only have one wall patch to which I want to attach a bounary layer. However, I think you can run the command sequentially for each wall patch (or multiple times for successive refinement of a given wall patch) to get he mesh you want. You can also use the -overwrite option to replace the current mesh with the refined-wall-layer mesh...Hope this helps.
hi timbojones,
would you please explain that what should we do with the new polyMesh that is obtained after runing the "refineWallLayer" utility?
please help me i really need to know this.
thanks in advance
s.m is offline   Reply With Quote

Reply

Tags
boundary, layer, snappyhexmesh

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
snappyHexMesh - layers in 3d pipe bifurcation nihil OpenFOAM Native Meshers: snappyHexMesh and Others 13 April 9, 2013 08:32
High-Re / Boundary Layers alex_rubel OpenFOAM Running, Solving & CFD 0 March 30, 2011 23:26
pipe with buoyantFoam buoyancy, boundary conditions Thomas Baumann OpenFOAM 0 June 15, 2009 08:58
Gambit 2 Boundary Layers An Modh Coinniolach FLUENT 2 January 30, 2002 11:54
Problem with periodic boundary layers Phil FLUENT 15 October 2, 2000 14:56


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