Commit Graph

21 Commits

Author SHA1 Message Date
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
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
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
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
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
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
8bfff27468 Updated member type comments
See http://bugs.openfoam.org/view.php?id=2356
2016-11-28 09:22:56 +00:00
b37269d481 functionObjects: Improved handling of multi-file indexing and code style
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2216
2016-08-24 19:34:00 +01:00
6a529f2f76 functionObjects::volRegion: General base-class to handle vol (cell) region processing
Renamed the original volRegion -> volFieldValue to clarify the purpose
of this class to process vol fields on a volRegion.
2016-08-11 15:11:19 +01:00