CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Access cell value (https://www.cfd-online.com/Forums/openfoam-programming-development/92084-access-cell-value.html)

skabilan September 1, 2011 15:53

Access cell value
 
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

marupio September 2, 2011 16:16

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.

skabilan September 2, 2011 17:19

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


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