CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[cfMesh] Algorithm parameters in cfMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 24, 2014, 09:04
Default Algorithm parameters in cfMesh
  #1
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 94
Rep Power: 17
cliffoi is on a distinguished road
Hi all,
I found out about cfMesh at the 9th OpenFOAM workshop in Zagreb and have been trying to use it for my meshing purposes. I'm not entirely sure whether it counts as a native mesher, but since it is based on the FOAM libraries, I'll assume that this post is in the correct forum.
I've been using cartesianMesh to generate hex-dominant meshes in various regions of pressurized water reactors (PWRs). My initial impression is that the application does a really good job and I'm quite happy with the resulting meshes.
One particular issue that I've come across is that the mesher sometimes does unexpected things when adding in boundary layers. I've found that often inlet and outlet patches simply get treated as walls and boundary layers are added to these (see the attached figure).
After a lot of playing around I think I've narrowed down the cause; Sometimes the mesher doesn't quite capture the feature edges properly (see circled region in attached figure) and I think this prevents the mesher from adding the boundary layers properly.
So the question I have is, how do I adjust the mesher parameters to make sure it captures the features properly. I think many of the algorithm parameters (max number of iterations, etc.) are hardcoded and I'm trying to avoid making changes to the underlying sources.

A separate question I have is; how do you adjust the growth rate of the generated mesh?

Any suggestions would be welcome.

Thanks
Ivor
Attached Images
File Type: jpg pic1.jpg (98.2 KB, 448 views)

Last edited by cliffoi; July 24, 2014 at 13:25.
cliffoi is offline   Reply With Quote

Old   July 24, 2014, 18:48
Default
  #2
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 124
Rep Power: 17
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Hello Ivor,

cfMesh library is based on OpenFOAM, and I hope that others will also agree that it is the right forum for your post.
Boundary layers in cfMesh are governed by the following rules:
1. A single layer can exit at the surface of the mesh only at convex edges. Therefore, a single layer is extended over all patches which hare a concave edge, or in case the surface of the volume mesh is tangled at a feature edge.
2. If you have corners with valence greater than three this also forces generation of a single layer over all patches at that corner.

Re meshing parameters, the best thing you can do is to adjust the refinement settings of the template, such that it fits the geometry as good as possible. If you switch a debug flag in cfMesh/eshLibrary/cartesianMesh/cartesianMeshGenerator/cartesianMeshGenerator.C you can write the mesh after each step, and monitor what is going on. In addition, it is desirable to specify cell sizes smaller then the feature size, especially near feature edges. Otherwise, there is no guarantee that you will get what you want.

Growth rate is controlled by a criterion that every cartesian cell must not have a neighbour which differs by more than one refinement level, and it happens at the closest distance from the refinement source. I hope that this is the right answer to your question? Do you have additional requirement in mind?

Kind Regards,

Franjo
franjo_j is offline   Reply With Quote

Old   July 25, 2014, 04:29
Default
  #3
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 94
Rep Power: 17
cliffoi is on a distinguished road
Thanks for the information Franjo. I now understand the problem I'm encountering, that the edge where I want the boundary layer to exit is tangled; and the best way to correct this is simply to play with the refinement settings and mesh sizes until it works correctly. I've noticed that cfMesh performs untangling iterations during the meshing process. Will adjusting anything here (number of iterations, etc.) help?

