functionObjects: forces: Write global and local values on the same line

The forces function object, when specified with a full coordinate
system, previously wrote forces and moments out in the following format:

    time-0 forces-0 moments-0
    time-0 localForces-0 localMoments-0
    time-1 forces-1 moments-1
    time-1 localForces-1 localMoments-1
    # etc ...

There are two rows of values per time. This complicates the definition
of the table and means that filtering has to be done before the data
series can be visualised. The format has now been changed to the
following form:

    time-0 forces-0 moments-0 localForces-0 localMoments-0
    time-1 forces-1 moments-1 localForces-1 localMoments-1
    # etc ...

There is one row per time, and each column is therefore a continuous
series of one variable that can be plotted.
This commit is contained in:
Will Bainbridge
2017-10-12 10:18:47 +01:00
parent 20aa72ff67
commit d923beb85b

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -419,14 +419,14 @@ void Foam::functionObjects::forces::writeForces()
<< endl;
writeTime(file(MAIN_FILE));
file(MAIN_FILE) << tab << setw(1) << '('
<< sum(force_[0]) << setw(1) << ' '
<< sum(force_[1]) << setw(1) << ' '
<< sum(force_[2]) << setw(3) << ") ("
<< sum(moment_[0]) << setw(1) << ' '
<< sum(moment_[1]) << setw(1) << ' '
<< sum(moment_[2]) << setw(1) << ')'
<< endl;
<< sum(moment_[2]) << setw(1) << ')';
if (localSystem_)
{
@ -437,16 +437,16 @@ void Foam::functionObjects::forces::writeForces()
vectorField localMomentT(coordSys_.localVector(moment_[1]));
vectorField localMomentP(coordSys_.localVector(moment_[2]));
writeTime(file(MAIN_FILE));
file(MAIN_FILE) << tab << setw(1) << '('
<< sum(localForceN) << setw(1) << ' '
<< sum(localForceT) << setw(1) << ' '
<< sum(localForceP) << setw(3) << ") ("
<< sum(localMomentN) << setw(1) << ' '
<< sum(localMomentT) << setw(1) << ' '
<< sum(localMomentP) << setw(1) << ')'
<< endl;
<< sum(localMomentP) << setw(1) << ')';
}
file(MAIN_FILE) << endl;
}