Commit Graph

25498 Commits

Author SHA1 Message Date
ee6c241b69 BUG: atmBoundaryLayer: replace global groundMin with local min (fixes #2471) 2022-05-20 10:05:23 +01:00
a11b5f2310 Merge branch 'feature-solid-body-mesh-motion-optimisation' into 'develop'
New solid body motion mesh update optimisations

See merge request Development/openfoam!537
2022-05-19 16:19:47 +00:00
b6390c2b75 COMP: resolved compiler warning 2022-05-19 15:48:31 +00:00
3a8a7cc6d4 ENH: snappyHexMesh: remove any left-over mesh data before topo change 2022-05-19 15:48:31 +00:00
6a8ddbb296 ENH: Added new solidBodyFvGeometryScheme
Geometry calculation scheme that performs geometry updates only in regions
where the mesh has changed, identified by comparing current and old points.

Example usage in fvSchemes:

    geometry
    {
        type            solidBody;

        // Optional entries

        // If set to false, update the entire mesh
        partialUpdate   yes;

        // Cache the motion addressing (changed points, faces, cells etc)
        cacheMotion     yes;
    }
2022-05-19 15:48:31 +00:00
f1dfaa90a7 ENH: Updated cyclicACMIPolyPatch following changes to geometry updates
The cell volumes are no longer deleted if already present; instead, cells
next to the patch are updated locally.
2022-05-19 15:48:31 +00:00
2493102044 ENH: added updateMesh(mpm) callback for surfaceInterpolation/fvGeometryScheme 2022-05-19 15:48:31 +00:00
823641ab9b ENH: refactored mesh movePoints to enable meshPhi update in the fvGeometryScheme 2022-05-19 15:48:31 +00:00
5a1307f41a STYLE: Code clean-up 2022-05-19 15:48:31 +00:00
0dc1faa2be ENH: primitiveMeshTools - added partial geometry update functions
Added new functions:
- updateFaceCentresAndAreas : update faces in faceIDs list
- updateCellCentresAndVols  : update cells in cellIDs list
2022-05-19 15:48:31 +00:00
ef14a415a9 ENH: ListOps - added uniqueSort function 2022-05-19 15:48:31 +00:00
053727d2d9 ENH: Enable Time objects for writeObjects FO 2022-05-19 15:48:31 +00:00
73d6fc9e91 ENH: Added profiling for dynamic mesh updates 2022-05-19 15:48:31 +00:00
6e644a1e8b ENH: solidFoam: energyCoupling tests 2022-05-19 14:28:45 +01:00
468f0a028a Merge branch 'feature-soft-wall-in-sixdof' into 'develop'
ENH: sixDoFRigidBodyMotion: add new softWall restraint

See merge request Development/openfoam!536
2022-05-19 10:58:40 +00:00
eb55af49dc ENH: sixDoFRigidBodyMotion: add new softWall restraint 2022-05-19 11:48:36 +01:00
da4827d7d2 Merge branch 'feature-extension-effectivenessHeatExchangerSource' into 'develop'
ENH: effectivenessHeatExchangerSource: add writeFile functionality

See merge request Development/openfoam!534
2022-05-18 16:08:05 +00:00
a2959b7586 STYLE: effectivenessHeatExchangerSource: modernise code
- removed redundant protected scope
- removed undefined 'calculateTotalArea' function
- reordered the constructor list

DOC: effectivenessHeatExchangerSource: improve header documentation
2022-05-18 16:07:25 +00:00
5bcf9b7997 ENH: effectivenessHeatExchangerSource: add secondaryOutletT functionality 2022-05-18 16:07:25 +00:00
9118ffb31e ENH: effectivenessHeatExchangerSource: add writeFile functionality 2022-05-18 16:07:25 +00:00
796715b029 Merge branch 'issue-1457-refcast' into 'develop'
ENH: Improve the handling of wall-function coefficients and blenders

See merge request Development/openfoam!486
2022-05-18 16:05:20 +00:00
b2610f19db ENH: wall functions: remove redundant and inconsistent virtual specifiers 2022-05-18 16:07:56 +01:00
e2a1076129 STYLE: wall functions: use more modern coding practices
The most frequent changes have been as follows.

from:

    tmp<scalarField> tuTau(new scalarField(patch().size(), Zero));
    scalarField& uTau = tuTau.ref();

to:

    auto tuTau = tmp<scalarField>::New(patch().size(), Zero);
    auto& uTau = tuTau.ref();

- Other changes involved the addition of - wherever approapriate -:

    const
    noexcept
    auto
2022-05-18 16:07:56 +01:00
dcfbdd2cad DOC: wall functions: update header-file documentation 2022-05-18 16:07:56 +01:00
876fc94bc8 ENH: wall functions: new class for wall-function blending methods 2022-05-18 16:07:53 +01:00
c7836f9d83 BUG: nutWallFunction: prevent casting errors (fixes #1457, #1966)
Previously, a nutWallFunctionFvPatchScalarField ref should be
created in epsilon, k, and omega wall functions to fetch various
common wall-function coefficients necessary to carry out and complete
local operations inside these wall functions.

However, this arrangement required the use of a nut wall function,
even when unnecessary, when any of non-nut wall functions are being used.
Therefore, some users had been redundantly restrained and
obstructed with rather obscure casting-error messages.

Also, the wall-function coefficients Cmu, kappa and E have been obtained
from the specified nutWallFunction in order to ensure that each patch
possesses the same set of values for these coefficients.

Although the motivation sounds reasonable, it has also been putting redundant
restraints on users and disregarding the specifics of each wall-function.
For example, the variation of epsilon in near-wall regions is usually very
steep and non-monotonic specific - an expert user may therefore want to use
an epsilon-specific coefficient, and this was not allowed by the previous
arrangement.

This commit introduces a new class (i.e. wallFunctionCoefficients) comprising
all common wall-function coefficients and yPlus calculations.
2022-05-18 14:54:26 +01:00
486be34631 BUG: wall functions: ensure consistent writing of traits
Previously, a number of wall functions were not not writing
their boundary-condition entries in the defacto order
(i.e. from type to value) while writing a field. For example:

    <patchName>
    {
        lowReCorrection 1;
        blending    stepwise;
        n           2;
        type        epsilonWallFunction; <!-- expected to be the first entry
        value       uniform 1;           <!-- expected to be the last entry
    }

Also, various wall functions have been writing out entries that
have not been being used by the wall function. For example:

    <patchName>
    {
        type        nutUSpaldingWallFunction;
        ...
        blending    stepwise;     <!-- no blending treatment in nutUSpaldingWF
        ...
    }

Additionally, various derived wall functions (e.g. atmOmegaWallFunction)
have been failing to write some of the inherited entries even though
these entries have been being used in carrying out wall-function calculations.

Taken these into consideration, wall functions have been reworked to obtain
reliable and consistent way of writing their traits while writing out a field.

- writeLocalEntries uses writeIfDifferent if constructed with getOrDefault.
2022-05-18 14:54:22 +01:00
06b353f8cd ENH: add faMeshTools for new/load mesh, proc addressing etc
ENH: simple faMeshSubset (zero-sized meshes only)

ENH: additional access methods for faMesh, primitive geometry mode

- wrapped walking of boundary edgeLabels as list of list
  (similar to edgeFaces).

- primitive finiteArea geometry mode with reduced communication:
  primarily interesting for decomposition/redistribution (#2436)

ENH: extra vtk debug outputs for checkFaMesh

- report per-processor sizes in the mesh summary
2022-05-17 17:36:34 +02:00
68b692fdfc ENH: combine loadOrCreateMesh from redistributePar into fvMeshTools.
- similar functionality as newMesh etc.
  Relocated to finiteVolume since there are no dynamicMesh dependencies.

- use simpler procAddressing (with updated mapDistributeBase).
  separated from redistributePar
2022-05-17 17:35:51 +02:00
b712e7289e ENH: use typed lookup versions instead of xyz::typeName literals 2022-05-17 17:35:51 +02:00
95e2a2e887 ENH: add sorted() to objectRegistry and IOobjectList
- returns UPtrList view (read-only or read/write) of the objects

- shorter names for IOobject checks: hasHeaderClass(), isHeaderClass()

- remove unused IOobject::isHeaderClassName(const word&) method.
  The typed versions are preferable/recommended, but can still check
  directly if needed:

     (io.headerClassName() == "foo")
2022-05-17 17:35:51 +02:00
f1098673c0 STYLE: compare Dynamic{Field,List} by casting address to common class
- previously used cdata() comparison but that tends to obscure what is
  going on
2022-05-17 17:35:51 +02:00
87f3866f20 ENH: support move append lists for PtrList and UPtrList 2022-05-17 17:35:51 +02:00
60e07d1f93 ENH: refine mapDistribute methods
- additional distribute/reverseDistribute with specified commsType.
  Improves flexibility.

- distribute with nullValue

- support move construct mapDistribute from mapDistributeBase

- refactor handling of schedules (as whichSchedule method) to
  simplify code.

- renumberMap helper for working with compact sub maps
  and renumberVisit for handling walk-ordered compaction.

COMP: make mapDistributeBase data private

- accessor methods are available - direct access is unnecessary
- mapDistribute : inherit mapDistributeBase constructors

STYLE: use List<labelPair>::null() for schedule placeholders

- clearer that they are doing nothing
2022-05-17 17:35:51 +02:00
ae0ef3efed COMP: make Function1 writeEntries virtual 2022-05-17 17:35:51 +02:00
9e2214131c COMP: Removed unused variable 2022-05-17 16:20:32 +01:00
edb0c5880b ENH: surfaceNoise - added optional areaAveraging for 1/3 octave data 2022-05-17 16:20:32 +01:00
6cafe441f8 ENH: valueAverageBase - added support for averaging label values 2022-05-17 16:20:32 +01:00
5d9456187d ENH: zero tag for constructing various IO types
- for int64 compilations this disambiguates between '0' as int32 (size)
  or as bool 'false' for local processor validity

  Eg,

     IOList list(io, 0);     <- With label-size 64: is this bool or label?
     IOList list(io, Zero);  <- Size = 0 (int32/int64), not a bool
2022-05-12 13:47:03 +02:00
812f4c4f09 BUG: globalIndex fails non-blocking gather of indirect list (fixes #2467)
- for indirect lists we use element-wise output streaming and read
  back as a regular list. This approach cannot however work with
  non-blocking mode - the receive buffers will simply not be filled
  before attempting to read from them.

  For contiguous data, the lowest overhead solution is to locally
  flatten the indirect list and use the regular gather routines
  for non-blocking mode. For non-contiguous data, can continue to
  use the element-wise output, but cannot use non-blocking for it.

STYLE: use non-blocking consistently as default for globalIndex gather(s)

- most of the front-facing code was already using non-blocking,
  but there were a few low-level routines defaulting to scheduled
  (but never relied upon in the code).
2022-05-12 11:29:38 +02:00
809fc70166 BUG: redistributePar: reconstruct mesh 2022-05-11 16:06:52 +01:00
efe057897f ENH: foamToVTK attempt finite-area write if -with-ids is specified
- previously filtered on the existence of area fields, but with
  faMesh::TryNew this is not required anymore.

STYLE: enable -verbose for various parallel utilities (consistency)
2022-05-11 11:34:04 +02:00
9c727abb84 COMP: increment lemon sources, fix stray comment char (wmkdepend)
COMP: compile utilites before solvers

- there are no inter-dependencies,
  so favour getting utilities working first
2022-05-11 09:53:58 +02:00
0ed0856593 COMP: avoid Istream/List operator() ambiguity (gcc-4.8.5)
- introduced UList<bool>::operator()(label) as part of bf0b3d8872
  but with gcc-4.8.5 this participates in operator resolution even
  for non-bool lists!!
  Partial revert until this predicate handling is really required.
2022-05-11 08:57:05 +02:00
dd560a6e3c ENH: reduce allocations/sorting when setting time (#2461)
- use DynamicList instead of List in the cache, which reduces the
  number of allocations occuring each time.

- since the cached times are stored in sorted order, first check if the
  new time is greater than the last list entry. Can then simply append
  without performing a binary search and can obviously also skip any
  subsequent sorting.

STYLE: add noexcept to Instant methods, declare in header (like Tuple2)
2022-05-10 21:16:09 +02:00
525f77f8bb TUT: add constraint types for finiteArea tutorials
STYLE: accept '-proc' as shortcut in restore0Dir function
2022-05-10 21:16:09 +02:00
de59875147 BUG: probes not written to probes/0 output (fixes #2452)
- as part of #2358 the writing was changed to be lazy.
  Which means that files are only created before they are actually
  written, which helps avoid flooding the filesystem if sample-only
  is required and also handles case such as "rho.*" where the sampled
  fields are not known from the objectRegistry at startup.

- now create any new files using the startTime value, which means they
  are easier to find but still retains the lazy construct.

  Don't expect any file collisions with this, but there could be some
  corner cases where the user has edited to remove fields (during
  runtime) and then re-edits to add them back in. In this case the
  file pointers would be closed but reopened later and overwriting
  the old probed values. This could be considered a feature or a bug.

BUG: bad indexing for streamlines (fixes #2454)

- a cut-and-paste error
2022-05-10 21:16:09 +02:00
762c095f4e COMP: WM_SCHEDULER breaks compilation (fixes #2439)
- only wrap compiler calls (not things like flex/bison)
- avoid single quoted '&&' (causes syntax errors)

STYLE: report WM_COMPILE_CONTROL value in top-level Allwmake
2022-05-10 21:15:39 +02:00
ebc634a425 Merge branch 'feature-reorganise' into 'develop'
code style, bug fixes

See merge request Development/openfoam!535
2022-05-10 11:07:46 +00:00
42de624344 ENH: consolidate processorTopology handling for volume and area meshes
- relocate templating to factory method 'New'.
  Adds provisions for more general re-use.

- expose processor topology in globalMesh as topology()

- wrap proc->patch lookup as processorTopology::procPatchLookup method
  (failsafe). May consider using Map<label> for its storage in the
  future.
2022-05-10 10:47:01 +02:00