Commit Graph

25101 Commits

Author SHA1 Message Date
fd82f3e47a ENH: distinguish between compressible/incompressible coded source
- previously had codeAddSup used for both incompressible and
  compressible source terms. However, it was not actually possible to
  use it for compressible sources since any references to the 'rho'
  parameter would cause a compilation error for the incompressible case.

  Added 'codeAddSupRho' to distinguish the compressible case.
  User must supply one or both of them on input.
2021-11-09 21:48:42 +01:00
8638d82325 ENH: additional dictionary controls, methods
STYLE: declaration order of topoSet, resize_nocopy for sortedOrder

STYLE: remove cstring dependency from SHA1

STYLE: use Ostream endEntry()
2021-11-09 21:33:32 +01:00
79e110aeb0 ENH: update lemon version, wmake wrappers 2021-11-09 21:17:51 +01:00
a78e79908b ENH: additional decompose options
- decomposePar: -no-fields to suppress decomposition of fields

- makeFaMesh: -no-decompose to suppress creation of *ProcAddressing
  and fields, -no-fields to suppress decomposition of fields only
2021-11-09 15:44:54 +01:00
e8aa3aad25 ENH: simple detection for collapsed block descriptions
- switch from default topology merge to point merge if degenerate
  blocks are detected. This should alleviate the problems noted in
  #1862.

  NB: this detection only works for blocks with duplicate vertex
      indices, not ones with geometrically duplicate points.

ENH: add patch block/face summary in blockMesh generation

- add blockMesh -verbose option to override the static or dictionary
  settings.  The -verbose option can be used multiple times to increase
  the verbosity.

ENH: extend hexCell handling with more cellShape-type methods

- allows better reuse in blockMesh.
  Remove blockMesh-local hex edge definitions that shadowed the
  hexCell values.

ENH: simplify some of the block-edge internals
2021-11-09 15:44:54 +01:00
5a121119e6 ENH: add -verbose support into argList
- similar to -dry-run handling, can be interrogated from argList,
  which makes it simpler to add into utilities.

- support multiple uses of -dry-run and -verbose to increase the
  level. For example, could have

    someApplication -verbose -verbose

 and inside of the application:

    if (args.verbose() > 2) ...

