db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
36 lines
1.2 KiB
C
36 lines
1.2 KiB
C
if (packingLimiter)
|
|
{
|
|
// Calculating exceeding volume fractions
|
|
volScalarField alphaEx = max(alpha - alphaMax, scalar(0));
|
|
|
|
// Finding neighbouring cells of the whole domain
|
|
labelListList neighbour = mesh.cellCells();
|
|
scalarField cellVolumes = mesh.cellVolumes();
|
|
|
|
forAll (alphaEx, celli)
|
|
{
|
|
// Finding the labels of the neighbouring cells
|
|
labelList neighbourCell = neighbour[celli];
|
|
|
|
// Initializing neighbouring cells contribution
|
|
scalar neighboursEx = 0.0;
|
|
|
|
forAll (neighbourCell, cellj)
|
|
{
|
|
labelList neighboursNeighbour = neighbour[neighbourCell[cellj]];
|
|
scalar neighboursNeighbourCellVolumes = 0.0;
|
|
|
|
forAll (neighboursNeighbour, cellk)
|
|
{
|
|
neighboursNeighbourCellVolumes +=
|
|
cellVolumes[neighboursNeighbour[cellk]];
|
|
}
|
|
|
|
neighboursEx +=
|
|
alphaEx[neighbourCell[cellj]]*cellVolumes[celli]
|
|
/neighboursNeighbourCellVolumes;
|
|
}
|
|
|
|
alpha[celli] += neighboursEx - alphaEx[celli];
|
|
}
|
|
}
|