Commit Graph

25666 Commits

Author SHA1 Message Date
Mark Olesen
cc1e6c12bb ENH: redistributePar support for finiteArea (#2436) 2022-05-25 13:12:38 +00:00
Mark Olesen
6644cf8ddb ENH: cleanup/reorganize parts of redistributePar
- separate out lagrangian routines etc

- align names with regular decompose/reconstruct methods
2022-05-25 13:12:38 +00:00
mattijs
f976a02bd0 ENH: redistributePar - add support for pointFields (#2436) 2022-05-25 13:12:38 +00:00
Mark Olesen
4c5c15664e ENH: faMeshDistributor for handling redistribution of finiteArea (#2436) 2022-05-25 13:12:38 +00:00
Mark Olesen
15535b8970 ENH: mapDistributeBase compaction based on a subset of elements (#2436)
- now have both compactData(),compactLocalData(), compactRemoteData()
  depending on where the compaction information is actually known.

  The compactData() performs a consistent union of local and remote
  values, which eliminates the danger of mapping to non-existent
  locations but does require a double communication to setup.
  Typically needed for point maps (for example).

  The compactLocalData() and compactRemoteData() work on the
  assumption that the source or target values are sufficent for
  creating unique compact maps.

  Can be used, for example, when compacting cell maps since there is
  no possibility of a source cell being represented on different
  target processors (ie, each cell is unique and only occurs once).

  The existing compact() is equivalent to compactRemoteData()
  and is now simply a redirect.

- use bitSet for defining compaction, but the existing compact()
  continues to use a boolList (for code compatibility).

BUG: compaction in non-parallel mode didn't compact anything.

STYLE: compact ascii output for procAddressing
2022-05-25 13:12:38 +00:00
Mark Olesen
3b6761afed ENH: code modernization for decompose/reconstruct
- simplify procAddressing read/write

- avoid accessing points in faMeshReconstructor.
  Can rely on the patch meshPoints (labelList), which does not need
  access to a pointField

- report number of points on decomposed mesh.
  Can be useful additional information.
  Additional statistics for finite area decomposition

- provide bundled reconstructAllFields for various reconstructors

- remove reconstructPar checks for very old face addressing
  (from foam2.0 - ie, older than OpenFOAM itself)

- bundle all reading into fieldsDistributor tools,
  where it can be reused by various utilities as required.

- combine decomposition fields as respective fieldsCache
  which eliminates most of the clutter from decomposePar
  and similfies reuse in the future.

STYLE: remove old wordHashSet selection (deprecated in 2018)

BUG: incorrect face flip handling for faMeshReconstructor

- a latent bug which is not yet triggered since the faMesh faces are
  currently only definable on boundary faces (which never flip)
2022-05-25 13:12:38 +00:00
mattijs
eccc998ed2 ENH: solidFoam: cleanup of sample case 2022-05-24 12:43:06 +01:00
Andrew Heather
4f4d333539 TUT: liquidFilmFoam - corrected cylinder h boundary condition 2022-05-23 09:42:42 +01:00
mattijs
e7fbb7e557 BUG: snappyHexMesh: unset moving flag. Fixes #2477
We want to use movePoints to update all the geometry
but do not want to have a meshPhi
2022-05-20 17:35:04 +01:00
mattijs
daca02dfd1 BUG: snappyHexMesh: unset moving flag. Fixes #2477 2022-05-20 17:11:25 +01:00
Tom Chen
ee6c241b69 BUG: atmBoundaryLayer: replace global groundMin with local min (fixes #2471) 2022-05-20 10:05:23 +01:00
Mattijs Janssens
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
Andrew Heather
b6390c2b75 COMP: resolved compiler warning 2022-05-19 15:48:31 +00:00
mattijs
3a8a7cc6d4 ENH: snappyHexMesh: remove any left-over mesh data before topo change 2022-05-19 15:48:31 +00:00
Andrew Heather
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
Andrew Heather
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
Andrew Heather
2493102044 ENH: added updateMesh(mpm) callback for surfaceInterpolation/fvGeometryScheme 2022-05-19 15:48:31 +00:00
Andrew Heather
823641ab9b ENH: refactored mesh movePoints to enable meshPhi update in the fvGeometryScheme 2022-05-19 15:48:31 +00:00
Andrew Heather
5a1307f41a STYLE: Code clean-up 2022-05-19 15:48:31 +00:00
Andrew Heather
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
Andrew Heather
ef14a415a9 ENH: ListOps - added uniqueSort function 2022-05-19 15:48:31 +00:00
Andrew Heather
053727d2d9 ENH: Enable Time objects for writeObjects FO 2022-05-19 15:48:31 +00:00
Andrew Heather
73d6fc9e91 ENH: Added profiling for dynamic mesh updates 2022-05-19 15:48:31 +00:00
mattijs
6e644a1e8b ENH: solidFoam: energyCoupling tests 2022-05-19 14:28:45 +01:00
Andrew Heather
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
Kutalmis Bercin
eb55af49dc ENH: sixDoFRigidBodyMotion: add new softWall restraint 2022-05-19 11:48:36 +01:00
Andrew Heather
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
Kutalmis Bercin
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
Kutalmis Bercin
5bcf9b7997 ENH: effectivenessHeatExchangerSource: add secondaryOutletT functionality 2022-05-18 16:07:25 +00:00
Kutalmis Bercin
9118ffb31e ENH: effectivenessHeatExchangerSource: add writeFile functionality 2022-05-18 16:07:25 +00:00
Andrew Heather
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
Kutalmis Bercin
b2610f19db ENH: wall functions: remove redundant and inconsistent virtual specifiers 2022-05-18 16:07:56 +01:00
Kutalmis Bercin
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
Kutalmis Bercin
dcfbdd2cad DOC: wall functions: update header-file documentation 2022-05-18 16:07:56 +01:00
Kutalmis Bercin
876fc94bc8 ENH: wall functions: new class for wall-function blending methods 2022-05-18 16:07:53 +01:00
Kutalmis Bercin
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
Kutalmis Bercin
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
mattijs
6f4196ae62 BUG: totalFlowRateAdvectiveDiffusive: missing autoMap. Fixes #2475 2022-05-18 12:19:33 +01:00
Mark Olesen
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
Mark Olesen
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
Mark Olesen
b712e7289e ENH: use typed lookup versions instead of xyz::typeName literals 2022-05-17 17:35:51 +02:00
Mark Olesen
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
Mark Olesen
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
Mark Olesen
87f3866f20 ENH: support move append lists for PtrList and UPtrList 2022-05-17 17:35:51 +02:00
Mark Olesen
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
Mark Olesen
ae0ef3efed COMP: make Function1 writeEntries virtual 2022-05-17 17:35:51 +02:00
Andrew Heather
9e2214131c COMP: Removed unused variable 2022-05-17 16:20:32 +01:00
Andrew Heather
edb0c5880b ENH: surfaceNoise - added optional areaAveraging for 1/3 octave data 2022-05-17 16:20:32 +01:00
Andrew Heather
6cafe441f8 ENH: valueAverageBase - added support for averaging label values 2022-05-17 16:20:32 +01:00
Mark Olesen
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