Compare commits

...

224 Commits

Author SHA1 Message Date
66908158ae RELEASE: Updated version to v2212 2022-12-21 16:16:18 +00:00
7e61f36c12 RELEASE: Updated headers to v2212 2022-12-21 16:16:18 +00:00
4cccd5f854 COMP: smoothSurfaceData was building into FOAM_USER_APPBIN 2022-12-21 16:16:17 +00:00
b1e919dbbb STYLE: UList::null() for default empty list 2022-12-21 09:33:14 +01:00
c273ee4697 Merge remote-tracking branch 'origin/master' into develop 2022-12-20 13:31:41 +00:00
aebd79ff59 BUG: parallel blocking writing surface noise output (fixes #2663)
- old logic (v2206 and earlier) always disabled writing on non-master,
  but other parts of the code were more recently updated to use lazy
  evaluation of surface data (with parallel communication)

- now retain full write/no-write logic identically on all ranks. Take
  care of master/non-master at the final output stage.
2022-12-19 18:00:07 +01:00
0a01492397 CONFIG: revert scotch version to 6.1.0
- some regressions (especially with ptscotch) noted with scotch-7.0.1
2022-12-19 16:26:02 +01:00
8d2165e7f4 ENH: topoSet: add new topoSet options 2022-12-19 14:49:16 +00:00
5fa37fb41c BUG: fvMatrix: avoiding dupolicate adjustment. Fixes #2658 2022-12-19 11:49:25 +00:00
87cff55f9e CONFIG: improve handling of debian multi-arch
- no guarantee that dpkg-architecture command is actually available,
  so revert to a reasonable guess from 'uname -m' and 'uname -s'
2022-12-19 11:13:53 +01:00
4dafaa8cfe STYLE: dump debug interpolation files to processor-specific names 2022-12-16 10:51:00 +01:00
ec77d3152b Merge branch 'feature-pureZoneMixture' into 'develop'
ENH: pureZoneMixture: different mixture properties according to cellZone

See merge request Development/openfoam!586
2022-12-14 15:39:16 +00:00
fa7f0e1b67 ENH: pureZoneMixture: different mixture properties according to cellZone 2022-12-14 15:07:00 +00:00
02ca7868d5 BUG: tutorial: missing run script invocation 2022-12-14 14:28:50 +00:00
029c5a24fe BUG: snappyMultiRegionHeaterImplicit: fix decomposition. Fixes #2657 2022-12-14 13:25:24 +00:00
b41ddc43c3 Merge branch 'feature-chtMultiRegionFoam-frozenFlow' into 'develop'
ENH: chtMultiRegionFoam - add frozenFlow option

See merge request Development/openfoam!564
2022-12-14 10:59:00 +00:00
48973bad83 ENH: chtMultiRegionFoam - add frozenFlow option
Also for 'chtMultiRegionSimpleFoam' and 'chtMultiRegionTwoPhaseEulerFoam'.
2022-12-14 10:54:40 +00:00
7d97b6f791 Merge branch 'feature-finite-area-numerics' into 'develop'
Misc. changes in finite-area methods

See merge request Development/openfoam!585
2022-12-14 10:19:05 +00:00
a0f1e98d24 ENH: finiteArea: improve robustness in code sections vulnerable to math errors
It has been observed that the finite-area framework is prone to numerical
issues when zero-valued edge lenghts, edge/face normals and face areas exist.

To improve exception handling at identified code sections to gracefully
overcome math errors, the problematic entities are lower-bounded by SMALL.
2022-12-14 10:18:23 +00:00
d5b7200295 ENH: edgeInterpolation: make skewness-correction optimisation compile-time optional 2022-12-14 10:18:23 +00:00
952d42512d BUG: regionFaModels: report min/max for all processors (fixes #2655) 2022-12-14 10:18:23 +00:00
0de1df7309 BUG: processorFaPatch: fix the sign of compound assignment 2022-12-14 10:18:23 +00:00
d58e06494d REVERT: leastSquaresFaVectors: pseudo-inverse shows instabilities for 2-D cases 2022-12-14 10:18:23 +00:00
b7b78a3052 COMP: unneeded move on return (mingw) 2022-12-13 19:49:36 +01:00
6ad25ef293 CONFIG: set API level to 2212 (pre-release state)
- README updated to v2212
2022-12-13 19:49:36 +01:00
c551ef3b01 CONFIG: update completion cache (csh) 2022-12-13 19:49:36 +01:00
24e97c6b91 CONFIG: update versions
- paraview (5.11.0), petsc (3.18.2), adios (2.8.3), scotch (7.0.1)
2022-12-13 11:18:54 +01:00
bd41ad1842 SUBMODULE: updates for adios, cfmesh, OpenQBMM, external-solver 2022-12-13 11:18:54 +01:00
ed5690ffbc STYLE: volSurfaceMapping is const 2022-12-13 11:18:16 +01:00
05322608a2 ENH: Pstream waitRequest ignore placeholder (negative) requests 2022-12-13 10:45:44 +01:00
4b94ac97c2 ENH: dimensioned/dimensionedSet handle optional read as per dictionary 2022-12-13 10:09:46 +01:00
1888bc62ab ENH: x/y, y/x comparison operators for Vector2D
STYLE: init label variants with std::sqrt + double (compile-time invariant)
2022-12-13 10:09:46 +01:00
95a6e8b419 BUG: boundaryRadiationProperties - check ptr exists before using 2022-12-13 06:16:52 +00:00
c3b0742e03 ENH: advancing front AMI - use area in direction of face normal 2022-12-12 18:07:31 +00:00
7c235371ff ENH: ConeNozzleInjection - added option to include an angular velocity (rad/s)
Specified using the optional 'omega' entry (Function1 type), e.g. for a constant
value:

      omega           12.56;

Note that the swirl contribution is applied in addition to the velocity set by
the 'flowType' option. For example, for the 'constantVelocity' option, parcels
are initially set the velocity according to the UMag and direction/cone angle;
the swirl velocity is then added.
2022-12-12 16:24:06 +00:00
e90092ad91 INT: continuation of 7441e18475 for S-A DES models 2022-12-12 16:24:06 +00:00
115bf529ad BUG: vanDriestDelta: use 1 if not specified. See #2648 2022-12-12 14:55:43 +00:00
09f4d8513f ENH: processorAgglomerator: test nMasters 2022-12-12 13:29:37 +00:00
36f66606a2 Merge branch 'feature-contact-line-movement' into 'develop'
ENH: dynamicContactAngleForce: new finite-area contact-angle force model

See merge request Development/openfoam!584
2022-12-09 13:09:21 +00:00
91a62ca05a STYLE: contactAngleForce: modernise code 2022-12-09 13:09:11 +00:00
993b7af513 BUG: contactAngleForce: avoid suppresing the film entering the domain (fixes #2651) 2022-12-09 13:09:11 +00:00
6f2c609a14 ENH: contactAngleForce: add optional contact-line movement force 2022-12-09 13:09:11 +00:00
885456f9a4 ENH: dynamicContactAngleForce: new finite-area contact-angle force model
DEFEATURE: merge fa-perturbedTemperatureDependent into dynamicContactAngle
2022-12-09 13:09:11 +00:00
8f63fd5230 INT: refactored kOmegaSST sigma extensions to restore previous v2206 behaviour 2022-12-09 11:51:57 +00:00
7441e18475 INT: S-A RAS - added missing correctNut following recent refactoring 2022-12-09 11:51:57 +00:00
9e6123b5a4 Merge branch 'feature-clouds-log-output' into 'develop'
ENH: added option to control log frequency of lagrangian calculations

See merge request Development/openfoam!583
2022-12-09 10:05:40 +00:00
3a429894b1 STYLE: lagrangian intermediate library - renamed log_ to logToFile_ to disambiguate against output to Info 2022-12-09 11:01:06 +01:00
d8f33c626a ENH: lagrangian intermediate library - added logging controls 2022-12-09 11:01:06 +01:00
9c9088f191 ENH: CloudSubModelBase - added info() function to set log flag 2022-12-09 11:01:06 +01:00
1f393aefa8 ENH: subModelBase - added log data member 2022-12-09 11:01:06 +01:00
b94bf625a5 ENH: cloudSolution - added log/Info output control 2022-12-09 11:01:06 +01:00
161fab8d60 COMP: messageStream - use this->log 2022-12-09 11:01:06 +01:00
8afd6ff729 ENH: support format readOptions for surfaceReader types (#2609)
- similar to surface writing formats, also support optional
  dictionary of reading options. The main beneficiary of this is the
  ensight surface reader:

  readOptions
  {
      ensight
      {
          masterOnly true;
      }
  }

  This will restrict reading to the master rank. Surfaces and values
  read will be broadcast to the other ranks, with the intention of
  reducing load on the filesystem.

ENH: add writing of Dimensioned fields for areaWrite functionObject

- can be useful for examining finite-area source terms
2022-12-09 10:59:36 +01:00
b69db76b67 ENH: bundle together freed/outstanding MPI request handling
- improve communicator wrapping
- avoid indexing errors when using partial subranks
- UPstream::is_subrank (for testing partial subranks)
2022-12-09 10:59:32 +01:00
d5e82f072e CONFIG: handle string splitting [zsh] (#2640) 2022-12-08 14:04:13 +01:00
a8b0ec0c4e STYLE: remove stray forward declaration 2022-12-08 14:04:13 +01:00
d7de6a2772 Merge branch 'feature-fvOptions-writeFile' into 'develop'
ENH: fvOptions: add writeFile functionality

See merge request Development/openfoam!577
2022-12-08 11:37:56 +00:00
48f8680941 ENH: fvOptions: add writeFile functionality
- velocityDampingConstraint
- limitTemperature
- limitVelocity
2022-12-08 11:37:33 +00:00
4c8fc9dc6e ENH: writeFile: add new flags to write/reset files 2022-12-08 11:37:33 +00:00
5844463ba4 Merge branch 'feature-evapotranspiration' into 'develop'
ENH: Evapotranspiration utilities

See merge request Development/openfoam!571
2022-12-08 11:36:28 +00:00
9479ab98eb ENH: solarLoad: remove unused vertical-direction object
STYLE: solarLoad: replace uppercase index variables with lowercase
2022-12-08 11:35:39 +00:00
c29e67e5e5 ENH: solarCalculator: consolidate diffuseSolarRad calculations 2022-12-08 11:35:39 +00:00
eaffe4c2cf ENH: solarLoadBase: new base class to access various solar-load data 2022-12-08 11:35:39 +00:00
0fde8ac91d ENH: faceShading: enable hit-face calculations for face zones
This change enables face zones creating shades and interacting with shades.

ENH: solarLoad: initialise hit faces in ctor level
2022-12-08 11:35:39 +00:00
d0061d6f54 ENH: cellToFaceZone: new topoSetSource 2022-12-08 11:35:39 +00:00
c439968390 ENH: cellToFace: new selection option 'outside'
The new selection option 'outside' can be used to select
faces with only one neighbour in the specified cellSet.
2022-12-08 11:35:39 +00:00
5fb0cd77f1 ENH: atmopshericModels: avoid storing common fields in fvOptions 2022-12-08 11:35:39 +00:00
b50591166e STYLE: rename atmospheric-field names, plantCd->Cd and leafAreaDensity->LAD 2022-12-08 11:35:39 +00:00
ce10cc54c2 Merge branch 'feature-newObjectiveFunctions' into 'develop'
ENH: new objective functions for adjoint-based optimisation

See merge request Development/openfoam!578
2022-12-08 11:16:21 +00:00
599b009b18 TUT: tutorials for the new objective functions
TUT: moved the nutSqr objective tutorial to the proper directory
2022-12-08 11:15:26 +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
9018c94b90 Merge branch 'feature-parallelFvGeometryScheme' into 'develop'
ENH: Added new parallelFvGeometryScheme

See merge request Development/openfoam!576
2022-12-08 11:14:30 +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
f9191b9377 Merge branch 'feature-fa-Brun-dripping-film-injection' into 'develop'
ENH: Brun dripping film injection

See merge request Development/openfoam!580
2022-12-01 13:58:33 +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
e60d0997e6 Merge branch 'feature-conditional-absorption-kinematic-film' into 'develop'
ENH: KinematicSurfaceFilm: add option to specify interacting parcel types

See merge request Development/openfoam!581
2022-12-01 12:52:05 +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
4a01979fa8 Merge branch 'feature-fa-interpolation-scheme' into 'develop'
ENH: leastSquaresEdgeInterpolation: new edge interpolation method

See merge request Development/openfoam!575
2022-12-01 12:24:44 +00:00
689b2ab2a9 ENH: leastSquaresEdgeInterpolation: new edge interpolation method 2022-12-01 12:24:27 +00:00
fbd14e42a2 Merge branch 'update-Pstream-comms-fileHandler' into 'develop'
Cleaner separation global/local/self communication, cleaner responsibility for fileHandler ownership

See merge request Development/openfoam!582
2022-12-01 12:18:50 +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
7fe8bdcf99 Merge branch 'feature-fa-least-squares' into 'develop'
ENH: inv: fall back to pseudo-inverse for singular tensors

See merge request Development/openfoam!574
2022-12-01 12:09:05 +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
6b6d4c10a3 Merge branch 'feature-solidIsothermalReactionRate' into 'develop'
ENH: solidIsothermalReactionRate: new solid reaction rate model

See merge request Development/openfoam!579
2022-11-29 14:31:15 +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
adf95d483c BUG: redistributePar: softlink uniform. Fixes #163 2022-11-24 14:58:07 +00:00
8c02820db6 COMP: EigenMatrix: remove unused iter variable 2022-11-24 13:47:08 +00:00
9d212dfd32 Merge branch 'feature-filtered-mapfile' into 'develop'
Add spatial filtering and ensight support to MappedFile and external file source (#2609)

See merge request Development/openfoam!568
2022-11-24 12:31:08 +00:00
126d831f6e TUT: use filter/mapping with ensight data (#2609) 2022-11-24 13:30:16 +01: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
2984d1e3e7 Merge branch 'feature-updated-core' into 'develop'
Feature updated core

See merge request Development/openfoam!573
2022-11-24 12:21:37 +00: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
5ec435aca3 ENH: base classes for wave algorithms (manage non-templated parts)
ENH: use DynamicList instead of List + size for point wave

- consistent with previous updates for the other algorithms

STYLE: unique_ptr instead of raw pointer in wave algorithms
2022-11-24 12:21:01 +00:00
c33167dc0e STYLE: use stack-like naming for ifEntry handling
STYLE: unique_ptr instead of autoPtr for holding std::thread
2022-11-24 12:21:01 +00:00
e4139898d2 ENH: face::connected() method
- return true if two faces share a common vertex.

  Same idea as the existing edge::connected() method
  (previously spelled 'connects()')
2022-11-24 12:21:01 +00:00
d3e285b48b ENH: add FixedList templated get<unsigned>() methods
- provides fast compile-time indexing for FixedList
  (invalid indices trigger a compiler error).

  This enables noexcept access, which can propagate into various
  other uses (eg, triFace, triPoints, ...)

ENH: add triangle edge vectors
2022-11-24 12:21:01 +00:00
c7e6ae30bf ENH: add front(), back() methods to List containers
- traditionally used first(), last() methods,
  but front(), back() are well-known from std::vector etc
  which makes the access more familiar.

- support push_back() method for containers that already had append().
  This increases name familiar and can help when porting between
  different C++ code bases.

- support pop_back() method for List containers.
  This is similar to std::vector
2022-11-24 12:21:01 +00:00
db88265163 ENH: use CircularBuffer instead SLList for FIFO-style handling
- PrimitivePatch localPointOrder
- enrichedPatch
- polyMeshZipUpCells
2022-11-24 12:21:01 +00:00
f3ba6c6da0 ENH: linked-lists accept more familiar STL method names
- ie, front(), back(), push_front(), push_back(), pop_front()

ENH: add CircularBuffer flattening operator() and list() method

- useful if assigning content to a List etc

BUG: CircularBuffer find() did not return logical index
2022-11-24 12:21:01 +00:00
9f9b8fb662 Merge branch 'feature-resolution-index' into 'develop'
ENH: resolutionIndex: new function object to evaluate LES/DES resolution

See merge request Development/openfoam!569
2022-11-23 18:24:06 +00:00
8ba1156a56 ENH: resolutionIndex: new function object to evaluate LES/DES resolution
Grid independency studies and grid adaptation for implicit LES/DES are
nontrivial and intractable due to the inherent coupling between spatial
resolution and subgrid-scale modelling.

To enable assessments for LES/DES resolution, a function object of
single-mesh resolution index with three submodels is introduced.
2022-11-23 13:41:20 +00:00
13606d4e09 ENH: RASModelBaseName: new type name for RANS models 2022-11-23 13:41:20 +00:00
90b61429f6 ENH: multiComponentMixture: fixes #2206
- added bit of tolerance
- write difference
2022-11-23 12:20:04 +00:00
d69ac516e8 ENH: allow configurable field send/receive for surfaceNoise (#2639)
- replaced PstreamBuffers mechanism with globalIndex for both gather
  and scatter operations. Use scheduled communication by default, but
  is selectable.

- reduced communication with ensemble averaging and no-write
2022-11-22 17:07:40 +01:00
9114e01de9 STYLE: align faceZone handling (functionObjects, sampling)
- pattern as per surfaceFieldValue::setFaceZoneFaces()

  1. define faceId, facePatchId assuming an internal face
  2. if actually a boundary face:
     - get facePatchId
     - ignore if emptyPolyPatch or coupledPolyPatch (neighbour side)
     - get patch relative faceId

  This currently seems to be the least amount of code clutter.

ENH: recover some memory my shrinking lists in fluxSummary

BUG: potentially trailing rubbish in the heatExchangerModel lists

- the final resize to length actually used was missing.
  Does not affect any released versions
2022-11-22 13:14:53 +01:00
a8f369fd2b ENH: region support for foamRestoreFields (#2638) 2022-11-22 13:14:53 +01:00
b5e6a42ded Merge branch 'feature-htc-facezone' into 'develop'
ENH: faceZoneReferenceTemperature: new heatTransferCoeff model

See merge request Development/openfoam!561
2022-11-21 15:59:45 +00:00
b18a6675cb STYLE: heatTransferCoeff: minor cleanup of models
TUT: solidQuenching2D: correct libs for reactingEulerHtcModel
2022-11-21 15:58:58 +00:00
354767c694 ENH: faceZoneReferenceTemperature: new heatTransferCoeff model 2022-11-21 15:58:58 +00:00
88e1932145 Merge branch 'feature-mappedPatchBase' into 'develop'
BUG: avoid excessive recalculation of map for moving meshes

See merge request Development/openfoam!572
2022-11-21 13:21:56 +00:00
945405c32d BUG: avoid excessive recalculation of map for moving meshes 2022-11-21 13:17:56 +00:00
013f3cccc4 ENH: improve handling of finiteArea mesh with distributed roots
- in makeFaMesh, the serial fields are now only read on the master
  process and broadcast to the other ranks. The read+distribute is
  almost identical to that used in redistributePar, except that in
  this case entire fields are sent and not a zero-sized subset.

- improved internal faMesh checking for files so that the TryNew
  method works with distributed roots.
2022-11-20 19:59:52 +01:00
8993af73ac CONFIG: bump patch level 2022-11-20 18:16:53 +01:00
21e7ce8f42 STYLE: place HashTable trivial methods in the header (reduce clutter) 2022-11-20 16:55:58 +01:00
94c7e180fb ENH: more fault-tolerance in makeFaMesh decomposition
- if the volume faceProcAddressing is missing, it is not readily
  possible to determine equivalent area procAddressing.

  Instead of throwing an error, be more fault-tolerant by having it
  create with READ_IF_PRESENT and then detect and warn
  if there are problems.
2022-11-19 20:49:12 +01:00
67b58c28c0 ENH: IOobjectList simpler construction of unregistered
- accept IOobjectOption::registerOption with (MUST_READ, NO_WRITE)
  being implicit. Direct handling of IOobjectOption itself, for
  consistency with IOobject.

  The disabling of object registration is currently the only case
  where IOobjectList doesn't use default construction parameters,
  but it was previously a bit awkward to specify.
2022-11-19 20:48:54 +01:00
db57c456f6 ENH: tutorials/Alltest -backup option
- for repeated tests (eg, during bisection) can be used to preserve
  the existing directory as tutorialsTest.bak01,
  tutorialsTest.bak02, ... (max of 10).

- preserve the commit information as tutorialsTest/commit-info
  to help document the current or backup test results.
2022-11-19 13:44:01 +01:00
1b11e4b3ac CONFIG: restrict wmakeLnInclude to header/template files
- source-code (.c, .cpp etc) only adds to clutter in the lnInclude
  directory
2022-11-19 12:41:55 +01:00
5e0a23edd5 STYLE: compacter help information for -debug-switch etc. 2022-11-18 21:24:17 +01:00
d7bf2d400d BUG: string wrapping (eg, argList help) truncates character (#2625)
- had an off-by-one in the accounting for some corner caes,
  partly because the logic was a bit convoluted

ENH: improved string wrapping (#2625)

- reworked logic (like a state machine) to handle backtracking
  with fallback of splitting near punctuation characters.

  Still doesn't compete with nroff or TeX, but does avoid long lines
  and many funny splits.  With this change the help for mapFieldsPar
  now like this:

  =====
      Specify the mapping method
      (direct|mapNearest|cellVolumeWeight|
      correctedCellVolumeWeight)
  =====

  Since the list of options is very long without any spaces, it takes
  '|' as the best split point, which definitely reads better
2022-11-18 21:14:22 +01:00
d9ab5d54ef ENH: ensightWrite, vtkWrite support for excluding fields and patches
- functionality similar to that provided by foamToEnsight, foamToVTK
  which allows blocking out patches (eg, outer walls, inlet/outlet)
  that are not particularly interesting to visualize
2022-11-18 15:28:14 +01:00
ec1d66d640 TUT: keyword updates 2022-11-18 10:31:00 +01:00
3b0af86448 STYLE: add notes where files are added into global/globals.C
ENH: use dictionary findDict() directly for debugSwitches

- the isDict() method is just a wrapper around the pointer anyhow
2022-11-17 15:26:51 +01:00
d009cb8bc1 CONFIG: set API level to 2208 to distinguish from previous release 2022-11-17 15:19:44 +01:00
1dafe5d393 ENH: use full scratch buffer capacity for ensight output
- improves overall buffering ability across parts
2022-11-17 14:03:25 +01:00
225f548d2d ENH: pointHistory: cooperate with collated file format. Fixes #2636 2022-11-17 10:32:35 +00:00
6cb8337345 BUG: faceReflecting: initialisation. Fixes #2634 2022-11-16 16:30:11 +00:00
3d81dd6277 COMP: forward declarations for uniformDimensionedFields 2022-11-16 14:14:59 +01:00
90c4ee7e12 ENH: support wmakeLnInclude of C++ template files (.tcc, .tpp, .txx)
- can be used to avoid confusion with source files

ENH: improve handling of '--' option termination (wmake scripts)
2022-11-16 13:11:40 +01:00
5714a3606e Merge branch 'feature-atomic-stream' into 'develop'
Updates for ensight writing

See merge request Development/openfoam!570
2022-11-15 17:02:04 +00:00
0fabbcb404 ENH: direct ensight output of float/double
- since ensight format is always float and also always written
  component-wise, perform the double -> float narrowing when
  extracting the components.  This reduces the amount of data
  transferred between processors.

ENH: avoid vtk/ensight parallel communication of empty messages

- since ensight writes by element type (eg, tet, hex, polyhedral) the
  individual written field sections will tend to be relatively sparse.
  Skip zero-size messages, which should help reduce some of the
  synchronization bottlenecks.

ENH: use 'data chunking' when writing ensight files in parallel

- since ensight fields are written on a per-element basis, the
  corresponding segment can become rather sparsely distributed. With
  'data chunking', we attempt to get as many send/recv messages in
  before flushing the buffer for writing. This should make the
  sequential send/recv less affected by the IO time.

ENH: allow use of an external buffer when writing ensight components

STYLE: remove last vestiges of autoPtr<ensightFile> for output routines
2022-11-15 17:26:09 +01:00
5338e56c73 ENH: add support for OFstream atomic file creation (#2631)
- with ATOMIC, an intermediary file is created - eg, (fileAbc~tmp~)
  where all of the output is written to. When the stream goes out of
  scope, this intermediary file is moved/renamed to the actually
  output name - eg, (fileAbc~tmp~) -> (fileAbc).

  This adds some safety if the simulation crashes while writing the
  file, since it will the partial (corrupt) file will be left
  behind as (fileAbc~tmp~) and not as (fileAbc), which means it will
  will be treated as a backup file and not loaded again on restart.

ENH: provided enumeration for APPEND/NON_APPEND

- clearer than using bool (with comments).
  Since append mode is primarily only used by masterOFstream etc
  this change is unlikely to affect user coding.

ENH: use file atomic for ensight file creation

- avoids corrupt (truncated) files being referenced by the ensight
  case file if the simulation crashes while writing the ensight file.
2022-11-15 14:10:01 +01:00
9f7cfa9419 ENH: support libz disabling via WM_COMPILE_CONTROL (as ~libz)
- eg, for partially incomplete systems (without libz devel header)

ENH: clearer binding of dummy Pstream in OpenFOAM/Make/options

- link of dummy stub Pstream now contingent on linking libOpenFOAM as
  well. This makes the purpose slightly clearer

ENH: cleaner option naming/handling in wmake script

- allow special purpose -no-openfoam option.
  Eg, compiling test programs without OpenFOAM and Pstream libraries
  but using the rest of the wmake system.

ENH: add +openmp support into WM_COMPILE_CONTROL (#2633)

- this adds compile/link flags for openmp.
  For single-use, can also use 'wmake -openmp'.

  If both +openmp and ~openmp are specified in WM_COMPILE_CONTROL
  the ~openmp will have priority.

  This is actually done indirectly since ~openmp will set empty
  COMP_OPENMP, LINK_OPENMP internal variables, which the +openmp then
  adds to the c++FLAGS and linkexe targets (ie, won't actually add
  anything).

ENH: add +ccache or ccache=... support into WM_COMPILE_CONTROL (#2633)

- with the first version (+ccache), simply use ccache from the path
  without any extra options.

- with the second version (ccache=...), can be more specific about
  what is called.

  Using "+ccache" is identical to "ccache=ccache", but the later could
  be used in other ways. For example,

     ccache=/strange/install/path/ccache
     ccache=</path/my-tooling --option>

  Have the choice of unquoted, single or double quoted or '< >' quoted

STYLE: relocate FOAM_EXTRA_LDFLAGS in general makefile

- removes clutter for different linkers (eg, gold, mold, ldd)
  making it easier to extend for other linkers.

STYLE: protect makefile checks with 'strip' function
2022-11-15 14:00:18 +01:00
e15b103003 COMP: remove wmake rules for ARM7 (discontinued) arch 2022-11-15 14:00:18 +01:00
c2af76337e COMP: remove wmake rules for discontinued IA64 (itanium) arch 2022-11-15 14:00:18 +01:00
edc12c9ad9 COMP: remove fast-math and unsafe-math-optimizations for Fujitsu (#2564)
- was found to cause issues (snappyHexMesh specifically)
  on Fugaku. Reported by @azami
2022-11-15 14:00:18 +01:00
25e874a4f0 ENH: provide MPI native minOp, maxOp reduce multiple values
- consistent with sumOp

ENH: globalIndex with gatherNonLocal tag, and use leading dispatch tags

- useful for gather/write where the master data can be written
 separately.  Leading vs trailing dispatch tags for more similarity to
 other C++ conventions.
2022-11-15 14:00:18 +01:00
beea22b2f0 Merge branch 'feature-histogram-extension' into 'develop'
ENH: functionObjects: refactor and extend histogram

See merge request Development/openfoam!563
2022-11-14 17:34:54 +00:00
0624fb0181 STYLE: use MinMax for handling histogram ranges 2022-11-14 17:34:06 +00:00
941cd7fef4 ENH: functionObjects: refactor and extend histogram
- new submodels:
  - 'equalBinWidth': groups data into bins of equal widths (previous behaviour)
  - 'unequalBinWidth': groups data into bins of unequal widths

- output files per time-step are replaced with a single output file

- silently deprecates the input entries: 'setFormat' and 'formatOptions'
2022-11-14 17:34:06 +00:00
fd75d38757 Merge branch 'feature-overset-coupledPatch' into 'develop'
overset modifications: allow overset pacthes overlap, allow fringe faces walk, mass conservation update

See merge request Development/openfoam!555
2022-11-14 15:48:58 +00:00
d5a973419a STYLE: overset: change massCorrection to fluxCorrection
COMP: overset: fixes for SPDP, int64
2022-11-14 15:41:40 +00:00
ab6615c060 BUG: overset: support GAMG. Fixes #2559
Note that there is no support for using GAMG with mass-correction.
2022-11-11 10:19:52 +00:00
b48fd4f38a TUT: overset: add new tutorials and update existing tutorials 2022-11-11 10:19:51 +00:00
2a406bbb25 ENH: overset: various improvements in the framework
The improvements include:

- Allowing overset patches to be displaced outside background domain.
  - The approach does not support overlapping of multiple inset meshes
    on top of background domain.
- Allowing fringe faces to walk away from hole cells in background domain.
  - The approach was not extensibly tested with overlapping patches.
- Improving mass conservation.
- Various experimental entries are removed: massFluxInterpolation, ddtCorr.
- New entries:
  - oversetAdjustPhi: adds a flux correction outside the pressure equation.
  - massCorrection: adds an implicit correction.
2022-11-11 10:19:47 +00:00
8c0679d25f BUG: Lagrangian: sync IO call. Fixes #2627 2022-11-09 15:31:20 +00:00
a4d235af6b BUG: porousBafflePressure: read fixedJump entries - apply under-relaxation (fixes #2626) 2022-11-09 14:18:06 +00:00
6c6c8c5008 BUG: distributedTriSurfaceMesh: locally empty surface. Fixes #2612 2022-11-09 08:55:06 +00:00
7fa4f1ef76 Merge branch 'feature-mpi-updates' into 'develop'
More consistent use of combineReduce, simpler and/or reductions

See merge request Development/openfoam!566
2022-11-08 16:48:21 +00:00
5b29ff0e42 ENH: consolidate 'formatOptions' handling for coordSetWriter/surfaceWriter
- replaced ad hoc handling of formatOptions with coordSetWriter and
  surfaceWriter helpers.

  Accompanying this change, it is now possible to specify "default"
  settings to be inherited, format-specific settings and have a
  similar layering with surface-specific overrides.

- snappyHexMesh now conforms to setFormats

  Eg,

      formatOptions
      {
          default
          {
              verbose     true;
              format      binary;
          }
          vtk
          {
              precision   10;
          }
     }

     surfaces
     {
         surf1
         {
             ...

             formatOptions
             {
                 ensight
                 {
                     scale   1000;
                 }
             }
         }
     }
2022-11-08 16:48:08 +00:00
b7592c1ee8 ENH: preserve globalIndex merge information within mergedSurf
- for later reuse with fields (for example)

ENH: use 'scheduled' for surfaceWriter field merging (#2402)

- in tests with merging fields (surfaceWriter), 'scheduled' was
  generally faster than 'nonBlocking' for scalars, minorly faster for
  vectors.
  Thus make 'scheduled' the default for the surfaceWriter but with a
  user-option to adjust as required. Previously simply relied on
  whichever default globalIndex had (currently nonBlocking).

  Reuse globalIndex information from mergedSurf instead of
  globalIndex::gatherOp to avoid an extra MPI call to gather sizes
  each time.

  These changes will not be noticable unless surface sampling is done
  very frequently (eg, every iteration) and with large core counts.
2022-11-08 16:48:08 +00:00
799d247142 ENH: PatchTools::gatherAndMerge with recovery of the globalIndex
- support globalIndex for points/faces as an output parameter,
  which allows reuse in subsequent field merge operations.

- make pointMergeMap an optional parameter. This information is not
  always required. Eg, if only using gatherAndMerge to combine faces
  but without any point fields.

ENH: make globalIndex() noexcept, add globalIndex::clear() method
2022-11-08 16:48:08 +00:00
70208a7399 ENH: use returnReduceAnd(), returnReduceOr() functions
DOC: document which MPI send/recv are associated with commType
2022-11-08 16:48:08 +00:00
473e14418a ENH: more consistent use of broadcast, combineReduce etc.
- broadcast           : (replaces scatter)
  - combineReduce       == combineGather + broadcast
  - listCombineReduce   == listCombineGather + broadcast
  - mapCombineReduce    == mapCombineGather + broadcast
  - allGatherList       == gatherList + scatterList

  Before settling on a more consistent naming convention,
  some intermediate namings were used in OpenFOAM-v2206:

    - combineReduce       (2206: combineAllGather)
    - listCombineReduce   (2206: listCombineAllGather)
    - mapCombineReduce    (2206: mapCombineAllGather)
2022-11-08 16:48:08 +00:00
b9c15b8585 COMP: missing linkage for ensightToFoam (ldd linker) 2022-11-08 17:13:46 +01:00
18216a4639 BUG: zoneMotion: supply optional coeffs dict. Fixes #2630 2022-11-08 12:38:44 +00:00
99780bd7cd Merge branch 'feature-ensightToFoam' into 'develop'
ENH: ensightToFoam: Ensight Gold mesh converter

See merge request Development/openfoam!567
2022-11-07 21:26:37 +00:00
5163e52974 ENH: ensightToFoam: Ensight Gold mesh converter 2022-11-07 21:22:18 +00:00
35aa6140cc Merge branch 'feature-grey-area-turbulence' into 'develop'
Integration of grey area turbulence models from Upstream CFD

See merge request Development/openfoam!560
2022-11-07 11:33:31 +00:00
e510321a26 TUT: wallMountedHump: new DES tutorial 2022-11-07 10:59:18 +00:00
3a4537abc9 STYLE: various simplifications and changes
BUG: DEShybrid: reintroduce e28bed59
2022-11-07 10:59:18 +00:00
493bfdbdc4 ENH: DEShybrid - code refactoring/simplification 2022-11-07 10:59:18 +00:00
32507b3251 TUT: vortexShed case - added turbulenceFields example 2022-11-07 10:59:18 +00:00
81f783286c ENH: turbulenceFields FO - added LESRegion and DES shielding function, fd 2022-11-07 10:59:18 +00:00
7db69fc22e ENH: DES models - added access function for shielding function, fd 2022-11-07 10:59:18 +00:00
9557cde880 STYLE: Minor code formatting 2022-11-07 10:59:18 +00:00
c039a09e71 ENH: DEShybrid - restored inputs for backwards compatibility 2022-11-07 10:59:17 +00:00
e0f3993045 ENH: scalar - added readOrDefault(is, defaultValue) function 2022-11-07 10:59:17 +00:00
12ba22bebf ENH: DESModel - stabilisation of Ssigma function
- Code supplied by Marian Fuchs, Upstream CFD GmbH
2022-11-07 10:59:17 +00:00
07a9ee86f3 ENH: Code refactoring 2022-11-07 10:59:17 +00:00
9563607e01 ENH: Turbulence IDDES models - added option to switch fe term in dTilda calc
Default is fe = true, yielding the original form given be Shur (2008)
2022-11-07 10:59:17 +00:00
5b1c060e9e ENH: kOmegaSSTDES - added convenience functions for RAS|LES length scales 2022-11-07 10:59:17 +00:00
53397e6f3f ENH: Added deprecation warnings for SpalartAllmaras and kOmegaSST DES variants 2022-11-07 10:59:17 +00:00
67ba5acf18 ENH: Spalart-Allmaras model - added user switch for ft2 term (default = off) 2022-11-07 10:59:17 +00:00
e5cf96b0f9 INT: Integration of Upstream CFD's SLADelta - use hmaxPtr
- Initial code supplied by Marian Fuchs, Upstream CFD GmbH
- Code cleaned/refactored/integrated by OpenCFD
2022-11-07 10:59:17 +00:00
62f37b2a43 INT: Integration of Upstream CFD's sigma LES model
- Initial code supplied by Marian Fuchs, Upstream CFD GmbH
- Code cleaned/refactored/integrated by OpenCFD
2022-11-07 10:59:17 +00:00
619ddc2355 INT: Integration of Upstream CFD's DeltaOmegaTilde delta function
- Initial code supplied by Marian Fuchs, Upstream CFD GmbH
- Code cleaned/refactored/integrated by OpenCFD
2022-11-07 10:59:17 +00:00
4fc34c8a63 INT: Integration of Upstream CFD's DESHybrid updates
- Initial code supplied by Marian Fuchs, Upstream CFD GmbH
- Code cleaned/refactored/integrated by OpenCFD
2022-11-07 10:59:17 +00:00
2cc96ad7f4 INT: Integration of Upstream CFD's grey-area sigma into kOmegaSST models
- Initial code supplied by Marian Fuchs, Upstream CFD GmbH
- Code cleaned/refactored/integrated by OpenCFD
2022-11-07 10:59:17 +00:00
541b6eb28a INT: integration of Upstream CFD's grey-area sigma into S-A models
- Initial code supplied by Marian Fuchs, Upstream CFD GmbH
- Code cleaned/refactored/integrated by OpenCFD
2022-11-07 10:59:17 +00:00
10b724b10d INT: integration of Upstream CFD's grey-area sigma into base DESModel
- Initial code supplied by Marian Fuchs, Upstream CFD GmbH
- Code cleaned/refactored/integrated by OpenCFD
2022-11-07 10:59:17 +00:00
d2f2ab6d25 ENH: kOmegaSST - code refactoring and clean-up 2022-11-07 10:59:16 +00:00
b92fbd8f73 ENH: Refactored Spalart-Allmaras turbulence models
- Added a new S-A base class: SpalartAllmarasBase
- RAS and DES models derived from new base class
- Removed code duplication
2022-11-07 10:59:16 +00:00
3c214e99df ENH: propellerInfo - protection against Uref = 0 2022-11-03 09:43:39 +00:00
913c45afff ENH: faMatrix - added dot operator functions 2022-11-03 09:43:39 +00:00
dffac4d887 BUG: distributedTriSurfaceMesh: locally empty surface. Fixes #2612 2022-10-13 11:57:27 +01:00
9851 changed files with 68479 additions and 27003 deletions

View File

@ -49,7 +49,7 @@
<!--
Providing details of your set-up can help us identify any issues, e.g.
OpenFOAM version : v2206|v2112|v2106|v2012|v2006 etc
OpenFOAM version : v2212|v2206|v2112|v2106|v2012 etc
Operating system : ubuntu|openSUSE|centos etc
Hardware info : any info that may help?
Compiler : gcc|intel|clang etc

View File

@ -1,2 +1,2 @@
api=2206
patch=220907
api=2212
patch=0

View File

@ -40,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted.
If OpenFOAM has already been compiled on your system, simply source
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
For example, for the OpenFOAM-v2206 version:
For example, for the OpenFOAM-v2212 version:
```
source /installation/path/OpenFOAM-v2206/etc/bashrc
source /installation/path/OpenFOAM-v2212/etc/bashrc
```
## Compiling OpenFOAM
@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
to the OpenFOAM directory. For example,
```
/path/parent
|-- OpenFOAM-v2206
\-- ThirdParty-v2206
|-- OpenFOAM-v2212
\-- ThirdParty-v2212
```
There are, however, many cases where this simple convention is inadequate:
@ -136,7 +136,7 @@ There are, however, many cases where this simple convention is inadequate:
operating system or cluster installation provides it)
* When we have changed the OpenFOAM directory name to some arbitrary
directory name, e.g. openfoam-sandbox2206, etc..
directory name, e.g. openfoam-sandbox2212, etc..
* When we would like any additional 3rd party software to be located
inside of the OpenFOAM directory to ensure that the installation is
@ -156,9 +156,9 @@ when locating the ThirdParty directory with the following precedence:
2. PREFIX/ThirdParty-VERSION
* this corresponds to the traditional approach
3. PREFIX/ThirdParty-vAPI
* allows for an updated value of VERSION, *eg*, `v2206-myCustom`,
* allows for an updated value of VERSION, *eg*, `v2212-myCustom`,
without requiring a renamed ThirdParty. The API value would still
be `2206` and the original `ThirdParty-v2206/` would be found.
be `2212` and the original `ThirdParty-v2212/` would be found.
4. PREFIX/ThirdParty-API
* same as the previous example, but using an unadorned API value.
5. PREFIX/ThirdParty-common

View File

@ -3,6 +3,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/overset/lnInclude \
-I$(LIB_SRC)/overset/include/lnInclude
EXE_LIBS = \
-lfiniteVolume \

View File

@ -31,3 +31,25 @@
Info<< "Reading diffusivity DT\n" << endl;
dimensionedScalar DT("DT", dimViscosity, transportProperties);
bool oversetPatchErrOutput =
simple.dict().getOrDefault("oversetPatchErrOutput", false);
// Dummy phi for oversetPatchErrOutput
tmp<surfaceScalarField> tdummyPhi;
if (oversetPatchErrOutput)
{
tdummyPhi = tmp<surfaceScalarField>::New
(
IOobject
(
"dummyPhi",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(dimless, Zero)
);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2016-2017 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -58,6 +58,7 @@ Description
#include "fvOptions.H"
#include "simpleControl.H"
#include "dynamicFvMesh.H"
#include "oversetPatchPhiErr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -99,6 +100,11 @@ int main(int argc, char *argv[])
fvOptions.constrain(TEqn);
TEqn.solve();
fvOptions.correct(T);
if (oversetPatchErrOutput)
{
oversetPatchPhiErr(TEqn, tdummyPhi.ref());
}
}
#include "write.H"

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenCFD Ltd
Copyright (C) 2017-2022 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -149,7 +149,6 @@ int main(int argc, char *argv[])
mesh.update();
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
// Since solver contains no time loop it would never execute
// function objects so do it ourselves

View File

@ -1,4 +0,0 @@
bool ddtCorr
(
pimple.dict().getOrDefault("ddtCorr", true)
);

View File

@ -69,6 +69,8 @@ mesh.setFluxRequired(p.name());
// Mask field for zeroing out contributions on hole cells
#include "createCellMask.H"
// Create bool field with interpolated cells
#include "createInterpolatedCells.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2016-2017 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,7 +43,6 @@ Description
#include "dynamicFvMesh.H"
#include "fluidThermo.H"
#include "turbulentFluidThermoModel.H"
#include "bound.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "CorrectPhi.H"
@ -89,10 +88,8 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readControls.H"
#include "readDyMControls.H"
// Store divrhoU from the previous mesh so that it can be mapped
// and used in correctPhi to ensure the corrected phi has the
// same divergence
@ -128,7 +125,6 @@ int main(int argc, char *argv[])
{
if (pimple.firstIter() || moveMeshOuterCorrectors)
{
// Do any mesh changes
mesh.update();
@ -137,52 +133,22 @@ int main(int argc, char *argv[])
MRF.update();
#include "setCellMask.H"
const surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
// Zero Uf on old faceMask (H-I)
rhoUf() *= faceMaskOld;
surfaceVectorField rhoUfint(fvc::interpolate(rho*U));
// Update Uf and phi on new C-I faces
rhoUf() += (1-faceMaskOld)*rhoUfint;
// Update Uf boundary
forAll(rhoUf().boundaryField(), patchI)
{
rhoUf().boundaryFieldRef()[patchI] =
rhoUfint.boundaryField()[patchI];
}
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf();
#include "setInterpolatedCells.H"
#include "correctRhoPhiFaceMask.H"
if (correctPhi)
{
// Corrects flux on separated regions
#include "correctPhi.H"
}
// Zero phi on current H-I
const surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;
U *= cellMask;
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
}
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
}

View File

@ -25,17 +25,6 @@ surfaceScalarField phiHbyA
fvc::interpolate(rho)*fvc::flux(HbyA)
);
if (ddtCorr)
{
surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
phiHbyA +=
faceMaskOld*MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf));
}
fvc::makeRelative(phiHbyA, rho, U);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
@ -134,8 +123,4 @@ if (thermo.dpdt())
}
}
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;

View File

@ -1,9 +0,0 @@
#include "readTimeControls.H"
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
checkMeshCourantNo =
pimple.dict().getOrDefault("checkMeshCourantNo", false);
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);

View File

@ -4,7 +4,7 @@
sqrt
(
2*M_PI*sigma*sqr(aMesh.edgeInterpolation::deltaCoeffs())
*aMesh.edgeInterpolation::deltaCoeffs()
*mag(aMesh.edgeInterpolation::deltaCoeffs())
/rhol
)
).value()*runTime.deltaT().value();

View File

@ -1,3 +1,6 @@
// Volume-to surface mapping object
const volSurfaceMapping vsm(aMesh);
volVectorField U
(
IOobject
@ -26,6 +29,3 @@ volScalarField H
mesh,
dimensionedScalar(dimLength, Zero)
);
// Create volume-to surface mapping object
volSurfaceMapping vsm(aMesh);

View File

@ -1,5 +1,5 @@
// Create volume-to surface mapping object
volSurfaceMapping vsm(aMesh);
// Volume-to surface mapping object
const volSurfaceMapping vsm(aMesh);
volScalarField Cvf
(

View File

@ -1,5 +1,5 @@
// Create volume-to surface mapping object
volSurfaceMapping vsm(aMesh);
// Volume-to surface mapping object
const volSurfaceMapping vsm(aMesh);
volScalarField Cvf
(

View File

@ -124,3 +124,6 @@ dimensionedScalar initialMass("initialMass", fvc::domainIntegrate(rho));
// Mask field for zeroing out contributions on hole cells
#include "createCellMask.H"
// Create bool field with interpolated cells
#include "createInterpolatedCells.H"

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -50,6 +50,7 @@ Description
#include "CorrectPhi.H"
#include "cellCellStencilObject.H"
#include "localMin.H"
#include "oversetAdjustPhi.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -86,9 +87,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readControls.H"
#include "readDyMControls.H"
#include "compressibleCourantNo.H"
@ -128,45 +126,14 @@ int main(int argc, char *argv[])
MRF.update();
#include "setCellMask.H"
const surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
// Zero Uf on old faceMask (H-I)
rhoUf() *= faceMaskOld;
//fvc::correctRhoUf(rhoUfint, rho, U, phi);
surfaceVectorField rhoUfint(fvc::interpolate(rho*U));
// Update Uf and phi on new C-I faces
rhoUf() += (1-faceMaskOld)*rhoUfint;
// Update Uf boundary
forAll(rhoUf().boundaryField(), patchI)
{
rhoUf().boundaryFieldRef()[patchI] =
rhoUfint.boundaryField()[patchI];
}
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf();
#include "setInterpolatedCells.H"
#include "correctRhoPhiFaceMask.H"
if (correctPhi)
{
#include "correctPhi.H"
}
// Zero phi on current H-I
const surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;
U *= cellMask;
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
}

View File

@ -21,17 +21,14 @@ surfaceScalarField phiHbyA
fvc::flux(rho*HbyA) + phig
);
if (ddtCorr)
if (adjustFringe)
{
surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
phiHbyA +=
faceMaskOld*MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi));
fvc::makeRelative(phiHbyA,rho, U);
oversetAdjustPhi(phiHbyA, U);
fvc::makeAbsolute(phiHbyA,rho, U);
}
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the pressure BCs to ensure flux consistency
@ -122,8 +119,4 @@ if (thermo.dpdt())
}
}
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;

View File

@ -1,9 +0,0 @@
#include "readTimeControls.H"
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
checkMeshCourantNo =
pimple.dict().getOrDefault("checkMeshCourantNo", false);
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);

View File

@ -113,15 +113,19 @@ int main(int argc, char *argv[])
forAll(fluidRegions, i)
{
#include "setRegionFluidFields.H"
fvMesh& mesh = fluidRegions[i];
#include "readFluidMultiRegionPIMPLEControls.H"
#include "setRegionFluidFields.H"
#include "solveFluid.H"
}
forAll(solidRegions, i)
{
#include "setRegionSolidFields.H"
fvMesh& mesh = solidRegions[i];
#include "readSolidMultiRegionPIMPLEControls.H"
#include "setRegionSolidFields.H"
#include "solveSolid.H"
}
@ -133,8 +137,10 @@ int main(int argc, char *argv[])
forAll(fluidRegions, i)
{
#include "setRegionFluidFields.H"
fvMesh& mesh = fluidRegions[i];
#include "readFluidMultiRegionPIMPLEControls.H"
#include "setRegionFluidFields.H"
if (!frozenFlow)
{
Info<< "\nSolving for fluid region "
@ -166,20 +172,24 @@ int main(int argc, char *argv[])
forAll(fluidRegions, i)
{
fvMesh& mesh = fluidRegions[i];
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionPIMPLEControls.H"
frozenFlow = true;
#include "solveFluid.H"
#include "readFluidMultiRegionPIMPLEControls.H"
#include "setRegionFluidFields.H"
frozenFlow = true;
#include "solveFluid.H"
}
forAll(solidRegions, i)
{
fvMesh& mesh = solidRegions[i];
Info<< "\nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
#include "readSolidMultiRegionPIMPLEControls.H"
#include "setRegionSolidFields.H"
#include "solveSolid.H"
}

View File

@ -76,17 +76,21 @@ int main(int argc, char *argv[])
forAll(fluidRegions, i)
{
fvMesh& mesh = fluidRegions[i];
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionSIMPLEControls.H"
#include "setRegionFluidFields.H"
#include "solveFluid.H"
}
forAll(solidRegions, i)
{
#include "setRegionSolidFields.H"
fvMesh& mesh = solidRegions[i];
#include "readSolidMultiRegionSIMPLEControls.H"
#include "setRegionSolidFields.H"
#include "solveSolid.H"
}
@ -99,8 +103,10 @@ int main(int argc, char *argv[])
forAll(fluidRegions, i)
{
#include "setRegionFluidFields.H"
fvMesh& mesh = fluidRegions[i];
#include "readSolidMultiRegionSIMPLEControls.H"
#include "setRegionFluidFields.H"
if (!frozenFlow)
{
#include "pEqn.H"
@ -121,20 +127,24 @@ int main(int argc, char *argv[])
forAll(fluidRegions, i)
{
fvMesh& mesh = fluidRegions[i];
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionSIMPLEControls.H"
frozenFlow = true;
#include "solveFluid.H"
#include "readFluidMultiRegionSIMPLEControls.H"
#include "setRegionFluidFields.H"
frozenFlow = true;
#include "solveFluid.H"
}
forAll(solidRegions, i)
{
fvMesh& mesh = solidRegions[i];
Info<< "\nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
#include "readSolidMultiRegionSIMPLEControls.H"
#include "setRegionSolidFields.H"
#include "solveSolid.H"
}

View File

@ -5,3 +5,5 @@
const bool momentumPredictor =
simple.getOrDefault("momentumPredictor", true);
simple.readIfPresent("frozenFlow", frozenFlowFluid[i]);

View File

@ -1,5 +1,3 @@
const fvMesh& mesh = fluidRegions[i];
rhoThermo& thermo = thermoFluid[i];
thermo.validate(args.executable(), "h", "e");

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -108,19 +108,23 @@ int main(int argc, char *argv[])
forAll(fluidRegions, i)
{
fvMesh& mesh = fluidRegions[i];
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionPIMPLEControls.H"
#include "setRegionFluidFields.H"
#include "solveFluid.H"
}
forAll(solidRegions, i)
{
fvMesh& mesh = solidRegions[i];
Info<< "\nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
#include "readSolidMultiRegionPIMPLEControls.H"
#include "setRegionSolidFields.H"
#include "solveSolid.H"
}
@ -135,20 +139,24 @@ int main(int argc, char *argv[])
forAll(fluidRegions, i)
{
fvMesh& mesh = fluidRegions[i];
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionPIMPLEControls.H"
frozenFlow = true;
#include "solveFluid.H"
#include "readFluidMultiRegionPIMPLEControls.H"
#include "setRegionFluidFields.H"
frozenFlow = true;
#include "solveFluid.H"
}
forAll(solidRegions, i)
{
fvMesh& mesh = solidRegions[i];
Info<< "\nSolving for solid region "
<< solidRegions[i].name() << endl;
#include "setRegionSolidFields.H"
#include "readSolidMultiRegionPIMPLEControls.H"
#include "setRegionSolidFields.H"
#include "solveSolid.H"
}
}

View File

@ -9,3 +9,5 @@
(
pimpleDict.getOrDefault<int>("nEnergyCorrectors", 1)
);
pimpleDict.readIfPresent("frozenFlow", frozenFlowFluid[i]);

View File

@ -1,5 +1,3 @@
fvMesh& mesh = fluidRegions[i];
twoPhaseSystem& fluid = phaseSystemFluid[i];
phaseModel& phase1 = fluid.phase1();

View File

@ -8,3 +8,5 @@
const bool momentumPredictor =
pimple.getOrDefault("momentumPredictor", true);
pimple.readIfPresent("frozenFlow", frozenFlowFluid[i]);

View File

@ -1,5 +1,3 @@
fvMesh& mesh = fluidRegions[i];
CombustionModel<rhoReactionThermo>& reaction = reactionFluid[i];
rhoReactionThermo& thermo = reaction.thermo();

View File

@ -1,4 +1,3 @@
fvMesh& mesh = solidRegions[i];
solidThermo& thermo = thermos[i];
tmp<volScalarField> trho = thermo.rho();

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2016 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -37,7 +37,10 @@ scalar meanCoNum = 0.0;
if (mesh.nInternalFaces())
{
surfaceScalarField phiMask(localMin<scalar>(mesh).interpolate(cellMask));
surfaceScalarField phiMask
(
localMin<scalar>(mesh).interpolate(cellMask + interpolatedCells)
);
scalarField sumPhi(fvc::surfaceSum(mag(phiMask*phi))().internalField());

View File

@ -1,5 +1,4 @@
// Solve the Momentum equation
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> tUEqn

View File

@ -1,26 +0,0 @@
#include "createTimeControls.H"
bool correctPhi
(
pimple.dict().getOrDefault("correctPhi", false)
);
bool checkMeshCourantNo
(
pimple.dict().getOrDefault("checkMeshCourantNo", false)
);
bool massFluxInterpolation
(
pimple.dict().getOrDefault("massFluxInterpolation", false)
);
bool adjustFringe
(
pimple.dict().getOrDefault("oversetAdjustPhi", false)
);
bool ddtCorr
(
pimple.dict().getOrDefault("ddtCorr", true)
);

View File

@ -1,273 +0,0 @@
// Interpolation used
interpolationCellPoint<vector> UInterpolator(HbyA);
// Determine faces on outside of interpolated cells
bitSet isOwnerInterpolatedFace(mesh.nInternalFaces());
bitSet isNeiInterpolatedFace(mesh.nInternalFaces());
// Determine donor cells
labelListList donorCell(mesh.nInternalFaces());
scalarListList weightCellCells(mesh.nInternalFaces());
// Interpolated HbyA faces
vectorField UIntFaces(mesh.nInternalFaces(), Zero);
// Determine receptor neighbour cells
labelList receptorNeigCell(mesh.nInternalFaces(), -1);
{
const cellCellStencilObject& overlap = Stencil::New(mesh);
const labelList& cellTypes = overlap.cellTypes();
const labelIOList& zoneID = overlap.zoneID();
label nZones = gMax(zoneID)+1;
PtrList<fvMeshSubset> meshParts(nZones);
labelList nCellsPerZone(nZones, Zero);
// A mesh subset for each zone
forAll(meshParts, zonei)
{
meshParts.set
(
zonei,
// Select cells where the zoneID == zonei
new fvMeshSubset(mesh, zonei, zoneID)
);
}
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
{
label ownType = cellTypes[mesh.faceOwner()[faceI]];
label neiType = cellTypes[mesh.faceNeighbour()[faceI]];
if
(
ownType == cellCellStencil::INTERPOLATED
&& neiType == cellCellStencil::CALCULATED
)
{
isOwnerInterpolatedFace.set(faceI);
const vector& fc = mesh.faceCentres()[faceI];
for (label zoneI = 0; zoneI < nZones; zoneI++)
{
if (zoneI != zoneID[mesh.faceOwner()[faceI]])
{
const fvMesh& partMesh = meshParts[zoneI].subMesh();
const labelList& cellMap = meshParts[zoneI].cellMap();
label cellI = partMesh.findCell(fc);
if (cellI != -1)
{
// Determine weights
labelList stencil(partMesh.cellCells()[cellI]);
stencil.append(cellI);
label st = stencil.size();
donorCell[faceI].setSize(st);
weightCellCells[faceI].setSize(st);
scalarField weights(st);
forAll(stencil, i)
{
scalar d = mag
(
partMesh.cellCentres()[stencil[i]]
- fc
);
weights[i] = 1.0/d;
donorCell[faceI][i] = cellMap[stencil[i]];
}
weights /= sum(weights);
weightCellCells[faceI] = weights;
forAll(stencil, i)
{
UIntFaces[faceI] +=
weightCellCells[faceI][i]
*UInterpolator.interpolate
(
fc,
donorCell[faceI][i]
);
}
break;
}
}
}
receptorNeigCell[faceI] = mesh.faceNeighbour()[faceI];
}
else if
(
ownType == cellCellStencil::CALCULATED
&& neiType == cellCellStencil::INTERPOLATED
)
{
isNeiInterpolatedFace.set(faceI);
const vector& fc = mesh.faceCentres()[faceI];
for (label zoneI = 0; zoneI < nZones; zoneI++)
{
if (zoneI != zoneID[mesh.faceNeighbour()[faceI]])
{
const fvMesh& partMesh = meshParts[zoneI].subMesh();
const labelList& cellMap = meshParts[zoneI].cellMap();
label cellI = partMesh.findCell(fc);
if (cellI != -1)
{
// Determine weights
labelList stencil(partMesh.cellCells()[cellI]);
stencil.append(cellI);
label st = stencil.size();
donorCell[faceI].setSize(st);
weightCellCells[faceI].setSize(st);
scalarField weights(st);
forAll(stencil, i)
{
scalar d = mag
(
partMesh.cellCentres()[stencil[i]]
- fc
);
weights[i] = 1.0/d;
donorCell[faceI][i] = cellMap[stencil[i]];
}
weights /= sum(weights);
weightCellCells[faceI] = weights;
forAll(stencil, i)
{
UIntFaces[faceI] +=
weightCellCells[faceI][i]
*UInterpolator.interpolate
(
fc,
donorCell[faceI][i]
);
}
break;
}
}
}
receptorNeigCell[faceI] = mesh.faceOwner()[faceI];
}
}
}
// contravariant U
vectorField U1Contrav(mesh.nInternalFaces(), Zero);
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf());
forAll(isNeiInterpolatedFace, faceI)
{
label cellId = -1;
if (isNeiInterpolatedFace.test(faceI))
{
cellId = mesh.faceNeighbour()[faceI];
}
else if (isOwnerInterpolatedFace.test(faceI))
{
cellId = mesh.faceOwner()[faceI];
}
if (cellId != -1)
{
const vector& n = faceNormals[faceI];
vector n1(Zero);
// 2-D cases
if (mesh.nSolutionD() == 2)
{
for (direction cmpt=0; cmpt<vector::nComponents; cmpt++)
{
if (mesh.geometricD()[cmpt] == -1)
{
switch (cmpt)
{
case vector::X:
{
n1 = vector(0, n.z(), -n.y());
break;
}
case vector::Y:
{
n1 = vector(n.z(), 0, -n.x());
break;
}
case vector::Z:
{
n1 = vector(n.y(), -n.x(), 0);
break;
}
}
}
}
}
else if (mesh.nSolutionD() == 3)
{
//Determine which is the primary direction
if (mag(n.x()) > mag(n.y()) && mag(n.x()) > mag(n.z()))
{
n1 = vector(n.y(), -n.x(), 0);
}
else if (mag(n.y()) > mag(n.z()))
{
n1 = vector(0, n.z(), -n.y());
}
else
{
n1 = vector(-n.z(), 0, n.x());
}
}
n1.normalise();
const vector n2 = normalised(n ^ n1);
tensor rot =
tensor
(
n.x() ,n.y(), n.z(),
n1.x() ,n1.y(), n1.z(),
n2.x() ,n2.y(), n2.z()
);
// tensor rot =
// tensor
// (
// n & x ,n & y, n & z,
// n1 & x ,n1 & y, n1 & z,
// n2 & x ,n2 & y, n2 & z
// );
U1Contrav[faceI].x() =
2*transform(rot, UIntFaces[faceI]).x()
- transform(rot, HbyA[receptorNeigCell[faceI]]).x();
U1Contrav[faceI].y() = transform(rot, HbyA[cellId]).y();
U1Contrav[faceI].z() = transform(rot, HbyA[cellId]).z();
HbyA[cellId] = transform(inv(rot), U1Contrav[faceI]);
}
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2018 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -46,12 +46,9 @@ Description
#include "fvOptions.H"
#include "cellCellStencilObject.H"
#include "zeroGradientFvPatchFields.H"
#include "localMin.H"
#include "interpolationCellPoint.H"
#include "transform.H"
#include "fvMeshSubset.H"
#include "oversetAdjustPhi.H"
#include "oversetPatchPhiErr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -68,10 +65,9 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createUf.H"
#include "createMRF.H"
@ -88,7 +84,9 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readControls.H"
#include "readDyMControls.H"
#include "readOversetDyMControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
@ -97,45 +95,20 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
bool changed = mesh.update();
mesh.update();
if (changed)
if (mesh.changing())
{
#include "setCellMask.H"
#include "setInterpolatedCells.H"
#include "correctPhiFaceMask.H"
surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
fvc::makeRelative(phi, U);
// Zero Uf on old faceMask (H-I)
Uf *= faceMaskOld;
// Update Uf and phi on new C-I faces
Uf += (1-faceMaskOld)*fvc::interpolate(U);
phi = mesh.Sf() & Uf;
// Zero phi on current H-I
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;
}
if (mesh.changing() && correctPhi)
{
// Calculate absolute flux from the mapped surface velocity
#include "correctPhi.H"
}
// Make the flux relative to the mesh motion
fvc::makeRelative(phi, U);
if (mesh.changing() && checkMeshCourantNo)
{
#include "meshCourantNo.H"
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
// --- Pressure-velocity PIMPLE corrector loop

View File

@ -1,36 +1,11 @@
// Option 1: interpolate rAU, do not block out rAU on blocked cells
volScalarField rAU("rAU", 1.0/UEqn.A());
mesh.interpolate(rAU);
// Option 2: do not interpolate rAU but block out rAU
//surfaceScalarField rAUf("rAUf", fvc::interpolate(blockedCells*rAU));
// Option 3: do not interpolate rAU but zero out rAUf on faces on holes
// But what about:
//
// H
// H I C C C C
// H
//
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
volVectorField H("H", UEqn.H());
volVectorField HbyA("HbyA", U);
HbyA = constrainHbyA(rAU*H, U, p);
if (massFluxInterpolation)
{
#include "interpolatedFaces.H"
}
if (runTime.outputTime())
{
H.write();
rAU.write();
HbyA.write();
}
if (pimple.nCorrPISO() <= 1)
{
tUEqn.clear();
@ -38,33 +13,16 @@ if (pimple.nCorrPISO() <= 1)
phiHbyA = fvc::flux(HbyA);
if (ddtCorr)
{
surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
phiHbyA += rAUf*faceMaskOld*fvc::ddtCorr(U, Uf);
}
MRF.makeRelative(phiHbyA);
// WIP
if (p.needReference())
{
fvc::makeRelative(phiHbyA, U);
adjustPhi(phiHbyA, U, p);
fvc::makeAbsolute(phiHbyA, U);
}
if (adjustFringe)
{
fvc::makeRelative(phiHbyA, U);
oversetAdjustPhi(phiHbyA, U);
oversetAdjustPhi(phiHbyA, U, zoneIdMass);
fvc::makeAbsolute(phiHbyA, U);
}
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
@ -79,27 +37,26 @@ while (pimple.correctNonOrthogonal())
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA - pEqn.flux();
// option 2:
// rAUf*fvc::snGrad(p)*mesh.magSf();
pEqn.relax();
U =
cellMask*
(
HbyA
- rAU*fvc::reconstruct((pEqn.flux())/rAUf)
);
U.correctBoundaryConditions();
fvOptions.correct(U);
}
if (oversetPatchErrOutput)
{
oversetPatchPhiErr(pEqn, phiHbyA);
}
}
// Excludes error in interpolated/hole cells
#include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p.relax();
volVectorField gradP(fvc::grad(p));
// Option 2: zero out velocity on blocked out cells
//U = HbyA - rAU*cellMask*gradP;
// Option 3: zero out velocity on blocked out cells
// This is needed for the scalar Eq (k,epsilon, etc)
// which can use U as source term
U = cellMask*(HbyA - rAU*gradP);
U.correctBoundaryConditions();
fvOptions.correct(U);
{
Uf = fvc::interpolate(U);
@ -109,9 +66,4 @@ fvOptions.correct(U);
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;

View File

@ -1,10 +0,0 @@
#include "readTimeControls.H"
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
checkMeshCourantNo = pimple.dict().getOrDefault("checkMeshCourantNo", false);
massFluxInterpolation =
pimple.dict().getOrDefault("massFluxInterpolation", false);
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);

View File

@ -24,7 +24,3 @@ bool adjustFringe
(
simple.dict().getOrDefault("oversetAdjustPhi", false)
);
bool massFluxInterpolation
(
simple.dict().getOrDefault("massFluxInterpolation", false)
);

View File

@ -1,18 +1,10 @@
{
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rAUf("rAUf", faceMask*fvc::interpolate(rAU));
volVectorField HbyA("HbyA", U);
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
//mesh.interpolate(HbyA);
if (massFluxInterpolation)
{
#include "interpolatedFaces.H"
}
tUEqn.clear();
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));

View File

@ -129,10 +129,5 @@ compressibleInterPhaseTransportModel turbulence
// Mask field for zeroing out contributions on hole cells
#include "createCellMask.H"
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
// Create bool field with interpolated cells
#include "createInterpolatedCells.H"

View File

@ -80,9 +80,6 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
pimpleControl pimple(mesh);
#include "createTimeControls.H"
#include "createDyMControls.H"
#include "createFields.H"
@ -109,7 +106,7 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readControls.H"
#include "readDyMControls.H"
if (LTS)
{
@ -154,40 +151,10 @@ int main(int argc, char *argv[])
// Update cellMask field for blocking out hole cells
#include "setCellMask.H"
#include "setInterpolatedCells.H"
faceMask =
localMin<scalar>(mesh).interpolate(cellMask.oldTime());
// Zero Uf on old faceMask (H-I)
Uf *= faceMask;
const surfaceVectorField Uint(fvc::interpolate(U));
// Update Uf and phi on new C-I faces
Uf += (1-faceMask)*Uint;
// Update Uf boundary
forAll(Uf.boundaryField(), patchI)
{
Uf.boundaryFieldRef()[patchI] =
Uint.boundaryField()[patchI];
}
phi = mesh.Sf() & Uf;
// Correct phi on individual regions
if (correctPhi)
{
#include "correctPhi.H"
}
#include "correctPhiFaceMask.H"
mixture.correct();
// Zero phi on current H-I
faceMask = localMin<scalar>(mesh).interpolate(cellMask);
phi *= faceMask;
U *= cellMask;
// Make the flux relative to the mesh motion
fvc::makeRelative(phi, U);
@ -202,10 +169,6 @@ int main(int argc, char *argv[])
#include "alphaControls.H"
#include "compressibleAlphaEqnSubCycle.H"
const surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
rhoPhi *= faceMask;
turbulence.correctPhasePhi();

View File

@ -10,19 +10,6 @@
fvc::flux(HbyA)
);
if (ddtCorr)
{
surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
phiHbyA +=
MRF.zeroFilter
(
fvc::interpolate(rho*rAU)*faceMaskOld*fvc::ddtCorr(U, Uf)
);
}
MRF.makeRelative(phiHbyA);
surfaceScalarField phig

View File

@ -157,12 +157,7 @@ void Foam::radiation::laserDTRM::initialiseReflection()
);
}
if (reflections_.size())
{
reflectionSwitch_ = true;
}
reflectionSwitch_ = returnReduce(reflectionSwitch_, orOp<bool>());
reflectionSwitch_ = returnReduceOr(reflections_.size());
}
}
@ -299,14 +294,12 @@ void Foam::radiation::laserDTRM::initialise()
DTRMCloud_.addParticle(pPtr);
}
if (returnReduce(cellI, maxOp<label>()) == -1)
if (nMissed < 10 && returnReduceAnd(cellI < 0))
{
if (++nMissed <= 10)
{
WarningInFunction
<< "Cannot find owner cell for focalPoint at "
<< p0 << endl;
}
++nMissed;
WarningInFunction
<< "Cannot find owner cell for focalPoint at "
<< p0 << endl;
}
}
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -36,7 +36,10 @@ scalar meanCoNum = 0.0;
if (mesh.nInternalFaces())
{
surfaceScalarField phiMask(localMin<scalar>(mesh).interpolate(cellMask));
surfaceScalarField phiMask
(
localMin<scalar>(mesh).interpolate(cellMask + interpolatedCells)
);
scalarField sumPhi
(

View File

@ -7,3 +7,5 @@ volScalarField::Internal divU
? fvc::div(phiCN() + mesh.phi())
: fvc::div(phiCN())
);
divU *= interpolatedCells*cellMask;

View File

@ -1,30 +0,0 @@
bool correctPhi
(
pimple.dict().getOrDefault("correctPhi", true)
);
bool checkMeshCourantNo
(
pimple.dict().getOrDefault("checkMeshCourantNo", false)
);
bool moveMeshOuterCorrectors
(
pimple.dict().getOrDefault("moveMeshOuterCorrectors", false)
);
bool massFluxInterpolation
(
pimple.dict().getOrDefault("massFluxInterpolation", false)
);
bool adjustFringe
(
pimple.dict().getOrDefault("oversetAdjustPhi", false)
);
bool ddtCorr
(
pimple.dict().getOrDefault("ddtCorr", true)
);

View File

@ -40,8 +40,12 @@ volVectorField U
nonInt.insert("HbyA");
nonInt.insert("grad(p_rgh)");
nonInt.insert("nHat");
nonInt.insert("surfaceIntegrate(nHatf)");
nonInt.insert("surfaceIntegrate(phi+meshPhi)");
nonInt.insert("surfaceIntegrate(phi)");
nonInt.insert("surfaceIntegrate(phiHbyA)");
nonInt.insert("surfaceSum(((S|magSf)*S)");
nonInt.insert("surfaceIntegrate(((rAUf*magSf)*snGradCorr(p_rgh)))");
nonInt.insert("cellMask");
nonInt.insert("cellDisplacement");
nonInt.insert("interpolatedCells");

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2014 OpenFOAM Foundation
Copyright (C) 2016-2017 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -49,14 +49,11 @@ Description
#include "turbulentTransportModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "CorrectPhi.H"
#include "fvcSmooth.H"
#include "cellCellStencilObject.H"
#include "localMin.H"
#include "interpolationCellPoint.H"
#include "transform.H"
#include "fvMeshSubset.H"
#include "oversetAdjustPhi.H"
#include "oversetPatchPhiErr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -76,8 +73,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
#include "createTimeControls.H"
#include "createDyMControls.H"
#include "createFields.H"
#include "createAlphaFluxes.H"
@ -97,11 +93,8 @@ int main(int argc, char *argv[])
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1.0)
);
if (correctPhi)
{
#include "correctPhi.H"
}
#include "createUf.H"
#include "createControls.H"
#include "setCellMask.H"
#include "setInterpolatedCells.H"
@ -119,7 +112,8 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readControls.H"
#include "readDyMControls.H"
#include "readOversetDyMControls.H"
if (LTS)
{
@ -158,50 +152,17 @@ int main(int argc, char *argv[])
talphaPhi1Corr0.clear();
}
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
// Update cellMask field for blocking out hole cells
#include "setCellMask.H"
#include "setInterpolatedCells.H"
#include "correctPhiFaceMask.H"
const surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
// Zero Uf on old faceMask (H-I)
Uf *= faceMaskOld;
const surfaceVectorField Uint(fvc::interpolate(U));
// Update Uf and phi on new C-I faces
Uf += (1-faceMaskOld)*Uint;
// Update Uf boundary
forAll(Uf.boundaryField(), patchI)
{
Uf.boundaryFieldRef()[patchI] =
Uint.boundaryField()[patchI];
}
phi = mesh.Sf() & Uf;
// Correct phi on individual regions
if (correctPhi)
{
#include "correctPhi.H"
}
mixture.correct();
// Zero phi on current H-I
const surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;
U *= cellMask;
// Make the flux relative to the mesh motion
fvc::makeRelative(phi, U);
@ -213,14 +174,14 @@ int main(int argc, char *argv[])
}
}
if (adjustFringe)
{
oversetAdjustPhi(phi, U, zoneIdMass);
}
#include "alphaControls.H"
#include "alphaEqnSubCycle.H"
const surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
rhoPhi *= faceMask;
mixture.correct();

