|December 11, 2012, 16:11||
Accessing neighbor cells fields
Join Date: Oct 2011
Posts: 27Rep Power: 7
I am trying to do an average of cells neighbors. For instance, if I want to get an average of Temperature in the internal field I can easily type
What could be the function to do it just in cell neighbors? Could it be inside geometricField.C?
|December 11, 2012, 16:37||
I think you need to do a bit more for that:
const labelList& neighbour = mesh.cellCells()[celli]
scalar sum = scalar(0);
sum += T[neighbour[i]];
sum /= neighbour.size();
And loop over all the cells with that will give you an average of cell neighbours.
You can find more of functions relating to the mesh information in primitiveMesh class.
|May 13, 2015, 17:53||
Join Date: Dec 2009
Location: Lisbon, Portugal
Posts: 19Rep Power: 8
This a nice implementation, but, in parallel, it does not recognize neighbour cells if they are in subdomains different from the one of the central cell. Is there a simple implementation to address this problem?
|Thread||Thread Starter||Forum||Replies||Last Post|
|Time averaged fields on a defined time range||Yann||OpenFOAM Post-Processing||7||November 19, 2014 09:52|
|Accessing fields and dictionaries from within a BC implementation||alberto||OpenFOAM Running, Solving & CFD||12||December 6, 2011 10:30|
|Missing fields in reconstructPar||flowris||OpenFOAM||1||July 9, 2010 02:48|
|domainIntegrate, dieselFoam and Lagrangian Fields||mturcios777||OpenFOAM||0||May 14, 2010 15:16|
|PostChannel||maka||OpenFOAM Post-Processing||5||July 22, 2009 09:15|