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

How can I access cells located in the centerline of a channel/pipe

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2010, 07:37
Default How can I access cells located in the centerline of a channel/pipe
  #1
Edy
Member
 
Join Date: Sep 2010
Posts: 35
Rep Power: 15
Edy is on a distinguished road
Hi Foamers,

For my geometry, i will consider :
- either a channel, i.e water flowing between two plane walls, 2D problem
- or a pipe, 3D problem

I am modeling subcooled nucleate boiling, and for each cell in contact with the walls (that are uniformly heated), i need to access and retrieve parameters of a corresponding cell, located in the bulk liquid (roughly around the centerline of my channel/pipe) but at the same axial location.

I created a patch to identify cells in contact with the walls but i dont know how to access the corresponding cell.

If possible I would like to do it in such a way that it is mesh-independent.
Any help welcome.

Thanks a lot!

/Edouard
Edy is offline   Reply With Quote

Old   October 8, 2010, 11:50
Default
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
Hi Edouard

In my opinion, once you know the axial position of your cell, the radial location depends upon the geometry. considering you have a pipe (implies radial symmetry), you can find the location of your centreline by using mesh bounds.
member function mesh.bounds( ) gives you the (minX, minY, minZ) and (maxX, maxY, maxZ). You can use these coordinates to evaluate the location of centreLine .

With the centreLine location known (in 2D y coordinate, in 3d (y,z) coordinate known), you can then utilize the mesh.findCell(const point&) to find the cell label according to your location along the x-axis i.e. your axial direction.

This way your coding will be mesh independent but not geometry independent.

Hope this helps

Regards
jaswi
jaswi is offline   Reply With Quote

Old   October 11, 2010, 06:21
Default
  #3
Edy
Member
 
Join Date: Sep 2010
Posts: 35
Rep Power: 15
Edy is on a distinguished road
Hi Jaswi,

Thank you for your message. Your solution seems quite appropriate to what i want to do. I'll try it and come back to this thread if I encounter problems.
Thanks again.

Best

/Edouard
Edy is offline   Reply With Quote

Old   October 11, 2010, 07:24
Default
  #4
Edy
Member
 
Join Date: Sep 2010
Posts: 35
Rep Power: 15
Edy is on a distinguished road
Hi Jaswi,

Could you tell me if this is correct.

// For all the faces in contact with the wall, i.e in my patch thePatchItself
forAll(thePatchItself,iFace)
{
// identify the cell corresponding to the face in contact with the wall
label iCell = thePatchItself.faceCells()[iFace];

//access the cell center point of this cell
vector iCellCentre = mesh.cellCentres()[iCell];

//get the point at the same axial position but located in the center line
vector bulkPoint(0,iCellCentre.y(),0);

// create a label corresponding to this point
label bulkCell = mesh.findCell(bulkPoint);



I think it s correct but I am not yet very familiar with OpenFOAM so i d like to have your opinion.

Thanks in advance

Best

/Edouard
Edy is offline   Reply With Quote

Reply

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
Can we have access to cells coordinates? adrianahscott OpenFOAM Running, Solving & CFD 20 January 23, 2018 15:39
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 09:54
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 06:50
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 20:43
physical boundary error!! kris Siemens 2 August 3, 2005 01:32


All times are GMT -4. The time now is 11:41.