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 }
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::dimensioned::name
const word & name() const
Return const reference to name.
Definition: dimensionedType.C:406
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
forAll
forAll(mesh.cellZones(), czi)
Definition: zonePhaseVolumes.H:4
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
reduce
reduce(hasMovingMesh, orOp< bool >())
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6