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 for (const volScalarField& alpha : fluid.phases())
9 {
10 scalar phaseVolume = 0;
11
12 for (const label celli : cellLabels)
13 {
14 phaseVolume += alpha[celli]*V[celli];
15 }
16
17 reduce(phaseVolume, sumOp<scalar>());
18
19 Info<< alpha.name()
20 << " phase volume in zone " << mesh.cellZones()[czi].name()
21 << " = " << phaseVolume*1e6 << " ml " << endl;
22 }
23 }
24}
reduce(hasMovingMesh, orOp< bool >())
twoPhaseSystem & fluid
dynamicFvMesh & mesh
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
volScalarField & alpha
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333