View File

@ -1,64 +1,31 @@
{
rAU = 1.0/UEqn.A();
//mesh.interpolate(rAU);
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
volVectorField H("H", UEqn.H());
volVectorField HbyA("HbyA", U);
//HbyA = rAU*UEqn.H();
HbyA = constrainHbyA(rAU*H, U, p_rgh);
if (massFluxInterpolation)
{
#include "interpolatedFaces.H"
}
HbyA = constrainHbyA(rAU*H, U, p_rgh);
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
if (ddtCorr)
{
surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
phiHbyA +=
fvc::interpolate(rho*rAU)*faceMaskOld*fvc::ddtCorr(U, Uf);
}
MRF.makeRelative(phiHbyA);
if (p_rgh.needReference())
{
fvc::makeRelative(phiHbyA, U);
adjustPhi(phiHbyA, U, p_rgh);
fvc::makeAbsolute(phiHbyA, U);
}
if (adjustFringe)
{
fvc::makeRelative(phiHbyA, U);
oversetAdjustPhi(phiHbyA, U);
fvc::makeAbsolute(phiHbyA, U);
}
surfaceScalarField phig
(
(
mixture.surfaceTensionForce()
- ghf*fvc::snGrad(rho)
)*faceMask*rAUf*mesh.magSf()
- ghf*fvc::snGrad(cellMask*rho)
)*rAUf*faceMask*mesh.magSf()
);
phiHbyA += phig;
if (adjustFringe)
{
fvc::makeRelative(phiHbyA, U);
oversetAdjustPhi(phiHbyA, U);
fvc::makeAbsolute(phiHbyA, U);
oversetAdjustPhi(phiHbyA, U, zoneIdMass);
}
// Update the pressure BCs to ensure flux consistency
@ -90,6 +57,10 @@
U.correctBoundaryConditions();
fvOptions.correct(U);
}
if (oversetPatchErrOutput)
{
oversetPatchPhiErr(p_rghEqn, phiHbyA);
}
}
#include "continuityErrs.H"

