Commit Graph

17013 Commits

Author SHA1 Message Date
b50591166e STYLE: rename atmospheric-field names, plantCd->Cd and leafAreaDensity->LAD 2022-12-08 11:35:39 +00:00
80f385a3b0 ENH: added new objective functions
- flowRate: volume flow-rate through given patches
- flowRatePartition: distribution of the inlet flow-rate to certain
  outlet patches, with given percentages
- uniformityPatch: uniformity of the velocity field at given (outlet) patches,
  expressed as (half) the variance of the velocity field
- uniformityCellZone: same as uniformityPatch, but defined over
  cellZones
- powerDissipation: the fluid power dissipation taking place within
  given cellZones. In the absence of viscous stress at the "inlets" and
  "outlets" of the cellZones, this corresponds to the volume flow-rate
  weighted total pressure losses through the cellZones

ENH: updated nutSqr so it can be used with adjointkOmegaSST too
2022-12-08 11:15:26 +00:00
8127ec6a05 ENH: added some auxiliary functions in objective
to help allocate pointers related to contributions to the adjoint
turbulence model PDEs, populate them and check the validity of the
cellZones provided for cellZone-based objectives
2022-12-08 11:15:26 +00:00
c9a10055e8 ENH: adjointRASModel now also returns the Jacobian of nut w.r.t. U 2022-12-08 11:15:26 +00:00
d6204acd0e ENH: Added new parallelFvGeometryScheme 2022-12-08 11:14:30 +00:00
3e260b84db ENH: vanDriest: change calcInterval to updateInterval 2022-12-07 16:15:53 +00:00
9fbe2ef0b3 ENH: leastSquaresFaVectors: use pseudo inverse instead of direct inverse 2022-12-07 13:17:32 +00:00
9b379398c5 ENH: tensor-symmTensor: new pseudo-inverse function
REVERT: add heuristic handling of tensor-field inverses - simplify algorithm
2022-12-07 13:17:26 +00:00
b50850de56 COMP: DiagonalMatrix: avoid clang's over-eager optimisation (fixes #2650) 2022-12-07 13:17:03 +00:00
3ab182b1ae STYLE: prefer std::unique_ptr instead of (aliased) Foam::unique_ptr 2022-12-01 16:40:52 +00:00
3151dacccc ENH: include <algorithm> in stdFoam.H
- was already included in many places (via UList.C templates), but now
  formalise by placing in stdFoam.H
2022-12-01 15:52:48 +00:00
8ae2e5a969 ENH: fail-safe access of ITstream tokens as front(), back()
- more standard naming than peekFront() etc
2022-12-01 14:51:19 +00:00
bbd6bfbb7f ENH: additional 'other' category for profilingPstream
- eg, for user MPI operations that are to be tracked separately
2022-12-01 14:51:19 +00:00
8d4e32da22 COMP: fixup test applications 2022-12-01 14:51:19 +00:00
59811983db ENH: BrunDrippingInjection: new injection model for liquid films 2022-12-01 13:56:39 +00:00
dff4c3da05 ENH: limitHeight: new faOption to limit film height 2022-12-01 13:55:27 +00:00
ea44944037 ENH: KinematicSurfaceFilm: add option to specify interacting parcel types
This pack adds a new entry 'parcelTypes' which can specify the list of
parcel type IDs interacting with a surface film. If the entry
is omitted, all particle types are considered.

```
    surfaceFilmModel kinematicSurfaceFilm;

    kinematicSurfaceFilmCoeffs
    {
        interactionType absorb;

        // Optional list of participating parcel IDs
        parcelTypes     (10);
    }
```

To set the parcel type by injector, 'injectorID' entry can be used
when specifying the injector models, e.g.

```
injectionModels
{
    model1
    {
        type            <injectionModelType>;

        // Optional injector ID
        // - if ommitted, parcels use '-1'
        injectorID      10;

        ...
    }
}
```
2022-12-01 12:47:40 +00:00
689b2ab2a9 ENH: leastSquaresEdgeInterpolation: new edge interpolation method 2022-12-01 12:24:27 +00:00
9711b7f1b9 ENH: more consistent single-ownership when swapping fileHandlers
- make fileHandler deletion mechanism more
  transparent by providing a nullptr signature. A nullptr parameter
  is already being used in the argList destructor for shutdown, but that
  relied on an implicit conversion to autoPtr to trigger things.

