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  forAllConstIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
9  {
10  const volScalarField& alpha = iter();
11  scalar phaseVolume = 0;
12 
13  forAll(cellLabels, cli)
14  {
15  label celli = cellLabels[cli];
16  phaseVolume += alpha[celli]*V[celli];
17  }
18 
19  reduce(phaseVolume, sumOp<scalar>());
20 
21  Info<< alpha.name()
22  << " phase volume in zone " << mesh.cellZones()[czi].name()
23  << " = " << phaseVolume*1e6 << " ml " << endl;
24  }
25  }
26 }
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
multiphaseSystem & fluid
Definition: createFields.H:11
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dynamicFvMesh & mesh
List< label > labelList
A List of labels.
Definition: labelList.H:56
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:29
volScalarField scalarField(fieldObject, mesh)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
forAll(mesh.cellZones(), czi)
messageStream Info
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].