CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Averaging pMean by slice (http://www.cfd-online.com/Forums/openfoam-post-processing/61364-averaging-pmean-slice.html)

cedric_duprat September 19, 2008 10:10

Hi all, I want to calculate
 
Hi all,

I want to calculate an average pressure on each slice of my mesh to get the pressure drop as a Post-processing tool.

the result of this "operation" should be a volScalarField (value = cst by slice).
I have a structured, mesh so at every dx, I should be able to cut my geometry and make a sum of pMean.

my question is how to get this slice's cell, this piece of code manage with all the cells.
forAll(mesh.cells(),cellI)
{
pDropSlice[cellI] = sum(mesh.cells()*pMean[cellI]);
}
I can't find how to tell OF
forAll(slice on x direction, sliceI)
{
forAll(mesh.cells[sliceI], cellI)
{do the averaging}
}

Hope you can help,

Cedric


All times are GMT -4. The time now is 09:22.