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

Access cell value

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 1, 2011, 15:53
Default Access cell value
  #1
Senior Member
 
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 8
skabilan is on a distinguished road
Dear Foamers,

Within the forAll loop, I need to find the owner of faceI and get the cell value of T.

fixedGradientFvPatchScalarField& bufferField= refCast<fixedGradientFvPatchScalarField>(T.boundar yField()[patchIndex]);
scalarField& bufferMesh = bufferField.gradient();
forAll (bufferField, faceI)
{


}

Thanks all in advance
Senthil
skabilan is offline   Reply With Quote

Old   September 2, 2011, 16:16
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
marupio is on a distinguished road
I think it's in lduMesh. Look through fvMesh, lduMesh, primitiveMesh. It'll be owner_ or something like that. One of them will give you access. Discretization schemes use it... look in GaussConvection, or Laplacian.
marupio is offline   Reply With Quote

Old   September 2, 2011, 17:19
Default
  #3
Senior Member
 
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 8
skabilan is on a distinguished road
David,

Thanks for the tip. Just for others who might have the same issue...below is the code that should be within the forAll loop to access the cell value:

const unallocLabelList& owner = mesh.owner();
Info << T[owner[faceI]];


Thanks
Senthil
skabilan is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access cell face center / cell vertices lichmaster OpenFOAM Programming & Development 7 May 31, 2014 02:31
Cells with t below lower limit Purushothama CD-adapco 2 May 31, 2010 21:58
how to access each cell of a face? (user fortran) Katariina CFX 3 January 28, 2008 10:16
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15
Warning 097- AB CD-adapco 6 November 15, 2004 05:41


All times are GMT -4. The time now is 08:39.