Commit Graph

26347 Commits

Author SHA1 Message Date
Mark Olesen
139a8fc6ff STYLE: use SPDX-style for scripts 2023-05-10 18:23:13 +02:00
Mark Olesen
e8bcf4cb1b ENH: additional uniform boundary conditions (#2703)
- provide uniformMixed conditions for finite-area and finite-volume.

  These are intended to replace the exprMixed condition but allow
  the full range of different PatchFunction1 and Function1 types.

- add uniformFixedGradient to finite-area for completeness.

Note:
   - still some possible difficulties with the order of evaluation.
   - eg, using an expression within the 'U' field that depends
     of the surface 'phi' field before that is constructed.
     In this case, the 'value' entry is really needed.
2023-05-09 19:30:58 +02:00
Mattijs Janssens
3d091a0d6a ENH: separate nonBlocking send/receive mapDistribute (#2775) 2023-05-09 19:30:58 +02:00
Mark Olesen
b3fa59db92 ENH: additional handling for multiply-connected finite-area edges (#2771)
- multiply-connected edges can arise at the centre of a "star"
  connection or because the patch faces are actually baffles.

- In the serial case these internal edges are also rather dubious in
  terms of modelling. However, when they are split across multiple
  processors there can only be a single processor-to-processor
  connectivity.

  We don't necessary have enough information to know how things should
  be connected, so connect pair-wise as the first remedial solution

- Any extra dangle edges are relegated to an 'ignore' faPatch
  to tag as needing different handling.
2023-05-09 19:30:58 +02:00
Mark Olesen
b62e4b06fa ENH: add finite-area 'ignore' boundary condition
- this is a placeholder boundary BC for using with bad or illegal
  edges. It is currently functionally identical to zero-gradient.
  Naming and definition still subject to change.
2023-05-09 19:30:58 +02:00
Mark Olesen
783934ccad ENH: add global topology check in checkMesh and makeFaMesh (#2771)
- detect when boundary patches are multiply connected across edges

STYLE: initialize some faMesh values
2023-05-09 19:30:58 +02:00
Mark Olesen
1bef57d018 ENH: optional saving of illegal edges in patch surfaceType() check
- reduce some intermediate storage in looping

STYLE: explicit iterator dereference in syncTools
2023-05-09 19:30:58 +02:00
Mark Olesen
31600c96d4 ENH: output finiteArea patchID with foamToVTK -with-ids
- can be quite useful for debugging/orientation with complex
  geometries
2023-05-09 19:30:58 +02:00
Mark Olesen
f462a850ce ENH: added polyBoundaryMesh patchID(meshFacei) method
- this complements the whichPatch(meshFacei) method [binary search]
  and the list of patchID() by adding internal range checks.

  eg,
     Before
     ~~~~~~
     if (facei >= mesh.nInternalFaces() && facei < mesh.nFaces())
     {
         patchi = pbm.patchID()[facei - mesh.nInternalFaces()];
         ...
     }

     After
     ~~~~~
     patchi = pbm.patchID(facei);

     if (patchi >= 0)
     {
         ...
     }
2023-05-09 19:30:58 +02:00
Mark Olesen
dfa5c05a16 ENH: use New factory methods for Dimensioned/Geometric functions (#2723) 2023-05-09 19:30:58 +02:00
Mark Olesen
1685e8e418 INT: objectRegistry: optionally caching temporary objects (#2723)
- functionality introduced by openfoam.org to support selective
  caching of temporary fields. The purpose is two-fold: to enable
  diagnostics and to allow more places to use unregistered fields by
  default.

  For example to cache the grad(k) field in

    cacheTemporaryObjects
    (
        grad(k)
    );

  If the name of a field which in never constructed is added to the
  cacheTemporaryObjects list a waning message is generated which
  includes a useful list of ALL the temporary fields constructed
  during the time step

  Multiple regions are also supported by specifying individual region
  names in a cacheTemporaryObjects dictionary.

    cacheTemporaryObjects
    {
        porous
        (
            porosityBlockage:UNbr
        );
    }

    functions
    {
        writePorousObjects
        {
            type        writeObjects;
            libs        (utilityFunctionObjects);

            region      porous;
            writeControl writeTime;
            writeOption anyWrite;

            objects     (porosityBlockage:UNbr);
        }
    }
2023-05-09 19:30:58 +02:00
Mark Olesen
2df90880d6 ENH: consistent use of name scoping for turbulence fields
- with IOobject::scopedName instead of literal ':' for future
  transitioning of separators
2023-05-09 19:30:57 +02:00
Mark Olesen
8e32db2b5f STYLE: more explicit use of REGISTER when storing fields
ENH: add phaseScopedName convenience method

- unites IOobject::scopedName + phasePropertyName
2023-05-09 19:30:57 +02:00
Mark Olesen
16591012e9 ENH: add -verbose option to surface conversion, cleanup
- by default, reduce the amount of output

ENH: support default text description for -verbose option

- simplifies use in more places.
2023-05-09 19:30:57 +02:00
Mark Olesen
bddda09a08 ENH: earlier exit from interface polling in updateMatrixInterfaces
- exit the wait-some polling loop when no interfaces are left
  to be updated
2023-05-09 19:30:57 +02:00
Mark Olesen
98c42479f6 ENH: relax processorField waiting requirements
- for interface polling previously required that both send and recv
  requests were completed before evaluating (values or matrix update).
  However, only the recv needs to be complete, which helps disentangle
  the inter-rank waiting.

  NB: this change is possible following (1f5cf3958b) that replaced
      UPstream::resetRequests() call in favour of UPstream::waitRequests()
2023-05-09 19:30:57 +02:00
Mattijs Janssens
52b225b6d5 STYLE/COMP: include cyclic patch headers earlier 2023-05-09 19:30:57 +02:00
Mark Olesen
c6f528588b ENH: use Mprobe/Mrecv for IPstream constructor
- retains the queried message without secondary polling.
2023-05-09 19:30:54 +02:00
Mark Olesen
2eb1f5678d ENH: use Improbe/Mrecv for NBX size exchange
- retains the queried message without secondary polling.
  Purported to be slightly faster. Better thread-safety.
2023-05-09 14:51:43 +02:00
Mark Olesen
50f4d0444c ENH: avoid synchronization on UPstream::shutdown with error (#2774)
- UPstream exit with a non-zero return code is raised by things like
  exit(FatalError) which means there is no reason to believe that
  any/all of the buffered sends, requests etc have completed.

  Thus avoid detaching buffers, freeing communicators etc in this
  situation. This makes exit(1) behave much more like abort(), but
  without any stack trace. Should presumably help with avoiding
  deadlocks on exit.
2023-05-09 14:51:43 +02:00
Mark Olesen
639b800049 ENH: clearer separation of MPI initialize/finalize stages (#2774)
ENH: support transfer from a wrapped MPI request to global list

- allows coding with a list UPstream::Request and subsequently either
  retain that list or transfer into the global list.
2023-05-09 14:51:43 +02:00
Mark Olesen
9d2ae3da67 CONFIG: remove optional 'value' entry from setConstraintTypes template
- processor types automatically handle a missing 'value' as
  patchInternalField, so no need having it in the setConstraintTypes
  template as well.
2023-05-09 14:51:43 +02:00
Mark Olesen
d22c206226 STYLE: fix truncated error message for non-constraint patch types 2023-05-09 14:51:43 +02:00
Kutalmis Bercin
fd1a70f933 BUG: effectivenessTable: fix the sign for secondary outlet temperature (fixes #2772) 2023-05-09 08:26:43 +01:00
Kutalmis Bercin
3e382aadea Revert "BUG: Fixing ray dAve and omega for 1D and 2D cases"
This reverts commit 5848b0afd5.
2023-05-05 13:24:23 +01:00
Mark OLESEN
964cb140e2 Merge branch 'feature-parProfiling' into 'develop'
ENH: parProfiling: profile linear solver only

See merge request Development/openfoam!603
2023-05-03 19:04:10 +00:00
Mattijs Janssens
b0b3ec0d8e ENH: parProfiling: profile linear solver only 2023-05-03 19:04:10 +00:00
Mark OLESEN
0ae31d4c00 Merge branch 'optimizationBranch' into 'develop'
Optimization to ldu Matrix

See merge request Development/openfoam!601
2023-05-02 16:17:56 +00:00
Yu Ankun
4f7aa70ad6 ENH: new FPCG solver (faster PCG)
- this should be faster than the regular PCG on larger systems
  since it combines two global reductions
2023-05-02 18:00:50 +02:00
Yu Ankun
47bb79cb75 ENH: use residual method in GAMGSolverSolve: fuses Amul with b-Amul 2023-05-02 17:54:23 +02:00
Yu Ankun
b664eea712 ENH: remove redundant distribution in backward sweep (symGaussSeidel) 2023-05-02 17:54:16 +02:00
Mark Olesen
287025d2df COMP: remove explicit specialisations for CSV reading (fixes #2764)
- can use traits to distinguish label vs scalar types and
  setComponents to properly index into single or multi-component
  types without needing template specialisations for the task.

  This avoids the need for a concrete translation unit and the
  reported problem of multiply-defined specialisations when the header
  is included in different places.
2023-05-02 13:34:12 +02:00
Mark Olesen
e967305ef2 STYLE: use calculatedType() and zeroGradientType() methods 2023-05-02 13:34:12 +02:00
Santiago Marquez Damian
09ce87135b DOC: kOmega: correct literature reference (fixes #2766) 2023-04-26 17:30:38 +01:00
Mark Olesen
7a5ecd70b8 BUG: misleading error message in finiteArea construct
- the default (uninitialised) value for edge connections of -1
  could be confused with a tagged finiteArea patch, which used
  (-patchid-1) encoding. This would lead to messages about erroneous
  processor-processor addressing, but is in fact an mismatched edge
  connection.

  Now tag the finiteArea patch as (-patchid-2) to avoid this ambiguity
  and correctly generate an "Undefined connection:" message instead.

  Properly flush the VTP writers before raising a FatalError
  to ensure that they are not prematurely truncated.

Open Point:

  The base problem of "Undefined connection:" is largely related to
  multiply-connected face edges (ie, from the underlying volume mesh).
  Not easily remedied in the finiteArea generation.

TUT: basic finiteArea setup on motorBike
2023-04-25 13:45:08 +02:00
Mark Olesen
ee39e3d276 STYLE: use explicit REGISTER option when storing fields 2023-04-25 13:45:08 +02:00
Mark Olesen
d9533e561b ENH: allow null pointer when reading binary block
- have read(nullptr, count) and readRaw(nullptr, count) act like a
  forward seek instead of failing.
  This lets it be used to advance through a file without needing to
  allocate (and discard) storage space etc.
2023-04-25 13:44:33 +02:00
Mark Olesen
ce282dfbbf ENH: correct the selfComm procNo relative to world communicator
STYLE: qualify worldComm as UPstream instead Pstream

STYLE: PPCG::gSumMagProd() as static function
2023-04-24 15:46:04 +02:00
Mark Olesen
a7c4c184b8 ENH: respect value of dimensionSet::checking() for pow() function
STYLE: remove unused/meaningless pow(dimensionScalar, dimensionSet)
2023-04-24 15:46:04 +02:00
Mark Olesen
5042d1296f ENH: consistent UniformDimensionedField naming
- construct from components, or use word::null to ensure
  consistent avoid naming between IOobject vs dimensioned type.

- support construct with parameter ordering as per DimensionedField

ENH: instantiate a uniformDimensionedLabelField

- eg, for registering standalone integer counters
2023-04-24 15:46:04 +02:00
Mark Olesen
1d39cdaa17 STYLE: support READ_MODIFIED <-> MUST_READ_IF_MODIFIED as aliases 2023-04-24 15:46:04 +02:00
Mark Olesen
2b1061420c STYLE: remove trailing space, tabs 2023-04-24 15:37:33 +02:00
Mark Olesen
7bef18a274 STYLE: document const-ness of isA, refCast 2023-04-21 15:49:27 +02:00
Andrew Heather
35c2b4b603 BUG: splash model - correction and code refactoring 2023-04-20 13:11:42 +01:00
Andrew Heather
424f913fdd Merge branch 'feature-multiLevel-scotch' into 'develop'
ENH: multiLevel: native scotch implementation of multi-level

See merge request Development/openfoam!599
2023-04-19 13:02:32 +00:00
mattijs
32df7c2e92 ENH: multiLevel: native scotch implementation of multi-level 2023-04-19 13:02:13 +00:00
Mark Olesen
8434931c29 CONFIG: support call of 'openfoam' wrapper in other in-project locations
- directory discovery originally designed for a sub-dir location
  (eg, etc/openfoam) but failed if called from within the sub-dir
  itself.

  Now simply assume it is located in the project directory or the etc/
  sub-dir, so that it can also be relocated into the project directory
  in the future (pending changes to RPM and debian packaging)
2023-04-18 20:19:29 +02:00
Mark Olesen
b12e47d9ab CONFIG: increment API level to 2302 2023-04-18 14:08:39 +02:00
Mark Olesen
66a7f0c9db ENH: provide UPstream::finishedRequests() support
- for querying all outstanding requests:

     if (UPstream::finishedRequests(startRequest)) ...
     if (UPstream::finishedRequests(startRequest, -1)) ...

- for querying slice of outstanding requests:

     if (UPstream::finishedRequests(startRequest, 10)) ...
2023-04-18 14:08:39 +02:00
Mark Olesen
80bc1db5b7 ENH: provide UPstream intra-host and inter-host communicators
- simplifies communication structuring with intra-host communication.
  Can be used for IO only, or for specialised communication.

  Demand-driven construction. Gathers the SHA1 of host names when
  determining the connectivity. Internally uses an MPI_Gather of the
  digests and a MPI_Bcast of the unique host indices.

  NOTE:
    does not use MPI_Comm_splt or MPI_Comm_splt_type since these
    return MPI_COMM_NULL on non-participating process which does not
    easily fit into the OpenFOAM framework.

    Additionally, if using the caching version of
    UPstream::commInterHost() and UPstream::commIntraHost()
    the topology is determined simultaneously
    (ie, equivalent or potentially lower communication).
2023-04-18 14:08:39 +02:00