Rationalised and standardised cell, face and point set selection controls
The keyword 'select' is now used to specify the cell, face or point set
selection method consistently across all classes requiring this functionality.
'select' replaces the inconsistently named 'regionType' and 'selectionMode'
keywords used previously but backwards-compatibility is provided for user
convenience. All configuration files and tutorials have been updated.
Examples of 'select' from the tutorial cases:
functionObjects:
cellZoneAverage
{
type volFieldValue;
libs ("libfieldFunctionObjects.so");
writeControl writeTime;
writeInterval 1;
fields (p);
select cellZone;
cellZone injection;
operation volAverage;
writeFields false;
}
#includeFunc populationBalanceSizeDistribution
(
name=numberDensity,
populationBalance=aggregates,
select=cellZone,
cellZone=outlet,
functionType=numberDensity,
coordinateType=projectedAreaDiameter,
allCoordinates=yes,
normalise=yes,
logTransform=yes
)
fvModel:
cylinderHeat
{
type heatSource;
select all;
q 5e7;
}
fvConstraint:
momentumForce
{
type meanVelocityForce;
select all;
Ubar (0.1335 0 0);
}
This commit is contained in:
@ -53,7 +53,6 @@ Foam::functionObjects::fieldValue::fieldValue
|
||||
logFiles(obr_, name),
|
||||
dict_(dict),
|
||||
valueType_(valueType),
|
||||
regionName_(word::null),
|
||||
resultDict_(fileName("result"), dictionary::null)
|
||||
{
|
||||
read(dict);
|
||||
@ -72,7 +71,6 @@ Foam::functionObjects::fieldValue::fieldValue
|
||||
logFiles(obr_, name),
|
||||
dict_(dict),
|
||||
valueType_(valueType),
|
||||
regionName_(word::null),
|
||||
resultDict_(fileName("result"), dictionary::null)
|
||||
{
|
||||
read(dict);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,9 +76,6 @@ protected:
|
||||
//- The name of the type of value (volFieldValue, or surfaceFieldValue)
|
||||
const word valueType_;
|
||||
|
||||
//- Name of region (patch, zone, etc.)
|
||||
word regionName_;
|
||||
|
||||
//- List of field names to operate on
|
||||
wordList fields_;
|
||||
|
||||
@ -160,9 +157,6 @@ public:
|
||||
//- Return the reference to the construction dictionary
|
||||
inline const dictionary& dict() const;
|
||||
|
||||
//- Return the region name
|
||||
inline const word& regionName() const;
|
||||
|
||||
//- Return the list of fields required
|
||||
inline virtual wordList fields() const;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,12 +34,6 @@ inline const Foam::dictionary& Foam::functionObjects::fieldValue::dict() const
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::word& Foam::functionObjects::fieldValue::regionName() const
|
||||
{
|
||||
return regionName_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::wordList Foam::functionObjects::fieldValue::fields() const
|
||||
{
|
||||
return fields_;
|
||||
|
||||
@ -54,7 +54,7 @@ namespace fieldValues
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes,
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::selectionTypes,
|
||||
3
|
||||
>::names[] =
|
||||
{
|
||||
@ -90,9 +90,9 @@ const char* Foam::NamedEnum
|
||||
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes,
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::selectionTypes,
|
||||
3
|
||||
> Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypeNames_;
|
||||
> Foam::functionObjects::fieldValues::surfaceFieldValue::selectionTypeNames_;
|
||||
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
@ -105,14 +105,15 @@ const Foam::NamedEnum
|
||||
|
||||
void Foam::functionObjects::fieldValues::surfaceFieldValue::setFaceZoneFaces()
|
||||
{
|
||||
label zoneId = mesh_.faceZones().findZoneID(regionName_);
|
||||
label zoneId = mesh_.faceZones().findZoneID(selectionName_);
|
||||
|
||||
if (zoneId < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< type() << " " << name() << ": "
|
||||
<< regionTypeNames_[regionType_] << "(" << regionName_ << "):" << nl
|
||||
<< " Unknown face zone name: " << regionName_
|
||||
<< selectionTypeNames_[selectionType_]
|
||||
<< "(" << selectionName_ << "):" << nl
|
||||
<< " Unknown face zone name: " << selectionName_
|
||||
<< ". Valid face zones are: " << mesh_.faceZones().names()
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
@ -175,14 +176,15 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setFaceZoneFaces()
|
||||
|
||||
void Foam::functionObjects::fieldValues::surfaceFieldValue::setPatchFaces()
|
||||
{
|
||||
const label patchId = mesh_.boundaryMesh().findPatchID(regionName_);
|
||||
const label patchId = mesh_.boundaryMesh().findPatchID(selectionName_);
|
||||
|
||||
if (patchId < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< type() << " " << name() << ": "
|
||||
<< regionTypeNames_[regionType_] << "(" << regionName_ << "):" << nl
|
||||
<< " Unknown patch name: " << regionName_
|
||||
<< selectionTypeNames_[selectionType_]
|
||||
<< "(" << selectionName_ << "):" << nl
|
||||
<< " Unknown patch name: " << selectionName_
|
||||
<< ". Valid patch names are: "
|
||||
<< mesh_.boundaryMesh().names() << nl
|
||||
<< exit(FatalError);
|
||||
@ -360,7 +362,7 @@ combineSurfaceGeometry
|
||||
pointField& points
|
||||
) const
|
||||
{
|
||||
if (regionType_ == regionTypes::sampledSurface)
|
||||
if (selectionType_ == selectionTypes::sampledSurface)
|
||||
{
|
||||
const sampledSurface& s = surfacePtr_();
|
||||
|
||||
@ -396,7 +398,7 @@ combineSurfaceGeometry
|
||||
Foam::scalar
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::totalArea() const
|
||||
{
|
||||
if (regionType_ == regionTypes::sampledSurface)
|
||||
if (selectionType_ == selectionTypes::sampledSurface)
|
||||
{
|
||||
return gSum(surfacePtr_().magSf());
|
||||
}
|
||||
@ -414,33 +416,35 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::initialise
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
switch (regionType_)
|
||||
switch (selectionType_)
|
||||
{
|
||||
case regionTypes::faceZone:
|
||||
case selectionTypes::faceZone:
|
||||
{
|
||||
dict.lookupBackwardsCompatible({"faceZone", "name"}) >> regionName_;
|
||||
dict.lookupBackwardsCompatible({"faceZone", "name"})
|
||||
>> selectionName_;
|
||||
setFaceZoneFaces();
|
||||
break;
|
||||
}
|
||||
case regionTypes::patch:
|
||||
case selectionTypes::patch:
|
||||
{
|
||||
dict.lookupBackwardsCompatible({"patch", "name"}) >> regionName_;
|
||||
dict.lookupBackwardsCompatible({"patch", "name"}) >> selectionName_;
|
||||
setPatchFaces();
|
||||
break;
|
||||
}
|
||||
case regionTypes::sampledSurface:
|
||||
case selectionTypes::sampledSurface:
|
||||
{
|
||||
sampledSurfaceFaces(dict);
|
||||
regionName_ = surfacePtr_().name();
|
||||
selectionName_ = surfacePtr_().name();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< type() << " " << name() << ": "
|
||||
<< regionTypeNames_[regionType_] << "(" << regionName_ << "):"
|
||||
<< nl << " Unknown region type. Valid region types are:"
|
||||
<< regionTypeNames_.sortedToc() << nl << exit(FatalError);
|
||||
<< selectionTypeNames_[selectionType_]
|
||||
<< "(" << selectionName_ << "):" << nl
|
||||
<< " Unknown selection type. Valid selection types are:"
|
||||
<< selectionTypeNames_.sortedToc() << nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -448,11 +452,12 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::initialise
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< type() << " " << name() << ": "
|
||||
<< regionTypeNames_[regionType_] << "(" << regionName_ << "):" << nl
|
||||
<< " Region has no faces" << exit(FatalError);
|
||||
<< selectionTypeNames_[selectionType_]
|
||||
<< "(" << selectionName_ << "):" << nl
|
||||
<< " selection has no faces" << exit(FatalError);
|
||||
}
|
||||
|
||||
if (regionType_ == regionTypes::sampledSurface)
|
||||
if (selectionType_ == selectionTypes::sampledSurface)
|
||||
{
|
||||
surfacePtr_().update();
|
||||
}
|
||||
@ -505,8 +510,10 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::writeFileHeader
|
||||
{
|
||||
if (operation_ != operationType::none)
|
||||
{
|
||||
writeCommented(file(), "Region type : ");
|
||||
file() << regionTypeNames_[regionType_] << " " << regionName_ << endl;
|
||||
writeCommented(file(), "Selection type : ");
|
||||
file()
|
||||
<< selectionTypeNames_[selectionType_] << " "
|
||||
<< selectionName_ << endl;
|
||||
writeCommented(file(), "Faces : ");
|
||||
file() << nFaces_ << endl;
|
||||
writeCommented(file(), "Area : ");
|
||||
@ -652,7 +659,14 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
|
||||
fieldValue(name, runTime, dict, typeName),
|
||||
dict_(dict),
|
||||
surfaceWriterPtr_(nullptr),
|
||||
regionType_(regionTypeNames_.read(dict.lookup("regionType"))),
|
||||
selectionType_
|
||||
(
|
||||
selectionTypeNames_.read
|
||||
(
|
||||
dict.lookupBackwardsCompatible({"select", "regionType"})
|
||||
)
|
||||
),
|
||||
selectionName_(word::null),
|
||||
operation_(operationTypeNames_.read(dict.lookup("operation"))),
|
||||
weightFieldNames_(),
|
||||
scaleFactor_(1),
|
||||
@ -675,7 +689,14 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
|
||||
fieldValue(name, obr, dict, typeName),
|
||||
dict_(dict),
|
||||
surfaceWriterPtr_(nullptr),
|
||||
regionType_(regionTypeNames_.read(dict.lookup("regionType"))),
|
||||
selectionType_
|
||||
(
|
||||
selectionTypeNames_.read
|
||||
(
|
||||
dict.lookupBackwardsCompatible({"select", "regionType"})
|
||||
)
|
||||
),
|
||||
selectionName_(word::null),
|
||||
operation_(operationTypeNames_.read(dict.lookup("operation"))),
|
||||
weightFieldNames_(),
|
||||
scaleFactor_(1),
|
||||
@ -716,7 +737,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
|
||||
fieldValue::write();
|
||||
}
|
||||
|
||||
if (regionType_ == regionTypes::sampledSurface)
|
||||
if (selectionType_ == selectionTypes::sampledSurface)
|
||||
{
|
||||
surfacePtr_().update();
|
||||
}
|
||||
@ -742,7 +763,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
|
||||
faceList faces;
|
||||
pointField points;
|
||||
|
||||
if (regionType_ == regionTypes::sampledSurface)
|
||||
if (selectionType_ == selectionTypes::sampledSurface)
|
||||
{
|
||||
combineSurfaceGeometry(faces, points);
|
||||
}
|
||||
@ -756,7 +777,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
|
||||
surfaceWriterPtr_->write
|
||||
(
|
||||
outputDir(),
|
||||
regionTypeNames_[regionType_] + ("_" + regionName_),
|
||||
selectionTypeNames_[selectionType_] + ("_" + selectionName_),
|
||||
points,
|
||||
faces
|
||||
);
|
||||
@ -766,7 +787,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
|
||||
// Construct the sign and weight fields and the surface normals
|
||||
const scalarField signs
|
||||
(
|
||||
regionType_ == regionTypes::sampledSurface
|
||||
selectionType_ == selectionTypes::sampledSurface
|
||||
? scalarField(surfacePtr_().Sf().size(), 1)
|
||||
: List<scalar>(faceSign_)
|
||||
);
|
||||
@ -777,7 +798,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
|
||||
}
|
||||
const vectorField Sf
|
||||
(
|
||||
regionType_ == regionTypes::sampledSurface
|
||||
selectionType_ == selectionTypes::sampledSurface
|
||||
? surfacePtr_().Sf()
|
||||
: (signs*filterField(mesh_.Sf()))()
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue
|
||||
|
||||
Description
|
||||
Provides a 'face regionType' variant of the fieldValues function object.
|
||||
Surface (face) region selection class.
|
||||
|
||||
Given a list of user-specified fields and a selection of mesh (or general
|
||||
surface) faces, a number of operations can be performed, such as sums,
|
||||
@ -45,7 +45,7 @@ Description
|
||||
writeControl writeTime;
|
||||
writeFields true;
|
||||
|
||||
regionType patch;
|
||||
select patch;
|
||||
name movingWall;
|
||||
|
||||
operation areaAverage;
|
||||
@ -68,7 +68,8 @@ Description
|
||||
writeFields true;
|
||||
|
||||
surfaceFormat none;
|
||||
regionType faceZone;
|
||||
|
||||
select faceZone;
|
||||
name f0;
|
||||
|
||||
operation sum;
|
||||
@ -89,11 +90,11 @@ Usage
|
||||
Property | Description | Required | Default value
|
||||
type | type name: surfaceFieldValue | yes |
|
||||
log | write data to standard output | no | no
|
||||
writeFields | Write the region field values | yes |
|
||||
writeFields | Write the field values | yes |
|
||||
writeArea | Write the area of the surfaceFieldValue | no |
|
||||
surfaceFormat | output value format | no |
|
||||
regionType | face regionType: see below | yes |
|
||||
name | name of face regionType if required | no |
|
||||
select | face selection: see below | yes |
|
||||
name | name of face select if required | no |
|
||||
operation | operation to perform | yes |
|
||||
weightField | name of field to apply weighting | no |
|
||||
weightFields | Names of fields to apply weighting | no |
|
||||
@ -101,7 +102,7 @@ Usage
|
||||
fields | list of fields to operate on | yes |
|
||||
\endtable
|
||||
|
||||
Where \c regionType is defined by
|
||||
Where the supported \c select options are:
|
||||
\plaintable
|
||||
faceZone | requires a 'name' entry to specify the faceZone
|
||||
patch | requires a 'name' entry to specify the patch
|
||||
@ -136,7 +137,7 @@ Usage
|
||||
- If the field is a volField then a \c faceZone can only consist of
|
||||
boundary faces, because only these faces have a value associated with
|
||||
them. No cell-to-face interpolation is performed.
|
||||
- If the field is a surfaceField then the region cannot be a \c
|
||||
- If the field is a surfaceField then the selection cannot be a \c
|
||||
sampledSurface
|
||||
- If a sampledSurface has interpolation set to false then the surface
|
||||
face values will be taken directly from the cell that contains the
|
||||
@ -187,16 +188,16 @@ public:
|
||||
|
||||
// Public data types
|
||||
|
||||
//- region type enumeration
|
||||
enum class regionTypes
|
||||
//- Selection type enumeration
|
||||
enum class selectionTypes
|
||||
{
|
||||
faceZone,
|
||||
patch,
|
||||
sampledSurface
|
||||
};
|
||||
|
||||
//- region type names
|
||||
static const NamedEnum<regionTypes, 3> regionTypeNames_;
|
||||
//- Selection type names
|
||||
static const NamedEnum<selectionTypes, 3> selectionTypeNames_;
|
||||
|
||||
|
||||
//- Operation type enumeration
|
||||
@ -265,8 +266,11 @@ protected:
|
||||
//- Surface writer
|
||||
autoPtr<surfaceWriter> surfaceWriterPtr_;
|
||||
|
||||
//- region type
|
||||
regionTypes regionType_;
|
||||
//- Selection type
|
||||
selectionTypes selectionType_;
|
||||
|
||||
//- Name of face selection (patch, faceZone, etc.)
|
||||
word selectionName_;
|
||||
|
||||
//- Operation to apply to values
|
||||
operationType operation_;
|
||||
@ -434,8 +438,11 @@ public:
|
||||
|
||||
// Public Member Functions
|
||||
|
||||
//- Return the region type
|
||||
inline const regionTypes& regionType() const;
|
||||
//- Return the selection type
|
||||
inline const selectionTypes& selectionType() const;
|
||||
|
||||
//- Return the selection name
|
||||
inline const word& selectionName() const;
|
||||
|
||||
//- Return the local list of face IDs
|
||||
inline const labelList& faceId() const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,10 +28,18 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes&
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::regionType() const
|
||||
inline
|
||||
const Foam::functionObjects::fieldValues::surfaceFieldValue::selectionTypes&
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::selectionType() const
|
||||
{
|
||||
return regionType_;
|
||||
return selectionType_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::word&
|
||||
Foam::functionObjects::fieldValues::surfaceFieldValue::selectionName() const
|
||||
{
|
||||
return selectionName_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,7 +40,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::validField
|
||||
{
|
||||
if
|
||||
(
|
||||
regionType_ != regionTypes::sampledSurface
|
||||
selectionType_ != selectionTypes::sampledSurface
|
||||
&& obr_.foundObject<SurfaceField<Type>>(fieldName)
|
||||
)
|
||||
{
|
||||
@ -62,7 +62,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::getFieldValues
|
||||
const word& fieldName
|
||||
) const
|
||||
{
|
||||
if (regionType_ == regionTypes::sampledSurface)
|
||||
if (selectionType_ == selectionTypes::sampledSurface)
|
||||
{
|
||||
if (obr_.foundObject<VolField<Type>>(fieldName))
|
||||
{
|
||||
@ -302,7 +302,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
||||
faceList faces;
|
||||
pointField points;
|
||||
|
||||
if (regionType_ == regionTypes::sampledSurface)
|
||||
if (selectionType_ == selectionTypes::sampledSurface)
|
||||
{
|
||||
combineSurfaceGeometry(faces, points);
|
||||
}
|
||||
@ -320,8 +320,8 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
||||
(
|
||||
outputDir(),
|
||||
fieldName
|
||||
+ '_' + regionTypeNames_[regionType_]
|
||||
+ '_' + regionName_,
|
||||
+ '_' + selectionTypeNames_[selectionType_]
|
||||
+ '_' + selectionName_,
|
||||
points,
|
||||
faces,
|
||||
false,
|
||||
@ -390,7 +390,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
||||
file() << tab << result;
|
||||
|
||||
Log << " " << operationTypeNames_[operation_]
|
||||
<< "(" << regionName_ << ") of " << fieldName
|
||||
<< "(" << selectionName_ << ") of " << fieldName
|
||||
<< " = " << result << endl;
|
||||
}
|
||||
|
||||
@ -424,7 +424,8 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::filterField
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< type() << " " << name() << ": "
|
||||
<< regionTypeNames_[regionType_] << "(" << regionName_ << "):"
|
||||
<< selectionTypeNames_[selectionType_]
|
||||
<< "(" << selectionName_ << "):"
|
||||
<< nl
|
||||
<< " Unable to process internal faces for volume field "
|
||||
<< field.name() << nl << abort(FatalError);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -41,8 +41,8 @@ Description
|
||||
writeControl writeTime;
|
||||
writeFields true;
|
||||
|
||||
regionType cellZone;
|
||||
name c0;
|
||||
select cellZone;
|
||||
cellZone c0;
|
||||
operation volAverage;
|
||||
|
||||
weightField alpha1;
|
||||
@ -62,7 +62,7 @@ Usage
|
||||
log | Write data to standard output | no | no
|
||||
writeFields | Write the region field values | yes |
|
||||
writeLocation| Write the location (if available) | no | no
|
||||
regionType | volRegion type: see below | yes |
|
||||
select | volRegion type: see below | yes |
|
||||
name | Name of volRegion if required | no |
|
||||
operation | Operation to perform | yes |
|
||||
weightField | Name of field to apply weighting | no |
|
||||
@ -70,7 +70,7 @@ Usage
|
||||
fields | List of fields to operate on | yes |
|
||||
\endtable
|
||||
|
||||
Where \c regionType is defined by
|
||||
Where \c select options are:
|
||||
\plaintable
|
||||
cellZone | requires a 'name' entry to specify the cellZone
|
||||
all | all cells
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -250,8 +250,8 @@ bool Foam::functionObjects::fieldValues::volFieldValue::writeValues
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fieldName + '_' + regionTypeNames_[regionType_]
|
||||
+ '-' + volRegion::regionName_,
|
||||
fieldName + '_' + selectionTypeNames_[selectionType_]
|
||||
+ '-' + volRegion::cellZoneName_,
|
||||
obr_.time().name(),
|
||||
obr_,
|
||||
IOobject::NO_READ,
|
||||
@ -318,7 +318,7 @@ bool Foam::functionObjects::fieldValues::volFieldValue::writeValues
|
||||
file() << tab << result.value;
|
||||
|
||||
Log << " " << operationTypeNames_[operation_]
|
||||
<< "(" << volRegion::regionName_ << ") of " << fieldName
|
||||
<< "(" << volRegion::cellZoneName_ << ") of " << fieldName
|
||||
<< " = " << result.value;
|
||||
|
||||
if (result.celli != -1)
|
||||
|
||||
@ -38,8 +38,8 @@ functions
|
||||
writeInterval 1;
|
||||
log true;
|
||||
writeFields true;
|
||||
regionType faceZone;
|
||||
name f0;
|
||||
select faceZone;
|
||||
faceZone f0;
|
||||
operation areaAverage;
|
||||
|
||||
fields
|
||||
|
||||
Reference in New Issue
Block a user