|
[Sponsors] |
[snappyHexMesh] SHM, addLayers, complex topography - How to determine size of first cell at surface? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 16, 2018, 06:18 |
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 |
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! |
|
May 22, 2018, 05:29 |
Determine spacing with Paraview
|
#2 |
New Member
Join Date: Apr 2018
Location: Cologne
Posts: 4
Rep Power: 8 |
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. |
|
August 28, 2018, 10:55 |
Size of the first cell - very easy solution
|
#3 |
New Member
Join Date: Apr 2018
Location: Cologne
Posts: 4
Rep Power: 8 |
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. |
|
September 18, 2018, 02:13 |
|
#4 |
New Member
Bence Somogyi
Join Date: Mar 2009
Location: Mattighofen, Austria
Posts: 11
Rep Power: 17 |
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 |
|
October 8, 2018, 11:32 |
|
#5 |
Senior Member
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 25 |
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. |
|
Tags |
atmboundary, cell size, grid, snappyhexmesh, surface refinement |
|
|
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 07:40 |
[snappyHexMesh] snappyHexMesh generates not planar surface | krzychu111 | OpenFOAM Meshing & Mesh Conversion | 2 | April 23, 2020 17:38 |
[snappyHexMesh] SHM addLayers doesnt work on the small surface | handicraft | OpenFOAM Meshing & Mesh Conversion | 4 | October 5, 2018 04:50 |
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry | pizzaspinate | OpenFOAM Meshing & Mesh Conversion | 1 | February 25, 2015 08:05 |
[snappyHexMesh] crash sHM | H25E | OpenFOAM Meshing & Mesh Conversion | 11 | November 10, 2014 12:27 |