FreeFOAM The Cross-Platform CFD Toolkit
zonePhaseVolumes.H
Go to the documentation of this file.
1 {
2  const scalarField& V = mesh.V();
3 
4  forAll(mesh.cellZones(), czi)
5  {
6  const labelList& cellLabels = mesh.cellZones()[czi];
7 
8  scalar phaseVolume = 0;
9 
10  forAll(cellLabels, cli)
11  {
12  label celli = cellLabels[cli];
13  phaseVolume += alpha1[celli]*V[celli];
14  }
15 
16  reduce(phaseVolume, sumOp<scalar>());
17 
18  Info<< "Phase volume in zone " << mesh.cellZones()[czi].name()
19  << " = " << phaseVolume*1e6 << " ml " << endl;
20  }
21 }