Commit Graph

72 Commits

Author SHA1 Message Date
20f5235ecf Renamed ID() -> Index()
Index is a better name to describe a label index than ID which may be an
integer, word or other means of identification.
2023-12-20 18:39:55 +00:00
621740e90b polyBoundaryMesh::findPatchID,findPatchIDs: renamed findIndex,findIndices
Index is a better name to describe a label index than ID which may be an
integer, word or other means of identification.
2023-12-16 13:27:12 +00:00
77f0b172a9 MeshZones: Renamed findZoneID -> findIndex
Index is a better name to describe a label index than ID which may be an
integer, word or other means of identification.
2023-12-15 22:25:02 +00:00
58f82fccbd functionObjects::volFieldValue: Filter processors without zone cells for max/min
Resolves bug-report https://bugs.openfoam.org/view.php?id=4014
2023-09-04 11:57:27 +01:00
4c62933e7f surfaceFieldValue: Removed sumDirection and sumDirectionBalance operations
The purpose of these operations was unclear, and there was no
documentation or examples of their usage. The differences between these
operations behaviours for scalar and vector input seemed arbitrary.
These operations have in some cases become the subject of confusion.
They have therefore been removed.

Equivalent functionality could be easily reinstated as and when a clear
need and application becomes apparent.
2023-06-22 15:42:18 +01:00
618d9d33b2 controlDict: the optional graphFormat entry is now used as the default for all setFormat entries
Foam::graph superseded by the more general Foam::setWriter reducing code
maintenance overhead, simplifying usage and further development.
2023-06-12 17:14:37 +01:00
496850ebb2 functionObjects::fieldValues::volFieldValue: Added support for VolInternalField
It is now possible to calculate field values of VolInternalFields, e.g. the
cached kEpsilon:G field in the
tutorials/modules/incompressibleFluid/pitzDailySteady case:

    #includeFunc cellMax(kEpsilon:G)
2023-03-15 13:59:29 +00:00
e2c160462e functionObjects::volRegion: Replaced with fvCellSet
Replacing volRegion removes unnecessary functionality duplication and ensures
cell set selection is consistent between functionObjects, fvModels and
fvConstraints for user convenience and reducing the code maintenance overhead.

Description
    General cell set selection class for models that apply to sub-sets
    of the mesh.

    Currently supports cell selection from a set of points, a specified cellSet
    or cellZone or all of the cells.  The selection method can either be
    specified explicitly using the \c select entry or inferred from the
    presence of either a \c cellSet, \c cellZone or \c points entry.  The \c
    select entry is required to select \c all cells.

Usage
    Examples:
    \verbatim
        // Apply everywhere
        select   all;

        // Apply within a given cellSet
        select   cellSet; // Optional
        cellSet         rotor;

        // Apply within a given cellZone
        select   cellZone; // Optional
        cellZone        rotor;

        // Apply in cells containing a list of points
        select   points; // Optional
        points
        (
            (2.25 0.5 0)
            (2.75 0.5 0)
        );
    \endverbatim
2023-02-03 19:16:32 +00:00
4dbc23c141 ListOps::identity -> identityMap
to avoid confusion with the tensor identity.
2023-02-03 17:12:31 +00:00
295223624b 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);
    }
