CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Post-Processing (
-   -   Averaging pMean by slice (

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.
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,


All times are GMT -4. The time now is 16:21.