View File

@ -1,16 +0,0 @@
#include "readTimeControls.H"
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
checkMeshCourantNo =
pimple.dict().getOrDefault("checkMeshCourantNo", false);
moveMeshOuterCorrectors =
pimple.dict().getOrDefault("moveMeshOuterCorrectors", false);
massFluxInterpolation =
pimple.dict().getOrDefault("massFluxInterpolation", false);
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);
adjustFringe = pimple.dict().getOrDefault("oversetAdjustPhi", false);

View File

@ -1,11 +0,0 @@
CorrectPhi
(
U,
phi,
p_rgh,
surfaceScalarField("rAUf", fvc::interpolate(rAU)),
divU,
pimple
);
#include "continuityErrs.H"

View File

@ -149,10 +149,5 @@ surfaceScalarField alphaPhi10
// Mask field for zeroing out contributions on hole cells
#include "createCellMask.H"
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
// Create bool field with interpolated cells
#include "createInterpolatedCells.H"

View File

@ -82,9 +82,7 @@ int main(int argc, char *argv[])
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
pimpleControl pimple(mesh);
#include "createTimeControls.H"
#include "createDyMControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
@ -118,7 +116,7 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readControls.H"
#include "readDyMControls.H"
// Store divU from the previous mesh so that it can be mapped
// and used in correctPhi to ensure the corrected phi has the
@ -153,40 +151,10 @@ int main(int argc, char *argv[])
// Update cellMask field for blocking out hole cells
#include "setCellMask.H"
#include "setInterpolatedCells.H"
faceMask =
localMin<scalar>(mesh).interpolate(cellMask.oldTime());
// Zero Uf on old faceMask (H-I)
Uf *= faceMask;
const surfaceVectorField Uint(fvc::interpolate(U));
// Update Uf and phi on new C-I faces
Uf += (1-faceMask)*Uint;
// Update Uf boundary
forAll(Uf.boundaryField(), patchI)
{
Uf.boundaryFieldRef()[patchI] =
Uint.boundaryField()[patchI];
}
phi = mesh.Sf() & Uf;
if (correctPhi)
{
#include "correctPhi.H"
}
#include "correctPhiFaceMask.H"
mixture->correct();
// Zero phi on current H-I
faceMask = localMin<scalar>(mesh).interpolate(cellMask);
phi *= faceMask;
U *= cellMask;
// Make the flux relative to the mesh motion
fvc::makeRelative(phi, U);
}
@ -214,10 +182,6 @@ int main(int argc, char *argv[])
mixture->correct();
#include "alphaEqnSubCycle.H"
const surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
rhoPhi *= faceMask;
interface.correct();