- improved handling of file handler replacement.

  Previously had a very basic check on old vs new handlers using their
  type() values (string comparison!!), which would unfortunately
  prevent proper swapping of the contents.
  Check the actual pointers instead.

  As part of the change, treat any empty autoPtr as no-op instead of as
  deletion (which is handled explicitly as nullptr instead).

  In addition to making the internal logic simpler, it means that the
  current file handler always changes to a valid state without
  inadvertently removing everything and falling back to creating a new
  default handler (again).

  This handling of no-ops also simplifies call code. For example,

  <code>
      autoPtr<fileHandler> oldHandler;
      autoPtr<fileHandler> writeHandler;
      word handlerName;

      if (arg.readIfPresent("writeHandler", handlerName))
      {
          writeHandler = fileOperation::New(handlerName);
      }

      oldHandler = fileHandler(std::move(writeHandler));

      ... do something

      writeHandler = fileHandler(std::move(oldHandler));
  </code>

  If the "writeHandler" is not specified, each call is a no-op.
  If it is specified, the handlers are swapped out each time.

- the management of the fileHandler communicators is now encapsulated
  privately (managedComm_) with the final layer being responsible for
  cleaning up after itself. This makes delegation/inheritance clearer
  and avoids the risk of freeing an MPI communicator twice.

STYLE: uniformFile static check relocated to fileOperation layer
2022-12-01 12:18:38 +00:00
ffeef76d8f ENH: cleaner separation of global and local world naming
- UPstream::globalComm constant always refers to MPI_COMM_WORLD but
  UPstream::worldComm could be MPI_COMM_WORLD (single world)
  or a dedicated local communicator (for multi-world).

- provide a Pstream wrapped version of MPI_COMM_SELF,
  references as UPstream::selfComm

- UPstream::isUserComm(label)
  test for additional user-defined communicators
