Skip to content
Snippets Groups Projects
Commit 85703eaf authored by Kutalmış Berçin's avatar Kutalmış Berçin
Browse files

BUG: volFieldValue FO: parallel/empty output (#1853 #1849)

TUT: volFieldValue FO: adds usage example
TUT: multiply FO: adds usage example
parent 05bf4e11
Branches
Tags
No related merge requests found
...@@ -209,30 +209,26 @@ bool Foam::functionObjects::fieldValues::volFieldValue::writeValues ...@@ -209,30 +209,26 @@ bool Foam::functionObjects::fieldValues::volFieldValue::writeValues
if (writeFields_) if (writeFields_)
{ {
Field<Type> allValues(values); word outName = fieldName + '_' + regionTypeNames_[regionType_];
combineFields(allValues); if (this->volRegion::regionName_ != polyMesh::defaultRegion)
if (Pstream::master())
{ {
word outName = fieldName + '_' + regionTypeNames_[regionType_]; outName = outName + '-' + this->volRegion::regionName_;
if (this->volRegion::regionName_ != polyMesh::defaultRegion) }
{
outName = outName + '-' + this->volRegion::regionName_;
}
IOField<Type> IOField<Type>
(
IOobject
( (
IOobject outName,
( obr_.time().timeName(),
outName, obr_,
obr_.time().timeName(), IOobject::NO_READ,
obr_, IOobject::NO_WRITE
IOobject::NO_READ, ),
IOobject::NO_WRITE weightFieldNames_.empty()
), ? scaleFactor_*values
scaleFactor_*weightField*allValues : scaleFactor_*weightField*values
).write(); ).write();
}
} }
if (operation_ != opNone) if (operation_ != opNone)
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
multiply1_scalar_scalar
{
// Mandatory entries
type multiply;
libs (fieldFunctionObjects);
fields (k k_0);
// Optional (inherited) entries
result k2;
region region0;
enabled true;
log true;
timeStart 0;
timeEnd 10;
executeControl timeStep;
executeInterval 1;
writeControl runTime;
writeInterval 1;
}
multiply1_vector_vector
{
${multiply1_scalar_scalar}
fields (U U_0);
result U2;
}
multiply1_scalar_vector
{
${multiply1_scalar_scalar}
fields (k U);
result kU;
}
multiply1_scalar_tensor
{
${multiply1_scalar_scalar}
fields (k U2);
result kU2;
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
volFieldValue1_none_none
{
// Mandatory entries (unmodifiable)
type volFieldValue;
libs (fieldFunctionObjects);
// Mandatory entries (runtime modifiable)
fields (p U);
operation none;
regionType all;
// Optional entries (runtime modifiable)
postOperation none;
weightField none;
// Optional (inherited) entries
writeFields true;
scalingFactor 1.0;
writePrecision 8;
writeToFile true;
useUserTime true;
region region0;
enabled true;
log true;
timeStart 0;
timeEnd 1000;
executeControl timeStep;
executeInterval 1;
writeControl writeTime;
writeInterval -1;
}
volFieldValue1_min_none
{
${volFieldValue1_none_none}
operation min;
}
volFieldValue1_max_none
{
${volFieldValue1_none_none}
operation max;
}
volFieldValue1_sum_none
{
${volFieldValue1_none_none}
operation sum;
}
volFieldValue1_sumMag_none
{
${volFieldValue1_none_none}
operation sumMag;
}
volFieldValue1_average_none
{
${volFieldValue1_none_none}
operation average;
}
volFieldValue1_volAverage_none
{
${volFieldValue1_none_none}
operation volAverage;
}
volFieldValue1_volIntegrate_none
{
${volFieldValue1_none_none}
operation volIntegrate;
}
volFieldValue1_CoV_none
{
${volFieldValue1_none_none}
operation CoV;
}
volFieldValue1_min_none_cellzone
{
${volFieldValue1_min_none}
regionType cellZone;
name zone1;
}
volFieldValue1_max_none_cellzone
{
${volFieldValue1_max_none}
regionType cellZone;
name zone1;
}
volFieldValue1_sum_none_cellzone
{
${volFieldValue1_sum_none}
regionType cellZone;
name zone1;
}
volFieldValue1_sumMag_none_cellzone
{
${volFieldValue1_sumMag_none}
regionType cellZone;
name zone1;
}
volFieldValue1_average_none_cellzone
{
${volFieldValue1_average_none}
regionType cellZone;
name zone1;
}
volFieldValue1_volAverage_none_cellzone
{
${volFieldValue1_volAverage_none}
regionType cellZone;
name zone1;
}
volFieldValue1_volIntegrate_none_cellzone
{
${volFieldValue1_volIntegrate_none}
regionType cellZone;
name zone1;
}
volFieldValue1_CoV_none_cellzone
{
${volFieldValue1_CoV_none}
regionType cellZone;
name zone1;
}
// ************************************************************************* //
...@@ -67,6 +67,7 @@ functions ...@@ -67,6 +67,7 @@ functions
#include "FOlog" #include "FOlog"
#include "FOmag" #include "FOmag"
#include "FOmagSqr" #include "FOmagSqr"
#include "FOmultiply"
#include "FOmomentum" #include "FOmomentum"
#include "FOnearWallFields" #include "FOnearWallFields"
#include "FOPecletNo" #include "FOPecletNo"
...@@ -85,6 +86,7 @@ functions ...@@ -85,6 +86,7 @@ functions
#include "FOsurfaceInterpolate" #include "FOsurfaceInterpolate"
#include "FOturbulenceFields" #include "FOturbulenceFields"
#include "FOvalueAverage" #include "FOvalueAverage"
#include "FOvolFieldValue"
#include "FOvorticity" #include "FOvorticity"
#include "FOreference" #include "FOreference"
#include "FOwallShearStress" #include "FOwallShearStress"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment