Updated function object documentation

This commit is contained in:
andy
2012-08-13 17:36:58 +01:00
parent c74987549b
commit f3d8e5316c
14 changed files with 503 additions and 164 deletions

View File

@ -39,7 +39,7 @@ Description
{ {
type cloudInfo; type cloudInfo;
functionObjectLibs ("libcloudFunctionObjects.so"); functionObjectLibs ("libcloudFunctionObjects.so");
...
clouds clouds
( (
kinematicCloud1 kinematicCloud1
@ -60,8 +60,8 @@ Description
The output data of each cloud is written to a file named \<cloudName\>.dat The output data of each cloud is written to a file named \<cloudName\>.dat
SeeAlso SeeAlso
functionObject.H Foam::functionObject
OutputFilterFunctionObject.H Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
cloudInfo.C cloudInfo.C

View File

@ -67,11 +67,9 @@ Description
{ {
type fieldAverage; type fieldAverage;
functionObjectLibs ("libfieldFunctionObjects.so"); functionObjectLibs ("libfieldFunctionObjects.so");
...
resetOnRestart true; resetOnRestart true;
resetOnOutput false; resetOnOutput false;
fields fields
( (
U U
@ -104,8 +102,8 @@ Note
To employ the \c prime2Mean option, the \c mean option must be selecetd. To employ the \c prime2Mean option, the \c mean option must be selecetd.
SeeAlso SeeAlso
functionObject.H Foam::functionObject
OutputFilterFunctionObject.H Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
fieldAverage.C fieldAverage.C

View File

@ -36,21 +36,15 @@ Description
\verbatim \verbatim
fieldCoordinateSystemTransform1 fieldCoordinateSystemTransform1
{ {
// Type of functionObject
type fieldCoordinateSystemTransform; type fieldCoordinateSystemTransform;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so"); functionObjectLibs ("libfieldFunctionObjects.so");
...
// Fields to be transformed
fields fields
( (
U U
UMean UMean
UPrime2Mean UPrime2Mean
); );
// Co-ordinate system
coordinateSystem coordinateSystem
{ {
origin (0.001 0 0); origin (0.001 0 0);
@ -60,7 +54,17 @@ Description
} }
\endverbatim \endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | type name: fieldCoordinateSystemTransform | yes |
fields | list of fields to be transformed |yes |
coordinateSystem | local co-ordinate system | yes |
\endtable
SeeAlso SeeAlso
Foam::functionObject
Foam::OutputFilterFunctionObject
Foam::coordinateSystem Foam::coordinateSystem
SourceFiles SourceFiles

View File

@ -28,13 +28,44 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
Calculates scalar minimim and maximum field values. This function object calculates the value and position of scalar minimim
and maximum for a list of user-specified fields. For variables with a rank
greater than zero, either the min/max of a component value or the magnitude
is reported. When operating in parallel, the processor owning the value
is also given.
For variables with rank > 0, computes the magnitude of the min/max Example of function object specification:
values. \verbatim
fieldMinMax1
{
type fieldMinMax;
functionObjectLibs ("libfieldFunctionObjects.so");
...
write yes;
log yes;
mode magnitude;
fields
(
U
p
);
}
\endverbatim
Data written to the file \<timeDir\>/fieldMinMax.dat \heading Function object usage
\table
Property | Description | Required | Default value
type | type name: fieldMinMax | yes |
write | write min/max data to file | no | yes
log | write min/max data to standard output | no | no
mode | calculation mode: magnitude or component | no | magnitude
\endtable
Output data is written to the file \<timeDir\>/fieldMinMax.dat
SeeAlso
Foam::functionObject
Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
fieldMinMax.C fieldMinMax.C

View File

@ -24,39 +24,75 @@ License
Class Class
Foam::fieldValues::cellSource Foam::fieldValues::cellSource
Description Group
Cell source variant of field value function object. Values of user- grpFieldFunctionObjects
specified fields reported for collections of cells.
cellObj1 // Name also used to identify output folder Description
This function object provides a 'cell source' variant of the fieldValues
function object. Given a list of user-specified fields and a selection
of mesh cells, a number of operations can be performed, such as sums,
averages and integrations.
Example of function object specification:
\verbatim
cellSource1
{ {
type cellSource; type cellSource;
functionObjectLibs ("libfieldFunctionObjects.so"); functionObjectLibs ("libfieldFunctionObjects.so");
enabled true; ...
outputControl outputTime; log true;
log true; // log to screen? valueOutput true;
valueOutput true; // Write values at run-time output times? source cellZone;
source cellZone; // Type of cell source
sourceName c0; sourceName c0;
operation volAverage; operation volAverage;
weightField alpha1; // optional weight field weightField alpha1;
fields fields
( (
p p
U U
); );
} }
\endverbatim
where operation is one of: \heading Function object usage
- none \table
- sum Property | Description | Required | Default value
- average type | type name: cellSource | yes |
- weightedAverage log | write data to standard output | no | no
- volAverage valueOutput | write the raw output values | yes |
- volIntegrate source | cell source: see below | yes |
- CoV (Coefficient of variation: standard deviation/mean) sourceName | name of cell source if required | no |
- min operation | operation to perform | yes |
- max weightField | name of field to apply weighting | no |
fields | list of fields to operate on | yes |
\endtable
\linebreak
Where \c source is defined by
\plaintable
cellZone | requires a 'sourceName' entry to specify the cellZone
all | all cells
\endplaintable
\linebreak
The \c operation is one of:
\plaintable
none | no operation
sum | sum
average | ensemble average
weightedAverage | weighted average
volAverage | volume weighted average
volIntegrate | volume integral
min | minimum
max | maximum
CoV | coefficient of variation: standard deviation/mean
\endplaintable
SeeAlso
Foam::fieldValues
Foam::functionObject
Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
cellSource.C cellSource.C

View File

@ -24,24 +24,32 @@ License
Class Class
Foam::fieldValues::faceSource Foam::fieldValues::faceSource
Description Group
Face source variant of field value function object. Values of user- grpFieldFunctionObjects
specified fields reported for collections of faces.
Description
This function object provides a 'face source' variant of the fieldValues
function object. 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, averages and integrations.
\linebreak
For example, to calculate the volumetric or mass flux across a patch,
apply the 'sum' operator to the flux field (typically \c phi)
Example of function object specification:
\verbatim \verbatim
faceObj1 // Name also used to identify output folder faceSource1
{ {
type faceSource; type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so"); functionObjectLibs ("libfieldFunctionObjects.so");
enabled true; ...
outputControl outputTime; log yes;
log true; // log to screen? valueOutput yes;
valueOutput true; // Write values at run-time output times? source faceZone;
source faceZone; // Type of face source: sourceName f0;
// faceZone,patch,sampledSurface
sourceName f0; // faceZone name, see below
operation sum; operation sum;
weightField alpha1; // optional weight field weightField alpha1;
fields fields
( (
p p
@ -51,44 +59,66 @@ Description
} }
\endverbatim \endverbatim
source: \heading Function object usage
- faceZone : requires a 'sourceName' entry to specify the faceZone \table
- patch : "" patch Property | Description | Required | Default value
- sampledSurface : requires a 'sampledSurfaceDict' subdictionary. See e.g. type | type name: faceSource | yes |
sampleDict. log | write data to standard output | no | no
valueOutput | write the raw output values | yes |
source | face source: see below | yes |
sourceName | name of face source if required | no |
operation | operation to perform | yes |
weightField | name of field to apply weighting | no |
fields | list of fields to operate on | yes |
\endtable
operation is one of: \linebreak
- none Where \c source is defined by
- sum \plaintable
- average (ensemble) faceZone | requires a 'sourceName' entry to specify the faceZone
- weightedAverage patch | requires a 'sourceName' entry to specify the patch
- areaAverage sampledSurface | requires a 'sampledSurfaceDict' sub-dictionary
- areaIntegrate \endplaintable
- min
- max
- CoV (Coefficient of variation: standard deviation/mean)
- areaNormalAverage (vector with first component (average of) inproduct
of value and face area vector)
- areaNormalIntegrate ( ,, ,, (sum of) ,,
For example, to calculate the volumetric or mass flux across a patch, \linebreak
apply the 'sum' operator to the flux field (typically \c phi) The \c operation is one of:
\plaintable
none | no operation
sum | sum
average | ensemble average
weightedAverage | weighted average
areaAverage | area weighted average
areaIntegrate | area integral
min | minimum
max | maximum
CoV | coefficient of variation: standard deviation/mean
areaNormalAverage| area weighted average in face normal direction
areaNormalIntegrate | area weighted integral in face normal directon
\endplaintable
Note Note
- The values reported by the areaNormalAverage and areaNormalIntegrate
operations are written as the first component of a field with the same
rank as the input field.
- faces on empty patches get ignored - faces on empty patches get ignored
- if the field is a volField the \c faceZone can only consist of boundary - if the field is a volField the \c faceZone can only consist of boundary
faces faces
- all fields get oriented according to the \c faceZone (so you might - all fields are oriented according to the \c faceZone (so you might
e.g. see negative pressure) e.g. see negative pressure)
- using \c sampledSurfaces: - using \c sampledSurfaces:
- they do not do surface fields - not available for surface fields
- if interpolate=true they use \c interpolationCellPoint - if interpolate=true they use \c interpolationCellPoint
otherwise they use cell values otherwise they use cell values
- each triangle in \c sampledSurface is logically only in one cell - each triangle in \c sampledSurface is logically only in one cell
so interpolation will be wrong when triangles are larger than so interpolation will be wrong when triangles are larger than
cells. This can only happen for sampling on \c triSurfaceMesh cells. This can only happen for sampling on a \c triSurfaceMesh
- take care when using isoSurfaces - these might have duplicate - take care when using isoSurfaces - these might have duplicate
triangles so integration might be wrong triangles and so integration might be wrong
SeeAlso
Foam::fieldValues
Foam::functionObject
Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
faceSource.C faceSource.C

View File

@ -28,30 +28,41 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
Samples near-patch volFields This function object samples near-patch volume fields
Holds fields Fields are stored
- every timestep the field get updated with new values - every time step the field is updated with new values
- at write it writes the fields - at output it writes the fields
so this functionObject can either be used to calculate a new field
as a postprocessing step or (since the fields are registered)
use these in another functionObject (e.g. faceSource).
surfaceValues This functionObject can either be used
- to calculate a new field as a post-processing step or
- since the fields are registered, used in another functionObject
Example of function object specification:
\verbatim
nearWallFields1
{ {
type nearWallFields; type nearWallFields;
.. functionObjectLibs ("libfieldFunctionObjects.so");
enabled true; ...
outputControl outputTime;
..
// Name of volField and corresponding surfaceField
fields ((p pNear)(U UNear)); fields ((p pNear)(U UNear));
// Name of patch to sample
patches (movingWall); patches (movingWall);
// Distance away from the wall distance 0.13;
distance 0.13; // distance away from wall
} }
\endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | type name: nearWallFields | yes |
fields | list of fields with correspoding output field names | yes |
patches | list of patches to sample | yes |
distance | distance from patch to sample | yes |
\endtable
SeeAlso
Foam::functionObject
Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
nearWallFields.C nearWallFields.C

View File

@ -28,8 +28,28 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
Writes a scalar field whose value is the local processor ID. Output This function object writes a scalar field whose value is the local
field name is processorID. processor ID. The output field name is 'processorID'.
Example of function object specification:
\verbatim
processorField1
{
type processorField;
functionObjectLibs ("libfieldFunctionObjects.so");
...
}
\endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | type name: processorField | yes |
\endtable
SeeAlso
Foam::functionObject
Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
processorField.C processorField.C

View File

@ -28,8 +28,34 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
Reads fields from the time folders and adds them to the mesh database This function object reads fields from the time folders and adds them to
for further post-processing. the mesh database for further post-processing.
Example of function object specification:
\verbatim
readFields1
{
type readFields;
functionObjectLibs ("libfieldFunctionObjects.so");
...
fields
(
U
p
);
}
\endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | type name: readFields | yes |
fields | list of fields to read | no |
\endtable
SeeAlso
Foam::functionObject
Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
readFields.C readFields.C

View File

@ -28,25 +28,24 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
Droplet size distribution calculation. This function object creates a size distribution via interrogating a
continuous phase fraction field.
Looks up a void-fraction (alpha) field and splits the mesh into regions Looks up a phase-fraction (alpha) field and splits the mesh into regions
based on where the field is below the threshold value. These based on where the field is below the threshold value. These
regions ("droplets") can now be analysed. regions ("droplets") can now be analysed.
Regions: Regions:
- (debug) write regions as a volScalarField
- (debug) print for all regions the sum of volume and alpha*volume
- print the regions connected to a user-defined set of patches. - print the regions connected to a user-defined set of patches.
(in spray calculation these form the liquid core) (in spray calculation these form the liquid core)
- print the regions with too large volume. These are the 'background' - print the regions with too large volume. These are the 'background'
regions. regions.
- (debug) write regions as a volScalarField
- (debug) print for all regions the sum of volume and alpha*volume
Fields: Output (volume scalar) fields include:
- write volScalarField alpha_liquidCore : alpha with outside liquid core - alpha_liquidCore : alpha with outside liquid core set to 0
set to 0. - alpha_background : alpha with outside background set to 0.
alpha_background : alpha with outside background
set to 0.
Histogram: Histogram:
- determine histogram of diameter (given minDiameter, maxDiameter, nBins) - determine histogram of diameter (given minDiameter, maxDiameter, nBins)
@ -55,40 +54,41 @@ Description
- write graph of sum, average and deviation of user-defined fields. For - write graph of sum, average and deviation of user-defined fields. For
volVectorFields these are those of the 3 components and the magnitude. volVectorFields these are those of the 3 components and the magnitude.
Sample input: Example of function object specification:
\verbatim
functions regionSizeDistribution1
{
regionSizeDistribution
{ {
type regionSizeDistribution; type regionSizeDistribution;
functionObjectLibs ("libfieldFunctionObjects.so");
outputControl timeStep; ...
outputInterval 1;
// Field to determine regions from
field alpha; field alpha;
// Patches that provide the liquid core
patches (inlet); patches (inlet);
// Delimit alpha regions
threshold 0.4; threshold 0.4;
// Fields to sample (no need to include alpha)
fields (p U); fields (p U);
// Number of bins for histogram
nBins 100; nBins 100;
// Max droplet diameter
maxDiameter 0.5e-4; maxDiameter 0.5e-4;
//// Min droplet diameter (default is 0) minDiameter 0;
//minDiameter 0;
// Writing format
setFormat gnuplot; setFormat gnuplot;
} }
} \endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | type name: regionSizeDistribution |yes|
field | phase field to interrogate | yes |
patches | patches from which the liquid core is identified | yes|
threshold | phase fraction applied to delimit regions | yes |
fields | fields to sample | yes |
nBins | number of bins for histogram | yes |
maxDiameter | maximum region equivalent diameter | yes |
minDiameter | minimum region equivalent diameter | no | 0
setFormat | writing format | yes |
\endtable
SeeAlso
Foam::functionObject
Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
regionSizeDistribution.C regionSizeDistribution.C

View File

@ -28,7 +28,72 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
Generation of streamlines. Samples along track of passive particle. This function object generates streamline data by sampling a set of
user-specified fields along a particle track, transported by a
user-specified velocity field.
Example of function object specification:
\verbatim
streamLine1
{
type streamLine;
functionObjectLibs ("libfieldFunctionObjects.so");
...
setFormat vtk;
UName U;
trackForward yes;
fields
(
U
p
);
lifeTime 10000;
trackLength 1e-3;
nSubCycle 5;
cloudName particleTracks;
seedSampleSet uniform;
uniformCoeffs
{
type uniform;
axis x; //distance;
start (-0.0205 0.0001 0.00001);
end (-0.0205 0.0005 0.00001);
nPoints 100;
}
}
\endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | type name: streamLine | yes |
setFormat | output data type | yes |
UName | tracking velocity field name | yes |
fields | fields to sample | yes |
lifetime | maximum number of particle tracking steps | yes |
trackLength | tracking segment length | no |
nSubCycle | number of tracking steps per cell | no|
cloudName | cloud name to use | yes |
seedSampleSet| seeding method (see below)| yes |
\endtable
\linebreak
Where \c seedSampleSet is typically one of
\plaintable
uniform | uniform particle seeding
cloud | cloud of points
triSurfaceMeshPointSet | points according to a tri-surface mesh
\endplaintable
Note
When specifying the track resolution, the \c trackLength OR \c nSubCycle
option should be used
SeeAlso
Foam::functionObject
Foam::OutputFilterFunctionObject
Foam::sampledSet
Foam::wallBoundedStreamLine
SourceFiles SourceFiles
streamLine.C streamLine.C
@ -83,7 +148,6 @@ class streamLine
//- On/off switch //- On/off switch
bool active_; bool active_;
//- List of fields to sample //- List of fields to sample
wordList fields_; wordList fields_;
@ -130,9 +194,10 @@ class streamLine
//- Axis of the sampled points to output //- Axis of the sampled points to output
word sampledSetAxis_; word sampledSetAxis_;
//- File output writer //- File writer for scalar data
autoPtr<writer<scalar> > scalarFormatterPtr_; autoPtr<writer<scalar> > scalarFormatterPtr_;
//- File writer for vector data
autoPtr<writer<vector> > vectorFormatterPtr_; autoPtr<writer<vector> > vectorFormatterPtr_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,26 +27,39 @@ Class
Group grpFieldFunctionObjects Group grpFieldFunctionObjects
Description Description
Linear interpolates volFields to surfaceFields This function object linearly interpolates volume fields to generate
surface fields
- at write it writes the fields Fields are stored
- it executes every time step - every time step the field is updated with new values
- at output it writes the fields
so it can either be used to calculate and write the interpolate or This functionObject can either be used
(since the interpolates are registered) use some other functionObject - to calculate a new field as a post-processing step or
to work on them. - since the fields are registered, used in another functionObject
sampleSomeFields Example of function object specification:
\verbatim
surfaceInterpolateFields1
{ {
type surfaceInterpolateFields; type surfaceInterpolateFields;
.. functionObjectLibs ("libfieldFunctionObjects.so");
enabled true; ...
outputControl outputTime; fields ((p pNear)(U UNear));
..
// Name of volField and corresponding surfaceField
fields ((p pInterpolate)(U UInterpolate));
} }
\endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | type name: nearWallFields | yes |
fields | list of fields with correspoding output field names | yes |
\endtable
SeeAlso
Foam::functionObject
Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
surfaceInterpolateFields.C surfaceInterpolateFields.C

View File

@ -28,13 +28,53 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
Stores turbulence fields on the mesh database for further manipulation. This function object stores turbulence fields on the mesh database for
further manipulation.
Fields are stored as copies of the original, with the prefix Fields are stored as copies of the original, with the prefix
"tubulenceModel::", e.g. "tubulenceModel::", e.g.
turbulenceModel::R turbulenceModel::R
Example of function object specification:
\verbatim
turbulenceFields1
{
type turbulenceFields;
functionObjectLibs ("libfieldFunctionObjects.so");
...
fields
(
R
devRhoReff
);
}
\endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | type name: processorField | yes |
fields | fields to store (see below) | yes |
\endtable
Where \c fields can include:
\plaintable
R | Stress tensor
devRhoReff |
mut | turbulence viscosity (compressible)
muEff | effective turbulence viscosity (compressible)
alphat | turbulence thermal diffusivity (compressible)
alphaEff | effective turbulence thermal diffusivity (compressible)
devReff |
nut | turbulence viscosity (incompressible)
nuEff | effective turbulence viscosity (incompressible)
\endplaintable
SeeAlso
Foam::functionObject
Foam::OutputFilterFunctionObject
SourceFiles SourceFiles
turbulenceFields.C turbulenceFields.C

View File

@ -28,7 +28,72 @@ Group
grpFieldFunctionObjects grpFieldFunctionObjects
Description Description
Generation of streamlines. Samples along track of passive particle. This function object generates streamline data by sampling a set of
user-specified fields along a particle track, transported by a
user-specified velocity field, constrained to a patch.
Example of function object specification:
\verbatim
wallBoundedStreamLine1
{
type wallBoundedStreamLine;
functionObjectLibs ("libfieldFunctionObjects.so");
...
setFormat vtk;
UName UNear;
trackForward yes;
fields
(
UNear
p
);
lifeTime 10000;
trackLength 1e-3;
nSubCycle 5;
cloudName particleTracks;
seedSampleSet patchSeed;
patchSeedCoeffs
{
type patchSeed;
patches (wall);
axis x;
maxPoints 20000;
}
}
\endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | type name: wallBoundedStreamLine| yes |
setFormat | output data type | yes |
UName | tracking velocity field name | yes |
fields | fields to sample | yes |
lifetime | maximum number of particle tracking steps | yes |
trackLength | tracking segment length | no |
nSubCycle | number of tracking steps per cell | no|
cloudName | cloud name to use | yes |
seedSampleSet| seeding method (see below)| yes |
\endtable
\linebreak
Where \c seedSampleSet is typically one of
\plaintable
uniform | uniform particle seeding
cloud | cloud of points
patchSeed | seeding via patch faces
triSurfaceMeshPointSet | points according to a tri-surface mesh
\endplaintable
Note
When specifying the track resolution, the \c trackLength OR \c nSubCycle
option should be used
SeeAlso
Foam::functionObject
Foam::OutputFilterFunctionObject
Foam::sampledSet
Foam::streamLine
SourceFiles SourceFiles
wallBoundedStreamLine.C wallBoundedStreamLine.C