CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 11, 2021, 07:16
Smile 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
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.

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

Reply

Tags
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 392 September 8, 2023 18:10
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
[OpenFOAM.org] 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 10:28.