CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Face IDs for cells at boundary patch

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By vigneshTG

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 17, 2016, 17:56
Default Face IDs for cells at boundary patch
  #1
New Member
 
Praveen Srikanth
Join Date: Jul 2012
Location: West Lafayette, IN
Posts: 23
Rep Power: 13
praveensrikanth91 is on a distinguished road
Hello Forum users,

I am working with the conjugate heat transfer solver where I am trying to find the temperature at a liquid vapor interface by interpolating the temperatures from the liquid and the gas regions and taking an average. I interpolate the temperatures with

Code:
surfaceScalarField TI_liquid = fvc::interpolate(liquidT); 
surfaceScalarField TI_gas = fvc::interpolate(gasT);
but this does it for the entire region. I also know the cells next to the boundary which I get using the respective patchIDs

Code:
const labelList& gasPFaceCells = gasMesh_.boundary()[gasPatchID_].faceCells();
But I am not sure how to find the face IDs for the boundary faces for these cells which I can then use to get the interpolated temperature at the boundary. I have been going through this forum without much luck so any help is most appreciated
praveensrikanth91 is offline   Reply With Quote

Old   June 23, 2016, 07:13
Default
  #2
Member
 
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 66
Rep Power: 13
vigneshTG is on a distinguished road
Hi,
If you have not figured it out,


Code:
//To access the mesh information for the boundary
const polyPatch& cPatch = mesh.boundaryMesh()[patchI];

//Starting index of the face in a patch
label faceId_start = cPatch.start() ;

List of cells close to a boundary
const labelUList& faceCells = cPatch.faceCells();

forAll(cPatch, faceI) 
{ 
  
// index of each face
label faceID = faceId_start +faceI;

//id of the owner cell having the face
label faceOwner = faceCells[faceI] ;

....

 }



If there is a better way, do let me know !!
Noémie and Sayed Mostafa like this.
__________________
Thanks and Regards

Vignesh
vigneshTG is offline   Reply With Quote

Old   July 6, 2016, 11:55
Default
  #3
New Member
 
Praveen Srikanth
Join Date: Jul 2012
Location: West Lafayette, IN
Posts: 23
Rep Power: 13
praveensrikanth91 is on a distinguished road
Hey Vignesh,

Thank you so much for that. I did not realise that the face numbers on the patch were going to be continuous.
Code:
	const cell& gasFaces = gasMesh_.cells()[gasPfCellI];
	label gasfaceI = 0;

	forAll(gasFaces, i)
	{
		label gasPatchI = gasMesh_.boundaryMesh().whichPatch(gasFaces[i]);
		if(gasPatchI == gasPatchID_)
		{
			gasfaceI = gasFaces[i];
			Info<<"gasFaceI = "<< gasfaceI<<endl;
		}
	}
I used boundary().faceCells() on the boundary patches to get the cells on the boundary like you did. It seems to work fine as far as I can see. I will let you know if I find something wrong with it. Thanks again.
praveensrikanth91 is offline   Reply With Quote

Reply

Tags
boundary cell, chtmultiregionfoam, conjugate heat transfer, face


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
[Other] Wedge patch '*' is not planar LilumDaru OpenFOAM Meshing & Mesh Conversion 6 January 12, 2021 05:55
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 10:56


All times are GMT -4. The time now is 09:23.