diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index dbc7ff73..f672579b 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -142,10 +142,12 @@ void Foam::fieldValues::cellSource::initialise(const dictionary& dict) return; } + volume_ = volume(); + Info<< type() << " " << name_ << ":" << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl << " total cells = " << nCells_ << nl - << " total volume = " << gSum(filterField(mesh().V())) + << " total volume = " << volume_ << nl << endl; if (dict.readIfPresent("weightField", weightFieldName_)) @@ -164,7 +166,7 @@ void Foam::fieldValues::cellSource::writeFileHeader(const label i) writeCommented(file(), "Cells : "); file() << nCells_ << endl; writeCommented(file(), "Volume : "); - file() << volume() << endl; + file() << volume_ << endl; writeCommented(file(), "Time"); if (writeVolume_) @@ -238,10 +240,12 @@ void Foam::fieldValues::cellSource::write() if (writeVolume_) { + volume_ = volume(); if (Pstream::master()) { - file() << tab << volume(); + file() << tab << volume_; } + Info(log_)<< " total volume = " << volume_ << endl; } forAll(fields_, i) diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H index a945e91b..a02584e7 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H @@ -192,6 +192,9 @@ protected: //- Weight field name - only used for opWeightedAverage mode word weightFieldName_; + //- Volume of the cellSource + scalar volume_; + //- Optionally write the volume of the cellSource bool writeVolume_;