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 }
twoPhaseSystem & fluid
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
dynamicFvMesh & mesh
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word & name() const noexcept
Return const reference to name.
forAll(mesh.cellZones(), czi)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
Definition: List.H:62
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].