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

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

 October 8, 2010, 06:37 How can I access cells located in the centerline of a channel/pipe #1 Member   Join Date: Sep 2010 Posts: 35 Rep Power: 6 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

 October 8, 2010, 10:50 #2 Senior Member   Join Date: Mar 2009 Posts: 248 Rep Power: 9 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

 October 11, 2010, 05:21 #3 Member   Join Date: Sep 2010 Posts: 35 Rep Power: 6 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

 October 11, 2010, 06:24 #4 Member   Join Date: Sep 2010 Posts: 35 Rep Power: 6 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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post vishwa OpenFOAM Native Meshers: snappyHexMesh and Others 23 August 6, 2014 03:50 adrianahscott OpenFOAM Running, Solving & CFD 19 February 19, 2013 15:02 hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50 chelvistero OpenFOAM 11 January 15, 2010 20:43 kris CD-adapco 2 August 3, 2005 00:32

All times are GMT -4. The time now is 10:29.