|
[Sponsors] |
Accessing per-block mesh information in wall-normal direction |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 4, 2020, 15:37 |
Accessing per-block mesh information in wall-normal direction
|
#1 |
Member
Julian
Join Date: Sep 2019
Posts: 32
Rep Power: 7 |
Hi everyone,
I'm trying to write a small code that creates a mesh grading by manually modifying the location of wall-normal points in the mesh. The geometry is a backward-facing step with three blocks as shown in the image. I originally generated the mesh with blockMesh and I can get the points as follows: Code:
pointField newPoints = mesh.points(); The code looks like this for just the 0th block. I hard-code the number of points in pointsBlock0 based on what I know, but I wonder if I can retrieve this from the API. Then, I track a global point index to modify the list. Code:
scalar pointIndex = 0; // Block 0 vector pointsBlock0(119, 32, 129); for (label kk = 0; kk < pointsBlock0.z(); kk++) { for (label jj = 0; jj < pointsBlock0.y(); jj++) { Info << "kk: " << kk << " jj: " << jj << " y: " << points[pointIndex][1] << nl; for (label ii = 0; ii < pointsBlock0.x(); ii++) { points[pointIndex][1] = ... // some new calculated y-location to satisfy grading pointIndex++; } } Or is there some more elegant way to only modify the wall-normal portions of each coordinate? All wall-normal points in a given streamwise-spanwise plane need the same adjustment, but this adjustment is different for each streamwise-spanwise plane. Last edited by jmt; November 4, 2020 at 15:39. Reason: typo in the code |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] SnappyHexMesh for internal Flow | vishwa | OpenFOAM Meshing & Mesh Conversion | 24 | June 27, 2016 09:54 |
[blockMesh] OpenFoam - Block Mesh - identify a wall when wall is only part of a face of a block | michu | OpenFOAM Meshing & Mesh Conversion | 6 | June 26, 2015 14:07 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
Multicomponent fluid | Andrea | CFX | 2 | October 11, 2004 06:12 |