View File

@ -8,16 +8,6 @@
fvc::flux(HbyA)
);
if (ddtCorr)
{
surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
phiHbyA += faceMaskOld*fvc::ddtCorr(U, Uf);
}
if (p_rgh.needReference())
{
fvc::makeRelative(phiHbyA, U);

View File

@ -7,6 +7,7 @@ cd "${0%/*}" || exit # Run from this directory
library/Allwmake
wmake
# Does not use libOpenFOAM or libPstream...
wmake -no-openfoam
#------------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
/* Install into FOAM_APPBIN to support 'fake' builds (to test packaging) */
Test-dummyLib.C
Test-dummyLib.cpp
EXE = $(FOAM_APPBIN)/Test-dummyLib

View File

@ -1,4 +1,4 @@
/* Install into central FOAM_LIBBIN for 'fake' builds (test packaging) */
dummyLib.C
dummyLib.cpp
LIB = $(FOAM_LIBBIN)/libTestDummy-OpenFOAM

View File

@ -1,4 +1,4 @@
/* Install into central FOAM_LIBBIN/dummy for 'fake' builds (test packaging) */
dummyMpiLib.C
dummyMpiLib.cpp
LIB = $(FOAM_LIBBIN)/dummy/libTestDummyMpi

View File

@ -1,4 +1,4 @@
/* Install into central FOAM_MPI_LIBBIN for 'fake' builds (test packaging) */
dummyMpiLib.C
dummyMpiLib.cpp
LIB = $(FOAM_MPI_LIBBIN)/libTestDummyMpi

View File

@ -1,8 +1,8 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
# HPMPI rules (ia64)
PFLAGS =
PINC = -isystem $(MPI_ARCH_PATH)/include -D_MPICC_H
PLIBS = -L$(MPI_ARCH_PATH)/lib/linux_ia64 -lmpi
# Does not use libOpenFOAM or libPstream...
wmake -no-openfoam
#------------------------------------------------------------------------------

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2021 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -59,7 +59,8 @@ void print(const char* name, bool showLimits = true)
int main(int argc, char *argv[])
{
std::cout<<"machine sizes\n---\n\n";
std::cout<< "c++ = " << __cplusplus << '\n';
std::cout<< "machine sizes\n---\n\n";
print<short>("short");
print<int>("int");

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
# Does not use libOpenFOAM or libPstream...
wmake -no-openfoam
#------------------------------------------------------------------------------

View File

@ -1,3 +1,3 @@
Test-openmp.C
Test-openmp.cpp
EXE = $(FOAM_USER_APPBIN)/Test-openmp

View File

@ -41,8 +41,13 @@ Description
int main(int argc, char *argv[])
{
std::cout
<< "c++ = " << __cplusplus << '\n';
#if _OPENMP
std::cout << "_OPENMP = " << _OPENMP << "\n\n";
std::cout
<< "openmp = " << _OPENMP << '\n'
<< "Initial threads = " << omp_get_num_threads() << "\n\n";
// Fork threads with their own copies of variables
int nThreads, threadId;
@ -52,15 +57,15 @@ int main(int argc, char *argv[])
threadId = omp_get_thread_num();
nThreads = omp_get_num_threads();
// Printf rather than cout to ensure that it emits in one go
printf("Called from thread = %d\n", threadId);
// Master thread
if (threadId == 0)
{
// Printf rather than cout to ensure that it emits in one go
printf("Number of threads = %d\n", nThreads);
}
// Printf rather than cout to ensure that it emits in one go
printf("Called from thread = %d\n", threadId);
}
#else
std::cout << "Compiled without openmp!\n";

View File

@ -64,23 +64,23 @@ inline Ostream& report
int main(int argc, char *argv[])
{
CircularBuffer<label> buf1(1); report(buf1);
buf1.append(10); report(buf1);
buf1.push_back(10); report(buf1);
Info<< buf1.range_one() << nl;
buf1.append(20); report(buf1);
buf1.append(30); report(buf1);
buf1.push_back(20); report(buf1);
buf1.push_back(30); report(buf1);
buf1.push_back(40); report(buf1);
buf1.push_front(-50); report(buf1);
buf1.append(60); report(buf1);
buf1.append(labelList({70,80,90})); report(buf1);
buf1.push_back(60); report(buf1);
buf1.push_back(labelList({70,80,90})); report(buf1);
Info<< nl << "access: " << buf1 << nl;
Info<< buf1[-12] << nl;
Info<< "found: " << buf1.found(40) << nl;
buf1.appendUniq(100); report(buf1);
buf1.push_uniq(100); report(buf1);
buf1 = Zero; report(buf1);
@ -88,11 +88,11 @@ int main(int argc, char *argv[])
while (buf1.size() > 2)
{
(void) buf1.pop_front();
buf1.pop_front();
}
report(buf1);
buf1.append(identity(5)); report(buf1);
buf1.push_back(identity(5)); report(buf1);
buf1.info(Info);
Info<< buf1 << nl;
@ -123,6 +123,8 @@ int main(int argc, char *argv[])
Info<< endl;
}
Info<< nl << "list: " << flatOutput(buf2.list()) << nl;
Info<< "normal: " << flatOutput(buf2) << nl;
buf2.reverse();
Info<< "reverse: " << flatOutput(buf2) << nl;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,11 +67,11 @@ int main(int argc, char *argv[])
for (int i = 0; i<10; i++)
{
myList.append(1.3*i);
myList.push_back(1.3*i);
}
myList.append(100.3);
myList.append(500.3);
myList.push_back(100.3);
myList.push_back(500.3);
Info<< "DLList<scalar>" << nl;
Info<< nl << "flat-output: " << flatOutput(myList) << nl;
@ -144,23 +144,23 @@ int main(int argc, char *argv[])
Info<< " => " << flatOutput(myList) << nl;
}
myList.append(500.3);
myList.append(200.3);
myList.append(100.3);
myList.push_back(500.3);
myList.push_back(200.3);
myList.push_back(100.3);
Info<< nl << "Testing swapUp and swapDown:" << nl;
Info<< " => " << flatOutput(myList) << nl;
{
myList.swapUp(myList.DLListBase::first());
myList.swapUp(myList.DLListBase::last());
myList.swapUp(myList.DLListBase::front());
myList.swapUp(myList.DLListBase::back());
Info<< nl << "swapUp => " << flatOutput(myList) << nl;
}
{
myList.swapDown(myList.DLListBase::first());
myList.swapDown(myList.DLListBase::last());
myList.swapDown(myList.DLListBase::front());
myList.swapDown(myList.DLListBase::back());
Info<< nl << "swapDown => " << flatOutput(myList) << nl;
}
@ -200,7 +200,7 @@ int main(int argc, char *argv[])
for (int i = 0; i<5; i++)
{
labList.append(identity(6));
labList.push_back(identity(6));
}
Info<< nl
@ -221,16 +221,16 @@ int main(int argc, char *argv[])
List<label> content1 = identity(10);
Info<< nl
<< " move append ";
<< " move push_back ";
printAddress(content1);
labList.append(std::move(content1));
labList.push_back(std::move(content1));
Info<< " content " << flatOutput(content1) << nl
<< " list" << labList << nl;
printAddresses(labList);
// labList.append(content1);
// labList.push_back(content1);
}
Info<< nl << "Done." << endl;

