cellSource: Writing the volume of the cellSource (sum(V)) for each time is now optional

Previous behavior which may be useful for moving-mesh cases can be
selected using the optional entry:
    writeVolume  yes;

The initial volume is written in the log and data file header e.g.:

 #   Source : all
 #   Cells  : 3829
 #   Volume : 9.943164e-01

Also added
    sumMag        | sum of component magnitudes
This commit is contained in:
Henry
2015-04-26 21:35:25 +01:00
parent e393bbbaca
commit ef3ba43cf4
4 changed files with 58 additions and 21 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -90,6 +90,11 @@ Type Foam::fieldValues::cellSource::processValues
result = sum(values);
break;
}
case opSumMag:
{
result = sum(cmptMag(values));
break;
}
case opAverage:
{
result = sum(values)/values.size();
@ -201,7 +206,7 @@ bool Foam::fieldValues::cellSource::writeValues(const word& fieldName)
file()<< tab << result;
Info(log_)<< " " << operationTypeNames_[operation_]
<< "(" << sourceName_ << ") for " << fieldName
<< "(" << sourceName_ << ") of " << fieldName
<< " = " << result << endl;
}
}
@ -221,4 +226,3 @@ Foam::tmp<Foam::Field<Type> > Foam::fieldValues::cellSource::filterField
// ************************************************************************* //