CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Get ID of a boundary face with help of a cell ID

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 26, 2014, 10:47
Default Get ID of a boundary face with help of a cell ID
  #1
Senior Member
 
Join Date: Nov 2012
Location: Bavaria
Posts: 145
Rep Power: 13
aylalisa is on a distinguished road
Hi Foamers,

I have a cell label of a cell that belongs to the inner mesh and is located next to a boundary patch.

Can I directly access the face label ID of the adjacent face of that cell which belongs to the boundary mesh, without looping through all faces of that boundary patch.

Aylalisa
aylalisa is offline   Reply With Quote

Old   September 19, 2018, 12:07
Default
  #2
New Member
 
Adithya Gurumurthy
Join Date: Jun 2017
Posts: 18
Rep Power: 8
raptorishungry is on a distinguished road
Hello aylalisa,

Did you find out how to do this? I am also interested

adithya
raptorishungry is offline   Reply With Quote

Old   September 27, 2018, 07:07
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
It should not be possible as there is no function for that (as far as I know).
The best solution is to check the face ID before the solver starts and save the ID.
Therefore, you do not have to search for the face ID again and again.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 27, 2018, 16:32
Default
  #4
New Member
 
Adithya Gurumurthy
Join Date: Jun 2017
Posts: 18
Rep Power: 8
raptorishungry is on a distinguished road
Hello Tobi,

The Lagrangian solver (eg. icoUncoupledKinematicParcelFoam) writes the positions of the particles in /<time>/lagrangian/kinematicCloud/positions.

Aside from writing the x, y and z coordinates, it also writes the cellID of the cell the particle is located at that time step according to the following code fragment in particleIO.C ($FOAM_SRC/lagrangian/basic/particle/particleIO.C)

Code:
void Foam::particle::writePosition(Ostream& os) const
{
    if (os.format() == IOstream::ASCII)
    {
        os  << position_ << token::SPACE << celli_;
    }
    else
    {
        os.write(reinterpret_cast<const char*>(&position_), sizeofPosition_);
    }

    // Check state of Ostream
    os.check(FUNCTION_NAME);
}
Now, I want to write the face ID instead of cell ID. The facei_ has the value of faceID as per the following code from $FOAM_SRC/lagrangian/basic/particle/particle.H

Code:
        //- Face index if the particle is on a face otherwise -1
        label facei_;
So I changed the lines
Code:
os  << position_ << token::SPACE << celli_;
to
Code:
os  << position_ << token::SPACE << facei_;
This works in serial (and in every individual processor), but it does not work in parallel. In the sense that, while reconstructing the results from processors, I get -1 everywhere (although its not showing -1 for some particles in the individual processors).

Do you have any idea what is going on? or Do you suggest any work-around to get the solver to write the faceID instead of cellID along with positions?

Thanks.

-adithya
raptorishungry is offline   Reply With Quote

Old   September 27, 2018, 16:44
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
I am sorry. I do not have any background for parallel-computing in FOAM (only a small one - not worth to talk about).
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 30, 2022, 06:15
Default
  #6
New Member
 
Join Date: Aug 2019
Posts: 3
Rep Power: 6
Behradskn is on a distinguished road
Hi Tobi,

First of all, thank you for all you have done for the OpenFOAM community. I am desperately looking for how to get access to surface values of the face ids produced by faceSet in every time step. Do you have any idea about how can I solve this problem?

Thank you so much!
Behrad
Behradskn is offline   Reply With Quote

Reply


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
How to determine the direction of cell face vectors on processor patches sebastian_vogl OpenFOAM Programming & Development 1 October 11, 2016 13:17
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
Radiation interface hinca CFX 15 January 26, 2014 17:11
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 10:56
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


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