2022-12-01 12:18:38 +00:00
e190df9033 ENH: inv: fall back to pseudo-inverse for singular tensors
- remove heuristic handling of tensor-field inverses
2022-11-30 12:24:32 +00:00
0b83d39500 BUG: removed stickiness of readFields function object in postProcess mode. Fixes #2647 2022-11-30 10:34:49 +00:00
8495b86d8e BUG: solidIsothermalReactionRate: redefine the latent energy (fixes #2646) 2022-11-30 10:15:26 +00:00
09a6049f50 BUG: snappyHexMesh: revert to old behaviour. Fixes #2637
Curvature detection was switched on even without curvatureLevel
switched on. Now reverts to v2206 behaviour.
2022-11-29 15:02:21 +00:00
8bfbda8c71 ENH: solidIsothermalReactionRate: new solid reaction rate model
STYLE: solidArrheniusReactionRate: modernise code
2022-11-29 14:27:42 +00:00
bdb437ab10 STYLE: also mention -help-full on usage errors 2022-11-26 01:13:53 +01:00
286c6ce7d8 ENH: Foam::readLink(..)
- recover the target of symbolic links.
  This is needed when re-creating a file tree on another rank.

ENH: handle checkGzip, followLink flags in fileHander filePath()

- previously just relied on the backend defaults, now pass through
- separate init(...) for common constructor init steps
2022-11-26 01:13:53 +01:00
478c1b2312 ENH: add atomic file creation support into masterOFstream (#2631) 2022-11-26 01:13:53 +01:00
69be54107d ENH: IOobject headerClassName now initialised to empty value
- was previously populated with "IOobject" (the typeName) but then
  cannot easily detect if the object was actually read.
  Also clear the headerClassName on a failed read

BUG: parallel inconsistency in regIOobject::readHeaderOk

- headerOk() checked with master, but possible parallel operations
  within it
2022-11-25 12:48:45 +01:00
e401e8f132 COMP: RASModelBase adjustments
- naming more consistent with DESModelBase etc for 'isA' dynamic
  casting
2022-11-25 12:48:45 +01:00
3f87aec01a ENH: improve construct UniformDimensionedFields from components
- ensure that the name is non-empty.
- allow construct from IOobject, dimensions and value

ENH: gravity lookup accessors
2022-11-25 12:48:45 +01:00
efc4649f12 BUG: corrected mappedPatchBase error for multiworld introduced by 945405c32d 2022-11-25 10:04:06 +00:00
360af221fe BUG: [fa|fv]Matrix setValuesFromList - corrected loops. Fixes #2642 2022-11-25 09:24:31 +00:00
8c02820db6 COMP: EigenMatrix: remove unused iter variable 2022-11-24 13:47:08 +00:00
cb4e026aed ENH: add support for additional filter/mapping (#2609)
- comprises a few different elements:

FilterField (currently packaged in PatchFunction1Types namespace)
~~~~~~~~~~~

  The FilterField helper class provides a multi-sweep median filter
  for a Field of data associated with a geometric point cloud.

  The points can be freestanding or the faceCentres (or points)
  of a meshedSurface, for example.

  Using an initial specified search radius, the nearest point
  neighbours are gathered and addressing/weights are built for them.
  This currently uses an area-weighted, linear RBF interpolator
  with provision for quadratic RBF interpolator etc.

  After the weights and addressing are established,
  the evaluate() method can be called to apply a median filter
  to data fields, with a specified number of sweeps.

boundaryDataSurfaceReader
~~~~~~~~~~~~~~~~~~~~~~~~~

- a surfaceReader (similar to ensightSurfaceReader) when a general
  point data reader is needed.

MappedFile
~~~~~~~~~~
- has been extended to support alternative surface reading formats.
  This allows, for example, sampled ensight data to be reused for
  mapping.  Cavaet: multi-patch entries may still needs some work.

- additional multi-sweep median filtering of the input data.
  This can be used to remove higher spatial frequencies when
  sampling onto a coarse mesh.

smoothSurfaceData
~~~~~~~~~~~~~~~~~
- standalone application for testing of filter radii/sweeps
2022-11-24 13:30:16 +01:00
98598ba0bb ENH: use simpler constructor forms for treeData types 2022-11-24 12:21:01 +00:00
fc0b980333 BUG: avoid infinite recursion in AABBTree (fixes #2616)
- since bounding boxes overlap, need to verify the splitting actually
  did something. Problem only really evident with higher tree depths.
2022-11-24 12:21:01 +00:00
ffbad65538 ENH: replace triangleFuncs::intersectBb usage with boundBox::intersect 2022-11-24 12:21:01 +00:00
38b663b6a8 ENH: add boundBox/triangle intersection test to boundBox
- replaces edge by edge tests with separating axis tests
2022-11-24 12:21:01 +00:00
ac4f580d09 ENH: cleanup treeData items (#2609)
Changes / Improvements

- more consistent subsetting, interface

  * Extend the use of subset and non-subset collections with uniform
    internal getters to ensure that the subset/non-subset versions
    are robustly handled.

  * operator[](label) and objectIndex(label) for standardized access
    to the underlying item, or the original index, regardless of
    subsetting or not.

  * centres() and centre(label) for representative point cloud
    information.

  * nDim() returns the object dimensionality (0: point, 1: line, etc)
    these can be used to determine how 'fat' each shape may be
    and whether bounds(labelList) may contribute any useful information.

  * bounds(labelList) to return the full bound box required for
    specific items. Eg, the overall bounds for various 3D cells.

- easier construction of non-caching versions. The bounding boxes are
  rarely cached, so simpler constructors without the caching bool
  are provided.

- expose findNearest (bound sphere) method to allow general use
  since this does not actually need a tree.

- static helpers

  The boxes() static methods can be used by callers that need to build
  their own treeBoundBoxList of common shapes (edge, face, cell)
  that are also available as treeData types.

  The bounds() static methods can be used by callers to determine the
  overall bound-box size prior to constructing an indexedOctree
  without writing ad hoc code inplace.

  Not implemented for treeDataPrimitivePatch since similiar
  functionality is available directly from the PrimitivePatch::box()
  method with less typing.

========
BREAKING: cellLabels(), faceLabels(), edgeLabel() access methods

- it was always unsafe to use the treeData xxxLabels() methods without
  subsetting elements. However, since the various classes
  (treeDataCell, treeDataEdge, etc) automatically provided
  an identity lookup, this problem was not apparent.

  Use objectIndex(label) to safely de-reference to the original index
  and operator[](index) to de-reference to the original object.
2022-11-24 12:21:01 +00:00
f638db48c7 ENH: octree findBox, findSphere with external storage of results
- more memory efficient within loops

- octree/boundBox overlaps().
  Like findBox(), findSphere() but early exit if any shapes overlap.

ENH: additional query for nLeafs()
2022-11-24 12:21:01 +00:00
b8d01a88ea ENH: setter/getter for octree permutation tolerance
- make template invariant
2022-11-24 12:21:01 +00:00
3d7dc6a870 ENH: reduce some internal overhead when splitting octree nodes (#2609)
- don't need separate scratch arrays (avoids possible reallocations
  when split is imbalanced)

ENH: upgrade dynamicIndexedOctree to use DynamicList directly

- with C++11 move semantics don't need lists of autoPtr
  for efficient transfers
2022-11-24 12:21:01 +00:00
b129446221 ENH: simplify sub-octant bound-box search
- basic support for splitting into two at a given position and face to keep
2022-11-24 12:21:01 +00:00
fc9311ba0d STYLE: octree pushPoint with local constexpr (more readable code) 2022-11-24 12:21:01 +00:00
3384747f9b ENH: split off template-invariant part of indexedOctree node indexing
- code reduction, reinherit for dynamicIndexedOctree

ENH: additional OBJ writing, statistics
2022-11-24 12:21:01 +00:00
e5006a62d7 ENH: use simpler boundBox handling
- use default initialize boundBox instead of invertedBox
- reset() instead of assigning from invertedBox
- extend (three parameter version) and grow method
- inflate(Random) instead of extend + re-assigning
2022-11-24 12:21:01 +00:00
1339c3357b ENH: general boundBox/treeBoundBox improvements
- null() static method
  * as const reference to the invertedBox with the appropriate casting.

- boundBox inflate(random)
  * refactored from treeBoundBox::extend, but allows in-place modification

- boundBox::hexFaces() instead of boundBox::faces
  * rarely used, but avoids confusion with treeBoundBox::faces
    and reuses hexCell face definitions without code duplication

- boundBox::hexCorners() for corner points corresponding to a hexCell.
  Can also be accessed from a treeBoundBox without ambiguity with
  points(), which could be hex corners (boundBox) or octant corners
  (treeBoundBox)

- boundBox::add with pairs of points
  * convenient (for example) when adding edges or a 'box' that has
    been extracted from a primitive mesh shape.

- declare boundBox nPoints(), nFaces(), nEdges() as per hexCell

ENH: return invertedBox instead of FatalError for empty trees

- similar to #2612

ENH: cellShape(HEX, ...) + boundBox hexCorners for block meshes

STYLE: cellModel::ref(...) instead of de-reference cellModel::ptr(...)
2022-11-24 12:21:01 +00:00
0ba458fdbc ENH: add primitiveMesh cellBb()
- the boundBox for a given cell, using the cheapest calculation:

  - cellPoints if already available, since this will involve the
    fewest number of min/max comparisions.

  - otherwise walk the cell faces: via the cell box() method
    to avoid creating demand-driven cellPoints etc.
2022-11-24 12:21:01 +00:00
27c2cdc040 ENH: vector mag(), magSqr() methods - complementary to dist(), distSqr()
ENH: use direct access to pointHit as point(), use dist(), distSqr()

- if the pointHit has already been checked for hit(), can/should
  simply use point() noexcept access subsequently to avoid redundant
  checks. Using vector distSqr() methods provides a minor optimization
  (no itermediate temporary), but can also make for clearer code.

ENH: copy construct pointIndexHit with different index

- symmetric with constructing from a pointHit with an index

STYLE: prefer pointHit point() instead of rawPoint()
2022-11-24 12:21:01 +00:00