CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Using subset of data on sampledPlane (

nikwin November 13, 2009 09:21

Using subset of data on sampledPlane
Dear All,

I would like to perform an area-weighted average on a subset of samples on a sampledPlane. For all samples I am averaging as follows, e.g for pressure,

plane xPl(xP[cellI], n[cellI]);
sampledPlane smpPl("smpPl", mesh, xPl,word::null,false);
const scalarField pPl(smpPl.sample(p));
pArea = smpPl.average(pPl);

Is there a way to only use a subset of samples on the plane to average on?


olesen November 14, 2009 12:36

AKAIK sampledPlane respects cellZones, perhaps that is a good way to get your subset.

nikwin November 17, 2009 07:32

Thank you Olesen,

Unfortunately I haven't yet tried the cellZones approach. Instead I've solved my problem via making a subsetMesh on which I've been able to create a sampledPlane on.


All times are GMT -4. The time now is 19:04.