2023-02-01 16:17:16 +00:00
574165dc13 functionObjects: Replaced 'name' with 'patch', 'faceZone' or 'cellZone' as appropriate
for consistency with the rest of OpenFOAM and to allow 'name' to be used as the
keyword to name the functionObject.
2023-02-01 11:54:36 +00:00
73c5624acf functionObjects/field: Simplified code using the VolField and SurfaceField partial specialisations
replacing the inconsistently named local typedefs and direct use of the more
complex GeometricField template types.
2022-12-01 22:01:54 +00:00
ed7e703040 Time::timeName(): no longer needed, calls replaced by name()
The timeName() function simply returns the dimensionedScalar::name() which holds
the user-time name of the current time and now that timeName() is no longer
virtual the dimensionedScalar::name() can be called directly.  The timeName()
function implementation is maintained for backward-compatibility.
2022-11-30 15:53:51 +00:00
b0d2002e72 functionObjects: Clean up and completion of hooks 2022-08-05 14:20:53 +01:00
3ce205e2b3 surfaceFieldValue: Fix run-time usage with non-conformal coupled 2022-08-05 14:20:53 +01:00
d675aabccd surfaceFieldValue: Select processor cyclics
If a "patch" selection is made for a cyclic patch, surfaceFieldValue now
also selects faces on any associated processor cyclic patches. This
ensures that the serial and parallel operations are equivalent.
2022-07-28 15:05:27 +01:00
107f85b275 surfaceFieldValue: Support operations on non-conformal boundaries 2022-07-28 12:55:46 +01:00
ab92fc5a39 fvMesh: Moved functionObject mesh change updates from polyMesh -> fvMesh
Many functionObjects operate on fvMesh objects, in particular vol and surface
fields and they cannot be updated in polyMesh as they depend on fvMesh data
which is updated after polyMesh.
2022-07-13 16:21:05 +01:00
b88be2d950 functionObjects::surfaceFieldValue: Update on mesh change
check that the mesh corresponds to the functionObject region
2022-07-10 19:40:14 +01:00
f0e693176d fvMeshTopoChangers::meshToMesh: Added support for changes in decomposition between meshes
If the sequence of meshes are decomposed independently the number, order and
potentially type of processor patches is likely to change.  Thus the processor
patches and patch fields must be replaced with those of the new mesh.
2022-07-10 16:06:17 +01:00
48d9c77085 Updated documentation for foamInfo: The "Note" entry is now part of "Description" or "Usage"
so that it is printed by foamInfo.
2022-05-11 21:27:27 +01:00
18cd22fe5d volFieldValue: Corrected min and max operation for scalars
Resolves bug report https://bugs.openfoam.org/view.php?id=3828
2022-04-21 15:16:31 +01:00
261ce05fac sampledSurfaces: Write multiple fields to the same file
This prevents excessive duplication of surface geometry and makes
post-processing tasks in paraview more convenient.

The Nastran and Star-CD surface formats were found not to work, so
support for these output types has been removed. Raw, VTK, Foam and
Ensight formats are all still available.
2021-11-23 14:44:34 +00:00
c01118589f functionObjects: Added fields() function to provide list of required fields to postProcess
With this change each functionObject provides the list of fields required so
that the postProcess utility can pre-load them before executing the list of
functionObjects.  This provides a more convenient interface than using the
-field or -fields command-line options to postProcess which are now redundant.
2021-10-21 09:23:34 +01:00
056cc20f34 functionObjects: surfaceFieldValue, volFieldValue: Various improvements
A number of changes have been made to the surfaceFieldValue and
volFieldValue function objects to improve their usability and
performance, and to extend them so that similar duplicate functionality
elsewhere in OpenFOAM can be removed.

Weighted operations have been removed. Weighting for averages and sums
is now triggered simply by the existence of the "weightField" or
"weightFields" entry. Multiple weight fields are now supported in both
functions.

The distinction between oriented and non-oriented fields has been
removed from surfaceFieldValue. There is now just a single list of
fields which are operated on. Instead of oriented fields, an
"orientedSum" operation has been added, which should be used for
flowRate calculations and other similar operations on fluxes.

Operations minMag and maxMag have been added to both functions, to
calculate the minimum and maximum field magnitudes respectively. The min
and max operations are performed component-wise, as was the case
previously.

In volFieldValue, minMag and maxMag (and min and mag operations when
applied to scalar fields) will report the location, cell and processor
of the maximum or minimum value. There is also a "writeLocation" option
which if set will write this location information into the output file.
The fieldMinMax function has been made obsolete by this change, and has
therefore been removed.

