diff --git a/src/finiteVolume/functionObjects/volRegion/volRegion.C b/src/finiteVolume/functionObjects/volRegion/volRegion.C index 3a0dcede22b0c95eba0cb1eede8e22faa8739cbb..b650a4785edd6c1c7900e10a51f9284464bf5029 100644 --- a/src/finiteVolume/functionObjects/volRegion/volRegion.C +++ b/src/finiteVolume/functionObjects/volRegion/volRegion.C @@ -83,6 +83,7 @@ Foam::functionObjects::volRegion::volRegion ? regionTypeNames_.read(dict.lookup("regionType")) : vrtAll ), + regionName_(polyMesh::defaultRegion), regionID_(-1) { read(dict); diff --git a/src/functionObjects/field/fieldValues/volFieldValue/volFieldValueTemplates.C b/src/functionObjects/field/fieldValues/volFieldValue/volFieldValueTemplates.C index e53b2665b8aaff962c6e25889c53da388b7f63dc..c5a30db000999b9e02f4d5f351e302d53a665e86 100644 --- a/src/functionObjects/field/fieldValues/volFieldValue/volFieldValueTemplates.C +++ b/src/functionObjects/field/fieldValues/volFieldValue/volFieldValueTemplates.C @@ -217,12 +217,17 @@ bool Foam::functionObjects::fieldValues::volFieldValue::writeValues if (Pstream::master()) { + word outName = fieldName + '_' + regionTypeNames_[regionType_]; + if (this->volRegion::regionName_ != polyMesh::defaultRegion) + { + outName = outName + '-' + this->volRegion::regionName_; + } + IOField<Type> ( IOobject ( - fieldName + '_' + regionTypeNames_[regionType_] - + '-' + volRegion::regionName_, + outName, obr_.time().timeName(), obr_, IOobject::NO_READ, @@ -241,13 +246,17 @@ bool Foam::functionObjects::fieldValues::volFieldValue::writeValues file()<< tab << result; Log << " " << operationTypeNames_[operation_] - << "(" << volRegion::regionName_ << ") of " << fieldName + << "(" << this->volRegion::regionName_ << ") of " << fieldName << " = " << result << endl; // Write state/results information const word& opName = operationTypeNames_[operation_]; - word resultName = - opName + '(' + volRegion::regionName_ + ',' + fieldName + ')'; + word outName = fieldName; + if (this->volRegion::regionName_ != polyMesh::defaultRegion) + { + outName = this->volRegion::regionName_ + ',' + outName; + } + word resultName = opName + '(' + outName + ')'; this->setResult(resultName, result); }