Compare commits

..

495 Commits

Author SHA1 Message Date
772afd2e0d ENH: Friedrich: refactor model to use cornerDetectionModel framework
- replace inline corner detection logic with cornerDetectionModel integration
2025-10-20 15:10:35 +01:00
d41b5f65fa ENH: cornerDetectionModel: add corner detection framework for liquid film separation
- add cornerDetectionModel base class with runtime selection table
- geometryBased model for sharp/round corner detection
  * support for convex/concave curvature classification
  * configurable angle thresholds for sharp vs round corners
  * radius-based filtering for round corner identification
  * optional boundary edge treatment and smoothing passes
- implement fluxBased model for flux-driven corner identification
  * dynamic corner detection based on flow characteristics
  * integration with existing film separation mechanisms
- include debug output capabilities (OBJ file generation)
2025-10-20 15:10:35 +01:00
78cf2ce5db ENH: dynamicContactAngle: enable zonal input using persistent field storage
Temporary field creation is replaced with persistent field storage,
so that contact-angle can be input per zone using setFields utility.
2025-10-20 14:22:33 +01:00
f2793f2ac8 ENH: atmBoundaryLayer: extend range of applicability of displacement height, d (#3451) 2025-10-17 16:44:27 +01:00
013dbb8248 BUG: Pstream: incorrect indexing. Fixes #3452 2025-10-16 11:52:12 +01:00
e9fcd75ec4 ENH: add default "constant" name for fileOperations::findTimes()
- makes fileHandler calling resemble Time more closely

ENH: provide natural_sort less/greater functions

- more succinct than (compare < 0) or (compare > 0).
  The corresponding wrappers for UList renamed as list_less, etc
  but they were only used in unit tests

ENH: handle (-allRegions | -all-regions, ..) directly when retrieving args

- makes handling independent of aliasing order

STYLE: include <string_view> when including <string>

- the standard does not guarantee which headers (if any) actually
  include string_view
2025-10-12 15:53:26 +02:00
ac34d9fd29 ENH: allow delayed construction of regionFaModel in volume bcs (#3419)
Ideally wish to delay construction of the finite-area mesh until
  updateCoeffs(), when it is actually needed.

  This helps avoid difficult to trace errors and avoids inadvertent
  parallel communication during construction from a dictionary.

  However, lazy evaluation fails at the later stage while attempting
  to load the corresponding initial fields, since the timeIndex has
  already advanced.

  Use the newly introduced regionModels::allowFaModels() switch
  to locally enable or disable lazy evaluation as needed.

  This allows selective disabling (eg, in post-processing utilities)
  where loading the volume field should not activate the associated
  regionFaModel and loading a finite-area mesh too (which may not
  exist or be defined at that point).
2025-10-11 19:51:51 +02:00
14bece937b ENH: added clean up function remove0DirFields (RunFunctions)
- less typing than before and avoids relying on bash-specific behaviour
  (fixes #3448)

ENH: add -region support for cleanFaMesh and cleanPolyMesh

CONFIG: add bash completion help for -area-region

ENH: general improvements for regionProperties

- robustness and failsafe for foamListRegions, regionProperties
- additional global model switches for regionModels
2025-10-10 18:18:31 +02:00
2396828a60 ENH: increase some string_view coverage
- remove some stdFoam::span<char> handling, which was just a stop-gap
  measure
2025-10-10 09:05:23 +02:00
9223d238bd STYLE: surface/volume writing function objects
- further hide implementation (cxx ending)

STYLE: better distinction between code/templates for fileFormats/conversion

- for ensight and vtk, a large part of the code is header only.
  Make this easier to identify
2025-10-10 08:54:03 +02:00
4b92bb6533 ENH: update globalIndex::mpiGather to use MPI intrinsic/user types
- add provisional support for selecting MPI_Gatherv
  when merging fields in the surface writers.
  Uses the 'gatherv' keyword [experimental]

BUG: gatherv/scatterv wrappers used the incorrect data type

- incorrectly checked against UPstream_basic_dataType trait instead of
  UPstream_dataType, which resulted in a count mismatch for
  user-defined types (eg, vector, tensor,...).

  This was not visibly active bug, since previous internal uses of
  gatherv were restricted to primitive types.

COMP: make UPstream dataType traits size(...) constexpr

- allows static asserts and/or compile-time selection
  of code based on size(1)
2025-10-10 08:51:20 +02:00
55c81bce1b ENH: GAMGAgglomeration: increase repeatability. Fixes #3450 2025-10-09 11:55:06 +01:00
1cb0b7b6c9 Merge branch 'extend-field-distributors' into 'develop'
cleanup of decompose/reconstruct/redistribute, adding area-name support

See merge request Development/openfoam!761
2025-10-09 10:29:56 +00:00
7f939f6d2d ENH: increase coverage of bitSet support for field distributors 2025-10-08 21:26:37 +02:00
cbb66f7bc7 ENH: add area-name handling for faMesh decompose/reconstruct (#3419)
- using labelUList addressing

- support direct handling of pointers (as well as autoPtr)
2025-10-08 21:26:30 +02:00
5d7bd9c497 ENH: decompose/reconstruct using labelUList, UPtrList addressing
ENH: reduce some overhead for processorMeshes reconstructPoints
2025-10-08 21:26:22 +02:00
601239f59a Merge branch 'multi-finite-area.base-changes' into 'develop'
base changes to finite-area and faOptions to recognize different area regions.

See merge request Development/openfoam!760
2025-10-08 12:21:17 +01:00
b25147a4f8 ENH: finite-area region support to all faOptions and regionFaModels
- for a non-default mesh region, corresponding files:

     system/finite-area/faOptions.<name>
     system/finite-area/<name>/faSchemes, etc

  if the entries within the faOptions dictionary happen to contain an
  "area" entry and it conflicts with what is expected, it will be
  rejected when creating the list of options, which helps avoid
  unexpected behaviour and simplifies overall handling.
2025-10-08 13:17:40 +02:00
19628b9576 ENH: update faOptions handling to respect finite-area locations
- new locations
    * constant/finite-area/faOptions
    * system/finite-area/faOptions

- legacy locations are still supported
    * constant/faOptions
    * system/faOptions

TUT: update faOptions locations
2025-10-08 13:17:40 +02:00
b913463d95 ENH: correct handling of area-name for faMesh (#3419)
- unlike fvMesh and polyMesh, the faMesh mesh region name is passed
  separately into constructors and functions. Thus need the same for
  faMeshTools and faMeshSubset.

- ensure that an empty area name is treated like
  polyMesh::defaultRegion.
  The faMeshRegistry or other registries cannot have an empty name!
2025-10-08 13:17:40 +02:00
3ae725592d ENH: add area-regions option handling (based partly on regionProperties)
- extend the getAllRegionOptions and getAllFaRegionOptions handling
  to use the supplied string literals as fallback values.

  If regionProperties is missing (or empty) and the -regions/-area-regions
  option is supplied with literal names, these will be used directly
  instead of being used to filter the regionProperties.

STYLE: support both -all-regions and -allRegions
2025-10-08 13:17:39 +02:00
d6081a18f6 ENH: simpler mechanical or thermal use of solidProperties
- in some shell models, only the mechanical properties (rho,E,nu) are
  meaningful or just the basic thermal properties
  (rho,Cp,kappa,emissivity).

  Add a distinction when reading the dictionary entries
  if those properties are mandatory and the thermo properties
  (eg, molWt, Cp, etc) are optional or not.

  This simplifies user input for thermal and vibration shell models.
2025-10-08 13:17:39 +02:00
e46cc77a5b CONFIG: bump patch level to 2507
- changes in stream handling
- imminent API changes for finite-area
2025-10-08 13:11:07 +02:00
5321c92e3d SUBMODULE: update OpenQBMM (some compilation changes) 2025-10-08 13:05:57 +02:00
97cbe9c54e Merge branch 'update-UPstreamRequests-handling' into 'develop'
refine request handling to support MPI idioms

See merge request Development/openfoam!759
2025-10-08 10:49:29 +00:00
06b3e9bd0b ENH: update/refine UPstream request handling
- activeRequest() checks if given request is still active/pending

- finishedRequest() will now always call MPI_Test when running in
  parallel instead of using a fast-path for skipping a null request.
  This allows MPI a chance to progress operations even if that
  particular request is not active.

- sameProcs() is a convenience wrapper for the following:
  * check if indices resolve to the same underlying procs
  * check the communicator procs against a list of procs
  * to compare two lists of procs.

  For example, check if the communicator corresponds to a
  host-local communication:

     if (UPstream::sameProcs(UPstream::commLocalNode(), myComm)) ...

STYLE: UPstream::Request gets an 'active()' method

- more MPI idiomatic than 'good'
2025-10-07 21:04:23 +02:00
a6c924cf8f COMP: minor adjustments for MacOS
- to avoid the many overload warnings on that platform,
  may wish to use

      FOAM_EXTRA_CXXFLAGS="-Wno-overloaded-virtual"

GIT: remove some old compilation stub files
2025-10-07 19:43:07 +02:00
e5848196ef Merge branch 'mixed-precision-streams' into 'develop'
INT: token/stream support for reading/writing int32 and int64

See merge request Development/openfoam!756
2025-10-07 14:51:20 +00:00
aa96119de2 INT: token/stream support for reading/writing int32 and int64
integration-by: Mark Olesen <Mark.Olesen@keysight.com>
2025-10-07 14:50:37 +00:00
11166821f1 REGRESSION: corrected use of inotify 2025-10-06 16:16:26 +01:00
77b2687503 COMP: better constexpr isolation of List<char> specializations
- adjust the if/else-if/else-if cascade to have 'if constexpr (..)'
  first and the *entire* alternate branch within the following 'else'.
  This lets the compiler know that it can safely discarded the other
  parts.

  This change introduces a large amount of indentation change,
  so use `--ignore-space-change` when inspecting.

COMP: reintroduce UList<T>() initialization in List [silence gcc]

COMP: use std::min() instead of direct check [silence gcc]

- gcc complains about possible strict-overflow for this:
  ```
  if (count > len)
  {
      count = len;        // The count truncated by the new length
  }
  ```

  Using `count = std::min(count, len);` avoids these (spurious)
  warnings without adding a "diagnostic ignored" pragma

STYLE: pass std::pair<int,int> by copy [cheaper]

STYLE: make isdigit() and isspace() tests constexpr

- constexpr and C-locale only vs. the std counterparts
2025-10-06 15:54:00 +02:00
52c55543b5 COMP: no-rpath handling not found (darwin) 2025-10-06 15:01:59 +02:00
41231028da Merge branch 'feature-slicing.prerelease' into 'develop'
Adding scratch space for patchField data

See merge request Development/openfoam!757
2025-10-06 12:43:13 +00:00
35615174a3 Adding scratch space for patchField data 2025-10-06 12:43:13 +00:00
b9fecc3898 Merge branch 'time-paths' into 'develop'
Add handling of local/global layout for Time paths

See merge request Development/openfoam!758
2025-10-06 10:26:15 +00:00
c78b510928 ENH: improve search and addressing options for TimePaths
- extend time searching mechanisms to support searching in the case
  global path: times(), findClosestTime(), findInstancePath()

- extend IOobject path() and objectPath() methods with
  IOobjectOption::Layout variants

The changes are needed for addressing a global file structure
in parallel (#3431)
2025-10-05 21:52:51 +02:00
a91587e36a ENH: improve 'fuzzy' matching of time instant
- add '<=' and '>=' operators that include rounding.

  This means that typical code like the following would not have
  considered any rounding:

    instantList times = ...;
    scalar val = ..;

    // No rounding!
    if (times[i].value() <= val) { ... }

    // NEW: with rounding
    if (times[i] <= val) { ... }

    // old equivalent:
    if (times[i].value() <= val || times[i].equal(val)) { ... }

ENH: provide a default stopInstance for fileOperation::findInstance

- makes it more consistent with Time::findInstance and more convenient
  to use

STYLE: minor code style changes to TimePaths etc
2025-10-05 21:52:37 +02:00
9c4d0cdeef BUG: kinematicParcelFoam: correct source-term value (fixes #3446)
- likely results in output changes for denser carrier fluids

Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2025-10-03 15:47:26 +01:00
7a266b566f DOC: functionObjects: overhaul of header documentation 2025-10-02 21:32:26 +01:00
278ad6fb44 Merge branch 'modifiable-memory-streams' into 'develop'
Improve handling and sizing behaviour of memory streams

See merge request Development/openfoam!755
2025-10-01 15:43:01 +01:00
b0d29ba8d6 ENH: add UPstream interface for MPI/IO
- supports writing, but without overlapping (begin/end) semantics.
2025-09-30 10:16:23 +02:00
a42fa7949b ENH: provide Istream::rewind() implementation
- base implementation drops any putback token
2025-09-30 09:32:50 +02:00
c6fc90b629 ENH: add in-place modification for OCharStream
- enables partial overwriting of content
- make default construct zero-sized, add reserve_exact() method

- improve sizing behaviour of OCharStream.
  Since char buffers will approach the INT_MAX size more quickly than
  other content, adapt the following strategy:

    | Capacity range     | Strategy                     |
    |--------------------|------------------------------|
    | 0    < N <= 0.25)  | fast growth (2)              |
    | 0.25 < N <= 0.5)   | slower growth (1.5)          |
    | 0.5  < N <= 0.75)  | very slow growth (1.25)      |
    | 0.75 < N           | already large - use max      |
2025-09-30 09:21:29 +02:00
1d1e0c5f13 ENH: make List::resize_copy() a public method
- improves usability of List as a general dynamic container as member
  data without inheritance. Provide the same method for DynamicList
  to enable more efficient use.

- additional string_view support for charList: useful when being used
  as a character buffer

STYLE: improve allocation handling in List

- consolidate routines. Only assign size after allocation to ensure
  that states are always consistent.
2025-09-29 13:18:29 +02:00
462d04dcd4 ENH: minor cleanup of memory streams and IOstreamOption
- make memory streams header-only (simpler)
- add sub-views and direct seek for span streams

New IOobject convenience methods

- IOobject::instanceValue() : return the IOobject instance as a scalar
  value (or 0). Effectively the same as instant(io.instance()).value()
  but with far less typing.

- IOobject::fileModificationChecking_masterOnly() : combines checks for
  time-stamp and inotify variants

STYLE: minor adjustments for Enum
2025-09-29 13:00:46 +02:00
d39b8a5c94 ENH: binField: remove an unused field
- skip the reduce operation for serial mode
- fix typos
2025-09-24 19:34:17 +01:00
b30d42c391 ENH: age: improve field access pattern
- cache the repeated evaluations
2025-09-24 11:55:42 +01:00
f3998b8833 TUT: scalarTransport: reorganise pitzDaily tutorial
- add application missing step to pimpleFoam/RAS/propeller1
2025-09-24 11:55:42 +01:00
1fa20428a8 STYLE: code cleanup for surfaceCourantNumber (#3422)
- simplify some handling. Use reference (not copy) for internalField
2025-09-23 17:02:01 +02:00
ac1c41a51b ENH: align zones writing pattern with polyBoundaryMesh, patchField etc.
STYLE: output the zone meta data (names) as an undecorated wordList

ENH: extra safety check in reorderZones to avoid any possible leaking
2025-09-23 12:57:02 +02:00
c378893bcb ENH: simplify direct creation of dictionary primitive entries
- can now create an empty entry and add/overwrite with tokens afterwards,
  or copy/move construct from a list of tokens.

ENH: provided named token setter methods (disambiguates bool/char/label)

COMP: use 'if constexpr' for FlatOutput

DOC: more description for Field
2025-09-23 12:53:30 +02:00
d4019e497d ENH: add/subtract/multiply: validate minimum field count requirement 2025-09-20 18:51:53 +01:00
8be698528a ENH: comfort: improve object performance and readability
- Cache wall patch metadata to avoid repeated computation
- Pre-calculate static dimensioned scalars
- Fix minor typos and enhance code readability
- Improve convergence checking with explicit loop vs max reduction
2025-09-19 20:14:21 +01:00
2d522e921f BUG: FriedrichModel: correct relative-speed calculation (fixes #3436) 2025-09-19 10:55:05 +01:00
f7fd9f8186 ENH: FA film models - added zonal Cf specification for Darcy model
Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2025-09-12 14:36:25 +01:00
1e715d3847 STYLE: coneNozzleInjection: use Umag instead of UMag for consistency (fixes #1168) 2025-09-11 09:35:02 +01:00
f4b50daa3c TUT: excess files 2025-09-10 16:38:20 +01:00
6d2a6a5ef9 GIT: MacOS: filter extraneous files 2025-09-10 09:44:05 +01:00
d6e75fb289 TUT: column: use MPPICDyMFoam instead of MPPICFoam 2025-09-08 17:23:21 +01:00
63ef1f20e8 COMP: git: support for Darwin builds 2025-09-08 15:25:41 +01:00
b9d8f99bc2 ENH: tutorials: demoing mesh alignment before shm. Fixes #3409 2025-09-08 13:33:39 +01:00
ec2b71f324 BUG: Lee: fix the sign for the solid-to-liquid mass transfer model (fixes #3429) 2025-09-08 13:21:32 +01:00
52f2c42e54 BUG: InjectionModelList: avoid an FPE instance while using spray cloud (fixes #3413) 2025-09-08 11:19:51 +01:00
aee63e7418 TUT: airfoil2D: improve convergence (fixes #3159) 2025-09-06 21:48:20 +01:00
a26f7c243a BUG: ensure check file not written if 'none' option is set 2025-09-04 09:23:33 +01:00
88ff32b713 ENH: MSwindows implementation for memInfo (#3396)
- based on code provided by Daniel Jasinski
2025-09-01 09:34:48 +02:00
4c13fd8658 ENH: provide extended fileOperation::detectProcessorPath()
- returns collated grouping as an output parameter
2025-09-01 09:34:48 +02:00
bd57627955 ENH: extend bitSet functionality
- num_blocks(), test_set() as per boost
- broadcast(), reduceAnd(), reduceOr() to simplify parallel operations
- matrix-like output for PackedList::writeList()

BUG: Pstream::broadcastList() missing resize on sub-ranks

- latent bug since it was unused in any OpenFOAM code
2025-09-01 09:34:48 +02:00
19caabbd56 CONFIG: add stub for config.sh/readline (#3427)
- add homebrew support for readline in foamConfigurePaths
2025-08-28 17:01:25 +02:00
d8250512f6 Merge branch 'feature-inplace-patchFields' into 'develop'
Extend patchFields to support non-allocating members

See merge request Development/openfoam!753
2025-08-28 14:34:41 +00:00
7fa861f09b ENH: extend faPatchField, fvPatchField to support non-allocating snGrad()
Co-authored-by: <Mark.Olesen@keysight.com>
2025-08-28 14:18:25 +00:00
202b448b8f ENH: enforce snGradTransformDiag() as zero for rotational-invariant
- the snGradTransformDiag() is used in this type of code:

  ```
  if constexpr (!is_rotational_vectorspace_v<Type>)
  {
      // Rotational-invariant type
      return tmp<Field<Type>>::New(this->size(), pTraits<Type>::one);
  }
  else
  {
      return pTraits<Type>::one - snGradTransformDiag();
  }
  ```

  This implies that a rotational-invariant form should return 0
  and not 1 like the pow(..., 0) does.
  This is a backstop for any code that may inadvertently hit it,
  but also allows the possibility of having integer indicator fields
  without upsetting the compiler.

STYLE: doTransform() logic now uses is_rotational_vectorspace
2025-08-28 14:18:25 +00:00
4cc8423c94 ENH: support zeroValue boundary condition
- a special case of fixedValue with a value of zero:
    * non-assignable
    * no mapping needed
    * value internal coeffs are zero
    * value boundary coeffs are zero
2025-08-28 14:18:25 +00:00
f96c5fafb0 Merge branch 'improve-IOobject_PtrList_CompactIOList_List' into 'develop'
general list cleanups

See merge request Development/openfoam!754
2025-08-28 08:44:32 +00:00
376674d568 STYLE: remove redundant template parameter for CompactIOField, CompactIOList
- the packed content type can be determined directly from
  List<T>::value_type without need for an additional template parameter.
2025-08-27 12:12:19 +02:00
b2135600a8 ENH: add readContents to CompactIOList, CompactIOField
- align some of the internal handling with each other and with
  CompactListList

ENH: add readContentsSize to IOList, IOField etc.

- sometimes just need to know how many elements are stored on disk
  without actually caring about the content. In those cases, can
  frequently just get that information from the first label token
  without needing to read anything else.
2025-08-27 12:12:19 +02:00
697b8a1436 ENH: improved handling of PtrList copies/cloning
- the logic has been revised to allow list copying with nullptr entries.
  These previously would have thrown an error.

- remove PtrList trimTrailingNull() method.
  It was unused and would result in inconsistent addressing sizes.

FIX: inconsistent sizing used for DynamicList/PtrDynList clearStorage()

- older code did not reset addressable size prior to clearStorage()
  or transfer(). Only a latent bug until memory pools are used.
2025-08-27 12:12:19 +02:00
a85b0f0736 STYLE: replace UList<char> specializations with 'if constexpr' handling 2025-08-27 11:59:36 +02:00
3ad17ddf5e ENH: extend UList<bool> specializations to include any(), all(), none()
- simplifies code with boolList vs. bitSet
2025-08-27 11:59:36 +02:00
2446f3f0c7 ENH: handle 'void' type in IOobject::typeHeaderOk
- can be used in most places where checkType=false is used

ENH: add non-const get() method to HashPtrTable

- allows checking and modification (symmetric with PtrList methods)

STYLE: improve annotations in fileOperations headers
2025-08-27 11:59:36 +02:00
f3c97d41bd ENH: support wmake -all=FILE option
- allows specialized versions of ./Allwmake in the local directory
2025-08-21 20:36:20 +02:00
8aa69ad976 BUG: shm: filter out duplicates. Fixes #3333
Problem was duplicates in list of patches to
add buffer layers to
2025-08-21 17:42:35 +01:00
9c13057b80 ENH: createPatch: do not remove added patches. Fixes #2726 2025-08-20 15:13:48 +01:00
8357b7e28b CONFIG: handle mpirunDebug stdin redirection before execution (#3389)
- previously handled stdin redirection as part of the run command but
  (as Alexey Matveichev noted) this meant the command would actually
  require an `eval` for this to work. Instead redirect before executing
  the run command.

- can always use 'echo -e' (bash builtin) in mpirunDebug

CONFIG: add removal of mpirun.files/ to CleanFunctions

- leave mpirun.log/ files untouched, since they may still be useful
  for later diagnosis
2025-08-19 15:34:27 +02:00
828693bc90 ENH: explicitly handle empty name lookup (objectRegistry, IOobjectList)
- provides some additional safety and precludes any recursive searching

ENH: support local directory handling in regionProperties

- allows alternative locations. Eg, for finite-area (#3419)
2025-08-19 14:42:01 +02:00
1f5eb55eeb Merge branch 'remove-mixed-precision-particle-streaming_issue3412' into 'develop'
DEFEATURE: remove mixed precision support for streaming particles (#3412)

See merge request Development/openfoam!752
2025-08-19 10:56:45 +00:00
3a78203863 DEFEATURE: remove mixed precision support for streaming particles (#3412)
- since direct streaming of particles is only ever used internally and
  never for disk I/O (which is collated by property), mixed precision
  will never occur when constructing a particle from a stream.

  Due to padding issues, the previous code would have been faulty anyhow.
  Thus remove that code and replace with a simple sanity check.
2025-08-19 10:56:23 +00:00
14b68a7f05 ENH: createPatch: late adding patchfields. Fixes #3410
Thanks to Alexey Matveichev
2025-08-18 13:38:43 +01:00
45f34f558b BUG: snappyHexMesh: parallel consistency. Fixes #2320
non-adapt patches using zero values were only seen if on
same processor
2025-08-17 08:58:41 +01:00
f000a8e43d BUG: missed removal of pointMesh/boundaryProcAddressing (fixes #3412) 2025-08-14 10:56:18 +02:00
24b79d3469 ENH: surfaceHookUp: add maximum-iteration option (fixes #3401) 2025-08-13 16:43:53 +01:00
821cdf6681 ENH: energyTransport: transfer write control from controlDict to function object (#3303) 2025-08-13 16:30:51 +01:00
eaf17337aa ENH: support prefix and log-dir for RunFunctions (#3386)
- these new options permit alternative naming conventions.
  For example,

      runApplication -prefix 0001_ -suffix log blockMesh

      -> 0001_blockMesh.log
2025-08-13 12:39:42 +02:00
1642841868 ENH: allow modifiable access to IOobject local(), as per instance()
ENH: simplify code by using fieldTypes::is_xxx() tests
2025-08-13 11:57:15 +02:00
891ac808de FIX: robuster blockMesh, face::centre with SP mode (#3411)
- appears to hit single precision overflow with clang-15 in
  face::center(), cellModel::center() and blockMesh createPoints().

  The blockMesh might be particularly sensitive, since the points are
  frequently defined in millimeters (scaled later), which results
  in large intermediate summations.

  Similar to primitiveMesh checks, use double precision for these
  calculations.

ENH: support vector += and -= from compatible types

- eg, doubleVector += floatVector is now supported.
  This streamlines some coding for mixed precision.

- To avoid lots of boilerplate, do not yet attempt to support general
  operations such as `operator+(doubleVector, floatVector)`
  until they become necessary.
2025-08-12 09:24:47 +02:00
fe7006acd7 ENH: support mixed-precision reading for pointConstraintList (#3405)
- since pointConstraint is a tuple of (label, vector) not simply use
  readRawLabel, readRawScalar since the tuple will also include
  trailing padding and/or padding between its members

FIX: remove flawed handling of non-native precision for directionInfo

- packing of (label, vector) makes handling of non-native content
  non-trivial (#3412). Content is only streamed, not written to disk,
  so replace with a fatalCheck.
2025-08-12 09:24:47 +02:00
0483e4826a ENH: cleaner coding for low-level readRawLabel, readRawScalar (#1378)
- local templates and 'if constexpr' to simplify logic and reduce
  reliance on pre-processor defines.

FIX: readScalarOrDefault used scalarToken() not number() token

- will rarely (or never) be triggered, but was inconsistent
2025-08-12 09:24:46 +02:00
6a72b0e607 DEFEATURE: remove OStringStream::count() method (issue #3281)
- as seen in #3201, using count() based on the ostringstream tellp
  is not reliable since it is not updated with reset or copying.

STYLE: minor changes to string/char/span streams

- update docs to only mention string_view
- use auto return, without extra trailing 'decltype'

ENH: add IOstream size check helper methods

  * checkNativeSizes() : test only
  * fatalCheckNativeSizes() : an assert with FatalIOError
2025-08-12 09:24:46 +02:00
fcc8e62e47 ENH: add cfindPatch() method to boundary meshes
- find patch by name and return pointer to it. Similar to cfindZone()

ENH: robuster PatchFunction1 handling for uniformFixedValuePointPatchField

COMP: use 'if constexpr' with is_contiguous check

STYLE: consistent patch slicing parameters

- slice UList values, not List values
2025-08-12 09:24:46 +02:00
631b6e5111 ENH: add convenience fieldTypes tests for volume/area etc fields 2025-08-12 09:24:46 +02:00
83107a192c COMP: add forward declaration for UPstream::File
BUG: typo in UPstream::Window::put() code
2025-08-12 09:24:46 +02:00
233da9adaa TUT: bubbleColumnIATE: correct Crc-coefficient value (fixes #3362) 2025-08-11 21:32:49 +01:00
954a54ea73 BUG: heatTransferCoeff: correct the radiation-contribution sign (fixes #3325) 2025-08-08 15:35:00 +01:00
9cbf544ecd ENH: AMIInterpolation: make matching more robust 2025-08-06 11:11:37 +01:00
1bcad518c6 ENH: pointConstraint: work in binary mode 2025-07-31 14:53:21 +01:00
a32493778a ENH: surfaceSlip: allow use on stand-alone pointPatches. Fixes #3404 2025-07-31 11:39:06 +01:00
e4c1a252c6 Merge branch 'GeometricField-tweaks' into 'develop'
preliminary infrastructure for sliced/unified fields

See merge request Development/openfoam!751
2025-07-30 12:13:50 +01:00
c108153d06 ENH: DimensionedField/GeometricField provision for additional storage
- base DimensionedField on DynamicField instead of Field to allow
  convenient resizing

- initial infrastructure for unified GeometricField handling with
  the boundaryEvaluate() method

Co-authored-by: <Mark.Olesen@keysight.com>
2025-07-30 09:43:57 +02:00
53af711c6a ENH: simplify assign zero for Dimensioned and Geometric fields (#3402)
- regular or forced assignment from `zero` does not need dimension
  checking:

    Old:  U = dimensionedVector(U.dimensions(), Zero);
    New:  U = Zero;

  this eliminates a fair bit of clutter and simplifies new coding
  without losing general dimension checking capabilities.
2025-07-30 09:29:53 +02:00
a68ed1371f FIX: incorrect DynamicList resizing logic (memory pool)
- reserve() did not set the addressable size to the current capacity
  before resizing, which meant that the delete[] would not have the
  true allocated size. Only affects memory-pool usage (#3381), which
  is not yet integrated

ENH: remove unused DynamicList '*_unsafe()' methods

- can result in a mismatch between allocated and addressed sizes,
  which becomes important for memory-pool usage.
2025-07-28 14:58:08 +02:00
6ac50a3307 ENH: Added onStart option to timeControl for function object control
Triggers function object to execute on the first time step.

Example usage:

    minMax1
    {
        type            fieldMinMax;
        libs            (fieldFunctionObjects);
        writeControl    onStart;
        fields          (".*");
    }

Ref: EP2608
2025-07-24 15:09:58 +01:00
0a421c99ab ENH: checkMesh -writeChecks : support multi-region - see EP10:599 2025-07-24 15:09:58 +01:00
20e04a88f7 BUG: cylinderToCell: avoid large-number subtraction (fixes #3378) 2025-07-23 14:17:57 +01:00
9629ae8aa9 ENH: mapDistribute: add separate input and output
To avoid making initial copy of input to output field.
2025-07-17 09:59:46 +01:00
7a8089e076 ENH: extrudeMesh: excess code 2025-07-16 16:48:17 +01:00
4cd1912e4c BUG: AMIInterpolation: keep old geomComm. See #3372
Correcting bug introduced when trying to keep the old communicator.
We do not need local communicator if all ranks of comm have
some faces. Not all ranks of the already local communicator.
2025-07-14 14:43:50 +01:00
9eede215b0 BUG: argList: print excess. Fixes #3384 2025-07-14 14:43:50 +01:00
d37c685523 ENH: holeToFace: corrected documentation 2025-07-14 11:13:00 +01:00
bbef1bc289 ENH: report best dictionary context for failed foamDictionary search (#3379) 2025-07-03 14:35:54 +01:00
615aae61d7 RELEASE: Updated config to v2506 2025-06-27 09:47:59 +01:00
fabb1c2ce5 RELEASE: Updated headers to v2506 2025-06-27 09:46:28 +01:00
9f47957df5 CONFIG: updated completions cache 2025-06-27 09:45:58 +01:00
50b1c0be53 ENH: refine handling of AMI local communicator
- previous handling of forced inclusion of the master would taint the
  logic about single vs multiple ranks.

- be fussier about avoing creation of a local communicator when not
  needed.

STYLE: rename internal switch from localComm_ to useLocalComm_

- less confusing (it is a switch, not the communicator itself)
2025-06-27 09:43:15 +01:00
2e475793bc FIX: avoid setting warnComm for single-world mappedPatches
- setting the warnComm is useful for diagnosing multi-world issues but
  triggers many false warnings when used in combination with AMI local
  communicators.
2025-06-27 09:43:08 +01:00
b46b3356bc FIX: hard-coded communicator in mappedPatchFieldBase (fixes #3375) 2025-06-27 09:42:58 +01:00
453efa7ca8 COMP: minor changes for gcc-15
COMP: unresolved pTraits<long int> for reductions on i586 systems

- now always just use int64_t instead of off_t and time_t
  for master reductions.

  Note that this is not the only place where the off_t definition
  causes compilation issues (cf. fileOperation::broadcastCopy)
2025-06-27 09:42:51 +01:00
4d702d25a6 Merge remote-tracking branch 'origin/master' into develop 2025-06-27 09:41:03 +01:00
bf0eb9bede TUT: mixerVessel2D: avoid sensitivity issues when writing mesh data to disk 2025-06-26 14:05:24 +01:00
1cdf7d0b00 Merge branch 'feature-field-statistics' into 'develop'
ENH: fieldStatistics: New function object for statistics of input fields

See merge request Development/openfoam!732
2025-06-24 16:11:29 +00:00
053f895b2e ENH: fieldStatistics: new function object
- calculates various statistics (min, max, mean, variance)
  of specified fields
2025-06-24 15:52:32 +02:00
ec7ab996c5 CONFIG: set API level to 2506 (initial pre-release state)
- README updated to v2506, project-version updated to v2506
2025-06-23 16:56:30 +02:00
5f580f547f ENH: reuse AMI local communicator between timesteps (#3372)
- in many cases the local communicator has the same communication
  pattern for several timesteps so it can be reused instead of being
  recreated. Avoids repeated MPI_Comm_free()/MPI_Comm_group() calls

- STYLE: eliminate bitSet intermediate when determining the sub-ranks
2025-06-23 16:51:50 +02:00
36d1d9b79d SUBMODULE: update cfmesh (SLList changes) 2025-06-23 13:09:11 +02:00
9e9c90ddb2 SUBMODULE: update data-community and turbulence-community 2025-06-20 14:32:34 +01:00
45f8d847b0 Merge branch 'feature-bladeForces' into 'develop'
ENH: Added new bladeForces function object

See merge request Development/openfoam!746
2025-06-20 11:27:00 +00:00
1078234f18 ENH: Added new bladeForces function object
Calculates thrust, drag, torque and lift/drag/pressure coefficients
of single or multiple blades (eg, propeller, turbine blades)

This function object differs from the propellerInfo and forces
function objects in that all forces are calculated within the local
cylindrical coordinate system, which yields thrust and drag values
within the expected reference frame.

The output comprises:
- coefficients per radial bin
- area-weighted total coefficients
- integrated forces and torque

For convenient post-processing, the results are also written in a VTK
(.vtp) output format. All surface results are registered internally,
which makes them available for other function objects.
2025-06-18 21:16:03 +02:00
3c4e226130 COMP: reduce off_t as int64 for windows compilation
- avoids unresolved pTraits<long int> for reductions
2025-06-18 20:28:58 +02:00
7021b073cf DOC: repeat the documentation about function objects "error" enums
- originally only listed in functionObjectList, now also list the same
  information under namespace functionObjects so it is more likely to
  be found.  Document the behaviour as a table to make it more
  immediately visible than the text form.
2025-06-18 20:28:58 +02:00
cdd1e19f68 Merge branch 'feature-GAMGAgglomeration-name' into 'develop'
ENH: GAMGAgglomeration: optional name. Fixes #3332

See merge request Development/openfoam!749
2025-06-18 18:25:48 +00:00
09beb5571a ENH: GAMGAgglomeration: optional name. Fixes #3332 2025-06-18 18:23:37 +00:00
23adebdb86 FIX: missing specialisations for transformF[av]PatchField
- fix for 25139e492e
2025-06-18 11:07:28 +01:00
2b0e4dc97a ENH: potentialFoam: allow swirl bc. See #3211
Bypasses the constraint override. Contentious -
does field algebra or boundary constraints take
priority.
2025-06-16 17:13:31 +01:00
e803646228 Merge branch 'consistent-handling-of-filtered-names' into 'develop'
consistent handling of filtered patch/zone names. More inGroups handling for utilities etc.

See merge request Development/openfoam!748
2025-06-13 14:17:48 +01:00
be278abcc0 ENH: revise patch group selection to ensightMesh
- supports inGroup while also respecting allow/deny semantics

- support inGroup for cellZone/faceZone selection
2025-06-13 10:29:32 +02:00
93f980834b ENH: support patch group selection
- vtkWrite, foamToVTK, surfaceMeshExtract
2025-06-13 10:29:32 +02:00
e8dce32b0a ENH: consistent handling of filtered patch/zone names
- the indices(const wordRes& allow, const wordRes& deny) methods
  were not defined consistently with the wordRes::filter handling.

  wordRes::filter - allow/deny both empty:
      = no filtering (ie, accept everything)

  indices(allow,deny) - allow/deny both empty:
     = return identity list (NEW behaviour)
     = return empty list (OLD behaviour)

  Consider the old behaviour a minor bug since the limited number of
  callers had their own checks that avoided the poor behaviour.

  Example of the inconsistent behaviour:

     pbm.indices(wordRes(), wordRes({"non-existent"}))
        --> identity list (old, new behaviour)

     pbm.indices(wordRes(), wordRes())
         --> identity list (new behaviour)
         --> empty list    (old behaviour)
2025-06-13 09:15:58 +02:00
91925871d9 Merge branch 'fix-3374-questionable-const_cast' into 'develop'
avoid casting workarounds for syncTools::syncBoundaryFaceList

See merge request Development/openfoam!747
2025-06-12 12:49:26 +00:00
a5090c37a3 ENH: minor improvements to UPstream::communicator wrapper class
- robuster reset() method that handles self-assignment
- additional swap() and constCast() methods

STYLE: relocate UPstream::communicator declarations within header
2025-06-12 13:13:26 +02:00
0d7816b7fd ENH: avoid questionable const_cast of SubList (#3374) 2025-06-12 13:13:26 +02:00
9bdb75eeef ENH: add ListOps::equal() function
- tests for list equality with different but compatible data types.
  Eg, when comparing lists of int32 and int64 values.

STYLE: pass UList instead of List references into ListOps functors
2025-06-12 13:13:26 +02:00
a860d48637 ENH: make some vectorTensorTransform methods inplace
- avoids intermediate allocation and re-assignment to self (#3374)

BUG: checkMesh (application) with questionable memory handling (#3374)

- move the contents of the new points instead of attempting to transfer
  the entire list

COMP: replace mapDistribute specializations with if constexpr handling

- simplify future maintenance
2025-06-12 13:13:26 +02:00
97296043c0 ENH: snappyHexMesh: more warnings. See #3377
This one only tackles the per-region for refinementSurfaces.
Other ones tbd.
2025-06-12 10:10:16 +01:00
6bdceaf29f BUG: AMI: local communicators. Fixes #3376 2025-06-11 16:39:48 +01:00
34df4eaf40 ENH: ensightWrite: allow inGroup names in patches and excludePatches 2025-06-11 13:36:14 +01:00
75b2d0b656 BUG: masterStream forwards without communicator (fixes #3373)
- in messageStream::masterStream(int), it forwarded to stream()
  without the communicator, which meant it would incorrectly check
  UPstream::master(worldComm) and possibly not produce any output (or
  block).
2025-06-10 15:20:11 +02:00
9bc6f2f91f ENH: support 'rpm' input for propeller functionObject (as per rotorDisk)
- update code style for forces/propeller.
- simplify coordinate handling in propeller functionObject
2025-06-10 10:32:03 +02:00
96872f031f Merge branch 'feature-orientedSurface' into 'develop'
ENH: snappyHexMesh: work better on non-manifold. Fixes ##3361

See merge request Development/openfoam!740
2025-06-09 15:12:47 +00:00
55d89ac4d6 ENH: snappyHexMesh: work better on non-manifold. Fixes ##3361 2025-06-09 15:12:47 +00:00
fe0ba07a7a SUBMODULE: update OpenQBMM for v2506 2025-06-05 16:06:56 +02:00
164a3e8330 ENH: IOstream::unsetf() now returns old flags (eg, for toggling)
ENH: align MPI_Probe non-blocking handling with header description

- the header states that the commsType is non-blocking or not,
  but the implementation actually checked for 'buffered' or not.

STYLE: fix some spacing and some documentation
2025-06-05 16:06:56 +02:00
2f6581133c ENH: preserve matrix manipulation state in boundary consistency check
- add placeholder methods in faPatchField and move setter functions
  from protected to public access.
2025-06-05 15:09:25 +02:00
9e8e14e448 TUT: minor tutorial cleanup
- use functionObject writeInterval not timeInterval.
  No change in behaviour since the missing writeInterval is treated
  as '1' anyhow when using 'timeStep' for the writeControl

- consistent use of 'adjustable' vs 'adjustableRunTime'

- prefer '#eval{ vector(...) }' to calling '#eval' multiple times
2025-06-04 16:39:34 +02:00
ffea136955 BUG: correct constant definition in sigma LES model (fixes #3371) 2025-06-03 20:04:17 +01:00
5dbc2e5890 Merge branch 'patch_specializations' into 'develop'
Simplify specialization of patch fields, consolidate boundary evaluation

See merge request Development/openfoam!743
2025-05-29 11:20:25 +00:00
1be6991d3f CONFIG: set API level to 2502
- changes in patchField signatures
2025-05-28 17:50:55 +02:00
25139e492e ENH: replace patchField specializations with if constexpr
- simplifies future code changes

STYLE: noexcept access for wedgePatch methods
2025-05-28 17:50:55 +02:00
0189311026 ENH: avoid unneeded transform operations for scalar pointField BCs 2025-05-28 17:50:55 +02:00
d6e6450834 ENH: add missing construct GeometricField from primitive field (tmp)
ENH: improvements for GeometricBoundaryField evaluation

- early termination from evaluate_if() and evaluateCoupled().

- evaluateCoupled() now forwards to evaluate_if() and receives
  additional handling for a 'void' parameter type.

BREAKING: extra template parameter for overset correctBoundaryCondition

- the true/false flag as a template parameter instead of as an
  argument to use 'if constexpr' code
2025-05-28 17:50:55 +02:00
1d6c77f8f4 ENH: complement lookupPatchField with cfindPatchField
- encapsulates (foundObject && lookupPatchField) together,
  similar to cfindObject

STYLE: remove unnecessary dummy parameters from lookupPatchField

- these were a workaround for a very old gcc bug and are no longer
  needed. However, retain the (unneeded) second template parameter to
  continue with not breaking existing old code - it has no overhead.
2025-05-28 14:42:27 +02:00
83e73e4024 BREAKING: change in signature for {fa,fv}PatchField::patchInternalField()
Signature:

    void patchInternalField(UList<Type>& pfld) const;
    // OLD: void patchInternalField(Field<Type>& pfld) const;

    This change is necessary to allow collection into slices of a
    larger list.

ENH: add {fa,fv}PatchField::patchNeighbourField(UList<Type>&)

- a retrieval version similar to patchInternalField(...)

STYLE: adjust AMI patch field private method names

- rename private method

      patchNeighbourField(...) -> getNeighbourField(...)

  to avoid access clashes with public methods

- remove undefined method neighbourSideField()
2025-05-28 14:42:18 +02:00
0bb0c1db74 BUG: plicRDF: reconstructing distance func for point neighbours (fixes #3279) 2025-05-28 12:13:52 +01:00
8d9f4c54f3 COMP: suppress false positives from -Wdangling-reference (gcc)
- the number of false positives has reduced, but in a few remaining
  cases, the compiler cannot possibly "know" that the pointer stored
  on the registry will outlive the scope of the method (for example)

  gcc-13: suppressing these spurious warnings needs to be done at each
  caller, which is simply not worth it, since later compiler versions
  provide a cleaner solution.

  gcc-14: the [[gnu::no_dangling]] attribute on the declaration
  lets the compiler know the intent.

- additional FOAM_REAL_GNUC macro (defined in stdFoam.H) to define
  the "real" gcc version and ignoring other compilers masquerading
  as gcc.

COMP: rename MeshObject code to {cxx,txx}

- avoids issues on case-insensitive filesystems (#3316)
2025-05-27 18:25:58 +02:00
f7c8bfdce0 STYLE: retrieve tensor diagonal directly instead of via diagTensor 2025-05-27 11:09:27 +02:00
6ca0c59519 Merge branch 'feature-patchField-adjustments' into 'develop'
ENH: extend GeoMesh interface, prepare for in-place patch slices

See merge request Development/openfoam!741
2025-05-22 13:55:29 +00:00
72ce3eb4ef BREAKING: change in behaviour for faPatch/fvPatch patchInternalField()
- the output parameter was previously a field and resized according to
  the patch size. Now the output parameter must be pre-sized prior to
  calling, which makes it possible to collect the patch internal
  fields into slices of a larger list.

  Signatures:

      void patchInternalField
      (
          const UList<Type>& internalData,
          UList<Type>& pfld    // OLD: Field<Type>& pfld
      ) const;

      void patchInternalField
      (
          const UList<Type>& internalData,
          const labelUList& addressing,
          UList<Type>& pfld    // OLD: Field<Type>& pfld
      ) const;

  This low-level change is not expected to affect any user code,
  which would normally use a higher-level interface such as from
  fvPatchField etc.
2025-05-22 13:55:04 +00:00
a9b59ad27e ENH: control local boundary consistency checks from FieldBase settings
- avoids multiple definitions for various template specializations
2025-05-22 13:55:04 +00:00
4668d0e886 ENH: extend GeoMesh interface to include boundary_size() static method
- can be used to pre-allocate space for internal+boundary field for
  flat addressing (issue #3364).

  For example:

      DynamicField<Type> fld
      (
          std::pair<label,label>
          (
              GeoMesh::size(mesh),
              GeoMesh::size(mesh)
            + (extra ? GeoMesh::boundary_size(mesh) : label(0))
          )
      );

ENH: base changes for GeometricField flags

- FieldBase 'localBoundaryConsistency_' and 'localBoundaryTolerance_'
  for central handling of local boundary consistency checks.

- FieldBase 'unifiedGeometricField' for future extensions to GeometricField
2025-05-22 13:55:04 +00:00
c78f25035d Merge branch 'feature-memory_pool.pre' into 'develop'
basic hooks for alternative List/Matrix allocators

See merge request Development/openfoam!742
2025-05-22 13:46:49 +00:00
82e0d76748 ENH: provide basic hooks for alternative List/Matrix allocators
- include "contiguous.H" in ListPolicy, which makes it available
  whenever UList.H has been included

ENH: return plain List instead of shrinking the DynamicList
2025-05-22 14:41:05 +02:00
4e513cec18 ENH: DimensionedField, GeometricField enhancements and style changes
- constCast() convenience methods.
  This simplies coding in places, especially in solvers

- inline some methods within headers, for better overview/maintenance

- only set DimensionedField default value on construct if not read

- storeOldTimes() does not require const_cast
2025-05-21 14:19:36 +02:00
ae3adc1007 ENH: add fvPatch::offset() as pass-through to polyPatch::offset()
- makes fvPatch consistent with faPatch etc and can simplify coding

ENH: handle sizing within extrapolateInternal() patch field methods

- reduces reliance on any sub-components

ENH: extend polyBoundaryMesh patch selectors

- indices_if() method with a predicate, or with a patch-type
  behaves similarly to findPatchIDs(), but returns a sorted
  labelList instead of a labelHashSet

- nFaces_if() method with a predicate return the number of boundary
  faces for patches matching the given predicate.
2025-05-21 14:19:36 +02:00
a0bba74950 STYLE: remove old (__cplusplus >= 201703L) checks
- now using c++17 throughout
2025-05-21 14:19:36 +02:00
535a4fccb4 Merge branch 'fix-3360-wrong-addressing' into 'master'
BUG: wrong cellZone addressing in uniformityCellZone (fixes #3360)

Closes #3360

See merge request Development/openfoam!738
2025-05-13 10:36:26 +00:00
e1b04cb6a7 BUG: wrong cellZone addressing in uniformityCellZone (fixes #3360)
The mean value, variance and volume fields for each zone were accessed
using the wrong indices
2025-05-13 11:29:18 +03:00
a3f74d832a COMP: default construct Matrix is constexpr 2025-05-12 11:35:02 +02:00
a92143400d TUT: bubbleColumnPolydisperse: update the function object library (fixes #3321) 2025-05-09 16:25:47 +01:00
c6220c162e BUG: RosinRammler: correct the order of scale and shape parameters (fixes #3342)
Co-authored-by:Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2025-05-09 13:25:54 +01:00
e5f147a211 STYLE: report active/inactive state flag for fvOptions (fixes #3356) 2025-05-08 12:23:04 +01:00
ebbeef27b4 ENH: avoid the build-up of the background solver dictionary
The solverPerformanceDict gets larger due to the addition of a SolverPerformance
data per field at every outer iteration within the same main iteration/time
step.

However, the subsequent functionalities seem to use only the first and last
element of this dictionary per field; therefore, storing the interim values
was revealed to be redundant.

The change removes the interim values by transforming the `List` container
into the `Pair` container, and modifying the relevant algorithms.
2025-05-06 15:20:45 +01:00
5bb030480d Merge branch 'feature-mui-support' into 'develop'
add -mpi-split-by-appnum option (issue #3127)

See merge request Development/openfoam!735
2025-04-30 15:33:32 +00:00
4334aa43a0 ENH: add -mpi-split-by-appnum option (issue #3127)
- this can be used as an alternative to the (-world) multi-world
  option. For example, for calling OpenFOAM applications with MUI
  (https://github.com/MxUI/MUI)
2025-04-30 12:38:48 +02:00
34143b433a ENH: allow disabling of initial MPI_Comm_dup(MPI_COMM_WORLD,...)
- can use -mpi-no-comm-dup to suppress the initial communicator
  duplication (to avoid potential deadlock with coupled processes).
  This is partly related to comments in merge-request !735

ENH: simplify parsing/removal of local -world option

- can extract the world name in a single pass and also makes the
  parsing robuster.

ENH: support regular MPI_Comm_split()

- the two-step method of Allgather + Comm_create_group may not be
  expected by other applications (issue #3127) and that can lead to
  deadlock, so also add in code for the regular MPI_Comm_split.
  Does not support re-sorting keys!

FIX: faulty logic for splitting communicators

- only affected more recent develop branch
2025-04-30 12:38:45 +02:00
c5ceec3c73 Merge branch 'improved-list-sizing' into 'develop'
ENH: refine handling of DynamicList/DynamicField resizing

See merge request Development/openfoam!737
2025-04-30 08:22:01 +00:00
91e7870ee8 ENH: extend patch/boundary methods: faces(), faceOwner()
- similar to polyBoundaryMesh
2025-04-29 15:42:39 +02:00
1d62b6274e COMP: add <numeric> to stdFoam.H
- useful to have std::reduce(), std::transform_reduce() available in
  more places, so treat like <algorithm> and include in "stdFoam.H"

STYLE: add 'stricter' detection markers for cast of SubList to List etc.

STYLE: remove 'const' qualifier from Foam:one/Foam::zero (in Field)
2025-04-29 15:42:39 +02:00
5ee8f19bdd ENH: refine handling of DynamicList/DynamicField resizing
- previously had special resizing treatment for the corner case when
  the addressable size and the new capacity are identical. However,
  that particular approach (to minimize copying) meant that the exact
  deallocation size would likely be incorrect.
  Having the correct deallocation size becomes more important with
  alternative allocators.

  Introduce resize_copy() protected function to limit the number
  of elements copied during the resize.

ENH: provide DynamicList/DynamicField constructor with sizing

- allows fine-grained creation of a DynamicList/DynamicField with a
  given size/capacity without an initial value.

COMP: typo in code for DynamicList::push_back() with IndirectList
2025-04-29 15:42:39 +02:00
2d77f7ae26 ENH: add face/triFace/triangle magSqr() method (as per edge, boundBox etc) 2025-04-25 09:50:09 +02:00
5c44f360fe ENH: processorColour: unused code 2025-04-24 20:24:23 +01:00
735b701006 BUG: lduMesh: fix cell-cell addressing. Fixes #3357 2025-04-23 17:04:53 +01:00
fd41930377 Merge branch 'namespace-qualify_code-style' into 'develop'
Improve namespace qualification of min/max, other minor code improvements

See merge request Development/openfoam!736
2025-04-10 10:49:36 +00:00
59f3c55871 STYLE: avoid implicit cast of UList to List 2025-04-09 15:58:30 +02:00
0be19b7fae COMP: namespace qualify min/max functions (#3348)
FIX: missing patch face index writeFields (#3347)
2025-04-09 15:58:30 +02:00
01727c84f1 ENH: use gMinMax() instead of separate gMin(), gMax()
- for reciprocal values, gMinMax() first and then calculate the
  reciprocal, which avoids creating temporaries

STYLE: prefer MinMax to separate min/max accounting

COMP: namespace qualify min/max for deltaT, CourantNo, etc (#3348)
2025-04-09 15:58:30 +02:00
80d7fe97f0 TUT: clarify use of Antal parameters (#3353)
TUT: simplify example of coded motion solver
2025-04-09 15:58:29 +02:00
a7e8a43f4a ENH: add writeContents() static methods for IOList etc.
- encapsulates IOListRef etc into a simpler syntax

ENH: use UList instead of refPtr for IOListRef (avoids List cast etc)
2025-04-09 15:58:29 +02:00
6c20df2808 ENH: additional in-place clamp_min(), clamp_max() field methods
- these already existed for a single value, but now handle the full
  field. This is more memory-friendly.

      fld.clamp_min(lower);  OLD: fld = max(fld, lower);
      fld.clamp_max(upper);  OLD: fld = min(fld, upper);
2025-04-09 15:58:29 +02:00
b8a0706e72 ENH: add ListPolicy::reserve_size() helper (related to #3348)
- central way to calculate reverse sizes for dynamic containers.

  For example;
      reserve_size<16, 2>(len, cap);     // min-size=16, ratio=2
      reserve_size<16, 3, 2>(len, cap);  // min-size=16, ratio=1.5

  replaces this type of code that was used in several places:
      max(SizeMin, max(len, label(2*capacity_)));

  The caller will have already checked (len < cap) before deciding
  to make this call.

ENH: updates for DynamicList/DynamicField handling

- add reserve_exact() method, which is like reserve() but without any
  extra sizing heuristics

- add DynamicField 'reuse' constructors, consistent with Field constructors

- sync allocated size before list destruction.
  This may help when using aligned allocation strategies.
2025-04-09 08:10:48 +02:00
7f062a8f5e ENH: return plain List instead of shrinking the DynamicList
Using 'return List<T>(std::move(dynList))' for transfer of content
  (with implicit shrinking) into a plain List, and leave copy elision
  to do the rest. The implicit transfer (move construct List from
  DynamicList) will normally invoke resize (new/delete and moving
  elements).

  With 'return dynList.shrink()', it will first invoke an internal
  resize (new/delete and moving elements), followed by a copy
  construct as a plain list.

STYLE: avoid implicit cast to 'const List&' in constructors
2025-04-08 11:26:11 +02:00
f13a05375c STYLE: promote ListPolicy to Foam namespace
- previously under Foam::Detail::ListPolicy, now as Foam::ListPolicy
2025-04-07 18:28:46 +02:00
eb56c75c4b ENH: provide edge::sorted() static constructor
- avoids min(a,b), max(a,b) free functions (#3348)
2025-04-07 18:28:46 +02:00
cb6d11d39b CONFIG: add LIBO_LIBS support into wmake rules
- provides an additional hook when linking OSspecific

CONFIG: apply quiet flag to wmkdepend

- suppresses "could not open FileName" warnings in quiet mode

FIX: reinstate selection of strict/non-strict deprecation

- accidentally removed in cf2b305b4f.
- extend with a _STRICTER version as well.
2025-04-07 18:28:42 +02:00
ad037ac744 Merge branch 'issue-3313-SVD-pinv_tensors' into 'develop'
avoid heap allocations for pseudo-inverse of tensor/symmTensor (#3313)

See merge request Development/openfoam!734
2025-04-01 16:19:01 +00:00
e3c93a9c85 ENH: refactor SVD to support tensors directly (#3313) 2025-04-01 17:52:13 +02:00
a2df607998 CONFIG: set API level to 2501
- Pstream changes (one-sided), local AMI communicators,
  other adjustments
2025-03-31 18:53:43 +02:00
e121db6e86 ENH: extend sigFpe::fillNan() interfaces
- provide separate float/double UList interfaces, which improves
  flexibility (eg, with SPDP)

- sigFpe::fillNan_if() interface, for filling in when using alternative
  memory allocators
2025-03-31 18:50:29 +02:00
e720f823d3 ENH: simplify SubStrings class/handling (remove template parameters)
- previous code used derived string iterators, but these would
  be largely ignored anyhow since the underlying std::sub_match
  str() method would just yields a std::string anyhow.

  The SubStrings::str(size_t) method wasn't used in any code, so now
  just use std::string iterators only.

  This change simplfies overall handling, since it removes an unneeded
  template dependency.
2025-03-31 16:00:07 +02:00
bdac68ebc7 CONFIG: add Gcc rules for MacOS (darwin)
- /usr/bin/{gcc,g++} normally just symlinks to clang/clang++
  and may have unknown default flags.
  For a gcc toolchain, it would be better to use a homebrew
  installation.

  For these cases, the compiler will need to be specified with
  version=.. in WM_COMPILE_CONTROL.

  For example, with "version=14", to select gcc-14, g++-14 from the
  homebrew installation.

- needs a slight hack for locating the FlexLexer.h header.
  Added into src/OSspecific/POSIX similar to how it is handled
  in src/OSspecific/MSwindows

CONFIG: add simple config/detection support for libumpire (Linux)
2025-03-31 16:00:07 +02:00
edf9621ebe ENH: add foamConfigurePaths support for homebrew
- new options to set components specified by homebrew.
  Sets version as system, path from brew --prefix

    -adios-brew, -adios2-brew, -boost-brew, -cgal-brew,
    -fftw-brew, -kahip-brew, -metis-brew, -scotch-brew,
    -gmp-brew, -mpfr-brew

    -with-homebrew
     Shortcut for selecting all the above (except gmp, mpfr)

* additional special treatment for GMP and MPFR.

  If using non-system locations and not part of the ThirdParty
  compiler, they can additionally be set in the CGAL config file:

    -gmp-brew, -gmp-path
    -mpfr-brew, -mpfr-path
2025-03-31 16:00:07 +02:00
a9863d9a3f ENH: add size_type to Matrix and VectorSpace
- easier to create type-specific looping in templated code

STYLE: pass 'direction' and 'label' by value instead of reference

COMP: qualify Foam::min() in dense matrix classes
2025-03-31 15:58:55 +02:00
bdb890d4e2 COMP: disambiguate pTraits for long/unsigned long on Darwin 2025-03-25 16:02:42 +01:00
707db0b65b COMP: avoid deprecated headers for CGAL-6.0 2025-03-24 16:27:02 +01:00
8716795d86 COMP: more int/label consistency for communicator parameter 2025-03-24 16:27:02 +01:00
8bbfe6eb44 Merge branch 'remove-posix-regex' into 'develop'
DEFEATURE: remove POSIX regex interface (#3343)

See merge request Development/openfoam!733
2025-03-24 10:33:15 +00:00
aaa9af9ee8 DEFEATURE: remove POSIX regex interface (#3343)
- compiler versions are now sufficient that only the C++ regex
  interface is now being used. Can remove the old POSIX code
  accordingly.

  This change also removes any dependency on the SubStrings class to
  manage the matching results.

ENH: remove OpenFOAM dependencies from MacOS addr2line utility
2025-03-21 14:41:43 +01:00
4de0b84c2f Merge branch 'pstream-topo-aware' into 'develop'
additional topology-aware handling for Pstream

See merge request Development/openfoam!731
2025-03-20 12:02:45 +00:00
db871856c0 CONFIG: add named topoControls 2025-03-20 10:51:43 +00:00
a01f3ed8b7 ENH: add node-based gatherList() 2025-03-20 10:51:43 +00:00
c4b261c615 ENH: add node-based gather(), listGather(), mapGather() 2025-03-20 10:51:43 +00:00
7b0ab0dbb3 ENH: add node-based broadcasting and reduction 2025-03-20 10:51:43 +00:00
b9b0d1b3aa STYLE: use weighted average/sum in a few places
- minor adjustments to some BCs construction:
  * ensure origin/axis are zero-initialized
  * use dictionary get<> instead of lookup
2025-03-20 11:14:39 +01:00
b7ce6bf69d CONFIG: inject -no-recursion into the argument list (#3198)
- sourcing a file with '-no-recursion "$@"' does not work with dash.
  Need to modify the argument list directly.
2025-03-19 15:28:57 +01:00
034a0524af ENH: add weighted average and weighted sum functions (local and global)
- convenience, avoids creating intermediate fields and for
  gWeightedAverage() requires one fewer reduction

ENH: combine loops for FieldField averaging

STYLE: remove clip() function, superseded by clamp_range() - JAN-2023
2025-03-19 12:10:27 +01:00
eaa65913f4 CONFIG: combine flex/flex++ rules (minor cleanup)
- generate .cc (instead of .C) intermediate files, consistent with how
  we manage other generated code and makes them less case sensitive
2025-03-19 12:10:12 +01:00
6dd8804acb BUG: fixup. See #3334 2025-03-17 15:07:25 +00:00
a77aaa7582 BUG: AMIInterpolation: reset cached data. Fixes #3334 2025-03-17 14:11:38 +00:00
5cc36dc5b7 Merge branch 'issue-3211-fan-jumpCyclic' into 'develop'
BUG: fan: bc value not updated. See #3211

See merge request Development/openfoam!701
2025-03-17 14:11:12 +00:00
d4a959a93f BUG: fan: bc value not updated. See #3211 2025-03-17 14:11:12 +00:00
09e04003c4 CONFIG: support Allwmake with -bear-output-dir (#3322) 2025-03-17 11:58:25 +01:00
0a53013499 BUG: foamReport mesh quantities are not parallel (fixes #3338) 2025-03-17 11:53:23 +01:00
47f2ff618d COMP: remove obsolete -fsimdmath flag for ARM64 (#3326) 2025-03-17 09:59:42 +01:00
47575aabf2 COMP: compilation with clang (c++17) and older flex files (fixes #3337)
- The register keyword has been removed from c++17 but old flex
  versions (version < 2.6.0) produce code including it, leading to
  compilation errors when using clang (despite disabling the diagnostic).
  gcc compiles but issues warnings.

- use '#define register' as empty as a workaround
2025-03-17 09:58:20 +01:00
dcbd546d51 FIX: incorrect parameters for IN_PLACE MPI_Gather, MPI_Scatter
STYLE: mark Pstream::scatterList() as deprecated

- this entry point is not directly used anywhere, only the
  scatterList_algorithm backend is actually used.

  The scatterList() routine is misnomer since it actually works like a
  broadcast that skips overwriting the local rank, but only if used in
  combination with the gatherList() manual implementation that uses
  the same walk pattern.
2025-03-14 17:55:12 +01:00
d64c6371f1 ENH: foamDictionary now respects header format [ascii/binary] (#3329) 2025-03-14 09:08:04 +01:00
2d246cd5d1 ENH: add token::read(Istream&) method
- can be used to simplify some logic. For example,

      if
      (
          (tok.read(is) && tok.isWord("FoamFile"))
       && (tok.read(is) && tok.isPunctuation(token::BEGIN_BLOCK))
      )
      ...
  vs
      if
      (
          (is.good() && (is >> tok) && tok.isWord("FoamFile")) ...
       && (is.good() && (is >> tok) && tok.isPunctuation(token::BEGIN_BLOCK))
      ) ...
2025-03-12 20:09:00 +01:00
51bb06764a ENH: add polyBoundaryMesh::nNonProcessorFaces()
- the number boundary faces before the first processor patch.
  This approximately equals the 'real' number of boundary faces
2025-03-12 19:14:48 +01:00
795bce4519 COMP: suppress old-style cast warning (boost/cgal) 2025-03-12 12:14:58 +01:00
db0709f957 ENH: use DynamicList to SLList for ansysToFoam, kivaToFoam
- also fixes a compilation issue introduced by f13be4f62c
  (where the direct assignment from SLList to List was removed)
2025-03-12 11:50:58 +01:00
38e08fc092 COMP: avoid constructor ambiguity for ISpanStream
- compiler cannot decide between std::string and std::string_view
  when creating from 'const char*' without also supplying the size,
  so also supply a 'const char*' constructor.

ENH: additional string_view handling for ITstream and SubStrings
2025-03-12 10:04:43 +01:00
36ae93d017 ENH: components to support one-sided communication 2025-03-10 16:32:35 +01:00
ab7cfdcf49 ENH: add UList move construct and move assignment (shallow copy)
- the 'move' treatment performs a shallow copy but does not alter
  the passed parameter. Identical semantics as per std::span.

ENH: constexpr for basic HashTable constructors

STYLE: 'Foam::zero' instead of 'const Foam::zero' for containers

- this is simply a compiler dispatch flag, so the additional 'const'
  qualifier is unnecessary
2025-03-10 16:32:23 +01:00
f13be4f62c DEFEATURE: remove old/unused SLList -> List construct/assignment
- should ideally avoid SLList in most cases, since it is allocation
  intensive and most places can easily use DynamicList or
  CircularBuffer instead.

STYLE: use push_uniq instead of deprecated appendUniq method

- mark with a 'normal' deprecation instead of 'strict' deprecation
2025-03-10 16:32:22 +01:00
ae638c2b9c CONFIG: improvements to mpirunDebug
- the '-no-core' to limit coredumps to zero size
- the '-quick' option, which changes valgrind --leak-check from "full"
  to "summary", and implies -no-core as well.
- enforce tcp libfabrics provider under valgrind since valgrind
  does not otherwie work nicely with RMA
2025-03-10 16:29:47 +01:00
9cd0aa8816 COMP: avoid in-place reduce for OPEN-MPI as well (#3331)
- fails with MPI_ARG_ERR.
  Do not assume that any vendors actually support in-place handling
  for MPI_Reduce(), regardless of what their documentation may claim.
2025-03-07 09:29:28 +01:00
939ca03495 Merge branch 'pstream-typed-handling' into 'develop'
increased use of intrinsic data types and ops for communication

See merge request Development/openfoam!730
2025-03-06 16:16:01 +00:00
28818c73f9 COMP: workaround for broken in-place reduce INTEL-MPI (#3331)
- since that particular vendor version of MPI_Reduce() does not work
  with MPI_IN_PLACE, create a local copy of the data to pass into the
  routine.
2025-03-06 16:54:32 +01:00
20b2f46315 STYLE: prefer listReduce() to using listCombineReduce() when possible
- potentially allows access into the builtin MPI operations
2025-03-06 16:54:31 +01:00
5d9f8e9a9d ENH: remove gatherv/scatterv direct coding
- includes intrinsic MPI types, but no component aggregates since we
  barely wish to use gatherv/scatterv (slow!) in the first place
  and it makes no sense to recalculate the list of counts for
  component aggregates which we will never use.
2025-03-06 16:54:31 +01:00
3bf1399098 ENH: generalize mpiGather/mpiScatter/mpiAllGather
- include MPI and component aggregates
2025-03-06 16:54:31 +01:00
20b6aeb4dd ENH: generalize reduce/all-reduce to include MPI types
- for known data types (and component aggregates),
  and intrisic reduction operation can now use

     UPstream::mpiReduce(), UPstream::mpiAllReduce().

  This change permits more operations to use MPI calls directly.
  eg,

      reduce(vec, sumOp<vector>);

   now calls mpiAllReduce(..., op_sum) instead of point-to-point,
   followed by a broadcast.

   Similarly, when called as a simple reduction (not all-reduce)

      Pstream::gather(vec, sumOp<vector>);

   now calls mpiReduce(..., op_sum) instead of point-to-point

- extend use of MPI calls to list-wise reductions as well

- extend sumReduce() to bundle/unbundle vector-space types,
  which lowers overall communication.

  Before:
    1) send/recv + binary op through a communication tree
    2) broadcast
    3) all-reduce of the count

  Now:
    1) pack into a local bundle
    2) all-reduce
    3) unpack the bundle
2025-03-06 16:54:31 +01:00
c7fc9d4ddc ENH: extend MPI send/recv types
- support send/recv of basic types (int32, float, double, ...) in
  addition to common OpenFOAM vectorspace types (floatVector,
  doubleVector, ...)

  This permits sending NUM items of the given types instead of sending
  NUM sizeof() bytes.
  For a vector (as double): 1 item instead of 24 items (3*8 bytes).
  For a tensor (as double): 1 item instead of 72 items (9*8 bytes).
2025-03-06 16:54:31 +01:00
f0b844eb47 ENH: generalize MPI broadcast to basic and user-defined MPI types
- simplify and rationalize some of the broadcast methods for more code
  reuse.

  The bottom level UPstream::broadcast is now always to/from "root=0".
  This was previously passed as a default parameter, but never used
  anything other than '0' in the code. Fixing it as '0' makes it
  consistent with the 'top-down' logical for node-based broadcast.
2025-03-06 16:54:31 +01:00
151f4df546 ENH: add opaque data types to UPstream bridge code
- permits more flexible handling at the caller level
2025-03-06 16:54:31 +01:00
7ac83f22c7 ENH: refine the dataTypes handling
- now distinguish between basic MPI types and user-defined types.

  The new front-facing trait UPstream_basic_dataType unwinds components
  and other types, but only for MPI fundamental types
  (including any aliases)

- additional helper to combine a test for binary operator validity and
  basic data type validity, which better expresses intent:

     template<class BinaryOp, class T>
     UPstream_data_opType;

- relax bit-wise operators to also accept signed integrals
  and 'void' generic
2025-03-06 16:54:31 +01:00
8c395357f3 STYLE: more consistency in communicator types (int vs label) 2025-03-06 16:54:31 +01:00
d4b5280742 ENH: cleanup broadcast streams
- remove unused/unusable broadcast stream constructors/methods

- provide OPBstream::sends() and IPBstream::recvs() methods,
  refactored from Pstream::broadcasts. These will always use
  serializations, even for contiguous content.

- additional methods to support special handling of zero-sized lists.
  For example,

    if (UPstream::master(comm))
    {
        if (list.empty()) OPBstream::send(Foam::zero, comm);
        else              OPBstream::send(list, comm);
    }
    else
    {
        IPBstream is(comm);
        if (is.remaining()) { is >> list; }
        else { list.clear(); }
    }

   This avoids serialization of an empty list and the resulting double
   broadcast (size + content), using instead a single broadcast (size).

STYLE: more consistency in communicator types (int vs label)
2025-03-06 16:54:31 +01:00
be30598e3d ENH: add UPstream::localNode_parentProcs() method
- returns the (start/size) range of the commLocalNode ranks in terms
  of the (const) world communicator processors. This allows mapping
  back into lists defined in terms of the world ranks.
2025-03-06 16:54:30 +01:00
d64682a7af ENH: expand VectorSpaceOps to include copy_n/fill_n methods
- similar to what std::copy_n and std::fill_n would do, except with
  templated loops. This allows compile-time transcribing with loop
  unrolling. For example,

     vector vec1 = ..., vec2 = ...;

     FixedList<scalar, 6> values;

     VectorSpaceOps<3>::copy_n(vec1.begin(), values.begin());
     VectorSpaceOps<3>::copy_n(vec2.begin(), values.begin(3))

     // do something with all of these values

STYLE: make start index of VectorSpaceOps optional

ENH: add clamped begin(int) versions to FixedList as per UList
2025-03-06 16:54:30 +01:00
cf9fa16788 COMP: add pTraits for int16/uint16 types (simplifies messages) 2025-03-06 16:54:30 +01:00
9437e8d068 ENH: simplify operator calls for error, messageStream
- use move semantics for string parameters and reuse more code
2025-03-06 16:54:30 +01:00
dd09aa1289 ENH: PatchTools: version with supplied local points 2025-03-06 13:05:20 +00:00
56c52fd69e COMP: fix up merg e 2025-02-27 12:04:58 +00:00
34c933c1ce ENH: AMIInterpolation: use local communicator
- allocate communicator with only those ranks that have
patch faces
- use this communicator everywhere
- communicator preserved during mesh motion
2025-02-27 12:04:58 +00:00
f276016896 SUBMODULE: runTime postProcessing updated for change in minMaxOp 2025-02-27 12:48:34 +01:00
e3703c7626 Merge branch 'pstream-types' into 'develop'
add compile-time type system for MPI data/ops

See merge request Development/openfoam!729
2025-02-25 14:51:21 +00:00
dccdb263e8 ENH: add UPstreamTraits support to map data types and opcodes
The front-end traits:

- UPstream_dataType trait:
  This wrapper is unwinds the type to check against base/alias, but also
  checks if it is a component aggregate of a supported UPstream data type.
  This will be that main entry point for usage.

- UPstream_opType trait:
  Provides a mapping of OpenFOAM ops to their MPI equivalent.
  The \c opcode_id is the corresponding internal representation.

The lower-level traits (not normally used within coding)

- UPstream_base_dataType trait:
  Tests true/false if the specified data type has an internal MPI equivalent.
  The \c datatype_id is the corresponding internal enumeration.
  Even if this tests as false, it will always return \c type_byte as the
  fallback for general contiguous data

- UPstream_alias_dataType trait:
  Provides mapping for <int/long/long long,...> to the fundamental 32/64
  integrals, since <int/long/long long,...> may not otherwise directly map
  on all systems.

NOTE: can use the updates Test-machine-sizes test application to
determine if all data types and aliases are properly defined on
different systems
2025-02-25 10:09:38 +01:00
bf60a124ab ENH: add mapping for fundamental and OpenFOAM types -> MPI data types
- this will allow send/recv/broadcast of various data types directly
  without reinterpreting as bytes. No performance benefit, but makes
  programming more flexible. In addition to the normal MPI types, also
  provide some convenient groupings such as double[3], double[9] etc.

- the additional user-defined data types are created on the start of
  MPI and removed before shutdown
2025-02-25 09:52:12 +01:00
c448ea2a11 ENH: add simple handling for point-to-point barriers
- provides an additional means of process synchronization
2025-02-25 09:44:44 +01:00
d41c644a49 Merge branch 'pstream-cleanups' into 'develop'
various cleanup and add support for non-worldComm reduction of DimensionedField, GeometricField

See merge request Development/openfoam!728
2025-02-24 12:38:40 +00:00
d2dfd115be ENH: provide isolated "*_algorithm" versions of Pstream gather routines
- enables better selection of linear vs tree and improves future reuse.

ENH: optimize listReduce/listCombineReduce for single-value lists
2025-02-24 09:06:21 +01:00
8f3d29c1b7 ENH: retain linear vs tree state in commsStructList
- previously there were two places that used nProcsSimpleSum for
  defining the communication pattern. However, this meant in practice
  that filling of linearCommunication_ and treeCommunication_ themselves
  where globally controlled.

  Now retain the state within commsStructList and use linear/tree
  when populating.
2025-02-24 09:06:12 +01:00
e67fffac3f STYLE: use UPstream::reduceAnd(), UPstream::reduceOr() instead of longer forms 2025-02-24 09:04:04 +01:00
2783e78ae2 STYLE: unify some handling of warn communicator, minor code cleanup 2025-02-24 09:03:56 +01:00
e041af9481 DEFEATURE: remove non-blocking reduce() with global request tracking
- deprecated and replaced (JAN-2023) with a version that uses
  UPstream::Request to track the request. This avoids placing a
  request on the global list and then having difficulty isolating it
  later (or having it cleared out by someone else).

ENH: UPstream::addRequest() now ignores null requests

- avoids placing useless requests on the global list
2025-02-24 09:03:47 +01:00
e8e90a8de3 ENH: support non-worldComm for Dimensioned/Geometric field functions 2025-02-24 09:03:31 +01:00
0aecb25024 ENH: update MinMax to accept multiple values for add()
- now also provide its own member data (previously inherited from
  Tuple2) to provide better isolation from future changes
2025-02-24 09:03:19 +01:00
14b2302b38 COMP: remove 'special purpose' minMaxOp (#3326)
- replace with plusOp for reductions. The old use didn't necessarily work
  well with compiler resolution in all cases.
  Simplify to use plusOp (and removed the old version).
  [Does not affect very much code...]

COMP: incorrect include ordering for GeometricFieldFunctions

- header was included after the template code

REGRESSION: combineAllGather mapped to incorrect method (81fa7d08ee)

STYLE: use UPstream::commWarn(...) setter method
2025-02-24 08:57:36 +01:00
d655c2d343 ENH: print node/topology information in human-readable form at startup 2025-02-24 08:56:25 +01:00
533d3b58f8 TUT: backwardFacingStep2D: add missing probes (fixes #3319) 2025-02-21 16:49:36 +00:00
0c282bda65 Merge branch 'pstream-adjustments' into 'develop'
Additional refinements for Pstream and minor restructuring of combine vs reduce operations

See merge request Development/openfoam!727
2025-02-19 14:47:27 +00:00
4720b61313 REGRESSION: globalIndex::gatherInplaceOp was not forwarding to gatherInplace
- regression introduced by 512ec01328 (recent develop only)
2025-02-17 13:40:44 +01:00
a66be057c2 GIT: relocate Pstream template '.C' files to '.txx' prior to further changes
- reduces confusion about 'real' code vs template code
2025-02-17 13:40:44 +01:00
eae448c7aa CONFIG: handle embedded WM_COMPILE_CONTROL flags in wmakeLnInclude
- with WM_COMPILE_CONTROL="... lnInclude-extra ..." will treat like
  'wmakeLnInclude -extra' and include all source files into the
  lnInclude/ directory
2025-02-17 13:40:44 +01:00
81fa7d08ee ENH: extend Pstream gather templates to support combine or assign operation
- eliminates nearly identical code between 'gather' and 'combineGather'

  * Normal gather updates by assigning the result of the binary operation.
  * Combine gather updates by using a binary operator that modifies
    its first parameter in-place

  By-product of this refactoring are these new variants:

      listGather(), listGatherReduce()
      mapGather(), mapGatherReduce()

  that mirror the previously existing ones

      listCombineGather(), listCombineReduce()
      mapCombineGather(), mapCombineReduce()

  except that they use the 'regular' binary operator
2025-02-17 13:40:44 +01:00
0ce5053c75 ENH: mpiGather/mpiScatter now also support in-place use
- the general OpenFOAM way of collecting data often looks like this:

      List<scalar> allValues(numProcs);
      allValues[myProc] = localValue;

      Pstream::gatherList(allValues);

      // Now possible like this

      List<scalar> allValues(numProcs);
      allValues[myProc] = localValue;

      UPstream::mpiGather(nullptr, allValues.data_bytes(), sizeof(scalar));

- adjusted Pstream::gatherList accordingly.
  Split out the manual implementations, give them new names
  (..._tree_algorithm) and make them private.

STYLE: rename UPstream::gather -> UPstream::mpiGatherv

- easier to identify and establishes the connection to the MPI call
2025-02-17 13:40:44 +01:00
eb4345ed44 ENH: misc Pstream adjustments
- additional startup guard for inter-node/local-node queries (UPstream)

- impose linear communication tree for inter-node/local-node
  communicators. Was previously defaulted to a basic tree, but more
  consistent to have flat addressing for these types of connections.

- demand-driven UPstream::interNode_offsets() for walking
  inter-node ranges instead of creating it manually in various places.

- (style): List<int> instead of labelList for internal commsStruct
  since the communication structures are tied to MPI sizes
  and not to the OpenFOAM label sizes

- reduce the number of intermediate buffer allocations within
  gatherList, scatterList.
2025-02-17 13:40:44 +01:00
15ac0bc30b BUG: GAMG: processor agglomeration. Fixes #3323 2025-02-17 12:33:14 +00:00
21f36b18e5 Merge branch 'feature-UPstream-startup' into 'develop'
enhance UPstream communicator support

See merge request Development/openfoam!725
2025-02-13 15:12:42 +00:00
3852f7c5b7 ENH: add node-based globalIndex::gather (topology-aware handling) 2025-02-13 12:31:16 +01:00
a3e1376117 ENH: combine gathers of sizes in GAMGAgglomeration
- replace two listGatherValues with listGatherValues of labelPair and
  calculate offsets from the corresponding tuple members.
2025-02-13 12:31:16 +01:00
512ec01328 ENH: rationalize some globalIndex gather routines
- replace gatherValues() with listGatherValues(), which returns the
  gathered values instead of passing by argument. This makes it less
  fragile and more convenient. Naming as per
  Pstream::listGatherValues(), but still retaining the original
  parameter order.

- rename inplace 'gather' variant as 'gatherInplace' for clarity.

- changed signature of lowest-level globalIndex::gather routines from
  List<Type> to UList<Type> for the output and removed any resizing.
  This means that the caller is responsible for ensuring that the
  receiving field is adequately sized (on master). This change allows
  potential reuse of 'work' arrays etc.

  The only code change for using this low-level gather was in
  GAMGAgglomeration.
2025-02-13 12:31:16 +01:00
3e8b0a2c73 ENH: introduce UPstream::commsStructList class
- was previously simply a List<commsStruct>, but now wrap it into a
  class so that the associated communicator index can be easily
  recovered etc.
2025-02-13 12:31:16 +01:00
831a55f1ba ENH: expand UPstream communicator support
- split/duplicate functionality

- rework inter-node/intra-node handling to allow selection of
  splitting based on 'shared' or hostname (default).

- always creates node communicators at startup:
  * commInterNode() - between nodes
  * commLocalNode() - within a node

- world-comm is now always a duplicate of MPI_COMM_WORLD to provide
  better separation from other processes.

NB:
   the inter-node comm is a slight exception to other communicators
   in that we always retain its list of (global) ranks, even if the
   local process is not in that communicator.
   This can help when constructing topology-aware patterns.

FIX: non-participating ranks still had knowledge of their potential siblings

- after create by group, the procIDs_ of non-participating ranks
  should be empty (except for the inter-node exception)
2025-02-13 12:31:12 +01:00
579f8ef7c6 ENH: respect stdout/stderr preference for "Finalising parallel run" info
STYLE: namespace qualify macros use of Info, InfoErr, ...
2025-02-13 11:28:06 +01:00
0ba4f36c60 ENH: use List containers for Pstream read/write calls
- using the List containers, and not their low-level data_bytes(),
  size_bytes() methods is more convenient and allows future
  adjustments to be centralized

ENH: trivial intptr_t wrapper for MPI_Win

STYLE: minor adjustments to mpirunDebug
2025-02-11 11:09:30 +01:00
0adc745b50 CONFIG: mpirunDebug 2025-02-10 14:27:51 +01:00
3b40dd8c29 ENH: add prescan handling of -debug-switch etc
- allows use of registered switches before startup of UPstream etc.
2025-02-10 14:27:51 +01:00
6f2fadb48f ENH: extrudeToRegionMesh: ignore zone boundaries. Fixes #3318 2025-02-10 12:01:48 +00:00
559ed6c464 SUBMODULE: update adios module (fixes compilation change) 2025-02-07 14:49:28 +01:00
0cb812f6ac Merge branch 'feature-assignable' into 'develop'
ENH: assignable: extend to pointPatchFields and fvsPatchFields

See merge request Development/openfoam!726
2025-02-05 15:47:55 +00:00
4ae8ce3f0c ENH: assignable: extend to pointPatchFields and fvsPatchFields 2025-02-05 15:47:55 +00:00
9f0d1c7121 Merge branch 'style-demand-driven-memory' into 'develop'
ENH: use unique_ptr instead of raw pointers for demand-driven data

See merge request Development/openfoam!697
2025-02-05 09:44:26 +00:00
e1d40646cc ENH: use unique_ptr instead of raw pointers for demand-driven data
- simplifies construct/destruct and any later code extensions
2025-02-05 09:43:52 +00:00
9013c9941d STYLE: mark SHA1Digest as having is_contiguous content
- send/recv List<SHA1Digest> without serialization
2025-02-04 11:21:11 +01:00
0cc5273d0a GIT: cleanup old 'removed' files (ones left only for dependency checks)
GIT: minor directory structure cleanup
2025-02-04 08:27:55 +01:00
8f83ed786c Merge branch 'c++17-updates' into 'develop'
upgrade code to use some C++17 constructs

See merge request Development/openfoam!724
2025-01-31 14:17:34 +00:00
cf2b305b4f ENH: upgrade to use some C++17 constructs
- 'if constexpr (...)'
   * instead of std::enable_if
   * terminate template recursion
   * compile-time elimination of code

- use C++14 '_t', '_v' versions,
  eg, std::is_integral_v<T> instead of std::is_integral<T>::value

- std::begin, std::end, std::void_t instead of prev stdFoam versions

- provide is_contiguous_v<..> as short form of is_contiguous<..>::value
  with the additional benefit of removing any cv qualifiers.

ENH: include is_rotational_vectorspace trait

- tests for vector-space and nComponents > 1 (ie, not sphericalTensor)

ENH: improve robustness of pTraits_.. tests by removing cv qualifiers
2025-01-31 09:51:44 +01:00
b9f05bdc01 ENH: refineMesh: user-specified coordinate system 2025-01-29 09:25:40 +00:00
0b831572f3 ENH: refineMesh: tutorial to demo directional refinement 2025-01-27 17:24:35 +00:00
6dc57a1a8b STYLE: consistent parameter naming 2025-01-27 15:41:06 +00:00
a18c15a4cf ENH: add VectorSpace component fill() method
- as per std::array and FixedList

STYLE: rename Scalar.[CH] -> scalarImpl.[CH] (these are internal files)

- added inclusion guards to protect against bad use
2025-01-27 10:31:09 +01:00
39e1eb9dc6 Merge remote-tracking branch 'origin/master' into develop 2025-01-27 09:45:18 +01:00
97c8e62fe4 COMP: disambiguate some reactingEuler/multiphaseSystem file names
- poor naming (eg, 'exponential.[CH]') within the same set of library
  files means that the lnInclude/ contents are inconsistent or partly
  meaningless (related to #2520 and !542).
  Remedied by adding model-type qualifiers to the file names.
2025-01-27 09:39:18 +01:00
297fee00f1 COMP: adjustments for nvc++ compiler
- remove unneeded -Wno-old-style flags with boost/cgal elements
- add nvc equivalent to gcc/clang -Wno-invalid-offsetof
- avoid warnings about set-but-unused variable and change of scoping

STYLE: remove wmake 'CGAL' rule
- was a transitional forward to 'cgal' rule since DEC-2020
2025-01-24 10:46:06 +00:00
c987ac228c SUBMODULE: update visualization for v2412 (with c++17 standand) 2025-01-24 11:40:32 +01:00
c77b0e14a1 MISC: extend foamGrep...Targets tools 2025-01-16 16:30:37 +01:00
77cdf22eac STYLE: cellDecomposer: print operand fields in rows 2025-01-13 11:29:44 +00:00
4fe3f55e4d BUG: Fixes bug in plicRDF interface reconstruction across cyclic boundaries (fixes #3279)
Description:
The plicRDF interface reconstruction scheme calculates a reconstructed distance
function (RDF) in all interface cells and their point neighbours.
In point neighbours to interface cells, the RDF is calculated as a weighted
average of the distances to all adjacent interface cell centres with the weight
being the inverse distance to the cell centre.
By using the zoneDistribute class written by Henning Scheufler, the required
stencil data is communicated efficiently for stencil cells living on different
sides of one or more processor patches.
Some of the data required for the RDF reconstruction are cell centre and
interface centre positions. When a stencil extends across a cyclic patch these
positions have so far not been properly transformed in OpenFOAM. This issue is
fixed by the current contribution.
The fix is done by modifying the zoneDistribute class to hold the required
information about zone cells adjacent to cyclic patches. Positions are then
communicated with a new getPosition function which replaces getValue for
position data in the reconstructedDistanceFunction and plicRDF classes.
The implementation does not change the behaviour for cells not on
a cyclic patch and should have insignificant effect on efficiency for these.
The implementation can probably be optimised in terms of efficiency for zone
cells on cyclic patches, but we note that there are generally only very few of
these (interface cells and their point neighbours on cyclic patches) and so
the potential for speedup is expected to be limited.

Current limitations:

- In parallel, the user must constrain the decomposition to preserve cyclic
patches on the same processor, for the implementation to work properly.
  - See an example here: tutorials/discInConstantFlowCyclicBCs/system/decomposeParDict
- In the case of parallel rotational cyclics that are split by the decomposition
the current bugfix does not work and therefore throws an error. This is ongoing
work and should be reported and fixed by a future patch.

For further details, please see the modified files and the comments therein:
- $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.H
- $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.C
- $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistributeI.H
- $FOAM_SRC/transportModels/geometricVoF/reconstructedDistanceFunction/reconstructedDistanceFunction.C
- $FOAM_SRC/src/transportModels/geometricVoF/reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C

Co-authored-by: David Müller <> KIT
Co-authored-by: Konstantinos Missios <> Roskilde University
Co-authored-by: Johan Roenby <> Roskilde University and STROMNING
2025-01-10 15:52:52 +00:00
cb1aa273fd SUBMODULE: update external-solver, OpenQBMM for v2412 2025-01-09 11:45:11 +01:00
2e1552dd30 Merge branch 'style-pointSmoothing' into 'develop'
STYLE: update code style for point-smoothing

See merge request Development/openfoam!723
2025-01-08 19:32:21 +00:00
d072ad0e3f STYLE: update code style for point-smoothing 2025-01-08 15:04:12 +01:00
0a99702f9e ENH: lowerCSR: ignore lowerCSR for matrix type.
Reverting 267bd1af36 since makes it hard
to run cell-based algorithm on symmetric matrix.

- might become a problem if all discretisation
becomes lowerCSR based and lower() is never
constructed ...
2025-01-08 11:53:16 +00:00
5aa40389c2 BUG: snappyHexMesh: update dependent vars. Fixes #3297 2025-01-06 17:40:45 +00:00
7904a2734f BUG: twoPhaseEuler: incorrect phase. Fixes #3295. 2025-01-06 11:30:02 +00:00
b86ba60d35 ENH: lduMatrix: pass through dictionary 2025-01-03 14:48:38 +00:00
392aa56f23 COMP: dllexport symbols for conversion/ccm (fixes #3199)
- normally mingw will export *all* symbols, but since the ADF library
  explicitly uses __declspec(dllexport) itself we must do the same
  otherwise none of our library symbols are exported and linking fails.

- update some code style for conversion/ccm
2025-01-02 12:38:22 +01:00
6520d8e061 BUG: jumpCyclic: avoid neighbourField cache. Fixes #3292
- no caching of neighbour field
- no overlap of comms so not as efficient as cyclicAMI
2024-12-31 15:50:30 +00:00
45e7c4a005 Merge branch 'develop' into 'master'
RELEASE: develop branch to master

Closes #3291, #3278, #3286, #3193, #3276, #2457, #3269, #3271, #3267, #3265, #3258, #3259, #3218, #3255, #3088, #3241, #3192, #3204, #3217, and #3191

See merge request Development/openfoam!722
2024-12-24 11:57:24 +00:00
71d3f2344a Merge branch 'openfoam-v2412-rc' into 'develop'
Openfoam v2412 rc

See merge request Development/openfoam!721
2024-12-24 11:50:24 +00:00
d3949086ce RELEASE: Updated headers to v2412 2024-12-24 11:17:31 +00:00
03b470bec0 ENH: Updated completions 2024-12-24 11:17:30 +00:00
131bbaf476 TUT: v2412: optional backwards-compatibility setting 2024-12-24 09:05:49 +00:00
f6f6ffe055 ENH: mesh: added new tutorials 2024-12-24 08:39:39 +00:00
639e87b52f BUG: extrude: handle internal faces. See #3162 2024-12-23 17:53:31 +00:00
18f73c211d TUT: cylinder2D: avoid runtime errors due to the fix b0b1d0f8b2 2024-12-23 15:33:10 +00:00
6eae520af7 BUG: pointBoundaryMesh: use correct db. Fixes #3291 2024-12-23 14:48:43 +00:00
25de821e93 COMP: snappyHexMesh: extraneous code 2024-12-23 12:03:16 +00:00
0733d1cded Merge branch 'feature-distributedTriSurfaceMesh-noFill' into 'develop'
ENH: distributedTriSurfaceMesh: improvements

See merge request Development/openfoam!720
2024-12-23 09:56:50 +00:00
4fdeae66d5 ENH: distributedTriSurfaceMesh: improvements 2024-12-23 09:56:50 +00:00
8bf1108677 Merge branch 'feature-reporting' into 'develop'
Reporting tools

See merge request Development/openfoam!716
2024-12-20 12:46:56 +00:00
cddfe0e324 TUT: motorBike - added example for foamReport 2024-12-20 09:51:42 +00:00
dffb5774d5 ENH: Added new foamReport functionObject
Replaces user-supplied keywords by run-time computed values in a text file.

Usage
    Example using system/controlDict.functions:

    foamReport1
    {
        // Mandatory entries (unmodifiable)
        type            foamReport;
        libs            (foamUtilityFunctionObjects);

        template        "<system>/myTemplate.md";

        substitutions
        {
            divSchemes1
            {
                type        dictionaryValue;
                object      fvSchemes;

                entries
                {
                    divSchemes      "divSchemes";
                }
            }
            fvSolution1
            {
                type        dictionaryValue;
                path        "<system>/fvSolution";

                entries
                {
                    solver_p        "solvers/p/solver";
                    solver_p_tol    "solvers/p/tolerance";
                    solver_p_reltol "solvers/p/relTol";
                    solver_U        "solvers/U/solver";
                    solver_U_tol    "solvers/U/tolerance";
                    solver_U_reltol "solvers/U/relTol";
                }
            }
            controlDict1
            {
                type        dictionaryValue;
                path        "<system>/controlDict";

                entries
                {
                    initial_deltaT       "deltaT";
                }
            }
            continuityErrors
            {
                type        functionObjectValue;
                functionObject continuityError1;

                entries
                {
                    cont_error_local    local;
                    cont_error_global   global;
                    cont_error_cumulative cumulative;
                }
            }
        }
2024-12-20 09:51:42 +00:00
c926f146d4 TUT: motorBike - added example for graphFunctionObject 2024-12-20 09:51:42 +00:00
82e471e045 ENH: Added new graphFunctionObject function object
Accumulates function object result values and renders into a graph in SVG format

Minimal example by using system/controlDict.functions to plot the residuals from
the solverInfo function Object:

    residualGraph
    {
        type            graphFunctionObject;
        libs            (utilityFunctionObjects);
        writeControl    writeTime;

        logScaleX       no;
        logScaleY       yes;

        xlabel          "Iteration";
        ylabel          "log10(Initial residual)";

        functions
        {
            line1
            {
                object      solverInfo1;
                entry       Ux_initial;
            }
            line2
            {
                object      solverInfo1;
                entry       Uy_initial;
            }
            line3
            {
                object      solverInfo1;
                entry       Uz_initial;
            }
            line4
            {
                object      solverInfo1;
                entry       p_initial;
            }
        }
    }
2024-12-20 09:51:42 +00:00
3bc2b5fd74 Merge branch 'feature-deck-renard' into 'develop'
INT: S-A turbulence model - added enhanced DDES shielding function

See merge request Development/openfoam!717
2024-12-19 16:18:13 +00:00
af6e5e75fd INT: S-A turbulence model - added enhanced DDES shielding function
Activated using the [optional] 'shielding' keyword having the options:

- standard: [default] same as v2406 and earlier
- ZDES2020: new option based on the reference:

    Deck, S., Renard, N. (2020).
    Towards an enhanced protection of attached boundary layers in hybrid
    RANS/LES methods.
    Journal of Computational Physics, 400, 108970.
    DOI:10.1016/j.jcp.2019.108970

Contribution from Marian Fuchs at UpstreamCFD GmbH

Integrated by Andrew Heather OpenCFD Ltd.
2024-12-19 16:17:51 +00:00
8a8c2482d7 Merge branch 'feature-cone-nozzle-with-angular-segments' into 'develop'
ENH: ConeNozzle: add injector velocity and angular-segmented disc options

See merge request Development/openfoam!719
2024-12-19 13:43:13 +00:00
29c8a77e04 ENH: ConeNozzle: add injector velocity and angular-segmented disc options 2024-12-19 11:45:00 +00:00
8e98779d70 Merge branch 'feature-schemes-zoneBlended' into 'develop'
ENH: Added new zoneBlended scheme

See merge request Development/openfoam!718
2024-12-19 10:53:12 +00:00
1eb904fc68 ENH: Added new zoneBlended scheme
Multi-faceZone based blending differencing scheme.

Schemes are set in dictonary format according to:

    divSchemes
    {
        .
        .
        div(phi,U)      Gauss zoneBlended
        {
            default         defaultScheme;
            faceZone1       scheme1;
            faceZone2       scheme2;
            ...
            faceZoneN       schemeN;
        }
        .
        .
    }

The default entry specifies the background scheme; additional schemes
can be set per faceZone, e.g. scheme1 is applied to facZone1,
scheme2 is applied to facZone2 etc.
2024-12-19 10:52:43 +00:00
45ee161f23 Merge branch 'feature-film-separation-models' into 'develop'
ENH: regionFaModels: new filmSeparation models for finite-area framework

See merge request Development/openfoam!714
2024-12-19 10:09:57 +00:00
1e6d8d73a0 BUG: OwenRyley: correct the modelling constant (fixes #3278) 2024-12-19 10:09:46 +00:00
51d1050339 ENH: regionFaModels: new filmSeparation models for finite-area framework 2024-12-19 10:09:46 +00:00
83b9c60a88 Merge branch 'fa-parallel-consistency-improvements' into 'develop'
ENH: processorFaPatch: use internal-edge algos for processor edges to ensure parallel consistency

See merge request Development/openfoam!708
2024-12-19 10:09:31 +00:00
2d731e1af3 ENH: processorFaPatch: use internal-edge algos for processor edges to ensure parallel consistency
- The edgeInterpolation::makeCorrectionVectors() disables the non-orthogonality
correction if the calculated non-orthogonality coefficient is below 0.1.
However, this activation routine only considers internal edges, and excludes
any processor edges, resulting in inconsistent parallel calculations. This
routine is removed.
- Fatal errors are replaced with zero-valued fields for non-orthogonality-
and skewness-correction routines.
2024-12-19 10:09:16 +00:00
528ea551ec Merge branch 'feature-write-objects' into 'develop'
ENH: writeObjects: add flag to report registered objects

See merge request Development/openfoam!705
2024-12-18 17:45:47 +00:00
c77cc498d7 ENH: writeObjects: add flag to report registered objects
Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2024-12-18 17:45:15 +00:00
5d0058bc85 STYLE: rename 2024-12-18 17:08:58 +00:00
f265fcc8d0 Merge branch 'feature-moving_source' into 'develop'
Feature moving source

See merge request Development/openfoam!693
2024-12-18 17:05:54 +00:00
e33fb8d0db Feature moving source 2024-12-18 17:05:54 +00:00
3d35bb920f COMP: plugins: updated cfMesh 2024-12-18 15:48:32 +00:00
4423efd313 ENH: fanFvPatchField - refactored; added flowRate option
The basis of the table is specified according to the mode:

- velocity: deltap = F(velocity per face) \[DEFAULT\]
- uniformVelocity: deltap = F(patch area-averaged velocity)
- volumeFlowRate:  deltap = F(patch volume flow rate)
- nonDimensional:  non-dim deltap = F(non-dim volume flow rate)

Example of the boundary condition specification:

    <patchName>
    {
        type            fan;
        patchType       cyclic;
        jumpTable       csvFile;
        mode            velocity; // New entry

        jumpTableCoeffs
        {
            nHeaderLine     1;
            refColumn       0;
            componentColumns 1(1);
            separator       ",";
            mergeSeparators no;
            file            "<constant>/UvsPressure";
        }
        value           uniform 0;
    }
2024-12-18 15:28:11 +00:00
b0b1d0f8b2 ENH: fieldAverage - allow averaging on internal fields - see #3242
BUG: fieldAverage - handle duplicate entries
2024-12-18 15:11:40 +00:00
ed99546b8a ENH: tabulated6DoFMotion: add optional linear interpolation scheme 2024-12-18 15:01:18 +00:00
a2b3187188 ENH: rho/psiReactionThermos: add PengRobinsonGas to the thermos 2024-12-18 13:32:02 +00:00
30d29f2303 COMP: fix SPDP compilation (fixes #3286) 2024-12-18 12:15:48 +00:00
207806e55d COMP: explicitly declare copy construct for (point) symmetry field
- fixes -Wdeprecated-copy complaints
2024-12-18 10:09:49 +01:00
da09e9203f ENH: extraneous file 2024-12-17 18:22:42 +00:00
57b250963d ENH: damBreakLeakage: showcasing cyclicACMI with scale factor
scale factor is
- coded
- time varying
- spatial varying
2024-12-16 16:46:25 +00:00
ea4508c079 ENH: polyDualMesh: demonstrate cellDecomposer,polyDualMesh 2024-12-16 12:24:20 +00:00
1462a5effa BUG: decomposePar: only write pointBoundaryMesh if needed 2024-12-16 12:14:02 +00:00
bd5d32035e CONFIG: set API level to 2412 (initial pre-release state)
- README updated to v2412, project-version updated to v2412
2024-12-16 13:00:09 +01:00
d4d2e4af3d DEFEATURE: remove obsolete optionalData container
- unused and superseded by c++17 std::optional
2024-12-16 12:57:42 +01:00
8a4e3526c3 ENH: improve parsing robustness for foamInstallationTest (#3263) 2024-12-16 12:37:18 +01:00
8340317a46 COMP: missing dynamicMesh,dynamicFvMesh linkage for simpleFoam (#3269) 2024-12-16 10:49:29 +01:00
e64d93ffdb COMP: support compilation with CGAL-6.0 (#3234)
- CGAL-6 uses c++17 std::optional, std::variant instead of boost versions
2024-12-16 10:47:49 +01:00
4c21ad3d3f Merge remote-tracking branch 'origin/master' into develop 2024-12-16 10:07:54 +01:00
011f730309 COMP: SPDP compilation 2024-12-15 11:53:03 +00:00
009faad912 ENH: Test-GAMG: not normalise agglomeration unless specified 2024-12-14 16:58:28 +00:00
462fd687d2 BUG: reconstructParMesh: support for no finite-area. See #3276 2024-12-14 16:30:59 +00:00
1401ce02b5 ENH: badMove: missing directory creation 2024-12-12 16:58:49 +00:00
15059f78b8 Merge branch 'issue-3193-READ_IF_PRESENT' into 'develop'
BUG: READ_IF_PRESENT: return false if not read. Fixes #3193

See merge request Development/openfoam!698
2024-12-12 16:21:59 +00:00
aaaa80589f BUG: READ_IF_PRESENT: return false if not read. Fixes #3193 2024-12-12 16:21:59 +00:00
ab30b0301c Merge branch 'feature-pointMeshIO-shm-bufferlayers' into 'develop'
ENH: snappyHexMesh: add buffer layers before snapping

See merge request Development/openfoam!715
2024-12-12 16:13:32 +00:00
de5d34787c ENH: snappyHexMesh: add buffer layers before snapping 2024-12-12 16:13:32 +00:00
e7cf8a1d59 COMP: missing include. 2024-12-12 15:08:34 +00:00
0a363f2885 BUG: truncated error message when throwing (fixes #3201)
- only affected v2406. Root cause is #3281
2024-12-12 13:14:36 +01:00
44f7a7268a CONFIG: update c++ standard to c++17. 2024-12-12 11:56:39 +00:00
59c74e53ff ENH: objectRegistry - allow recurse into time db 2024-12-11 11:13:46 +00:00
bba45b3022 ENH: caseInfo function object - store data in IOdictionary for external lookup 2024-12-11 11:13:46 +00:00
6c60b19c4a ENH: caseInfo function object - set file extension to output file type 2024-12-11 11:12:46 +00:00
697e6147f4 ENH: writeFile - enable setting of file extension 2024-12-11 11:12:45 +00:00
c37a3f530d Merge branch 'feature-reconstructParMesh-finiteArea' into 'develop'
ENH: reconstructParMesh: support for finite-area. Fixes #3276

See merge request Development/openfoam!711
2024-12-11 09:26:01 +00:00
429d8d0522 ENH: reconstructParMesh: support for finite-area. Fixes #3276 2024-12-11 09:22:44 +00:00
3e80552244 BUG: isoAdvection: conserve volume of fluid across cyclic patches (fixes #2457)
Co-authored-by: David Müller <>
Co-authored-by: Konstantinos Missios <>
2024-12-10 14:32:04 +00:00
a797ac8193 COMP: fix typos in construct ispanstream from std::string_view (#3234) 2024-12-10 15:23:02 +01:00
1cb61b90e7 COMP: missing -pthread flag for intel icx compiler (fixes #3251) 2024-12-10 13:55:54 +01:00
52b530fb82 COMP: missing tmp dereference (fixes #3277)
- only affected v2406
2024-12-10 12:26:46 +01:00
96660cdfac Merge branch 'feature-fusedDiscretisation' into 'develop'
ENH: fused: 'fused' variants of explicit discretisation

See merge request Development/openfoam!712
2024-12-10 09:31:53 +00:00
e65d720164 ENH: fused: 'fused' variants of explicit discretisation 2024-12-10 09:31:53 +00:00
ff6ef5bdf8 Merge branch 'feature-csr-MERGE' into 'develop'
ENH: CSR: cell-cell addressing

See merge request Development/openfoam!713
2024-12-10 09:30:32 +00:00
267bd1af36 ENH: CSR: cell-cell addressing 2024-12-10 09:30:06 +00:00
b9335f4989 Merge branch 'fix-opt-convergence-criteria' into 'master'
BUG: optimisation convergence criteria misbehave w/o a line search (fixes #3268)

Closes #3268

See merge request Development/openfoam!709
2024-12-10 09:28:20 +00:00
23f8480af6 Merge branch 'adjoint-update-pre2412' into 'develop'
ENH: updates in the adjoint library

See merge request Development/openfoam!710
2024-12-10 09:27:50 +00:00
d061be643e TUT: change 'normalize' to 'normalise' in optimisation tutorials 2024-12-10 09:27:24 +00:00
8d0f4eb87a TUT: additional topology optimisation tutorials
- 1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval: showcases the
  initialization of the design variables using topoSet and setFields
- 3DBox/losses-mass-uniformity-SQP-extraVars: showcases the use of the
  so-called 'extra variables' in the QP problem which relax it,
  allowing its solution even if there is no feasible one
2024-12-10 09:27:24 +00:00
f90c7b17fc ENH: Allow setting the initial values of the design variables
in topology optimisation, through a volScalarfield named alpha.
The order of precedence is (top to bottom):
- values read from time/uniform/topOVars (used also for continuation)
- values read from 0/alpha (can be easily set with topoSet + setFields)
- uniform zero
2024-12-10 09:27:24 +00:00
9c5ce8e4f2 ENH: compatibility read for normalise in objective 2024-12-10 09:27:24 +00:00
8d6efa9f1b ENH: added the option to disable damping in ISQP
Can accelerate convergence in cases without constraints
2024-12-10 09:27:24 +00:00
91fb7456a5 ENH: changed the c coefficients in ISQP and MMA
to Function1, to be able to change their value at runtime.  Useful when
constraints are not feasible at the beginning of the optimisation
(frequent in topology optimisation) and we want to leave some room to
the optimiser to not focus heavily on them at the beginning, but respect
them during the last optimisation cycles.

Has a big impact, especially in MMA, when dealing with volume
constraints in topology optimisation.
2024-12-10 09:27:24 +00:00
3ab7d6a088 ENH: outletMappedUniformInletHeatAddition: add Function1-type Q input 2024-12-09 09:45:43 +00:00
a445dd10e1 BUG: simpleFoam: side-effect of reading dynamicMeshDict. See #3269 2024-12-05 09:08:54 +00:00
f0f915b932 BUG: simpleFoam: side-effect of reading dynamicMeshDict. Fixes #3269 2024-12-04 09:40:31 +00:00
86fda799ec BUG: decomposePar: support finiteArea. Fixes #3271 2024-12-02 19:11:53 +00:00
e45b26eaf0 ENH: simpleFoam: add dynamicFvMesh. Fixes #3269 2024-11-28 11:58:48 +00:00
6ad75fe141 Merge branch 'issue-3238-nbx-failure' into 'develop'
ENH: more unique tags to avoid overlapping comms

See merge request Development/openfoam!704
2024-11-27 12:33:29 +00:00
96db337a99 ENH: more unique tags to avoid overlapping comms 2024-11-27 12:33:28 +00:00
0fa5062c7d ENH: GAMG: update some fvSolution for updateInterval settings. See !707 2024-11-27 11:07:11 +00:00
3e00e05e33 Merge branch 'feature-updateInterval' into 'develop'
ENH: GAMGAgglomeration: optional updateInterval for moving mesh cases.

See merge request Development/openfoam!707
2024-11-25 13:38:01 +00:00
e54791019a ENH: GAMGAgglomeration: optional updateInterval for moving mesh cases. 2024-11-25 13:38:00 +00:00
8a508910ba BUG: optimisation convergence criteria misbehave w/o a line search (fixes #3268)
When using the (optional) convergence criteria for the optimisation
loop, adherence to them is checked in the postUpdate phase of the update
of the design variables. If a line search is used, this means that the
flow equations have been solved anew using the new design variables and
the objective reduction check makes sense. If, however, no line search
is used, the objective reduction check happens immediately after the
update of the design variables and before re-solving the flow equations,
giving a reduction in the objective function and terminating the
optimisation loop prematurely.

Solved by calling the convergence check directly after the solution of
the flow equations, in case of a fixedStepUpdate
2024-11-22 18:37:53 +02:00
96ccae977e ENH: surfaceFeatureExtract: do simple non-manifold. Fixes #3267 2024-11-21 13:36:46 +00:00
19601c0976 STYLE: consistent naming 2024-11-20 20:57:47 +00:00
3fb8f5ed69 BUG: thermalBaffle: allow for offset. See also #3260
- extrudePatchMesh holding reference to original patches
- offset not compensated for
2024-11-18 15:57:27 +00:00
f5310ca48c ENH: cyclicAMI-topoChange: allow restart. Fixes #3265 2024-11-18 14:41:46 +00:00
7f1120f6ed BUG: solarCalculator: time wraparound. Fixes #3258 2024-11-14 16:45:49 +00:00
96ada1dd54 COMP: Intel: compilation rule. Fixes #3259 2024-11-14 11:07:39 +00:00
6b08c346f1 Merge branch 'feature-cornerWeights' into 'develop'
ENH: wallFunctions: use cornerWeights linear. Fixes #3218.

See merge request Development/openfoam!703
2024-11-13 14:31:12 +00:00
f321fc73ef ENH: wallFunctions: use cornerWeights linear. Fixes #3218. 2024-11-13 14:29:11 +00:00
791796c67f BUG: cellReduce: use boundary values. Fixes #3255 2024-11-07 15:55:09 +00:00
b73de97f97 ENH: createPatch: demo case 2024-11-06 20:25:39 +00:00
cfdc2330eb ENH: polyBoundaryMesh: use patchID() if available. See #3233 2024-11-04 16:16:05 +00:00
cc580fc108 STYLE: limitFields: correct output for multiple variables
Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2024-10-25 10:45:59 +01:00
77ba7ca4d4 Merge branch 'feature-createPatch-cyclicACMI' into 'develop'
ENH: createPatch: allow duplicating face (for ACMI)

See merge request Development/openfoam!702
2024-10-24 14:51:01 +00:00
ceb2151094 ENH: createPatch: allow duplicating face (for ACMI) 2024-10-24 14:04:55 +00:00
e4f4c73b98 Merge branch 'feature-surface-courant-number' into 'develop'
ENH: surfaceCourantNumber: new finite-area function object

See merge request Development/openfoam!706
2024-10-23 15:32:31 +00:00
1a6f0f997a ENH: surfaceCourantNumber: new finite-area function object
Computes the surface Courant number field at finite-area face centres.
Note: the calculation is performed at face centers, not edge centers.
2024-10-23 15:30:13 +00:00
4f1e7f6343 ENH: DILUPreconditioner: Speedup. Fixes #3088 2024-10-23 11:20:28 +01:00
53052a5eb3 BUG: extrudeToRegionMesh: incorrect bounding box. Fixes #3241 2024-10-21 12:57:43 +01:00
fe0b71280e ENH: octree: avoid copy 2024-10-16 15:05:32 +01:00
5836d280b9 ENH: fvMatrix: avoid whichPatch. See #3233 2024-10-03 18:22:42 +01:00
cd2d81b79a ENH: extrudePatchMesh: support for features. See #2103
Optional 'featureAngle' entry to disable extrusion on
sharp corners
2024-10-03 16:06:03 +01:00
4df27f8be6 GIT: extraneous files. Fixes #3192 2024-10-03 10:19:47 +01:00
4167aababe ENH: phaseModels: add pureMovingSolidPhaseModel 2024-09-20 10:25:33 +01:00
d6b8b49da8 STYLE: mapFields, ensightWrite: print operand fields in rows 2024-09-19 16:29:17 +01:00
a9cc444b79 ENH: switch: move to OptimisationSwitches. See #3215 2024-09-18 14:39:17 +01:00
782f22feb8 ENH: continuity: avoid excess evaluations. See #3225 2024-09-18 14:01:26 +01:00
13146891fe Merge branch 'issue-3215-pointConnectedCells' into 'develop'
Issue 3215 point connected cells

See merge request Development/openfoam!700
2024-09-18 11:07:42 +00:00
d72f51ac23 Issue 3215 point connected cells 2024-09-18 11:07:41 +00:00
1d6396dd3f Merge branch 'feature-solver-function-objects-solution-control' into 'develop'
ENH: solver function objects: add outer-loop convergence checks

See merge request Development/openfoam!699
2024-09-06 10:02:29 +00:00
0ff5eb5687 STYLE: scalarTransport/energyTransport: modernise the code
- Remove redundant copy ctor and assignment operator (already deleted in base class)
- Remove unused header files
- Use default destructor
- Reorder member variables
2024-09-06 10:01:43 +00:00
559f13d450 DOC: scalarTransport/energyTransport: improve header file documentation 2024-09-06 10:01:43 +00:00
fd77d7d9b5 INT: solver function objects: add outer-loop convergence checks
Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2024-09-06 10:01:43 +00:00
050f27910e ENH: advectionDiffusionPatch: default mesh checking. Fixes #3204 2024-09-04 09:34:25 +01:00
483e9892ee BUG: blockMesh: incorrect sqrt. Fixes #3217 2024-09-04 09:31:23 +01:00
d6df40a5e2 BUG: wall distance: select wall-point connected cells. See #3215 2024-09-03 09:55:02 +01:00
60e5f0e0ae BUG: wall distance: select wall-point connected cells. See #3215 2024-08-22 16:50:51 +01:00
14fcd08f86 DOC: symplectic: add some comment 2024-08-22 16:23:43 +01:00
f72670edff BUG: overset: out-of-date lduAddressing. Fixes #3204
Was triggering update of cell-cell stencil (=meshObject) without
corresponding rebuilding of lduAddressing (= oversetFvMeshBase storage).
- added clearOut to oversetFvMesh(Base)
- added call to clearOut when rebuilding stencil
2024-08-19 15:49:21 +01:00
aacd99c030 ENH: transformPoints: added comment. See #3206 2024-07-31 14:40:01 +01:00
303c3135aa COMP: shm: missing bit. parallel consistency. See #2331 2024-07-18 09:40:11 +01:00
f97f715f66 ENH: shm: parallel consistency. See #2331 2024-07-17 09:14:02 +01:00
bb8f7799d9 ENH: vtkUnstructuredToFoam: construct&write fields. See #3195. 2024-07-10 15:20:54 +01:00
7ec78f6d6d BUG: interpolation: handling of bounds. Fixes #3191 2024-07-04 15:53:06 +01:00
dce009cef1 ENH: make Nastran PLOAD2,PLOAD4 field mappings optional
- PLOAD2 is a reasonable default and PLOAD4 output
  (currently misused for vectors/tensors) is the exception.

- simplify the specification by using optional PLOAD4, PLOAD2 wordRes
  lists to act as allow/deny selectors. In the regular case won't need
  to specify anything or perhaps only the PLOAD4 list.

ENH: atomic creation of Nastran files

FIX: inconsistent Nastran surface output format

- use FREE format by default. Previously had an odd mix of SHORT
  format when created without options and LONG format (as default)
  when created with format options.
2024-06-26 16:53:13 +02:00
d8d3e34d5c COMP: fix dangling references (gcc13+: -Wdangling-reference) 2024-06-26 16:53:05 +02:00
d300fab63a ENH: reduce some allocations in rawTopoChangerFvMesh
- cache and reuse the zero field

STYLE: use templated form of objectRegistry::names<..>
2024-06-26 16:51:12 +02:00
69b2a667c9 BUG: Nastran reading of free format truncates last field (fixes #3189)
- the old logic relied on the presence/absence of a comma to decide
  whether to parse as fixed or free format. This logic is faulty when
  handling the final (trailing) entry and will generally lead to the
  last field being truncated when read in.
  Now the caller decides on fixed vs free.

FIX: inconsistent Nastran surface output format

- use FREE format by default. Previously had an odd mix of SHORT
  format when created without options and LONG format (as default)
  when created with format options.
2024-06-26 16:26:37 +02:00
be01ca7888 Merge branch 'develop' into 'master'
OpenFOAM v2406

Closes #3183, #3149, #2588, #3177, #3146, #3161, #3128, #3163, #3175, #3171, #3115, #3144, #3137, #3138, #3133, #3125, #3126, #3123, #3119, #3105, #3106, #2024, #3102, #3082, #3090, #3089, #3085, and #3077

See merge request Development/openfoam!695
2024-06-25 13:11:36 +00:00
630d60de3b RELEASE: Updated headers to v2406 2024-06-24 09:58:36 +01:00
2390ebbf7e RELEASE: Updated completions 2024-06-24 09:58:35 +01:00
510d9fc5a5 DOC: doxygen - activate treeview 2024-06-24 09:58:35 +01:00
c6399ca920 CONFIG: update third-party compiler versions 2024-06-20 12:52:06 +02:00
cdc1a34bab CONFIG: add top-level Allwmake-modules, Allwmake-plugins scripts 2024-06-19 15:00:51 +02:00
fa49ae252b COMP: fix createViewFactors linkage errors (mingw, lld linker) 2024-06-19 14:31:46 +02:00
0b9391ff3b COMP: avoid remove dangling reference (finiteArea) 2024-06-19 12:14:21 +02:00
7bdc000865 COMP: corrected pointer to temporary 2024-06-19 11:00:15 +01:00
ac099d82eb Merge remote-tracking branch 'origin/master' into develop 2024-06-18 17:09:58 +01:00
fb96927275 Merge branch 'feature-createViewFactors' into 'develop'
ENH: Added new createViewFactors utility

See merge request Development/openfoam!692
2024-06-18 15:30:22 +00:00
ab5f6dbf41 ENH: Added new createViewFactors utility
Creates view factors for the view factor radiation model.

User-selectable models:

- raySearchEngine: model to generate rays, i.e. face-to-face connections
- viewFactorModel: model to compute the view factors

For visualisation, use:

- Write the view factors as a volume field

    writeViewFactors    yes;

- Write the rays using OBJ format:

    writeRays       yes; // default = no

Participating patches must be in the \c vewFactorWall group, i.e. using the
\c inGroups entry of the "\<case\>/polyMesh/boundary" file.

\verbatim
myPatch
{
    type            wall;
    inGroups        2(wall viewFactorWall);
    ...
}
\endverbatim

Reads:

- <constant>/viewFactorsDict : main controls
- <constant>/finalAgglom : agglomeration addressing (from faceAgglomerate)

Generates:

- <constant>/F : view factors (matrix)
- <constant>/mapDist : map used for parallel running
- <constant>/globalFaceFaces : face addressing
2024-06-18 16:27:20 +01:00
7c45670c8b SUBMODULE: update visualization
- bugfix for parallel gather of patch values with serial rendering
2024-06-18 10:32:27 +02:00
530a5192ca Merge branch 'fix-adjointRotatingWall-sens' into 'master'
BUG: adjointRotatingWallVelocity causes sensitivities to crash. Fixes #3180

Closes #3180

See merge request Development/openfoam!690
2024-06-11 10:39:58 +00:00
2ef96e9e43 BUG: adjointRotatingWallVelocity causes sensitivities to crash. Fixes #3180 2024-06-10 14:52:58 +03:00
51a34f5abc BUG: ThermoSurfaceFilm - corrected FA field caching for Cp. Fixes #3017 2024-06-07 20:47:35 +01:00
b2532e7769 BUG: extractEulerianParticles - corrected patch index. Fixes #2707 2024-06-07 12:26:03 +01:00
790de0f98e BUG: gltf corrections. Fixes #3179
- corrected scalar bounds (label->scalar), field limit initialisation
- corrected alpha field lookup
- updated header documentation
2024-06-07 12:25:32 +01:00
12232 changed files with 153170 additions and 43728 deletions

3
.gitignore vendored
View File

@ -11,6 +11,7 @@
# File-browser settings - anywhere
.directory
.DS_Store # OSX app store
# Backup/recovery versions - anywhere
.#*
@ -38,6 +39,8 @@ linux*Gcc*/
linux*Icc*/
solaris*Gcc*/
SunOS*Gcc*/
darwin*Clang*/
darwin*Gcc*/
platforms/
# Top-level build directories

View File

@ -49,7 +49,7 @@
<!--
Providing details of your set-up can help us identify any issues, e.g.
OpenFOAM version : v2406|v2312|v2306|v2212|v2206 etc
OpenFOAM version : v2506|v2412|v2406|v2312|v2306 etc
Operating system : ubuntu|openSUSE|RedHat etc
Hardware info : any info that may help?
Compiler : gcc|clang etc

View File

@ -68,19 +68,34 @@ src/Allwmake $targetType $*
# OpenFOAM applications
applications/Allwmake $targetType $*
#------------------------------------------------------------------------------
# Additional components
# Additional components/modules
case "$FOAM_MODULE_PREFIX" in
(false | none)
echo ========================================
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
echo "Can be built separately:"
echo
echo " ./Allwmake-modules -prefix=..."
echo
echo ========================================
echo
;;
(*)
# Use wmake -all instead of Allwmake to allow for overrides
( cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all )
echo ========================================
echo "The optional plugins can be built separately:"
echo
echo " ./Allwmake-plugins -prefix=..."
echo
echo ========================================
echo
esac
#------------------------------------------------------------------------------
# Count files in given directory. Ignore "Test-*" binaries.
_foamCountDirEntries()
{

39
Allwmake-modules Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
set -- -all="${0##*/}" "$@" # Execute this instead of ./Allwmake
# Run from OPENFOAM top-level directory only
wmake -check-dir "$WM_PROJECT_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments ]
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments || \
echo "Argument parse error"
else
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
echo " Check your OpenFOAM environment and installation"
exit 1
fi
#------------------------------------------------------------------------------
# Additional components
case "$FOAM_MODULE_PREFIX" in
(false | none)
echo ========================================
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
echo "Can be built separately:"
echo
echo " ./Allwmake-modules -prefix=..."
echo
echo ========================================
echo
;;
(*)
# Use wmake -all instead of Allwmake to allow for overrides
( cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all $* )
esac
#------------------------------------------------------------------------------

39
Allwmake-plugins Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
set -- -all="${0##*/}" "$@" # Execute this instead of ./Allwmake
# Run from OPENFOAM top-level directory only
wmake -check-dir "$WM_PROJECT_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments ]
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments || \
echo "Argument parse error"
else
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
echo " Check your OpenFOAM environment and installation"
exit 1
fi
#------------------------------------------------------------------------------
# Additional components
case "$FOAM_MODULE_PREFIX" in
(false | none)
echo ========================================
echo "OpenFOAM plugins disabled (prefix=${FOAM_MODULE_PREFIX})"
echo "Can be built separately:"
echo
echo " ./Allwmake-plugins -prefix=..."
echo
echo ========================================
echo
;;
(*)
# Use wmake -all instead of Allwmake to allow for overrides
( cd "$WM_PROJECT_DIR/plugins" 2>/dev/null && wmake -all $* )
esac
#------------------------------------------------------------------------------

View File

@ -27,6 +27,7 @@ It is likely incomplete...
- Bernhard Gschaider
- Andrew Heather
- David Hill
- Crist<73>bal Ib<49><62>ez
- Yoshiaki Inoue
- Mattijs Janssens
- Andrew Jackson

View File

@ -1,2 +1,2 @@
api=2406
api=2507
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-v2406 version:
For example, for the OpenFOAM-v2506 version:
```
source /installation/path/OpenFOAM-v2406/etc/bashrc
source /installation/path/OpenFOAM-v2506/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-v2406
\-- ThirdParty-v2406
|-- OpenFOAM-v2506
\-- ThirdParty-v2506
```
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-sandbox2406, etc..
directory name, e.g. openfoam-sandbox2412, 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*, `v2406-myCustom`,
* allows for an updated value of VERSION, *eg*, `v2506-myCustom`,
without requiring a renamed ThirdParty. The API value would still
be `2406` and the original `ThirdParty-v2406/` would be found.
be `2412` and the original `ThirdParty-v2506/` would be found.
4. PREFIX/ThirdParty-API
* same as the previous example, but using an unadorned API value.
5. PREFIX/ThirdParty-common

View File

@ -13,7 +13,13 @@ volVectorField U
);
// Initialise the velocity internal field to zero
U = dimensionedVector(U.dimensions(), Zero);
// Note: explicitly bypass evaluation of contraint patch overrides
// (e.g. swirlFanVelocity might lookup phi,rho)
//U = Zero;
{
U.internalFieldRef() = Zero;
U.boundaryFieldRef() = Zero;
}
surfaceScalarField phi
(

View File

@ -36,11 +36,13 @@ Description
if (adjustTimeStep)
{
scalar maxDeltaTFact = maxCo/(CoNum + StCoNum + SMALL);
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
const scalar deltaTFact =
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
runTime.setDeltaT
(
min
Foam::min
(
deltaTFact*runTime.deltaTValue(),
maxDeltaT

View File

@ -1,5 +1,6 @@
if (adjustTimeStep)
{
runTime.setDeltaT(min(dtChem, maxDeltaT));
runTime.setDeltaT(Foam::min(dtChem, maxDeltaT));
Info<< "deltaT = " << runTime.deltaTValue() << endl;
}

View File

@ -54,9 +54,18 @@ if (adjustTimeStep)
runTime.setDeltaT
(
min
Foam::min
(
dt0*min(min(TFactorFluid, min(TFactorFilm, TFactorSolid)), 1.2),
dt0
* Foam::min
(
Foam::min
(
TFactorFluid,
Foam::min(TFactorFilm, TFactorSolid)
),
1.2
),
maxDeltaT
)
);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020,2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -57,10 +57,22 @@ License
// (relative to reference value)
scalar alphaY(pimpleDict.getOrDefault<scalar>("alphaY", 1.0));
Info<< "Time scales min/max:" << endl;
// Cache old reciprocal time scale field
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// The old reciprocal time scale field, with any damping factor
tmp<volScalarField> rDeltaT0_damped;
// Calculate damped value before applying any other changes
if
(
rDeltaTDampingCoeff < 1
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
{
rDeltaT0_damped = (scalar(1) - rDeltaTDampingCoeff)*(rDeltaT);
}
Info<< "Time scales min/max:" << endl;
// Flow time scale
{
@ -70,12 +82,14 @@ License
/((2*maxCo)*mesh.V()*rho())
);
// Limit the largest time scale
rDeltaT.max(1/maxDeltaT);
// Limit the largest time scale (=> smallest reciprocal time)
rDeltaT.clamp_min(1/maxDeltaT);
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< " Flow = "
<< 1/gMax(rDeltaT.primitiveField()) << ", "
<< 1/gMin(rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}
// Heat release rate time scale
@ -86,11 +100,13 @@ License
mag(Qdot)/(alphaTemp*rho*thermo.Cp()*T)
);
Info<< " Temperature = "
<< 1/(gMax(rDeltaTT.field()) + VSMALL) << ", "
<< 1/(gMin(rDeltaTT.field()) + VSMALL) << endl;
rDeltaT.primitiveFieldRef().clamp_min(rDeltaTT);
rDeltaT.ref() = max(rDeltaT(), rDeltaTT);
auto limits = gMinMax(rDeltaTT.field());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< " Temperature = "
<< limits.min() << ", " << limits.max() << endl;
}
// Reaction rate time scale
@ -138,11 +154,13 @@ License
if (foundY)
{
Info<< " Composition = "
<< 1/(gMax(rDeltaTY.field()) + VSMALL) << ", "
<< 1/(gMin(rDeltaTY.field()) + VSMALL) << endl;
rDeltaT.primitiveFieldRef().clamp_min(rDeltaTY);
rDeltaT.ref() = max(rDeltaT(), rDeltaTY);
auto limits = gMinMax(rDeltaTY.field());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< " Composition = "
<< limits.min() << ", " << limits.max() << endl;
}
else
{
@ -161,28 +179,22 @@ License
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
}
// Limit rate of change of time scale
// Limit rate of change of time scale (=> smallest reciprocal time)
// - reduce as much as required
// - only increase at a fraction of old time scale
if
(
rDeltaTDampingCoeff < 1
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
if (rDeltaT0_damped)
{
rDeltaT = max
(
rDeltaT,
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
);
rDeltaT.clamp_min(rDeltaT0_damped());
}
// Update tho boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
auto limits = gMinMax(rDeltaT.field());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< " Overall = "
<< 1/gMax(rDeltaT.primitiveField())
<< ", " << 1/gMin(rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020,2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -106,7 +106,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
if (!this->readValueEntry(dict))
{
// Fallback: set to the internal field
fvPatchField<scalar>::patchInternalField(*this);
this->extrapolateInternal();
}
refValue() = *this;

View File

@ -23,7 +23,11 @@
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
{
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Flow time scale min/max = "
<< limits.min() << ", " << limits.max() << endl;
}
}

View File

@ -52,18 +52,26 @@
// Update the boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
{
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Flow time scale min/max = "
<< limits.min() << ", " << limits.max() << endl;
}
if (rDeltaTSmoothingCoeff < 1.0)
{
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
}
Info<< "Smoothed flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
{
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Smoothed flow time scale min/max = "
<< limits.min() << ", " << limits.max() << endl;
}
// Limit rate of change of time scale
// - reduce as much as required
@ -78,8 +86,10 @@
rDeltaT0
*max(rDeltaT/rDeltaT0, scalar(1) - rDeltaTDampingCoeff);
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Damped flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}
}

View File

@ -1,7 +1,7 @@
scalar CoNum = -GREAT;
forAll(fluidRegions, regionI)
{
CoNum = max
CoNum = Foam::max
(
compressibleCourantNo
(

View File

@ -78,8 +78,8 @@
}
rho = thermo.rho();
rho = max(rho, rhoMin[i]);
rho = min(rho, rhoMax[i]);
rho.clamp_range(rhoMin[i], rhoMax[i]);
rho.relax();
Info<< "Min/max rho:" << min(rho).value() << ' '

View File

@ -387,15 +387,18 @@ updateCoeffs()
{
scalar Q = gSum(kappa(Tp)*patch().magSf()*snGrad());
Info<< "T solid : " << nl << endl;
auto limits = gMinMax(Tp);
auto avg = gAverage(Tp);
Info
<< " heat transfer rate from solid:" << Q
<< " walltemperature "
<< " min:" << gMin(Tp)
<< " max:" << gMax(Tp)
<< " avg:" << gAverage(Tp) << nl
<< endl;
Info<< "T solid : " << nl << endl;
Info
<< " heat transfer rate from solid:" << Q
<< " walltemperature "
<< " min:" << limits.min()
<< " max:" << limits.max()
<< " avg:" << avg << nl
<< endl;
}
}
else if (regionType_ == fluid)
@ -445,10 +448,16 @@ updateCoeffs()
scalarField qLiq((Tp - Tc)*KdeltaLiq);
scalarField qVap((Tp - Tv.patchInternalField())*KdeltaVap);
auto infoT = gMinMax(Tp);
auto avgT = gAverage(Tp);
auto infoLiq = gMinMax(qLiq);
auto infoVap = gMinMax(qVap);
Info<< "T flow : " << nl << endl;
Info<< " qLiq: " << gMin(qLiq) << " - " << gMax(qLiq) << endl;
Info<< " qVap: " << gMin(qVap) << " - " << gMax(qVap) << endl;
Info<< " qLiq: " << infoLiq.min() << " - " << infoLiq.max() << nl
<< " qVap: " << infoVap.min() << " - " << infoVap.max() << nl;
scalar QLiq = gSum(qLiq*patch().magSf());
scalar QVap = gSum(qVap*patch().magSf());
@ -457,9 +466,9 @@ updateCoeffs()
Info<< " Heat transfer to Vap: " << QVap << endl;
Info<< " walltemperature "
<< " min:" << gMin(Tp)
<< " max:" << gMax(Tp)
<< " avg:" << gAverage(Tp)
<< " min:" << infoT.min()
<< " max:" << infoT.max()
<< " avg:" << avgT
<< endl;
}
}

View File

@ -31,7 +31,7 @@
);
CoNum =
scalar regionCoNum =
0.5*gMax
(
sumPhi/fluidRegions[regioni].V().field()
@ -41,9 +41,9 @@
(
fvc::surfaceSum(mag(phi1 - phi2))().primitiveField()
/ fluidRegions[regioni].V().field()
)*runTime.deltaTValue(),
)*runTime.deltaTValue();
CoNum = max(UrCoNum, CoNum);
CoNum = Foam::max(CoNum, Foam::max(regionCoNum, UrCoNum));
}
}

View File

@ -8,11 +8,13 @@
volVectorField& U1 = phase1.URef();
surfaceScalarField& phi1 = phase1.phiRef();
const surfaceScalarField& alphaPhi1 = phase1.alphaPhi();
const tmp<surfaceScalarField> talphaPhi1 = phase1.alphaPhi();
const auto& alphaPhi1 = talphaPhi1();
volVectorField& U2 = phase2.URef();
surfaceScalarField& phi2 = phase2.phiRef();
const surfaceScalarField& alphaPhi2 = phase2.alphaPhi();
const tmp<surfaceScalarField> talphaPhi2 = phase2.alphaPhi();
const auto& alphaPhi2 = talphaPhi2();
surfaceScalarField& phi = fluid.phi();

View File

@ -2,7 +2,7 @@
forAll(fluidRegions, regioni)
{
CoNum = max
CoNum = Foam::max
(
compressibleCourantNo
(
@ -17,7 +17,7 @@
/*
forAll(porousFluidRegions, porousi)
{
CoNum = max
CoNum = Foam::max
(
compressibleCourantNo
(

View File

@ -47,10 +47,10 @@ if (adjustTimeStep)
runTime.setDeltaT
(
min
Foam::min
(
min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaTValue(),
min(runTime.deltaTValue(), maxDeltaT)
Foam::min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaTValue(),
Foam::min(runTime.deltaTValue(), maxDeltaT)
)
);
Info<< "deltaT = " << runTime.deltaTValue() << endl;

View File

@ -48,18 +48,14 @@ if (adjustTimeStep)
scalar maxDeltaTFluid = maxCo/(CoNum + SMALL);
scalar maxDeltaTSolid = maxDi/(DiNum + SMALL);
scalar deltaTFluid =
min
(
min(maxDeltaTFluid, 1.0 + 0.1*maxDeltaTFluid),
1.2
);
const scalar deltaTFluid =
Foam::min(Foam::min(maxDeltaTFluid, 1.0 + 0.1*maxDeltaTFluid), 1.2);
runTime.setDeltaT
(
min
Foam::min
(
min(deltaTFluid, maxDeltaTSolid)*runTime.deltaTValue(),
Foam::min(deltaTFluid, maxDeltaTSolid)*runTime.deltaTValue(),
maxDeltaT
)
);

View File

@ -22,7 +22,7 @@ forAll(solidRegions, i)
tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho();
DiNum = max
DiNum = Foam::max
(
solidRegionDiffNo
(

View File

@ -17,7 +17,7 @@ scalar DiNum = -GREAT;
tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho();
DiNum = max
DiNum = Foam::max
(
solidRegionDiffNo
(

View File

@ -60,13 +60,10 @@ template<class Type>
void zeroCells
(
GeometricField<Type, fvPatchField, volMesh>& vf,
const labelList& cells
const labelUList& cells
)
{
forAll(cells, i)
{
vf[cells[i]] = Zero;
}
UIndirectList<Type>(vf.primitiveField(), cells) = Zero;
}

View File

@ -103,8 +103,8 @@ dimensionedScalar alphaMax
laminarTransport
);
const labelList& inletCells = mesh.boundary()["inlet"].faceCells();
//const labelList& outletCells = mesh.boundary()["outlet"].faceCells();
const labelUList& inletCells = mesh.boundary()["inlet"].faceCells();
//const labelUList& outletCells = mesh.boundary()["outlet"].faceCells();
volScalarField alpha
(

View File

@ -33,7 +33,12 @@ Description
\*---------------------------------------------------------------------------*/
{
volScalarField contErr(interpolatedCells*cellMask*fvc::div(phi));
const DimensionedField<scalar, volMesh> contErr
(
interpolatedCells.internalField()
*cellMask.internalField()
*fvc::div(phi)().internalField()
);
scalar sumLocalContErr = runTime.deltaTValue()*
mag(contErr)().weightedAverage(mesh.V()).value();

View File

@ -55,7 +55,7 @@ if (mesh.changing())
dimensionedScalar rAUf("rAUf", dimTime, 1.0);
const cellCellStencilObject& overlap = Stencil::New(mesh);
const labelList& cellTypes = overlap.cellTypes();
const labelUList& cellTypes = overlap.cellTypes();
const labelIOList& zoneIDs = overlap.zoneID();
while (pimple.correctNonOrthogonal())

View File

@ -36,18 +36,26 @@
// Update the boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
{
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Flow time scale min/max = "
<< limits.min() << ", " << limits.max() << endl;
}
if (rDeltaTSmoothingCoeff < 1.0)
{
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
}
Info<< "Smoothed flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
{
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Smoothed flow time scale min/max = "
<< limits.min() << ", " << limits.max() << endl;
}
// Limit rate of change of time scale
// - reduce as much as required
@ -62,8 +70,10 @@
rDeltaT0
*max(rDeltaT/rDeltaT0, scalar(1) - rDeltaTDampingCoeff);
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Damped flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}
}

View File

@ -5,13 +5,17 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-ldynamicMesh \
-ldynamicFvMesh \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \

View File

@ -33,7 +33,12 @@ Description
\*---------------------------------------------------------------------------*/
{
volScalarField contErr(interpolatedCells*cellMask*fvc::div(phi));
const DimensionedField<scalar, volMesh> contErr
(
interpolatedCells.internalField()
*cellMask.internalField()
*fvc::div(phi)().internalField()
);
scalar sumLocalContErr = runTime.deltaTValue()*
mag(contErr)().weightedAverage(mesh.V()).value();

View File

@ -64,6 +64,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "simpleControl.H"
@ -83,7 +84,7 @@ int main(int argc, char *argv[])
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createDynamicFvMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "initContinuityErrs.H"
@ -98,6 +99,14 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
// Do any mesh changes
mesh.controlledUpdate();
if (mesh.changing())
{
MRF.update();
}
// --- Pressure-velocity SIMPLE corrector
{
#include "UEqn.H"

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020,2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -54,10 +54,21 @@ License
scalar alphaTemp(pimpleDict.getOrDefault("alphaTemp", 0.05));
Info<< "Time scales min/max:" << endl;
// The old reciprocal time scale field, with any damping factor
tmp<volScalarField> rDeltaT0_damped;
// Cache old reciprocal time scale field
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Calculate damped value before applying any other changes
if
(
rDeltaTDampingCoeff < 1
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
{
rDeltaT0_damped = (scalar(1) - rDeltaTDampingCoeff)*(rDeltaT);
}
Info<< "Time scales min/max:" << endl;
// Flow time scale
{
@ -67,12 +78,14 @@ License
/((2*maxCo)*mesh.V()*rho())
);
// Limit the largest time scale
rDeltaT.max(1/maxDeltaT);
// Limit the largest time scale (=> smallest reciprocal time)
rDeltaT.clamp_min(1/maxDeltaT);
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< " Flow = "
<< gMin(1/rDeltaT.primitiveField()) << ", "
<< gMax(1/rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}
// Reaction source time scale
@ -93,15 +106,13 @@ License
)
);
Info<< " Temperature = "
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
rDeltaT.primitiveFieldRef().clamp_min(rDeltaTT);
rDeltaT.ref() = max
(
rDeltaT(),
rDeltaTT
);
auto limits = gMinMax(rDeltaTT.field());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< " Temperature = "
<< limits.min() << ", " << limits.max() << endl;
}
// Update tho boundary values of the reciprocal time-step
@ -113,25 +124,19 @@ License
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
}
// Limit rate of change of time scale
// Limit rate of change of time scale (=> smallest reciprocal time)
// - reduce as much as required
// - only increase at a fraction of old time scale
if
(
rDeltaTDampingCoeff < 1.0
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
if (rDeltaT0_damped)
{
rDeltaT = max
(
rDeltaT,
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
);
rDeltaT.clamp_min(rDeltaT0_damped());
}
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< " Overall = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}

View File

@ -6,7 +6,7 @@
+ MRF.DDt(U)
+ turbulence->divDevReff(U)
==
parcels.SU(U, true)
invRhoInf*parcels.SU(U)
+ fvOptions(U)
);

View File

@ -39,6 +39,11 @@ dimensionedScalar rhoInfValue
laminarTransport
);
const dimensionedScalar invRhoInf
(
dimless/dimDensity, scalar(1)/rhoInfValue.value()
);
volScalarField rhoInf
(
IOobject

View File

@ -36,13 +36,18 @@ Description
if (adjustTimeStep)
{
const scalar maxDeltaTFact =
min(maxCo/(CoNum + SMALL), maxCo/(surfaceFilm.CourantNumber() + SMALL));
Foam::min
(
maxCo/(CoNum + SMALL),
maxCo/(surfaceFilm.CourantNumber() + SMALL)
);
const scalar deltaTFact =
min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
runTime.setDeltaT
(
min
Foam::min
(
deltaTFact*runTime.deltaTValue(),
maxDeltaT

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020,2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -54,10 +54,21 @@ License
scalar alphaTemp(pimpleDict.getOrDefault("alphaTemp", 0.05));
Info<< "Time scales min/max:" << endl;
// The old reciprocal time scale field, with any damping factor
tmp<volScalarField> rDeltaT0_damped;
// Cache old reciprocal time scale field
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Calculate damped value before applying any other changes
if
(
rDeltaTDampingCoeff < 1
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
{
rDeltaT0_damped = (scalar(1) - rDeltaTDampingCoeff)*(rDeltaT);
}
Info<< "Time scales min/max:" << endl;
// Flow time scale
{
@ -67,12 +78,14 @@ License
/((2*maxCo)*mesh.V()*rho())
);
// Limit the largest time scale
rDeltaT.max(1/maxDeltaT);
// Limit the largest time scale (=> smallest reciprocal time)
rDeltaT.clamp_min(1/maxDeltaT);
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< " Flow = "
<< gMin(1/rDeltaT.primitiveField()) << ", "
<< gMax(1/rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}
// Reaction source time scale
@ -92,15 +105,13 @@ License
)
);
Info<< " Temperature = "
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
rDeltaT.primitiveFieldRef().clamp_min(rDeltaTT);
rDeltaT.ref() = max
(
rDeltaT(),
rDeltaTT
);
auto limits = gMinMax(rDeltaTT.field());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< " Temperature = "
<< limits.min() << ", " << limits.max() << endl;
}
// Update the boundary values of the reciprocal time-step
@ -112,25 +123,22 @@ License
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
}
// Limit rate of change of time scale
// Limit rate of change of time scale (=> smallest reciprocal time)
// - reduce as much as required
// - only increase at a fraction of old time scale
if
(
rDeltaTDampingCoeff < 1.0
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
if (rDeltaT0_damped)
{
rDeltaT = max
(
rDeltaT,
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
);
rDeltaT.clamp_min(rDeltaT0_damped());
}
// Update the boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< " Overall = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}

View File

@ -48,8 +48,7 @@ U.correctBoundaryConditions();
fvOptions.correct(U);
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.clamp_range(rhoMin, rhoMax);
rho.relax();
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;

View File

@ -49,8 +49,7 @@
fvOptions.correct(U);
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.clamp_range(rhoMin, rhoMax);
rho.relax();
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;

View File

@ -1,6 +1,5 @@
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.clamp_range(rhoMin, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn.A());
@ -94,8 +93,7 @@ p.relax();
// Recalculate density from the relaxed pressure
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.clamp_range(rhoMin, rhoMax);
rho.relax();
Info<< "rho min/max : " << min(rho).value() << " " << max(rho).value() << endl;

View File

@ -1,6 +1,5 @@
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.clamp_range(rhoMin, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn.A());
@ -94,8 +93,7 @@ p.relax();
// Recalculate density from the relaxed pressure
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.clamp_range(rhoMin, rhoMax);
rho.relax();
Info<< "rho min/max : " << min(rho).value() << " " << max(rho).value() << endl;

View File

@ -36,13 +36,14 @@ Description
if (adjustTimeStep)
{
scalar maxDeltaTFact =
min(maxCo/(CoNum + SMALL), maxAlphaCo/(alphaCoNum + SMALL));
Foam::min(maxCo/(CoNum + SMALL), maxAlphaCo/(alphaCoNum + SMALL));
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
const scalar deltaTFact =
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
runTime.setDeltaT
(
min
Foam::min
(
deltaTFact*runTime.deltaTValue(),
maxDeltaT

View File

@ -53,6 +53,21 @@
pimpleDict.getOrDefault<scalar>("maxDeltaT", GREAT)
);
// The old reciprocal time scale field, with any damping factor
tmp<volScalarField> rDeltaT0_damped;
// Calculate damped value before applying any other changes
if
(
rDeltaTDampingCoeff < 1
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
{
rDeltaT0_damped = (scalar(1) - rDeltaTDampingCoeff)*(rDeltaT);
}
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Set the reciprocal time-step from the local Courant number
@ -83,10 +98,13 @@
// Update tho boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
{
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Flow time scale min/max = "
<< limits.min() << ", " << limits.max() << endl;
}
if (rDeltaTSmoothingCoeff < 1.0)
{
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
@ -110,27 +128,25 @@
fvc::sweep(rDeltaT, alpha1, nAlphaSweepIter, alphaSpreadDiff);
}
Info<< "Smoothed flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
{
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
// Limit rate of change of time scale
Info<< "Smoothed flow time scale min/max = "
<< limits.min() << ", " << limits.max() << endl;
}
// Limit rate of change of time scale (=> smallest reciprocal time)
// - reduce as much as required
// - only increase at a fraction of old time scale
if
(
rDeltaTDampingCoeff < 1.0
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
if (rDeltaT0_damped)
{
rDeltaT = max
(
rDeltaT,
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
);
rDeltaT.clamp_min(rDeltaT0_damped());
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Damped flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}
}

View File

@ -36,13 +36,14 @@ Description
if (adjustTimeStep)
{
scalar maxDeltaTFact =
min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL));
Foam::min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL));
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
const scalar deltaTFact =
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
runTime.setDeltaT
(
min
Foam::min
(
deltaTFact*runTime.deltaTValue(),
maxDeltaT

View File

@ -37,11 +37,15 @@ if (adjustTimeStep)
if (CoNum > SMALL)
{
scalar maxDeltaTFact =
min(maxCo/(CoNum + SMALL), maxAcousticCo/(acousticCoNum + SMALL));
Foam::min
(
maxCo/(CoNum + SMALL),
maxAcousticCo/(acousticCoNum + SMALL)
);
runTime.setDeltaT
(
min
Foam::min
(
maxDeltaTFact*runTime.deltaTValue(),
maxDeltaT

View File

@ -74,8 +74,11 @@ Foam::compressibleInterPhaseTransportModel::compressibleInterPhaseTransportModel
const volScalarField& alpha1(mixture_.alpha1());
const volScalarField& alpha2(mixture_.alpha2());
const volScalarField& rho1 = mixture_.thermo1().rho();
const volScalarField& rho2 = mixture_.thermo2().rho();
const tmp<volScalarField> trho1 = mixture_.thermo1().rho();
const tmp<volScalarField> trho2 = mixture_.thermo2().rho();
const auto& rho1 = trho1();
const auto& rho2 = trho2();
alphaRhoPhi1_ =
(
@ -185,8 +188,8 @@ void Foam::compressibleInterPhaseTransportModel::correctPhasePhi()
{
if (twoPhaseTransport_)
{
const volScalarField& rho1 = mixture_.thermo1().rho();
const volScalarField& rho2 = mixture_.thermo2().rho();
const tmp<volScalarField> rho1 = mixture_.thermo1().rho();
const tmp<volScalarField> rho2 = mixture_.thermo2().rho();
alphaRhoPhi1_.ref() = fvc::interpolate(rho1)*alphaPhi10_;
alphaRhoPhi2_.ref() = fvc::interpolate(rho2)*(phi_ - alphaPhi10_);

View File

@ -26,12 +26,12 @@ forAll(dgdt, celli)
{
if (dgdt[celli] > 0.0)
{
Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
Sp[celli] -= dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
Su[celli] += dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
}
else if (dgdt[celli] < 0.0)
{
Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
Sp[celli] += dgdt[celli]/Foam::max(alpha1[celli], 1e-4);
}
}

View File

@ -210,7 +210,7 @@ void VoFPatchTransfer::correct
film().toRegion(patchi, Vp);
const polyPatch& pp = pbm[patchi];
const labelList& faceCells = pp.faceCells();
const labelUList& faceCells = pp.faceCells();
// Accumulate the total mass removed from patch
scalar dMassPatch = 0;

View File

@ -26,12 +26,12 @@ forAll(dgdt, celli)
{
if (dgdt[celli] > 0.0)
{
Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
Sp[celli] -= dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
Su[celli] += dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
}
else if (dgdt[celli] < 0.0)
{
Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
Sp[celli] += dgdt[celli]/Foam::max(alpha1[celli], 1e-4);
}
}

View File

@ -26,12 +26,12 @@ forAll(dgdt, celli)
{
if (dgdt[celli] > 0.0)
{
Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
Sp[celli] -= dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
Su[celli] += dgdt[celli]/Foam::max(1.0 - alpha1[celli], 1e-4);
}
else if (dgdt[celli] < 0.0)
{
Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
Sp[celli] += dgdt[celli]/Foam::max(alpha1[celli], 1e-4);
}
}

View File

@ -135,7 +135,7 @@ public:
virtual volScalarField& he()
{
NotImplemented;
return const_cast<volScalarField&>(volScalarField::null());
return volScalarField::null().constCast();
}
//- Enthalpy/Internal energy [J/kg]

View File

@ -1086,7 +1086,7 @@ void Foam::multiphaseMixtureThermo::solveAlphas
MULES::limitSum(alphaPhiCorrs);
rhoPhi_ = dimensionedScalar(dimensionSet(1, 0, -1, 0, 0), Zero);
rhoPhi_ = Zero;
volScalarField sumAlpha
(

View File

@ -243,7 +243,7 @@ public:
virtual volScalarField& he()
{
NotImplemented;
return const_cast<volScalarField&>(volScalarField::null());
return volScalarField::null().constCast();
}
//- Enthalpy/Internal energy [J/kg]

View File

@ -63,23 +63,11 @@ Foam::DTRMParticle::DTRMParticle
{
is >> p0_ >> p1_ >> I0_ >> I_ >> dA_ >> transmissiveId_;
}
else if (!is.checkLabelSize<>() || !is.checkScalarSize<>())
{
// Non-native label or scalar size
is.beginRawRead();
readRawScalar(is, p0_.data(), vector::nComponents);
readRawScalar(is, p1_.data(), vector::nComponents);
readRawScalar(is, &I0_);
readRawScalar(is, &I_);
readRawScalar(is, &dA_);
readRawLabel(is, &transmissiveId_);
is.endRawRead();
}
else
{
// No non-native streaming
is.fatalCheckNativeSizes(FUNCTION_NAME);
is.read(reinterpret_cast<char*>(&p0_), sizeofFields_);
}
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2023 OpenCFD Ltd.
Copyright (C) 2017-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -557,7 +557,7 @@ void Foam::radiation::laserDTRM::calculate()
// Reset the field
Q_ == dimensionedScalar(Q_.dimensions(), Zero);
Q_ == Zero;
a_ = absorptionEmission_->a();
e_ = absorptionEmission_->e();
@ -679,7 +679,7 @@ void Foam::radiation::laserDTRM::calculate()
}
}
scalar totalQ = gSum(Q_.primitiveFieldRef()*mesh_.V());
scalar totalQ = gWeightedSum(mesh_.V(), Q_.primitiveField());
Info << "Total energy absorbed [W]: " << totalQ << endl;
if (mesh_.time().writeTime())

View File

@ -36,13 +36,13 @@ Description
if (adjustTimeStep)
{
scalar maxDeltaTFact =
min
Foam::min
(
maxCo/(CoNum + SMALL),
min
Foam::min
(
maxAlphaCo/(alphaCoNum + SMALL),
min
Foam::min
(
maxAlphaDdt/(ddtAlphaNum + SMALL),
maxDi/(DiNum + SMALL)
@ -50,16 +50,18 @@ if (adjustTimeStep)
)
);
scalar deltaTFact = min(min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
const scalar deltaTFact =
Foam::min(Foam::min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
runTime.setDeltaT
(
min
Foam::min
(
deltaTFact*runTime.deltaTValue(),
maxDeltaT
)
);
Info<< "deltaT = " << runTime.deltaTValue() << endl;
}

View File

@ -86,7 +86,7 @@ public:
virtual volScalarField& he()
{
NotImplemented;
return const_cast<volScalarField&>(volScalarField::null());
return volScalarField::null().constCast();
}
//- Return access to the internal energy field [J/Kg]

View File

@ -33,7 +33,12 @@ Description
\*---------------------------------------------------------------------------*/
{
volScalarField contErr(interpolatedCells*cellMask*fvc::div(phi));
const DimensionedField<scalar, volMesh> contErr
(
interpolatedCells.internalField()
*cellMask.internalField()
*fvc::div(phi)().internalField()
);
scalar sumLocalContErr = runTime.deltaTValue()*
mag(contErr)().weightedAverage(mesh.V()).value();

View File

@ -65,7 +65,7 @@
dimensionedScalar rAUf("rAUf", dimTime/rho.dimensions(), 1.0);
const cellCellStencilObject& overlap = Stencil::New(mesh);
const labelList& cellTypes = overlap.cellTypes();
const labelUList& cellTypes = overlap.cellTypes();
const labelIOList& zoneIDs = overlap.zoneID();
while (pimple.correctNonOrthogonal())

View File

@ -232,7 +232,7 @@
surfaceScalarField mSfGradp("mSfGradp", pEqnIncomp.flux()/rAUf);
phasei = 0;
phi = dimensionedScalar("phi", phi.dimensions(), Zero);
phi = Zero;
for (phaseModel& phase : fluid.phases())
{
@ -261,7 +261,7 @@
mSfGradp = pEqnIncomp.flux()/rAUf;
U = dimensionedVector("U", dimVelocity, Zero);
U = Zero;
phasei = 0;
for (phaseModel& phase : fluid.phases())

View File

@ -626,7 +626,7 @@ void Foam::multiphaseMixture::solveAlphas
MULES::limitSum(alphaPhiCorrs);
rhoPhi_ = dimensionedScalar(dimMass/dimTime, Zero);
rhoPhi_ = Zero;
volScalarField sumAlpha
(

View File

@ -12,8 +12,11 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
phaseModel& phase = fluid.anisothermalPhases()[anisothermalPhasei];
const volScalarField& alpha = phase;
const volScalarField& rho = phase.rho();
const volVectorField& U = phase.U();
const tmp<volScalarField> trho = phase.rho();
const tmp<volVectorField> tU = phase.U();
const auto& rho = trho();
const auto& U = tU();
fvScalarMatrix EEqn
(

View File

@ -11,7 +11,9 @@
UPtrList<volScalarField>& Y = phase.YActiveRef();
const volScalarField& alpha = phase;
const volScalarField& rho = phase.rho();
const tmp<volScalarField> trho = phase.rho();
const auto& rho = trho();
forAll(Y, i)
{

View File

@ -14,9 +14,11 @@ PtrList<fvVectorMatrix> UEqns(phases.size());
phaseModel& phase = fluid.movingPhases()[movingPhasei];
const volScalarField& alpha = phase;
const volScalarField& rho = phase.rho();
const tmp<volScalarField> trho = phase.rho();
volVectorField& U = phase.URef();
const auto& rho = trho();
UEqns.set
(
phase.index(),

View File

@ -17,9 +17,11 @@ PtrList<fvVectorMatrix> UEqns(phases.size());
phaseModel& phase = fluid.movingPhases()[movingPhasei];
const volScalarField& alpha = phase;
const volScalarField& rho = phase.rho();
const tmp<volScalarField> trho = phase.rho();
volVectorField& U = phase.URef();
const auto& rho = trho();
UEqns.set
(
phase.index(),

View File

@ -38,7 +38,9 @@
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}

View File

@ -8,5 +8,5 @@
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
CoNum = max(CoNum, UrCoNum);
CoNum = Foam::max(CoNum, UrCoNum);
}

View File

@ -6,11 +6,13 @@ const volScalarField& alpha2 = phase2;
volVectorField& U1 = phase1.URef();
surfaceScalarField& phi1 = phase1.phiRef();
const surfaceScalarField& alphaPhi1 = phase1.alphaPhi();
const tmp<surfaceScalarField> talphaPhi1 = phase1.alphaPhi();
const auto& alphaPhi1 = talphaPhi1();
volVectorField& U2 = phase2.URef();
surfaceScalarField& phi2 = phase2.phiRef();
const surfaceScalarField& alphaPhi2 = phase2.alphaPhi();
const tmp<surfaceScalarField> talphaPhi2 = phase2.alphaPhi();
const auto& alphaPhi2 = talphaPhi2();
surfaceScalarField& phi = fluid.phi();

View File

@ -31,7 +31,9 @@
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
auto limits = gMinMax(rDeltaT.primitiveField());
limits.reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL));
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
<< limits.min() << ", " << limits.max() << endl;
}

View File

@ -8,5 +8,5 @@
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
CoNum = max(CoNum, UrCoNum);
CoNum = Foam::max(CoNum, UrCoNum);
}

View File

@ -50,7 +50,7 @@
+ (
he2.name() == thermo2.phasePropertyName("e")
? fvc::div(fvc::absolute(alphaPhi2, alpha2, U2), p)
+ p*fvc::ddt(alpha1)
+ p*fvc::ddt(alpha2)
: -alpha2*dpdt
)

View File

@ -14,6 +14,6 @@ if (!(runTime.timeIndex() % 5))
if (smi < -SMALL)
{
Info<< "Resetting Dcorr to 0" << endl;
Dcorr == dimensionedVector(Dcorr.dimensions(), Zero);
Dcorr == Zero;
}
}

View File

@ -1,6 +1,6 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions
cd "${0%/*}" || exit # Run from this directory
. "${WM_PROJECT_DIR:?}"/wmake/scripts/wmakeFunctions # Need wmake functions
#------------------------------------------------------------------------------

View File

@ -1,7 +1,9 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments -no-recursion "$@"
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions
cd "${0%/*}" || exit # Run from this directory
set -- -all="${0##*/}" "$@" # Execute this instead of ./Allwmake
. "${WM_PROJECT_DIR:?}"/wmake/scripts/AllwmakeParseArguments
. "${WM_PROJECT_DIR:?}"/wmake/scripts/wmakeFunctions # Need wmake functions
#------------------------------------------------------------------------------
# Environment

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2022 OpenCFD Ltd.
Copyright (C) 2018-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -25,9 +25,12 @@ License
Description
Test the sizeof for basic types.
Also tests how the data mapping of OpenFOAM types to UPstream (MPI)
type ids are handled.
Can be compiled and run without any OpenFOAM libraries.
g++ -std=c++11 -oTest-machine-sizes Test-machine-sizes.cpp
g++ -std=c++17 -oTest-machine-sizes Test-machine-sizes.cpp
\*---------------------------------------------------------------------------*/
@ -37,6 +40,134 @@ Description
#include <iostream>
#include <limits>
#include <typeinfo>
#include <type_traits>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Partial copy from UPstream.H
//- Some MPI data types
//
//- Mapping of some fundamental and aggregate types to MPI data types
enum class dataTypes : int
{
// Fundamental Types [10]:
Basic_begin,
type_byte = Basic_begin,
type_int16,
type_int32,
type_int64,
type_uint16,
type_uint32,
type_uint64,
type_float,
type_double,
type_long_double,
invalid,
Basic_end = invalid
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Partial copy from UPstreamTraits.H
//- UPstream data type corresponding to an intrinsic (MPI) type
template<class T>
struct UPstream_mpi_dataType : std::false_type
{
static constexpr auto datatype_id = dataTypes::invalid;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Specializations to match elements of UPstream::dataTypes
#undef defineUPstreamDataTraits
#define defineUPstreamDataTraits(TypeId, Type) \
template<> struct UPstream_mpi_dataType<Type> : std::true_type \
{ \
static constexpr auto datatype_id = dataTypes::TypeId; \
};
defineUPstreamDataTraits(type_byte, char);
defineUPstreamDataTraits(type_byte, unsigned char);
defineUPstreamDataTraits(type_int16, int16_t);
defineUPstreamDataTraits(type_int32, int32_t);
defineUPstreamDataTraits(type_int64, int64_t);
defineUPstreamDataTraits(type_uint16, uint16_t);
defineUPstreamDataTraits(type_uint32, uint32_t);
defineUPstreamDataTraits(type_uint64, uint64_t);
defineUPstreamDataTraits(type_float, float);
defineUPstreamDataTraits(type_double, double);
defineUPstreamDataTraits(type_long_double, long double);
#undef defineUPstreamDataTraits
//- Explicit handling of data type aliases. This is necessary since
//- different systems map things like 'unsigned long' differently but we
//- restrict ourselves to int32/int64 types
template<class T>
struct UPstream_alias_dataType
:
std::bool_constant
<
// Basic MPI type
UPstream_mpi_dataType<std::remove_cv_t<T>>::value ||
(
// Or some int 32/64 type to re-map
std::is_integral_v<T>
&& (sizeof(T) == sizeof(int32_t) || sizeof(T) == sizeof(int64_t))
)
>
{
using base = std::conditional_t
<
UPstream_mpi_dataType<std::remove_cv_t<T>>::value,
std::remove_cv_t<T>, // <- using mpi type (no alias)
std::conditional_t // <- using alias
<
(
std::is_integral_v<T>
&& (sizeof(T) == sizeof(int32_t) || sizeof(T) == sizeof(int64_t))
),
std::conditional_t
<
(sizeof(T) == sizeof(int32_t)),
std::conditional_t<std::is_signed_v<T>, int32_t, uint32_t>,
std::conditional_t<std::is_signed_v<T>, int64_t, uint64_t>
>,
char // Fallback is a byte (eg, arbitrary contiguous data)
>
>;
static constexpr auto datatype_id =
UPstream_mpi_dataType<base>::datatype_id;
};
// Handle int8_t/uint8_t as aliases since 'signed char' etc may be
// ambiguous
//- Map \c int8_t to UPstream::dataTypes::type_byte
template<>
struct UPstream_alias_dataType<int8_t> : std::true_type
{
using base = char;
static constexpr auto datatype_id = dataTypes::type_byte;
};
//- Map \c uint8_t to UPstream::dataTypes::type_byte
template<>
struct UPstream_alias_dataType<uint8_t> : std::true_type
{
using base = unsigned char;
static constexpr auto datatype_id = dataTypes::type_byte;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class T>
void print(const char* name, bool showLimits = true)
@ -47,28 +178,84 @@ void print(const char* name, bool showLimits = true)
if (showLimits)
{
std::cout
<< " \"max\"=" << std::numeric_limits<T>::max();
<< " max=<";
if constexpr (sizeof(T) == 1)
{
std::cout << int(std::numeric_limits<T>::max());
}
else
{
std::cout << std::numeric_limits<T>::max();
}
std::cout << '>';
}
// A declared or deduced MPI type, or aliased
if constexpr (UPstream_mpi_dataType<T>::value)
{
std::cout
<< " is_mpi=("
<< int(UPstream_mpi_dataType<T>::datatype_id) << ')';
}
else
{
std::cout << " is_mpi=(null)";
}
// Any aliases?
if constexpr (UPstream_alias_dataType<T>::value)
{
if constexpr (UPstream_mpi_dataType<T>::value)
{
std::cout << " alias=base";
}
else
{
std::cout
<< " alias=("
<< int(UPstream_alias_dataType<T>::datatype_id) << ')';
}
}
std::cout<< '\n';
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
std::cout<< "c++ = " << __cplusplus << '\n';
std::cout<< "machine sizes\n---\n\n";
std::cout<< "machine sizes (and some MPI traits)\n---\n\n";
print<int8_t>("int8_t");
print<uint8_t>("uint8_t");
print<int16_t>("int16_t");
print<uint16_t>("uint16_t");
print<int32_t>("int32_t");
print<uint32_t>("uint32_t");
print<int64_t>("int64_t");
print<uint64_t>("uint64_t");
std::cout << '\n';
print<char>("char");
print<signed char>("signed char");
print<unsigned char>("unsigned char");
print<short>("short");
print<int>("int");
print<unsigned>("unsigned");
print<long>("long");
print<unsigned long>("unsigned long");
print<std::size_t>("std::size_t");
print<long long>("long long");
std::cout << '\n';
print<std::size_t>("std::size_t");
print<std::streamsize>("std::streamsize");
std::cout << '\n';
print<float>("float");
print<double>("double");
print<long double>("long double");

View File

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

View File

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

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020-2022 OpenCFD Ltd.
Copyright (C) 2020-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -25,7 +25,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
testCompactIOList
Test-CompactIOList
Description
Simple demonstration and test application for the CompactIOList container
@ -46,13 +46,20 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::addBoolOption("ascii", "use ascii format");
argList::addOption("count", "number of faces");
#include "setRootCase.H"
#include "createTime.H"
IOstreamOption streamOpt(IOstreamOption::BINARY);
// IOstreamOption streamOpt(IOstreamOption::ASCII);
const label size = 20000000;
if (args.found("ascii"))
{
streamOpt.format(IOstreamOption::ASCII);
}
const label size = args.getOrDefault<label>("count", 20000000);
// Old format
// ~~~~~~~~~~
@ -63,39 +70,50 @@ int main(int argc, char *argv[])
(
IOobject
(
"faces2",
"faces2-plain",
runTime.constant(),
polyMesh::meshSubDir,
runTime,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
size
)
);
const face f(identity(4));
faces2.resize(size, face(identity(4)));
forAll(faces2, i)
{
faces2[i] = f;
}
Info<< "Constructed faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
Info<< "Plain format faceList " << faces2.objectRelPath() << nl;
Info<< " constructed in = " << runTime.cpuTimeIncrement()
<< " s" << endl;
faces2.writeObject(streamOpt, true);
Info<< "Written old format faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
Info<< " wrote in = "
<< runTime.cpuTimeIncrement() << " s" << endl;
// Read
faceIOList faces3
// Read (size only)
label count = faceIOList::readContentsSize
(
IOobject
(
"faces2",
"faces2-plain",
runTime.constant(),
polyMesh::meshSubDir,
runTime,
IOobject::MUST_READ
)
);
Info<< " counted " << count << " faces on disk in = "
<< runTime.cpuTimeIncrement() << " s" << endl;
// Read
faceIOList faces2b
(
IOobject
(
"faces2-plain",
runTime.constant(),
polyMesh::meshSubDir,
runTime,
@ -105,7 +123,7 @@ int main(int argc, char *argv[])
)
);
Info<< "Read old format " << faces3.size() << " faceList in = "
Info<< " read " << faces2b.size() << " faces in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
}
@ -114,44 +132,54 @@ int main(int argc, char *argv[])
// ~~~~~~~~~~
{
// Construct big faceList in new format
// Construct big faceList in compact format
faceCompactIOList faces2
(
IOobject
(
"faces2",
"faces2-compact",
runTime.constant(),
polyMesh::meshSubDir,
runTime,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
size
)
);
const face f(identity(4));
faces2.resize(size, face(identity(4)));
forAll(faces2, i)
{
faces2[i] = f;
}
Info<< "Constructed new format faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
Info<< "Compact format faceList" << faces2.objectRelPath() << nl;
Info<< " constructed in = "
<< runTime.cpuTimeIncrement() << " s" << endl;
faces2.writeObject(streamOpt, true);
Info<< "Written new format faceList in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
Info<< " wrote in = "
<< runTime.cpuTimeIncrement() << " s" << endl;
// Read
faceCompactIOList faces3
// Read (size only)
label count = faceCompactIOList::readContentsSize
(
IOobject
(
"faces2",
"faces2-compact",
runTime.constant(),
polyMesh::meshSubDir,
runTime,
IOobject::MUST_READ
)
);
Info<< " counted " << count << " faces on disk in = "
<< runTime.cpuTimeIncrement() << " s" << endl;
// Read
faceCompactIOList faces2b
(
IOobject
(
"faces2-compact",
runTime.constant(),
polyMesh::meshSubDir,
runTime,
@ -161,7 +189,7 @@ int main(int argc, char *argv[])
)
);
Info<< "Read new format " << faces3.size() << " faceList in = "
Info<< " read " << faces2b.size() << " faces in = "
<< runTime.cpuTimeIncrement() << " s" << nl << endl;
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020-2022 OpenCFD Ltd.
Copyright (C) 2020-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -38,12 +38,11 @@ Description
\*---------------------------------------------------------------------------*/
#include "complex.H"
#include "Tensor.H"
#include "SymmTensor.H"
#include "SphericalTensor.H"
#include "DiagTensor.H"
#include "scalar.H"
#include "complex.H"
using namespace Foam;
@ -57,45 +56,11 @@ unsigned nTest_ = 0;
unsigned nFail_ = 0;
// Compare two floating point types, and print output.
// Do ++nFail_ if values of two objects are not equal within a given tolerance.
// The function is converted from PEP-485.
template<class Type>
typename std::enable_if<pTraits<Type>::rank == 0, void>::type
cmp
(
const word& msg,
const Type& x,
const Type& y,
const scalar relTol = 1e-8, //<! are values the same within 8 decimals
const scalar absTol = 0 //<! useful for cmps near zero
)
{
Info<< msg << x << endl;
unsigned nFail = 0;
if (max(absTol, relTol*max(mag(x), mag(y))) < mag(x - y))
{
++nFail;
}
if (nFail)
{
Info<< nl
<< " #### Fail in " << nFail << " comps ####" << nl << endl;
++nFail_;
}
++nTest_;
}
// Compare two containers elementwise, and print output.
// Do ++nFail_ if two components are not equal within a given tolerance.
// The function is converted from PEP-485
template<class Type>
typename std::enable_if<pTraits<Type>::rank != 0, void>::type
cmp
void cmp
(
const word& msg,
const Type& x,
@ -104,18 +69,37 @@ cmp
const scalar absTol = 0
)
{
Info<< msg << x << endl;
const auto notEqual = [=](const auto& a, const auto& b) -> bool
{
return
(
Foam::max(absTol, relTol*Foam::max(Foam::mag(a), Foam::mag(b)))
< Foam::mag(a - b)
);
};
unsigned nFail = 0;
for (direction i = 0; i < pTraits<Type>::nComponents; ++i)
if constexpr (is_vectorspace_v<Type>)
{
if (max(absTol, relTol*max(mag(x[i]), mag(y[i]))) < mag(x[i] - y[i]))
for (direction i = 0; i < pTraits<Type>::nComponents; ++i)
{
if (notEqual(x[i], y[i]))
{
++nFail;
}
}
}
else
{
if (notEqual(x, y))
{
++nFail;
}
}
Info<< msg << x << endl;
if (nFail)
{
Info<< nl
@ -368,27 +352,26 @@ void test_global_opers(Type)
// Do compile-time recursion over the given types
template<std::size_t I = 0, typename... Tp>
inline typename std::enable_if<I == sizeof...(Tp), void>::type
run_tests(const std::tuple<Tp...>& types, const List<word>& typeID){}
template<std::size_t I = 0, typename... Tp>
inline typename std::enable_if<I < sizeof...(Tp), void>::type
run_tests(const std::tuple<Tp...>& types, const List<word>& typeID)
void run_tests(const std::tuple<Tp...>& types, const List<word>& names)
{
Info<< nl << " ## Test constructors: "<< typeID[I] <<" ##" << nl;
test_constructors(std::get<I>(types));
if constexpr (I < sizeof...(Tp))
{
const auto& name = names[I];
Info<< nl << " ## Test member functions: "<< typeID[I] <<" ##" << nl;
test_member_funcs(std::get<I>(types));
Info<< nl << " ## Test constructors: " << name << " ##" << nl;
test_constructors(std::get<I>(types));
Info<< nl << " ## Test global functions: "<< typeID[I] << " ##" << nl;
test_global_funcs(std::get<I>(types));
Info<< nl << " ## Test member functions: " << name << " ##" << nl;
test_member_funcs(std::get<I>(types));
Info<< nl << " ## Test global operators: "<< typeID[I] <<" ##" << nl;
test_global_opers(std::get<I>(types));
Info<< nl << " ## Test global functions: " << name << " ##" << nl;
test_global_funcs(std::get<I>(types));
run_tests<I + 1, Tp...>(types, typeID);
Info<< nl << " ## Test global operators: " << name << " ##" << nl;
test_global_opers(std::get<I>(types));
run_tests<I + 1, Tp...>(types, names);
}
}
@ -403,8 +386,8 @@ int main()
const List<word> typeID
({
"DiagTensor<floatScalar>",
"DiagTensor<doubleScalar>",
"DiagTensor<float>",
"DiagTensor<double>",
"DiagTensor<complex>"
});

View File

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

View File

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

View File

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

View File

@ -52,7 +52,8 @@ void printInfo
if (showSize)
{
Info<< " size=\"" << list.size()
<< "\" capacity=\"" << list.capacity() << "\"";
<< "\" capacity=\"" << list.capacity() << "\""
<< "\" min=\"" << SizeMin << "\"" ;
if (list.cdata())
{
Info<< " ptr=\"" << name(list.cdata()) << "\"";
@ -79,7 +80,8 @@ void printInfo
if (showSize)
{
Info<< " size=\"" << list.size()
<< "\" capacity=\"" << list.capacity() << "\"";
<< "\" capacity=\"" << list.capacity() << "\""
<< "\" min=\"" << SizeMin << "\"" ;
if (list.cdata())
{
Info<< " ptr=\"" << name(list.cdata()) << "\"";
@ -168,6 +170,22 @@ int main(int argc, char *argv[])
printInfo("", list2);
}
{
DynamicList<float, 32> list1(std::pair<label,label>(16,0));
list1 = -1;
Info<< "construct with specified size/capacity" << nl;
printInfo("", list1);
}
{
DynamicList<float, 32> list1(std::pair<label,label>(8,16));
list1 = -1;
Info<< "construct with specified size/capacity" << nl;
printInfo("", list1);
}
Info<< "\nEnd\n";
return 0;

View File

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

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2023 OpenCFD Ltd.
Copyright (C) 2019-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -41,7 +41,6 @@ See also
#include "List.H"
#include "IPstream.H"
#include "OPstream.H"
#include <numeric>
using namespace Foam;
@ -85,8 +84,7 @@ void compileInfo()
template<class FixedListType>
typename std::enable_if
<(FixedListType::max_size() == 2), bool>::type
std::enable_if_t<(FixedListType::max_size() == 2), bool>
is_pair()
{
return true;
@ -94,7 +92,7 @@ is_pair()
template<class FixedListType>
typename std::enable_if<(FixedListType::max_size() != 2), std::string>::type
std::enable_if_t<(FixedListType::max_size() != 2), std::string>
is_pair()
{
return "not really at all";

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / O peration | Version: v2506 |
| \\ / 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: v2312 |
| \\ / O peration | Version: v2506 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -92,7 +92,10 @@ int main(int argc, char *argv[])
{
fld[celli] = cellToCoarse[celli];
}
fld /= max(fld);
if (normalise)
{
fld /= max(fld);
}
scalarAgglomeration.correctBoundaryConditions();
scalarAgglomeration.write();

View File

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

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2017-2022 OpenCFD Ltd.
Copyright (C) 2017-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,33 +42,55 @@ Description
using namespace Foam;
class Scalar
bool verbosity = true;
// Gratuitous class inheritance
template<class T>
class BoxedType
{
scalar data_;
T data_;
public:
static bool verbose;
constexpr Scalar() noexcept : data_(0) {}
Scalar(scalar val) noexcept : data_(val) {}
constexpr BoxedType() noexcept : data_(0) {}
BoxedType(T val) noexcept : data_(val) {}
~BoxedType()
{
if (verbosity) Info<< " [delete BoxedType: " << value() << ']' << nl;
}
T value() const noexcept { return data_; }
T& value() noexcept { return data_; }
auto clone() const { return autoPtr<BoxedType<T>>::New(*this); }
};
template<class T> Ostream& operator<<(Ostream& os, const BoxedType<T>& item)
{
return (os << " -> " << item.value());
}
class Scalar : public BoxedType<scalar>
{
public:
using BoxedType<scalar>::BoxedType;
~Scalar()
{
if (verbose) Info<< "delete Scalar: " << data_ << endl;
}
const scalar& value() const noexcept { return data_; }
scalar& value() noexcept { return data_; }
friend Ostream& operator<<(Ostream& os, const Scalar& item)
{
os << item.value();
return os;
if (verbosity) Info<< "delete Scalar: " << value() << nl;
}
auto clone() const { return autoPtr<Scalar>::New(*this); }
};
bool Scalar::verbose = true;
Ostream& operator<<(Ostream& os, const Scalar& item)
{
return (os << item.value());
}
template<class T>

View File

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

View File

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

View File

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

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