surfaceFieldValue now operates in parallel without accumulating the
entire surface on the master processor for calculation of the operation.
Collecting the entire surface on the master processor is now only done
if the surface itself is to be written out.
2021-07-13 16:51:33 +01:00
c8307122c6 surfaceFieldValue: Corrected input of the orientWeightField
Resolves bug-report https://bugs.openfoam.org/view.php?id=3689
2021-06-19 12:12:06 +01:00
ee777e4083 Standardise on British spelling: -ize -> -ise
OpenFOAM is predominantly written in Britain with British spelling conventions
so -ise is preferred to -ize.
2021-06-01 19:11:58 +01:00
3ca14ebe58 functionObjects: Fixes to restart and run-time modification behaviour
All function objects now re-read as a result of run-time modifications
to the system/controlDict.

Function objects that write log files (via the logFiles class) will now
generate a new postProcessing/<funcName>/<time> directory as a result of
either restart or run-time modification. Log files will therefore never
be overwritten by restart or run-time modification, except for when a
case is restarted at the same time as a previous execution (e.g.,
repeated runs at the start time).
2021-01-26 08:12:21 +00:00
34cbcd444d surfaceFieldValue: Ouput as correct primitive type
If the surfaceFieldValue function object is used to compute an
area-normal average or integral of a vector quantity, the result will
now be correctly written out as a scalar.

Previously surfaceFieldValue was limited to writing the same type as the
input field. A vector area-normal average or integral therefore had to
be written out as a vector. This was done by setting the x component to
the result, and the y and z components to zero. This was considered to
be counter-intuitive.
2021-01-08 14:39:55 +00:00
bda07488f0 volumetricFlowRateTriSurface: Corrected pre-configuration, and added an example
A volumetric flow rate through a tri-surface can now be obtained using
the volumetricFlowRateTriSurface preconfigured function object, using
the following entry in system/controlDict:

    fuctions
    {
        #includeFunc "volumetricFlowRateTriSurface(name=surface.stl)"
    }

Where "surface.stl" is a tri-surface file in the constant/triSurface
directory. An example of this has been added to the
incompressible/pimpleFoam/RAS/impeller tutorial case.

Note that when possible, it is preferable to use the flowRatePatch or
flowRateFaceZone functions, as these make direct use of the flux and
therefore report a value that is exactly that computed by the solver.
volumetricFlowRateTriSurface, by contrast, does interpolation of the
velocity field which introduces error.

In addition, a minor fix has been made to the underlying
surfaceFieldValue function object so that it does not need a zone/set
name when values on a searchable surface are requested.
2021-01-08 12:03:25 +00:00
f7848e62a1 functionObjects: Emit warning messages only for field names which do not exist for any type
Resolves bug-report https://bugs.openfoam.org/view.php?id=3583
2020-10-27 20:03:19 +00:00
77ee78b47e functionObjects::volFieldValue: corrected parallel operation of writeFields = true
Resolves bug-report https://bugs.openfoam.org/view.php?id=3552
2020-09-21 10:55:49 +01:00
def4772281 Documentation: Centred the Class Declaration comment
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2020-08-28 13:28:58 +01:00
e01de98df0 functionObjects::volFieldValue: Added support for a list of weighting fields
This is particularly useful for multiphase simulations for which integrating the
density weighted phase properties also requires the phase fraction to be
including in the weighting.

A single weight field can be specified as before:

    weightField rho;

or a list specified by:

    weightFields (alpha.water rho.water);
2020-02-24 15:28:36 +00:00
b55bc28698 sampledSurface::writers: Added writeFormat option to select ascii or binary
e.g. in tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/cuttingPlane

    surfaceFormat   vtk;
    writeFormat     binary;
    fields          (p U);

selects writing the VTK surface files in binary format which significantly
speeds-up reading of the files in paraview.