View File

@ -189,6 +189,12 @@ int main(int argc, char *argv[])
<< " hash:" << FixedList<label, 4>::hasher()(list1) << nl
<< " hash:" << Hash<FixedList<label, 4>>()(list1) << nl;
Info<< "get<0>: " << list1.get<0>() << nl;
Info<< "get<1>: " << list1.get<1>() << nl;
Info<< "get<2>: " << list1.get<2>() << nl;
Info<< "get<3>: " << list1.get<3>() << nl;
// Will not compile: Info<< "get<4>: " << list1.get<4>() << nl;
label a[4] = {0, 1, 2, 3};
FixedList<label, 4> list2(a);

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -113,7 +113,6 @@ int main(int argc, char *argv[])
label coarseSize = max(addr)+1;
Info<< "Level : " << level << endl
<< returnReduce(addr.size(), sumOp<label>()) << endl
<< " current size : "
<< returnReduce(addr.size(), sumOp<label>()) << endl
<< " agglomerated size : "

View File

@ -37,8 +37,6 @@ Description
#include "labelPairHashes.H"
#include "FlatOutput.H"
#include <algorithm>
using namespace Foam;
template<class Iter>

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -240,13 +240,8 @@ int main(int argc, char *argv[])
);
argList::addBoolOption
(
"copy-append",
"test move append lists (requires -filter)"
);
argList::addBoolOption
(
"move-append",
"test move append lists (requires -filter)"
"merge",
"test merging lists (requires -filter)"
);
// timeSelector::addOptions();
@ -261,16 +256,10 @@ int main(int argc, char *argv[])
Info<<"limit names: " << matcher << nl;
}
if (args.found("copy-append") && matcher.empty())
if (args.found("merge") && matcher.empty())
{
FatalError
<< nl << "The -copy-append test also requires -filter" << nl
<< exit(FatalError);
}
if (args.found("move-append") && matcher.empty())
{
FatalError
<< nl << "The -move-append test also requires -filter" << nl
<< nl << "The -merge test also requires -filter" << nl
<< exit(FatalError);
}
@ -327,13 +316,9 @@ int main(int argc, char *argv[])
// On last time
if (timeI == timeDirs.size()-1)
{
if (args.found("copy-append"))
if (args.found("merge"))
{
Info<< nl << "Test move append" << nl;
}
else if (args.found("move-append"))
{
Info<< nl << "Test move append" << nl;
Info<< nl << "Test merge" << nl;
}
else
{
@ -349,18 +334,8 @@ int main(int argc, char *argv[])
Info<< "==target==" << nl; reportDetail(objects);
Info<< "==source==" << nl; reportDetail(other);
if (args.found("copy-append"))
{
objects.append(other);
Info<< nl << "After copy-append" << nl;
}
else
{
objects.append(std::move(other));
Info<< nl << "After move-append" << nl;
}
objects.merge(std::move(other));
Info<< nl << "After merge" << nl;
Info<< "==target==" << nl; reportDetail(objects);
Info<< "==source==" << nl; reportDetail(other);

View File

@ -76,11 +76,11 @@ int main(int argc, char *argv[])
for (int i = 0; i<10; i++)
{
myList.append(new Scalar(1.3*i));
myList.push_back(new Scalar(1.3*i));
}
myList.append(new Scalar(100.3));
myList.append(new Scalar(500.3));
myList.push_back(new Scalar(100.3));
myList.push_back(new Scalar(500.3));
Info<< "ISLList<scalar>" << myList << nl;
Info<< nl << "flat-output: " << flatOutput(myList) << nl;

View File

@ -126,8 +126,8 @@ void doTest
if (testskip)
{
Info<< " first : " << its.peekFirst().info() << nl
<< " last : " << its.peekLast().info() << nl;
Info<< " front : " << its.front().info() << nl
<< " back : " << its.back().info() << nl;
Info<< "rewind():" << nl;
reportPeek(its);

View File

@ -101,6 +101,9 @@ int main(int argc, char *argv[])
printInfo(idl1);
Info<< "list() = ";
idl1.list().writeList(Info, 0) << endl;
for (const label val : { 10, 30, 40, 50, 90, 80, 120 } )
{
testFind(val, idl1);
@ -182,7 +185,7 @@ int main(int argc, char *argv[])
// MPI barrier
bool barrier = true;
Pstream::scatter(barrier);
Pstream::broadcast(barrier);
}

View File

@ -214,8 +214,8 @@ int main(int argc, char *argv[])
forAllReverseIters(list2, iter) { *iter *= 0.5; Info<< " " << *iter; }
Info<< endl;
list1.append(list2);
Info<< "list1.append(list2): " << list1 << endl;
list1.push_back(list2);
Info<< "list1.push_back(list2): " << list1 << endl;
for (const vector& val : { vector(3, 4, 5), vector(10,11, 12)} )
{

View File

@ -40,8 +40,6 @@ Description
#include "OFstream.H"
#include "cpuTime.H"
#include <initializer_list>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
using namespace Foam;

View File

@ -40,8 +40,6 @@ Description
#include "OFstream.H"
#include "cpuTime.H"
#include <initializer_list>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
using namespace Foam;

View File

@ -0,0 +1,3 @@
Test-OFstream.C
EXE = $(FOAM_USER_APPBIN)/Test-OFstream

View File

@ -0,0 +1,228 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Test OFstream. Primarily atomic operations
\*---------------------------------------------------------------------------*/
#include "Fstream.H"
#include "IOstreams.H"
#include "OSspecific.H"
#include "argList.H"
#include "ListOps.H"
using namespace Foam;
void listFiles(const fileName& dir)
{
wordList files = ListOps::create<word>
(
readDir(dir, fileName::FILE),
nameOp<fileName>()
);
Info
<< nl
<< "files:" << nl
<< files << nl
<< "ls" << nl
<< "============" << endl;
Foam::system("ls -al " + dir);
Info<< "============" << endl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::addBoolOption("gz", "Use compression");
argList::addBoolOption("append", "Use append mode");
argList::addBoolOption("atomic", "Use atomic");
argList::addBoolOption("keep", "Do not remove test directory");
argList::addOption("write", "file", "test writing to file");
#include "setRootCase.H"
const fileName baseDir("Test-OFstream-directory");
Foam::mkDir(baseDir);
InfoErr<< "mkdir: " << baseDir << endl;
IOstreamOption streamOpt;
if (args.found("gz"))
{
streamOpt.compression(IOstreamOption::COMPRESSED);
}
IOstreamOption::appendType append =
(
args.found("append")
? IOstreamOption::APPEND
: IOstreamOption::NON_APPEND
);
IOstreamOption::atomicType atomic =
(
args.found("atomic")
? IOstreamOption::ATOMIC
: IOstreamOption::NON_ATOMIC
);
{
OFstream(baseDir/"dummy")() << "Some file content" << endl;
Foam::ln("dummy", baseDir/"Test2.txt");
Foam::ln("dummy", baseDir/"Test3.txt");
Foam::ln("dummy", baseDir/"Test4.txt");
Foam::ln("dummy", baseDir/"Test4.txt.gz");
Foam::ln("dummy", baseDir/"Test5.txt");
Foam::ln("dummy", baseDir/"Test5.txt.gz");
}
{
OFstream os
(
atomic,
baseDir/"Test1.txt",
streamOpt,
append
);
os << "=========================" << endl;
InfoErr<< "open: " << os.name() << endl;
InfoErr<< "... sleep" << endl;
listFiles(baseDir);
sleep(2);
os << "+++++++++++++++++++++++++++++++++++" << endl;
}
{
OFstream os
(
atomic,
baseDir/"Test2.txt",
streamOpt
// NON_APPEND
);
os << "=========================" << endl;
InfoErr<< "open: " << os.name() << endl;
InfoErr<< "... sleep" << endl;
listFiles(baseDir);
sleep(2);
os << "+++++++++++++++++++++++++++++++++++" << endl;
}
{
OFstream os
(
atomic,
baseDir/"Test3.txt",
streamOpt,
IOstreamOption::APPEND
);
os << "=========================" << endl;
InfoErr<< "open: " << os.name() << endl;
InfoErr<< "... sleep" << endl;
listFiles(baseDir);
sleep(2);
os << "+++++++++++++++++++++++++++++++++++" << endl;
}
{
OFstream os
(
baseDir/"Test4.txt",
IOstreamOption::ASCII,
IOstreamOption::COMPRESSED
);
os << "=========================" << endl;
InfoErr<< "open: " << os.name() << endl;
InfoErr<< "... sleep" << endl;
listFiles(baseDir);
sleep(2);
os << "+++++++++++++++++++++++++++++++++++" << endl;
}
{
OFstream os
(
IOstreamOption::ATOMIC,
baseDir/"Test5.txt"
// ASCII UNCOMPRESSED NON_APPEND
);
os << "=========================" << endl;
InfoErr<< "open: " << os.name() << endl;
InfoErr<< "... sleep" << endl;
listFiles(baseDir);
sleep(2);
os << "+++++++++++++++++++++++++++++++++++" << endl;
}
Info<< nl << "done:" << endl;
listFiles(baseDir);
if (args.found("keep"))
{
InfoErr<< "keep: " << baseDir << endl;
}
else
{
InfoErr<< "rmdir: " << baseDir << endl;
Foam::rmDir(baseDir);
}
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2018-2021 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -245,10 +245,10 @@ int main(int argc, char *argv[])
list1.resize(8);
report(list1);
Info<< "\ntest append() operation\n";
list1.append(2);
list1.append(3);
list1.append(4);
Info<< "\ntest push_back() operation\n";
list1.push_back(2);
list1.push_back(3);
list1.push_back(4);
report(list1);
Info<< "\ntest reserve() operation\n";
@ -326,9 +326,9 @@ int main(int argc, char *argv[])
report(list1);
Info<< "\ntest copy constructor + append\n";
Info<< "\ntest copy constructor + push_back\n";
PackedList<3> list2(list1);
list2.append(4);
list2.push_back(4);
Info<< "source list:\n";
report(list1);

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -108,7 +108,7 @@ Ostream& printAddr
for (label i=0; i < len; ++i)
{
os << "addr=" << name(list(i)) << nl;
os << "addr=" << Foam::name(list.get(i)) << nl;
}
// End delimiter
@ -140,7 +140,7 @@ Ostream& print
for (label i=0; i < len; ++i)
{
const T* ptr = list(i);
const T* ptr = list.get(i);
if (ptr)
{
@ -174,7 +174,7 @@ Ostream& print
for (label i=0; i < len; ++i)
{
const T* ptr = list(i);
const T* ptr = list.get(i);
if (ptr)
{
@ -192,7 +192,7 @@ Ostream& print
for (label i=len; i < cap; ++i)
{
const T* ptr = list(i);
const T* ptr = list.get(i);
os << "unused " << name(ptr) << nl;
}
@ -274,9 +274,9 @@ int main(int argc, char *argv[])
{
DLPtrList<Scalar> llist1;
llist1.prepend(new Scalar(100));
llist1.prepend(new Scalar(200));
llist1.prepend(new Scalar(300));
llist1.push_front(new Scalar(100));
llist1.push_front(new Scalar(200));
llist1.push_front(new Scalar(300));
auto citer = llist1.begin();
@ -305,9 +305,9 @@ int main(int argc, char *argv[])
// Same but as SLPtrList
{
SLPtrList<Scalar> llist1;
llist1.prepend(new Scalar(100));
llist1.prepend(new Scalar(200));
llist1.prepend(new Scalar(300));
llist1.push_front(new Scalar(100));
llist1.push_front(new Scalar(200));
llist1.push_front(new Scalar(300));
for (const auto& it : llist1)
{
@ -334,7 +334,7 @@ int main(int argc, char *argv[])
{
listApp.append(new Scalar(1.3*i));
}
listApp.emplace_append(100);
listApp.emplace_back(100);
Info<< nl
@ -580,8 +580,8 @@ int main(int argc, char *argv[])
}
PtrList<plane> planes;
planes.emplace_append(vector::one, vector::one);
planes.emplace_append(vector(1,2,3), vector::one);
planes.emplace_back(vector::one, vector::one);
planes.emplace_back(vector(1,2,3), vector::one);
Info<< nl << "appended values" << nl;
for (const plane& p : planes)
@ -594,15 +594,15 @@ int main(int argc, char *argv[])
PtrDynList<plane> dynPlanes;
{
dynPlanes.emplace_append(vector::one, vector::one);
dynPlanes.emplace_append(vector(1,2,3), vector::one);
dynPlanes.emplace_back(vector::one, vector::one);
dynPlanes.emplace_back(vector(1,2,3), vector::one);
dynPlanes.append(nullptr);
dynPlanes.set(6, new plane(vector(2,2,1), vector::one));
dynPlanes.set(10, new plane(vector(4,5,6), vector::one));
dynPlanes.emplace(12, vector(3,2,1), vector::one);
dynPlanes.emplace_append(Zero, vector::one);
dynPlanes.emplace_back(Zero, vector::one);
}
Info<< nl << "PtrDynList: ";
@ -633,7 +633,7 @@ int main(int argc, char *argv[])
forAll(dynPlanes, i)
{
const plane* pln = dynPlanes.set(i);
const plane* pln = dynPlanes.get(i);
if (pln)
{
stdPlanes.set(i, new plane(*pln));

View File

@ -67,11 +67,11 @@ int main(int argc, char *argv[])
for (int i = 0; i<10; i++)
{
myList.append(1.3*i);
myList.push_back(1.3*i);
}
myList.append(100.3);
myList.append(500.3);
myList.push_back(100.3);
myList.push_back(500.3);
Info<< "SLList<scalar>" << myList << nl;
Info<< nl << "flat-output: " << flatOutput(myList) << nl;
@ -103,11 +103,11 @@ int main(int argc, char *argv[])
for (int i = 0; i<10; i++)
{
myList.append(1.3*i);
myList.push_back(1.3*i);
}
myList.append(100.3);
myList.append(500.3);
myList.push_back(100.3);
myList.push_back(500.3);
Info<< nl << "Transfer: " << nl;
Info<< "original: " << flatOutput(myList) << endl;
@ -143,7 +143,7 @@ int main(int argc, char *argv[])
for (int i = 0; i<5; i++)
{
labList.append(identity(6));
labList.push_back(identity(6));
}
Info<< nl
@ -164,16 +164,16 @@ int main(int argc, char *argv[])
List<label> content1 = identity(10);
Info<< nl
<< " move append ";
<< " move push_back ";
printAddress(content1);
labList.append(std::move(content1));
labList.push_back(std::move(content1));
Info<< " content " << flatOutput(content1) << nl
<< " list" << labList << nl;
printAddresses(labList);
// labList.append(content1);
// labList.push_back(content1);
}
Info<< nl << "Done." << endl;

View File

@ -138,8 +138,8 @@ int main()
maxFirstEqOp<label>()(maxIndexed, item);
}
Pstream::combineAllGather(minIndexed, minFirstEqOp<label>());
Pstream::combineAllGather(maxIndexed, maxFirstEqOp<label>());
Pstream::combineReduce(minIndexed, minFirstEqOp<label>());
Pstream::combineReduce(maxIndexed, maxFirstEqOp<label>());
Info<< "Min indexed: " << minIndexed << nl
<< "Max indexed: " << maxIndexed << nl;
@ -156,8 +156,8 @@ int main()
maxIndexed = maxFirstOp<label>()(maxIndexed, item);
}
Pstream::combineAllGather(minIndexed, minFirstEqOp<label>());
Pstream::combineAllGather(maxIndexed, maxFirstEqOp<label>());
Pstream::combineReduce(minIndexed, minFirstEqOp<label>());
Pstream::combineReduce(maxIndexed, maxFirstEqOp<label>());
Info<< "Min indexed: " << minIndexed << nl
<< "Max indexed: " << maxIndexed << nl;

View File

@ -39,7 +39,6 @@ Description
#include "Pair.H"
#include <sstream>
#include <initializer_list>
using namespace Foam;

View File

@ -33,7 +33,6 @@ Description
#include "IOstreams.H"
#include "stdFoam.H"
#include <algorithm>
#include <type_traits>
#include <limits>

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -165,24 +165,24 @@ int main(int argc, char *argv[])
// Use predicate, or test() method
if (list2(1))
if (list2.test(1))
{
Info<< "1 is on (original)" << nl;
}
if (!list2(2))
if (!list2.test(2))
{
Info<< "2 is off (original)" << nl;
}
if (!list2(100))
if (!list2.test(100))
{
Info<< "100 is off (original)" << nl;
}
if (wrapper(1))
if (wrapper.test(1))
{
Info<< "1 is on (wrapped)" << nl;
}
if (!wrapper(2))
if (!wrapper.test(2))
{
Info<< "2 is off (wrapped)" << nl;
}

View File

@ -72,13 +72,13 @@ public:
// Member Functions
//- Is empty
bool empty() const
bool empty() const noexcept
{
return bits_.empty() && bools_.empty();
}
//- Size
label size() const
label size() const noexcept
{
return bits_.size() + bools_.size();
}
@ -93,7 +93,7 @@ public:
bool operator()(const label i) const
{
// Can also use test(i) etc...
return bits_(i) || bools_(i);
return bits_.test(i) || bools_.test(i);
}
};

Some files were not shown because too many files have changed in this diff Show More