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 }
Foam::labelList
List< label > labelList
A List of labels.
Definition: labelList.H:56
fluid
multiphaseSystem & fluid
Definition: createFields.H:10
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:216
Foam::dimensioned::name
const word & name() const
Return const reference to name.
Definition: dimensionedType.C:235
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
forAll
forAll(mesh.cellZones(), czi)
Definition: zonePhaseVolumes.H:4
Foam::reduce
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Definition: PstreamReduceOps.H:43
Foam::label
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
Foam::Info
messageStream Info
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
scalarField
volScalarField scalarField(fieldObject, mesh)