Commit Graph

16442 Commits

Author SHA1 Message Date
986199f897 ENH: align bitSet and FixedList methods names
- bitSet and PackedList fill() as per boost dynamic_bitset.
  Silently deprecate assign(val), which is potentially confusing
  with other forms of assign().

- FixedList fill() as per std::array.
  Add missing assignment from Foam::zero

- minor code simplication in bitSet and PackedList

STYLE: fix typo in comment, qualify Foam::zero
2020-11-30 13:59:07 +01:00
7830cc503e BUG: Fix sign in Lee model. Fixes #1934. 2020-11-27 19:46:08 -08:00
c879c24412 ENH: redistributePar: suppress warning. Fixes #1937. 2020-11-26 13:46:50 +00:00
024d22cb64 BUG: missing nullptr check in Function1/PatchFunction1 fallback logic 2020-11-26 01:53:15 +01:00
52c6642a4c Merge remote-tracking branch 'origin/master' into develop 2020-11-25 21:30:49 +01:00
1fa4221bc8 COMP: fix label ambiguity 2020-11-25 19:53:03 +01:00
501cd35351 ENH: consistent naming for ZoneMesh lookup method
- findZone(), cfindZone() to return pointer to existing or nullptr if
  not found. This fits with methods such as findObject() etc for other
  classes and can simplify code without checks for '-1' as not found.