BUG: error with empty distributed roots specification (fixes #2196)

- previously used the size of distributed roots to transmit if the
  case was running in distributed mode, but this behaves rather poorly
  with bad input. Specifically, the following questionable setup:

      distributed true;
      roots ( /*none*/ );

  Now transmit the ParRunControl distributed() value instead,
  and also emit a gentle warning for the user:

      WARNING: running distributed but did not specify roots!
2021-11-09 15:44:54 +01:00
c45c649d15 ENH: portable scoping char for solver info names (#2224, #1675)
COMP: implicit cast scope name to C++-string in IOobject::scopedName

- handles 'const char*' and allows a check for an empty scope name

COMP: avoid potential name conflict in local function (Istream)

- reportedly some resolution issues (unconfirmed) with Fujitsu clang
2021-11-09 15:44:54 +01:00
9371c517b9 COMP: adjust include guards 2021-11-09 12:18:07 +01:00
d4f3581265 BUG: createPhiv - updated flux call 2021-11-08 19:32:13 +00:00
c8ba81f92c Merge branch 'feature-one-equation-turbulence-model' into 'develop'
ENH: new RANS model for geophysical applications

See merge request Development/openfoam!493
2021-11-08 18:58:07 +00:00
f05dc09692 TUT: atmFlatTerrain: add an example for kL RANS model
BUG: atmFlatTerrain: fix input settings in the plot script
2021-11-08 18:56:59 +00:00
76dcc4f28f ENH: kL: new RANS model for geophysical applications
STYLE: atmosphericModels: regroup atmospheric turbulence models
ENH: kEpsilonLopesdaCosta: enable this RANS model for compressible applications
2021-11-08 18:56:59 +00:00
b90ba9d125 ENH: noiseModel updates. Fixes #2263
- updated safeLog10 - returns -GREAT instead of zero
- enabled reference for dB calc to be user defined

Cross reference exchange platform 1689
2021-11-08 18:48:46 +00:00
6102b76377 Merge branch 'feature-finiteArea-fixes' into 'develop'
parallel construct finiteArea with arbitrary connections

See merge request Development/openfoam!490
2021-11-05 18:08:12 +00:00
7fc943c178 ENH: improvements for makeFaMesh, checkFaMesh
- added -dry-run, -write-vtk options.
  Additional mesh information after creation.

- add parallel reductions and more information for checkFaMesh

ENH: minor cleanup of faPatch internals

- align pointLabels and pointEdges creation more closely with coding
  patterns used in PrimitivePatch

- use fileHandler when loading "S0" field.
2021-11-05 18:07:36 +00:00
a95427c28a ENH: improve handling of area calculations in faMesh (#2233)
- previous handling did not correctly account for off-processor
  connections (SEGFAULT).

- revised the point/area normal calculations to use the dual of the
  faces. This simplifies the logic and reduces the depth of loops.

  Point corrections from the neighbouring patches is handled
  centrally by the new halo face information, which properly handles
  on-processor or off-processor faces irrespective of any explicit
  processor patches.

STYLE: local function and add comments for finiteArea area weighting

- following the original Tukovic code, the area-weighted normal
  for a vector pair (defining a triangle) is weighted by
    (1) area : larger weight for larger areas
    (2) sin  : lower weight for narrow angles (eg, shards)
    (3) invDist squared : lower weights for distant points

  Refactored to eliminate intermediate operations, some additional
  divide-by-zero protection - similar to vector normalise()
2021-11-05 18:07:36 +00:00
ea92cb82c4 ENH: add boundary halo handling to faMesh
- the finiteArea is typically restricteed to one or more patches on a
  polyMesh but will have an external connectivity to other parts of
  the polyMesh. For proper determination of the point normals (for
  example), the neighbouring information is needed.

  These outside 'halo' faces can be located on different processors,
  but not correspond to an internal processor-processor interface.

  Add a dedicated form of mapDistribute for swapping this type of
  information. Since this is a collective operation, locate
  corresponding methods directly on the faMesh level instead of
  the faPatch level.
2021-11-05 18:07:36 +00:00
8e45108905 BUG: parallel construct finiteArea fails with arbitrary connections (#2152)
- the case of 'fan-like' processor was previously assumed to be
  rare (see merge-request !490 and issue #2084).

  However, Vaggelis Papoutsis noticed that even fairly normal geometries
  can trigger problems.

- replaced the old patch/patch matching style with a more general
  edge-based synchronisation and matching that appears to handle
  the corner cases inherently. The internal communication overhead
  is essentially unchanged, and the logic is simpler.

ENH: additional framework for managing patch connectivity
2021-11-05 18:07:36 +00:00
9c1f94d4fd BUG: parallel blocking with faFieldDecomposer, faMeshReconstructor (fixes #2237)
- the patch remapping in faFieldDecomposer calls weights
  internalField() which can trigger parallel communication on the
  complete mesh for some processors only (ie, blocks).

  Force a priori creation of weights instead.

- ensure that the complete mesh (reconstruction helper)
  is serial when adding patches.
2021-11-05 18:07:36 +00:00
a809265432 BUG: incorrect finite-area faceProcAddressing (fixes #2155)
- when creating a finite-area mesh in parallel, need to determine
  the equivalent ProcAddressing for the faMesh.

  In the faceProcAddressing the collected and sorted order was being
  scattered directly back to the individual processors instead of only
  the sections relevant to each particular processor.

  This caused the observed jumbled order for reconstructed fields.
2021-11-05 18:07:36 +00:00
38bf30167d Merge branch 'feature-runTimeCompat' into 'develop'
long-term maintenance improvement for runTime selection tables

See merge request Development/openfoam!481
2021-11-05 18:06:31 +00:00
ba8d6bddcc ENH: use singleton method for accessing runtime selection
STYLE: use alias to mark partialFaceAreaWeightAMI deprecation after v2012
2021-11-05 17:21:27 +01:00
4fc6ec1d1d ENH: define singleton-style lookups for runTime selection, alias handling
- this makes the lookup and use of tables slightly cleaner and
  provides a hook for update (compat) messages

  The singleton-style method returns the function pointer directly,
  or nullptr on not-found.

  NEW access method (mnemonic: 'ctor' prefix for constructors)

  ```
  auto* ctorPtr = dictionaryConstructorTable(modelType);

  if (!ctorPtr)
  {
      ...
  }

  return autoPtr<myModel>(ctorPtr(dict, ...));
  ```

  OLD method, which also still works, but without any compat handling:

  ```
  auto ctorIter = dictionaryConstructorTablePtr_->cfind(modelType);

  if (!ctorIter.found())
  {
      ...
  }

  return autoPtr<myModel>(ctorIter()(dict, ...));
  ```
2021-11-05 17:21:27 +01:00
794e23e083 ENH: add error::master() static for low-level messages
- a Pstream::master with a Pstream::parRun guard in case Pstream has
  not yet been initialised, as will be the case for low-level messages
  during startup.

- propagate relativeName handling into IOstreams
2021-11-05 14:53:55 +01:00
0bd113f537 ENH: refactored and simplified runtime declaration macros
- improves future maintenance, avoids code/macro duplication
2021-11-05 14:53:51 +01:00
7f8ecd98f5 ENH: rename runTime selection typedefs
- better distinction between content and storage type
  by appending 'Type' to the typedef.

    old: 'Class::abcConstructorTable* tablePtr'
    new: 'Class::abcConstructorTableType* tablePtr'

  Was rarely used in any exposed code.

BREAKING: LESdelta::New with additional table

- parameter change to dictionaryConstructorTableType
  (was dictionaryConstructorTable)
2021-11-05 14:14:20 +01:00
3416151dee ENH: improve isolation of basicThermo internals (as private)
- getThermoOrDie: returns constructor pointer, or FatalError.
  Better isolation and avoids additional template/typename previously
  needed with ambiguous method name (lookupThermo).

- makeThermoName: centralize dictionary -> stringified name

- splitThermoName: use stringOps functionality
2021-11-05 14:14:20 +01:00
9e56dd4098 Merge branch 'feature-proudman-mean-fields' into 'develop'
ENH: proudmanAcousticPower - extended to operate on mean turbulence fields

See merge request Development/openfoam!485
2021-11-05 13:08:52 +00:00
5cba269072 ENH: proudmanAcousticPower - extended to operate on mean turbulence fields
Example using mean turbulence fields (mean fields should be available e.g. from
a fieldAverage function object)

    proudmanAcousticPower1
    {
        // Mandatory entries (unmodifiable)
        type        proudmanAcousticPower;
        libs        (fieldFunctionObjects);

        ...

        // Turbulence field names (if not retrieved from the turb model)
        k           kMean;
        epsilon     epsilonMean;
        omega       none; // omegaMean
    }
2021-11-05 13:06:31 +00:00
83fd1c9579 SUBMODULE: update OpenQBMM (selector table modifications) 2021-11-04 21:44:04 +01:00
742a2c8a49 BUG: foamPackRelease detects wrong build information
- was taking from the current head instead from specified commit-ish

ENH: add -debian=NUM convenience option to foamPackRelease

STYLE: relocate compile begin/end messages

COMP: suppress more clang warnings (needed for boost)
2021-11-04 19:56:01 +01:00
50995706a6 STYLE: remove unused private fields (foamyMesh)
- simplify handling of warnings for surfaceBooleanFeatures
2021-11-04 18:03:34 +01:00
c9333a5ac8 ENH: improve flexibility of error, messageStream output
- provide a plain stream() method on messageStream to reduce reliance
  on casting operators and slightly opaque operator()() calls etc

- support alternative stream for messageStream serial output.
  This can be used to support local redirection of output.
  For example,

     refPtr<OFstream> logging;   // or autoPtr, unique_ptr etc

     // Later...
     Info.stream(logging.get())
        << "Detailed output ..." << endl;

  This will use the stdout semantics in the normal case, or allow
  redirection to an output file if a target output stream is defined,
  but still effectively use /dev/null on non-master processes.

  This is mostly the same as this ternary

      (logging ? *logging : Info())

  except that the ternary could be incorrect on sub-processes,
  requires more typing etc.

ENH: use case-relative names of dictionary, IOstream for FatalIOError

- normally yields more easily understandable information
2021-11-03 11:46:13 +01:00
1c354ce299 ENH: expose dictionary relativeName() method
STYLE: more consistent noexcept for dictionary and entry
2021-11-03 11:38:39 +01:00
b364a9e72c ENH: argList improvements
- argList::envExecutable() static method.
  This is identical to getEnv("FOAM_EXECUTABLE"), where the name of
  the executable has typically been set from the argList construction.

  Provides a singleton access to this value from locations that
  do not have knowledge of the originating command args (argList).
  This is a similar rationale as for the argList::envGlobalPath() static.

- additional argList::envRelativePath() static method.

- make -dry-run handling more central and easier to use by adding into
  argList itself.

STYLE: drop handling of -srcDoc (v1706 option)

- replaced with -doc-source for 1712 and never used much anyhow
2021-11-03 11:38:21 +01:00
a19f03a5cb STYLE: additional storage checks, noexcept, spelling
- prune unneeded demandDrivenData.H includes
2021-11-03 11:27:56 +01:00
851be8ea33 ENH: use consistent naming when toggling exception throwing on/off 2021-11-02 21:14:41 +01:00
fddf8a8832 ENH: add -help-full option for foamEtcFile 2021-11-02 21:14:41 +01:00
2698cab01c ENH: extend use of WM_COMPILER_CONTROL to manage compiler versions
- for compilers such as gcc and clang, may have several different
  variants installed on the computer. Use WM_COMPILER_CONTROL to
  specify the preferred variant.

  Eg,
      WM_COMPILER=Gcc
      WM_COMPILER_CONTROL="version=8"

      will compile with "gcc-8" and "g++-8"

  Good practice would be to tag output directory names with the
  version too. Eg

      WM_COMPILER=Clang110
      WM_COMPILER_CONTROL="version=11.0"

STYLE: modify message for change of gcc -> clang (darwin)
2021-11-02 17:30:06 +01:00
3494d662c7 COMP: eliminate some unused variables 2021-11-02 15:47:18 +01:00
a6f2aff449 BUG: spurious argument in sutherlandTransport addition (fixes #2256) 2021-11-02 15:47:18 +01:00
8746d7e443 Merge branch 'fix-2257-threaded-writing' into 'develop'
BUG: collated: threaded writing accesses out-of-scope. Fixes #2257.

See merge request Development/openfoam!494
2021-11-02 14:26:30 +00:00
227b3976ba BUG: collated: threaded writing accesses out-of-scope. Fixes #2257. 2021-11-02 14:26:30 +00:00
08e66a64e1 CONFIG: increment API level to 2108
- reflects updates for List, globalIndex handling etc
2021-10-29 19:41:27 +02:00
08588134fb ENH: report filter settings for distance surface (#1631) 2021-10-29 19:34:54 +02:00
0c89154729 ENH: add fallback behaviour for distanceSurface proximity regions (#1631)
- using the proximityRegions filter when there is no enclosing surface
  to segregate domains causes a surface of zero-faces to be created.

  In most cases, this means that a simpler proximityFaces filter would
  have been more appropriate. To increase overall robustness, revert
  to the simpler proximityFaces filter logic when the proximityRegions
  would otherwise result in zero faces (globally seen).
2021-10-29 17:49:50 +02:00
048166c3d8 ENH: reduces buffer use / blocking in Ensight output
- reuse single component buffer within an Ensight output method.
  Use direct UPstream read/write to avoid Pstream char buffers

- replace blocking transfer with scheduled for Ensight cloud output
2021-10-29 17:04:52 +02:00
33ff3201ea ENH: replace PstreamBuffers with scheduled read/writes for VTK output
- use the new updates to globalIndex to manage the bookkeeping
2021-10-29 17:04:52 +02:00
b6539cd02e ENH: additional MPI gather/scatter routines, globalIndex gather methods
- UPstream::mpiGather (MPI_Gather)   - used by Pstream::listGatherValues
- UPstream::mpiScatter (MPI_Scatter) - used by Pstream::listScatterValues

  These are much simpler forms for gather/scatter of fixed-sized
  contiguous types data types (eg, primitives, simple pairs etc).

  In the gather form, creates a list of gathered values on the master
  process. The subranks have a list size of zero.

  Similarly, scatter will distribute a list of values to single values
  on each process.

  Instead of

      labelList sendSizes(Pstream::nProcs());
      sendSizes[Pstream::myProcNo()] = sendData.size();
      Pstream::gatherList(sendSizes);

  Can write

      const labelList sendSizes
      (
          UPstream::listGatherValues<label>(sendData.size())
      );

  // Less code, lower overhead and list can be const.

  For scattering an individual value only,
  instead of

      labelList someValues;
      if (Pstream::master()) someValues = ...;

      Pstream::gatherList(sendSizes);
      const label localValue
      (
          someValues[Pstream::myProcNo()]
      );

  Can write

      labelList someValues;
      if (Pstream::master()) someValues = ...;

      Pstream::gatherList(sendSizes);
      const label localValue
      (
          UPstream::listScatterValues<label>(someValues)
      );

   Can of course also mix listGatherValues to assemble a list on master
   and use Pstream::scatterList to distribute.

ENH: adjusted globalIndex gather methods

- added mpiGather() method [contiguous data only] using MPI_Gatherv

- respect localSize if gathering master data to ensure that a
  request for 0 master elements is properly handled.
2021-10-29 17:04:52 +02:00
1f20747b1a ENH: cleanup Pstream internal names, cull unneeded parameters
- Pstreams can be ascii/binary but are always currentVersion

- rename UIPstream externalBuf_ to 'recvBuf_' for similar naming as
  PstreamBuffers and symmetry with UOPstream::sendBuf_

- specific enum size for commsType (for more compact structures in the
  future). Default construct lists items.

BUG: possible incidental indexing in UIPstream::read(char*, std::streamsize)

- raw reading had been split into beginRawRead(), readRaw().
  However, this could change the current input position (due to word
  boundary alignment), even if the expected count is zero. Make a
  no-op for count == 0. This mirrors UOPstream::write behaviour.
2021-10-29 17:04:51 +02:00