CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

access the values on a patch with its faceID

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

LinkBack Thread Tools Search this Thread Display Modes
Old   September 11, 2021, 07:16
Smile access the values on a patch with its faceID
New Member
Join Date: Nov 2018
Posts: 2
Rep Power: 0
FarhadZDH is on a distinguished road
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.

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.
FarhadZDH is offline   Reply With Quote


faceid, patch, polypatch

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
[IHFOAM] The IHFOAM Thread Phicau OpenFOAM Community Contributions 374 September 12, 2022 03:26
Near wall treatment in k-omega SST Arnoldinho OpenFOAM Running, Solving & CFD 38 March 8, 2017 13:48
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 22:38
[] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 19:43
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 09:28

All times are GMT -4. The time now is 08:20.