Currently binary writing is supported in VTK and EnSight formats.
2020-01-29 14:59:31 +00:00
3631f13a98 sampledSurface/writers: Removed unnecessary "verbose" argument 2020-01-28 22:46:00 +00:00
93047de818 functionObject::surfaceFieldValue: Removed temporary diagnostics statement 2019-11-11 13:19:02 +00:00
a5c33c5e18 functionObject::surfaceFieldValue: Added support for weighting with negative fields
For example this allows the an inlet flux to be used to create a weighted
average.

Resolves bug-report https://bugs.openfoam.org/view.php?id=3384
2019-11-11 12:20:35 +00:00
8ea55e8f06 functionObjects/.../*FieldValue: Protect against division by zero
Patch contributed by Timo Niemi, VTT.
Resolves bug report https://bugs.openfoam.org/view.php?id=3370
2019-10-14 09:21:27 +01:00
8e9f692aa4 Standardised the class declaration section comments to correspond to the foamNewSource template 2019-06-13 21:26:33 +01:00
30bea84fac C++11 conformance and consistency: Added "move" constructors and assignment operators to OpenFOAM containers
Replaced all uses of complex Xfer class with C++11 "move" constructors and
assignment operators.  Removed the now redundant Xfer class.

This substantial changes improves consistency between OpenFOAM and the C++11 STL
containers and algorithms, reduces memory allocation and copy overhead when
returning containers from functions and simplifies maintenance of the core
libraries significantly.
2019-05-25 17:40:39 +01:00
2f3d47ad7e Residuals: New MeshObject class to store solver performance residuals
This is more efficient and modular than the previous approach of storing the
residuals in the mesh data dictionary.
2019-04-04 19:08:08 +01:00
61c9bc2ee3 functionObjects: Rationalised use of enumerations by using the C++11 scoped form 2018-08-23 17:25:47 +01:00
bf54ab67e1 Updated OpenFOAM Foundation web-link in headers 2018-07-06 21:42:54 +01:00
f29114bfb6 Removed incomplete, inconsistent, confusing and un-maintained header clutter 2018-06-20 15:55:18 +01:00
c3be52bcd6 Corrected 'Class' entries in headers
Using script provided by Bruno Santos
See https://bugs.openfoam.org/view.php?id=2919
2018-05-07 14:18:44 +01:00
fc2b2d0c05 OpenFOAM: Rationalized the naming of scalar limits
In early versions of OpenFOAM the scalar limits were simple macro replacements and the
names were capitalized to indicate this.  The scalar limits are now static
constants which is a huge improvement on the use of macros and for consistency
the names have been changed to camel-case to indicate this and improve
readability of the code:

    GREAT -> great
    ROOTGREAT -> rootGreat
    VGREAT -> vGreat
    ROOTVGREAT -> rootVGreat
    SMALL -> small
    ROOTSMALL -> rootSmall
    VSMALL -> vSmall
    ROOTVSMALL -> rootVSmall

The original capitalized are still currently supported but their use is
deprecated.
2018-01-25 09:46:37 +00:00
7bdbab7f4e Rationalize the "pos" function
"pos" now returns 1 if the argument is greater than 0, otherwise it returns 0.
This is consistent with the common mathematical definition of the "pos" function:

https://en.wikipedia.org/wiki/Sign_(mathematics)

However the previous implementation in which 1 was also returned for a 0
argument is useful in many situations so the "pos0" has been added which returns
1 if the argument is greater or equal to 0.  Additionally the "neg0" has been
added which returns 1 if if the argument is less than or equal to 0.
2017-06-22 14:32:18 +01:00
f5b91be3d9 functionObjects:surfaceFieldValue, volFieldValue: Added weightedSum and weighted[Area|Vol]Integrate
Patch contributed by Timo Niemi, VTT.
Resolves patch request https://bugs.openfoam.org/view.php?id=2452
2017-02-06 15:48:11 +00:00
842aa71ed7 functionObjects::volRegion: Improved parallel efficiency
Based on patch contributed by Kevin Nordin-Bates
Resolves bug-report https://bugs.openfoam.org/view.php?id=2401
2016-12-19 19:20:09 +00:00