CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   FaceCellWave.C: handleCyclicPatches() is called once for each cell (

wenterodt October 22, 2009 08:11

FaceCellWave.C: handleCyclicPatches() is called once for each cell
Dear colleagues,

currently I am doing a research in turbulent plane channel flow using the kwSST_lowRe model from the extend-branch. I use a 1D grid, and for grid-independence studies I want to go to really high numbers of cells i.e. 1e3..1e5. While 1e3 cells are calculated quite fast, the larger grids are processed terribly slow, e.g. 2min for one outer iteration.

I tracked the problem down using valgrind/cachegrind which tells me, that most of the time is being spent in Foam::FaceCellWave<Foam::wallPoint>::handleCyclicP atches() and Foam::List<Foam::wallPoint>::List(int). The reason for this is that the check

if (hasCyclicPatches_)
// Transfer changed faces across cyclic halves

is located within

Foam::label Foam::FaceCellWave<Type>::cellToFace()
const cellList& cells = mesh_.cells();

label changedCellI = 0;
changedCellI < nChangedCells_;

so it is called once for each cell instead of once for each patch, causing the massive slowdown. Can anyone think of a better location for the transfer of changed faces?



mattijs October 24, 2009 09:44

The handleCyclicPatches call is outside the cell loop. Can you post a testcase for 1.6.x which exhibits this slowdown?

wenterodt October 26, 2009 07:10

Admitting I was wrong
Seems like the slowdown actually comes from something else (I'll doublecheck my fvSolutionDict), sorry for bothering you guys.

The described problem only occurs at the initialization of the case (taking one second or so). The iterations are not affected. I came to the wrong conclusion when I checked with cachegrind, where I did only one iteration, and assumed that the slowdown came from the iteration-loop.



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