OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

packingLimiter.H

Go to the documentation of this file.
00001     if (packingLimiter)
00002     {
00003         // Calculating exceeding volume fractions
00004         volScalarField alphaEx = max(alpha - alphaMax, scalar(0));
00005 
00006         // Finding neighbouring cells of the whole domain
00007         labelListList neighbour = mesh.cellCells();
00008         scalarField cellVolumes = mesh.cellVolumes();
00009 
00010         forAll (alphaEx, celli)
00011         {
00012             // Finding the labels of the neighbouring cells
00013             labelList neighbourCell = neighbour[celli];
00014 
00015             // Initializing neighbouring cells contribution
00016             scalar neighboursEx = 0.0;
00017            
00018             forAll (neighbourCell, cellj)
00019             {
00020                 labelList neighboursNeighbour = neighbour[neighbourCell[cellj]];
00021                 scalar neighboursNeighbourCellVolumes = 0.0;
00022         
00023                 forAll (neighboursNeighbour, cellk)
00024                 {
00025                     neighboursNeighbourCellVolumes +=
00026                         cellVolumes[neighboursNeighbour[cellk]];
00027                 }
00028 
00029                 neighboursEx +=
00030                     alphaEx[neighbourCell[cellj]]*cellVolumes[celli]
00031                    /neighboursNeighbourCellVolumes;
00032             }
00033 
00034             alpha[celli] += neighboursEx - alphaEx[celli];
00035         }
00036     }
Copyright © 2000-2009 OpenCFD Ltd