Regarding the growth rate, I have found that 90% of my mesh takes on the maximum cell size because the refinement is very localized at the walls. Having the ability to adjust the criterion (e.g. every neighbour's neighbour cannot differ by more than one refinement level, or even to set some flexible parameter to adjust the growth rate) would certainly be a useful feature.

Best Regards
Ivor
cliffoi is offline   Reply With Quote

Old   July 25, 2014, 18:01
Default
  #4
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 124
Rep Power: 17
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Hello Ivor,

Quote:
Originally Posted by cliffoi View Post
Thanks for the information Franjo. I now understand the problem I'm encountering, that the edge where I want the boundary layer to exit is tangled; and the best way to correct this is simply to play with the refinement settings and mesh sizes until it works correctly. I've noticed that cfMesh performs untangling iterations during the meshing process. Will adjusting anything here (number of iterations, etc.) help?

Regarding the growth rate, I have found that 90% of my mesh takes on the maximum cell size because the refinement is very localized at the walls. Having the ability to adjust the criterion (e.g. every neighbour's neighbour cannot differ by more than one refinement level, or even to set some flexible parameter to adjust the growth rate) would certainly be a useful feature.

Best Regards
Ivor
My experience shows that the number of iterations is sufficient for most cases I have tried so far. In most cases, the mesher is able to get rid of tangled regions after a few iterations. The large number of iterations usually mean that the mesh template, generated based on user input, does not fit the input geometry well, and that it cannot capture all features correctly. I prefer playing with mesh settings rather than changing the number of iterations.

The growth rate feature is added into my backlog. It will be available in the upcoming releases.

Kind Regards,

Franjo
franjo_j is offline   Reply With Quote

Old   July 30, 2014, 09:41
Default
  #5
Member
 
Ivor Clifford
Join Date: Mar 2009
Location: Switzerland
Posts: 94
Rep Power: 17
cliffoi is on a distinguished road
Hi Franjo,
I tried playing with some of the basic iteration parameters and I agree the current combination does seem to give the best results... or at least I didn't get much improvement by adjusting them.
My big concern is that even a single tangled face on a feature edge can prevent the boundary layers from being added correctly... and the knowledge that you have bad features in your mesh doesn't exactly inspire confidence in the solution.
I've tried adjusting the sizes and refinement levels in the input dictionary and I always seem to get a few bad spots in the mesh, albeit in slightly different places each time. Most often it's on the corners of curved (cylindrical) features.

A recommendation I have is to add an option for the mesher to halt with an error if it is unable to resolve all the tangled edges, rather than simply smoothing the unresolved faces. A faceSet or pointSet containing the affected faces or nodes would also be useful to track down problematic areas.

Best Regards
Ivor
cliffoi is offline   Reply With Quote

Old   July 31, 2014, 04:42
Default
  #6
New Member
 
Jan
Join Date: Jun 2010
Location: Erlangen, Germany
Posts: 3
Rep Power: 16
myself is on a distinguished road
Hi all,

I also tried cfMesh and it produces nice meshes for our single-region cases. Is it also possible to use cfMesh to generate multiregion-meshes?

Best regards,
Jan
myself is offline   Reply With Quote

Old   July 31, 2014, 05:11
Default Multi-region meshes
  #7
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 124
Rep Power: 17
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Hello Jan,

Quote:
Originally Posted by myself View Post
Hi all,

I also tried cfMesh and it produces nice meshes for our single-region cases. Is it also possible to use cfMesh to generate multiregion-meshes?

Best regards,
Jan
Unfortunately, it is not yet possible. The feature is very high on the list of priorities.

Kind Regards,

Franjo
franjo_j is offline   Reply With Quote

Old   July 31, 2014, 06:11
Default
  #8
New Member
 
Jan
Join Date: Jun 2010
Location: Erlangen, Germany
Posts: 3
Rep Power: 16
myself is on a distinguished road
Quote:
Originally Posted by franjo_j View Post
Hello Jan,

Unfortunately, it is not yet possible. The feature is very high on the list of priorities.

Kind Regards,

Franjo
Thanks for the information. I am really looking forward for such a feature.

Regards,
Jan
myself is offline   Reply With Quote

Old   May 13, 2016, 09:18
Default
  #9
New Member
 
Join Date: Mar 2015
Posts: 12
Rep Power: 11
JensD is on a distinguished road
Is such a feature already developed and is there a tutorial available for this?
JensD 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pro/E to ANSYS Parameterization Guide Trues ANSYS 4 April 18, 2018 06:52
[OpenFOAM] Paraview 3.98 - errors when saving geometry file pajot ParaView 1 September 28, 2013 11:45
Parameters rhoSimpleFoam marcus85 OpenFOAM Pre-Processing 0 May 15, 2013 10:36
Turbulence model parameters and equations Maximus91 Main CFD Forum 1 October 24, 2012 14:20
Parameters for multigrid solver HaZe OpenFOAM Running, Solving & CFD 3 January 28, 2012 03:05


All times are GMT -4. The time now is 19:45.