|
[Sponsors] |
How can I access cells located in the centerline of a channel/pipe |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 8, 2010, 07:37 |
How can I access cells located in the centerline of a channel/pipe
|
#1 |
Member
Join Date: Sep 2010
Posts: 35
Rep Power: 15 |
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, 11:50 |
|
#2 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
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, 06:21 |
|
#3 |
Member
Join Date: Sep 2010
Posts: 35
Rep Power: 15 |
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, 07:24 |
|
#4 |
Member
Join Date: Sep 2010
Posts: 35
Rep Power: 15 |
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 | Search this Thread |
Display Modes | |
|
|
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 |