|
[Sponsors] |
September 11, 2021, 08:16 |
access the values on a patch with its faceID
|
#1 |
New Member
Mohsen Farhadzadeh
Join Date: Nov 2018
Location: Copenhagen, Denmark
Posts: 2
Rep Power: 0 |
Hi foamers;
I have a basic problem! I want to smooth a variable on a boundary patch. so it is important to access the boundary faces in order. This is what I did so far: I use boundaryField() member function and forAll loop to handle the faces on a patch. the problem is that the faces are not necessarily consecutive. forAll(variable.boundaryField()[patchID],ii) { ... Info << variable.boundaryField()[patchID][ii].y() << endl; ... } Another thing that I am testing is to get the start face of the patch then clearly I have the face id of the rest, that way I access the faces in order, I guess. At this point, I wonder how I can access the face value by using the faceID. const polyPatch& cPatch = mesh.boundaryMesh()[patchID]; label faceId_start = cPatch.start() ; forAll(cPatch, faceI) { // index of each face label faceID = faceId_start +faceI; // Now how could I access a variable value at faces using faceID //.... } Thanks in advance! PS: I am searching the resources simultaneously I used blockMesh and snappyHexMesh to create my geometry. |
|
Tags |
faceid, patch, polypatch |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[IHFOAM] The IHFOAM Thread | Phicau | OpenFOAM Community Contributions | 392 | September 8, 2023 19:10 |
Near wall treatment in k-omega SST | Arnoldinho | OpenFOAM Running, Solving & CFD | 38 | March 8, 2017 14:48 |
using chemkin | JMDag2004 | OpenFOAM Pre-Processing | 2 | March 8, 2016 23:38 |
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch | gschaider | OpenFOAM Installation | 225 | August 25, 2015 20:43 |
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) | cfdonline2mohsen | OpenFOAM | 3 | October 21, 2013 10:28 |