- use simpler constructors for empty cell/face/point zones
2020-11-25 19:53:03 +01:00
be7a3f21be ENH: add BitOps::set(), unset() functions for boolList, labelHashSet 2020-11-25 19:53:03 +01:00
0de32a6e6f ENH: improve flexiblity for flat output of items (#1929)
- change to a templated implementation instead of relying on
  the container's writeList() method.

  This inlines the generation while also adding the flexibility to
  define different delimiters (at compile time) without the
  performance penalty of passing run-time parameters.
2020-11-25 19:53:03 +01:00
d2f1690536 ENH: align Enum methods with HashTable
- deprecate get(key, deflt) in favour of lookup(key, deflt).
  Method name compatibility with HashTable.

- deprecate operator().
  The meaning is too opaque and equally served by other means:

  - use get(key) instead of operator()(key).
    Const access whereas HashTable::operator()(key)
    creates missing entry.

  - lookup(key, deflt) - instead of operator()(key, deflt).
    Const access whereas HashTable::operator()(key, deflt)
    creates a missing entry.

- make Enum iterable to allow participation in range-for etc.
2020-11-25 19:53:02 +01:00
9122713b37 STYLE: mark deprecated findIndices methods with warnings
- were deprecated Aug-2018, but not marked as such
2020-11-25 19:53:02 +01:00
7349b97ecc STYLE: use labelRange for identity 2020-11-25 19:53:02 +01:00
89ea011585 ENH: snappyHexMesh: gapLevel. See #1463.
Adds distance-to-surface as a pre-selection
to detect cells-in-gaps. Before it could only
use inside or outside but not distance.
2020-11-25 16:10:02 +00:00
ac98e498fe BUG: meshToMesh - corrected mapping of internal field for tgt->src mapping. Fixes #1935 2020-11-24 12:01:15 +00:00
9c26b5ce9f BUG: subsetMesh: map instead of truncate. See #1558.
This also is to do with redistributePar:
this uses subsetMesh to generate parts to
send to different processors.
2) related to 1558: make sure not to choose 'mapped'
patches to move the processor patches into so
we can use the mapper cloning and correctly
size additional data (e.g. offsets). This should
be generalised to hold for any patch type
holding local data ...
2020-11-23 19:58:31 +00:00
f9033cbf92 BUG: wall distance: Fixes #1932.
Potential problem with multiple faces. Rewritten to
use DynamicList.
2020-11-23 13:08:17 +00:00
eaf6440a0a COMP: Allwmake: delay building finiteArea
For convenience - build finiteVolume first
2020-11-23 13:08:17 +00:00
8d2d894ae0 ENH: support frequency or period for Sine/Square Function1 (#1917)
- For slow oscillations it can be more intuitive to specify the
  period.

ENH: separate mark/space for Square

- makes it easier to tailor the desired intervals.

BUG: incorrect square wave fraction with negative phase shifts

ENH: additional cosine Function1

STYLE: avoid code duplication by inheriting Cosine/Square from Sine.
2020-11-19 16:57:45 +01:00
2f2dcdcf6f ENH: Function1 and PatchFunction1 improvements (#1917)
- easier support for non-mandatory functions.

  In some boundary conditions it can be desirable to support
  additional functions, but not necessarily require them. Make this
  easier to support with a Function1, PatchFunction1 NewIfPresent()
  selector.

- support for compatibility lookups

- harmonize branching logic and error handling between Function1 and
  PatchFunction1.

ENH: refactor a base class for Function1, PatchFunction1

- includes base characteristics, patch or scalar information

ENH: additional creation macros

- makeConcreteFunction1, makeConcretePatchFunction1Type for adding a
  non-templated function into the correct templated selection table.
  makeScalarPatchFunction1 for similarity with makeScalarFunction1
2020-11-19 16:57:45 +01:00
4b964f676e STYLE: fix doxygen comments 2020-11-19 16:57:45 +01:00
6e3bc1f7d0 STYLE: can add compile-time deprecated message for autoPtr::set()
- deprecated Feb-2018, but not marked as such.

  The set() method originally enforce an additional run-time check
  (Fatal if pointer was already set), but this was rarely used.
  In fact, the set() method was invariably used in constructors
  where the pointer by definition was unset.

  Can now mark as deprecated to catch the last of these.
  We prefer reset() for similarity with std::unique_ptr

  Eg,
  FOAM_EXTRA_CXXFLAGS="-DFoam_autoPtr_deprecate_setMethod"  wmake
2020-11-19 16:57:45 +01:00
07bbae0c55 STYLE: use brace constructors for Foam::zero and Foam::one
- makes it clearer that these are constructors and not function calls
2020-11-19 16:57:45 +01:00
98d05fa80a STYLE: prefix zero/one with Foam:: qualifier
ENH: support construction of zero-sized IndirectList

- useful when addressing is to be generated in-place after construction.
  Eg,

      indirectPrimitivePatch myPatches
      (
          IndirectList<face>(mesh.faces(), Zero),
          mesh.points()
      );
      labelList& patchFaces = myPatches.addressing();

      patchFaces.resize(...);
      // populate patchFaces

STYLE: add noexcept for zero/one fields and remove old dependency files

COMP: correct typedefs for geometricOneField, geometricZeroField
2020-11-19 16:55:29 +01:00
f126e29121 ENH: fanPressureFvPatchScalarField - adjust compatibility handling
COMP: add missing clone() for fanCurve member

STYLE: reduce padding in data members
2020-11-19 12:36:57 +01:00
da7165077c BUG: typo in solidProperties prevents re-reading of "Hf" (fixes #1927) 2020-11-18 19:38:55 +01:00
9fd514bbe6 ENH: support OFstream "/dev/null" equivalent directly
- uses ocountstream for the output, which swallows all output.
  Improves portability

ENH: improved efficiency in countstreambuf

- xsputn() instead of overflow
- more consistent seek* methods
2020-11-17 14:43:00 +01:00
345a42f2d8 ENH: improve overhead in planeToFaceZone
- use bitSet instead of boolList/HashSet. Simplify looping
2020-11-17 12:36:45 +01:00
24c9761429 COMP: silence warnings, fix transcription error for planeToFaceZone
ENH: add construct from components

STYLE: adjust action variable name for consistency
2020-11-17 12:36:45 +01:00
8969110f2a ENH: distinguish between face zone topoSetSource (#1060)
- add intermediate class topoSetFaceZoneSource
  and corresponding New() factories
2020-11-17 12:33:13 +01:00
54139592b9 ENH: add bitSet found() method - method name compatibility with HashSet 2020-11-17 10:50:42 +01:00
146a1d1b67 ENH: snappyHexMesh: par extrusion. Fixes #1923 2020-11-16 11:22:56 +00:00
fc541cee40 BUG: crash during gap refinement (fixes #1919)
- fixed indexing error (crashes under windows).
  No crash but still incorrect on other systems
2020-11-13 11:00:13 +01:00
2a64d98d02 ENH: PatchParticleHistogram: add a new cloud FO
Computes a histogram for the distribution of particle diameters
  and corresponding number of particles hitting on a given list of patches.

  A minimal example by using `constant/reactingCloud1Properties.cloudFunctions`:

  ```
  patchParticleHistogram1
  {
      // Mandatory entries (unmodifiable)
      type             patchParticleHistogram;
      patches          (<patch1> <patch2> ... <patchN>);
      nBins            10;
      min              0.1;
      max              10.0;
      maxStoredParcels 20;
  }
  ```
2020-11-13 09:22:46 +00:00
a1c25e6201 ENH: heatTransferCoeff: add optional Nusselt number functionality
DOC: heatTransferCoeff models: complete remaining header docs
  STYLE: heatTransferCoeff models: use auto specifier when appropriate

  Optionally, the Nusselt number (i.e. the ratio of convective to conductive
  heat transfer at a boundary in a fluid) can be output:

  ```math
      Nu = \frac{h L}{\kappa}
  ```

  where
  ```
    Nu | Nusselt number
    h  | Convective heat transfer coefficient of the flow
    L  | Characteristic length that defines the scale of the physical system
    \kappa | Thermal conductivity of the fluid
  ```
2020-11-13 09:18:44 +00:00
bbeda07862 BUG: polynomialEqns: fix discriminant limit
It was observed in a MPPICDyMFoam simulation involving a single particle
in a moving mesh that the barocentric trajectory of the particle follows
an unexpected path at some arbitrary instant in time.

The issue was tracked to "hitEqn()" where cubicEqn/quadraticEqn computes
one of the roots wrongly due to the discriminant limit we set, e.g. for:

    0x^3 + 1.4334549e-33 x^2 - 9.0869006e-10 x + 0.0027666538

Although the discriminant limit was carefully selected to avoid various
problems at the time, the new change is required more due to its exposition
to a wider spectrum of applications.
2020-11-13 09:18:44 +00:00
b42db6cee5 BUG: reconstructPar: prevent crashes when operating on processor cases (#1143)
From OpenFOAM Foundation e4d89daf5d

The main issue here was that reconstructPar is serial but coupled() in
cyclicAMIFvPatch.C could return true if both sides of the patch was present
(this->size() && neighbFvPatch().size()). However, this would result in an
evaluate call in cyclicAMIFvPatchField. This would only work if both sides
were completely contained on the same processor. The change in logic prevents
coupled() from returning true when called in serial for a decomposed case.

Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2020-11-13 09:18:44 +00:00
d392bf9841 DOC: actuationDiskSource: fix content (#1828)
ENH: actuationDiskSource: change two FatalError to FatalIOError
2020-11-13 09:18:43 +00:00
da65e02707 INT: planeToFaceZone: integrate a new topoSet from OpenFOAM.org 2020-11-13 09:18:43 +00:00
c91fc6f41c CONFIG: rationalize mpi config tuning (#1910)
- prefix FOAM_MPI and library directories with 'sys-' for system
  versions for uniform identication.

  WM_MPLIB      | libdir (FOAM_MPI)  | old naming |
  SYSTEMMPI     | sys-mpi            | mpi        |
  SYSTEMOPENMPI | sys-openmpi        | openmpi-system |

- prefix preferences with 'prefs.' to make them more easily
  identifiable, and update bin/tools/create-mpi-config accordingly

      Old name: config.{csh,sh}/openmpi
      New name: config.{csh,sh}/prefs.openmpi

- additional mpi preferences now available:
    * prefs.intelmpi
    * prefs.mpich
    ...

CONFIG: added hook for EASYBUILDMPI (eb-mpi), somewhat like USERMPI

- EasyBuild uses mpicc when compiling, so no explicit wmake rules are
  used

ENH: support different major versions for system openmpi

- for example, with

     WM_MPLIB=SYSTEMOPENMPI2

  defines FOAM_MPI=sys-openmpi2 and thus creates lib/sys-openmpi2

ENH: centralize handling of mpi as 'mpi-rules'

    Before:
        sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
        sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB)

        ifeq (,$(FOAM_MPI_LIBBIN))
            FOAM_MPI_LIBBIN := $(FOAM_LIBBIN)/$(FOAM_MPI)
        endif

    After:
        include $(GENERAL_RULES)/mpi-rules

- also allows variants such as SYSTEMOPENMPI2 to be handled separately
2020-11-11 18:36:01 +01:00
67b3c01e13 ENH: generalize argList help output 2020-11-11 16:59:01 +01:00
ef2ea9629c STYLE: line breaks and spelling 2020-11-11 10:02:17 +01:00
30ea7d6134 BUG: Make volUpdateType default to constRho particle. Fixes #1916 2020-11-10 09:17:21 -08:00
83fb48678d COMP: adjust build order
- blockMesh <- extrudeModel <- dynamicMesh

COMP: bad constructor in searchableSphere

- used brace initializer instead of bracket initializer, which
  triggered component-wise construction instead of copy/move
  construction (gcc 4.8)

STYLE: use uint8_t instead of relying on definition of 'direction'
2020-11-04 15:15:36 +01:00
aea876885f ENH: support surfaceFieldValue faceZone on internal volume (#1884)
- uses averaged value instead of emitting a fatal error
2020-10-29 11:32:50 +01:00
3b7100a9a1 BUG: PDRsetFields fails with non-orthogonal outer region (fixes #1907)
- first sort the cells into their ijk bins, and restrict testing for
  face orientation to those faces with an owner or neighbour that has
  an ijk bin.

ENH: ensure polyMesh from PDRblockMesh is marked as AUTO_WRITE

- the particular polyMesh constructor inherits the writeOpt, which
  makes is dependent on the caller and thus somewhat fragile for the
  top level caller.
2020-10-28 20:56:32 +01:00
e9d130f022 ENH: support general searchable spheroid (issue #1901)
- a sphere/spheroid can be specified as a single radius or three radii.
  If all three values happen to be identical, they are collapsed to a
  single value. Examples,

      radius 2;
      radius (2 2 2);
      radius (2 3 4);
      radius (2 2 4);

  The search for nearest point on an ellipse or ellipsoid follows the
  description given by Geometric Tools (David Eberly), which also
  include some pseudo code. The content is CC-BY 4.0

  In the search algorithm, symmetry is exploited and the searching is
  confined to the first (+x,+y,+z) octant, and the radii are ordered
  from largest to smallest.

  Searching is optimized for sphere, prolate and oblate spheroids.
2020-10-28 16:04:12 +01:00
4258f8059f ENH: adjustments to searchable surfaces
- code reduction, documentation, code stubs for spheroid (#1901)

- make searchableSurfaceCollection available as 'collection'
  for consistency with other objects
2020-10-28 16:04:12 +01:00
f999013f41 ENH: use static to define default blockMesh verbosity
- make handling of verbosity more consistent.

  Make all setter return the old value, remove (unused) default
  parameter as being counter-intuitive.  This makes it easier to
  restore the original values.

  For example,

     const bool oldVerbose = sampler.verbose(false);
     ...
     sampler.verbose(oldVerbose);
2020-10-28 16:04:12 +01:00
f959c8eb36 ENH: generate local orientation vectors for blockMesh VTK output (#1903)
- can help when designing/debugging blockMesh layouts

- propagate low-level cellModel methods face() and edge() to cellShape

STYLE: relocate blockMesh OBJ output to application only

- remove blockTopology files in cleanCase function

- improve code consistency in top-level blockMesh, PDRblockMesh
  generation.
2020-10-28 16:04:12 +01:00
242d9e40a2 ENH: consistency update for GeometricField::Boundary constructor
- make patchFieldType default to calculated,
  as per GeometricField constructor
2020-10-28 16:04:12 +01:00