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

[snappyHexMesh] SHM, addLayers, complex topography - How to determine size of first cell at surface?

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

Like Tree3Likes
  • 1 Post By Mucho
  • 1 Post By sbence
  • 1 Post By me3840

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 16, 2018, 05:18
Default SHM, addLayers, complex topography - How to determine size of first cell at surface?
  #1
New Member
 
Join Date: Apr 2018
Location: Cologne
Posts: 4
Rep Power: 8
Mucho is on a distinguished road
I simulate atmospheric boundary layer (ABL) flow over topography and built up my simulation on the OpenFoam Wiki validation case

http://openfoamwiki.net/index.php/File:3DBump.tar (which is really great!),

with k-epsilon, RANS model. It is a 3D model of flow over a smooth hill.




To simulate the law of the wall profile for the ABL flow, boundary conditions and wall functions from the atmBoundaryLayerClass are used.
The size of the first layer of cells on the ground is important for the correct use of them (for instance nutkAtmRoughWallFunction).
The mesh is generated with snappyHexMesh, n layers are added to the ground surface, 2 refinement zones around the hill (.jpg file below).

Is there a quick and easy way to determine the size of the first layer of cells on the ground?




I tried:
1.) Paraview, plot over line in z direction, export scene as csv file -> equidistant values for z - doesn't represent sizes of cells.

2.) Look at blockMeshDict, calculate spacing for normal mesh, look at snappyHexMeshDict divide spacing by 2 for each refinement level, multiply by finalLayerThickness 0.4, divide by (number layers * expansionRatio) -> neither fast, nor handy and maybe wrong. (snappyHexMeshDict file below)




My goal is to get the wall shear stress at the ground and the correct velocity profile over the entire domain (very close to the surface and with horizontal homogeneity at the beginning of the channel, prior to the hill).

Thank you for reading =) I would appreciate your suggestions!
Attached Images
File Type: jpg mesh_U.0020.jpg (122.0 KB, 124 views)
Attached Files
File Type: txt snappyHexMeshDict.txt (11.7 KB, 15 views)
Mucho is offline   Reply With Quote

Old   May 22, 2018, 04:29
Default Determine spacing with Paraview
  #2
New Member
 
Join Date: Apr 2018
Location: Cologne
Posts: 4
Rep Power: 8
Mucho is on a distinguished road
I found a solution to determine the spacing in Paraview:

1.) "Select cells On" (with Icon above window) and select cells with mouse
2.) Apply "Extract Selection" filter
3.) Strg+Space to open search menu, type "ce" for "cell centers", enter
4.) File -> Save data

This procedure writes the cell center values (of a selection of cells near the wall) into a .csv file that can be opened with Excel.

I am still open for better solutions.
finite_volume likes this.
Mucho is offline   Reply With Quote

Old   August 28, 2018, 09:55
Lightbulb Size of the first cell - very easy solution
  #3
New Member
 
Join Date: Apr 2018
Location: Cologne
Posts: 4
Rep Power: 8
Mucho is on a distinguished road
There is a very easy solution to this if you are working with simple geometries: Look into the blockMesh log-file!

You can create a logfile by running:
blockMesh > blockMesh.log

The output of the blockMesh.log looks like:

#other stuff
Creating block mesh topology
#more stuff
Creating points with scale 1
Block 0 cell size :
i : 0.01 .. 0.01
j : 0.02 .. 0.02
k : 0.00500204 .. 0.0302624

This part gives the cell sizes in x,y,z direction (=i,j,k). In this example I used grading in z direction. So, the smallest cell at the bottom has a size of 0.005m.
Mucho is offline   Reply With Quote

Old   September 18, 2018, 01:13
Default
  #4
New Member
 
Bence Somogyi
Join Date: Mar 2009
Location: Mattighofen, Austria
Posts: 11
Rep Power: 17
sbence is on a distinguished road
Hi Mucho!

You can measure the sizes in paraview exactly:

1) Make a clip of the mesh to see the boundary layers
2) Create a Line source. You can put its end points exactly on vertices of the mesh using CTRL+1 (start point of the line) and CTRL+2 (end point). Click apply, and you can read the length of the line in the properties panel.

Br,
Bence
Mucho likes this.
sbence is offline   Reply With Quote

Old   October 8, 2018, 10:32
Default
  #5
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
If you just need the number once, you can use the ruler or line source as sbence says.

If you need something more powerful and general you can just use the wall distance utility to get a field with the wall distance as a scalar for each cell.
Mucho likes this.
me3840 is offline   Reply With Quote

Reply

Tags
atmboundary, cell size, grid, snappyhexmesh, surface refinement

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] adding layers on complex terrain surface in SHM potac OpenFOAM Meshing & Mesh Conversion 1 November 9, 2020 06:40
[snappyHexMesh] snappyHexMesh generates not planar surface krzychu111 OpenFOAM Meshing & Mesh Conversion 2 April 23, 2020 16:38
[snappyHexMesh] SHM addLayers doesnt work on the small surface handicraft OpenFOAM Meshing & Mesh Conversion 4 October 5, 2018 03:50
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry pizzaspinate OpenFOAM Meshing & Mesh Conversion 1 February 25, 2015 07:05
[snappyHexMesh] crash sHM H25E OpenFOAM Meshing & Mesh Conversion 11 November 10, 2014 11:27


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