Commit Graph

1069 Commits

Author SHA1 Message Date
1bce1e44c4 ENH: propellerInfo - updated to work in postProcess mode. Fixes #2588 2024-06-07 12:36:59 +01:00
b2532e7769 BUG: extractEulerianParticles - corrected patch index. Fixes #2707 2024-06-07 12:26:03 +01:00
64c15e179a ENH: New viewFactorHeatFlux function object
Determines radiation heat flux between patches when using the viewFactor
radiation model.

Example usage

    viewFactorHeatFlux1
    {
        // Mandatory entries (unmodifiable)
        type        viewFactorHeatFlux;
        libs        (utilityFunctionObjects);

        // Optional entries (runtime modifiable)
        qr          qr;
    }
2024-06-04 16:39:56 +00:00
dfc9a8923a ENH: read support for EnSight single-file transient (#3154)
- the ensightReadFile init() now automatically sets up binary/ascii
  (for geometry files) and checks for the transient "BEGIN TIME STEP"
  marker. If found, will also populate the file offsets for each of
  the timesteps.  If no corresponding footer is found (which would be
  very inefficient), it simply pretends that there is only a single
  time step instead of performing a costly file scan.

- parsing of the ensight case file now also supports the use of

      filename numbers:

  as an alternative to

      filename start number:
      filename increment:

- improved parsing robustness of "time values:" entry.
  Can now also have contents on the same line as the introducer.

ENH: base-level adjustments for writing transient single-file

- beginGeometry() is now separated out from file creation.

- in append mode, ensightFile and ensightGeoFile will attempt to
  parse existing time-step information.
2024-05-29 14:04:52 +00:00
ffc9894033 STYLE: more consistency in writeEntry() signatures
- boundary entries with writeEntry(const word&, ...) instead of
  writeEntry(const keyType&, ...) to match with most other
  writeEntry() signatures. Also, this content will not be used
  to supply regex matched sub-dictionaries.

STYLE: more consistent patch initEvaluate()/evaluate() coding
2024-05-28 17:50:03 +01:00
6a80d4de40 ENH: reduce boundary face queries in streamFunction
BUG: streamFunction used uninitialized values for symmetry patches

- related to 8a8b5db977 changes (#3144)

ENH: improve robustness of surface field flattening

- vtk::surfaceFieldWriter
2024-05-23 13:51:53 +02:00
a7538fab57 BUG: interfaceHeight: fix header writing to output files (fixes #3115) 2024-05-08 11:20:34 +01:00
7b38b148fa STYLE: use PstreamBuffers default construct
- PstreamBuffers are nonBlocking by default, so no need to re-specify
2024-04-29 10:21:25 +02:00
7f355ba343 STYLE: communication name "buffered" instead of "blocking"
- "buffered" corresponds to MPI_Bsend (buffered send),
  whereas the old name "blocking" is misleading since the
  regular MPI_Send also blocks until completion
  (ie, buffer can be reused).

ENH: IPstream::read() returns std::streamsize instead of label (#3152)

- previously returned a 'label' but std::streamsize is consistent with
  the input parameter and will help with later adjustments.

- use <label> instead of <int> for internal accounting of the message
  size, for consistency with the underyling List<char> buffers used.

- improve handling for corner case of IPstream receive with
  non-blocking, although this combination is not used anywhere
2024-04-29 10:19:40 +02:00
31aadc5c4d ENH: prefer objectRegistry sorted to lookupClass
- lower memory overhead, consistent access pattern
2024-04-16 10:18:08 +02:00
16dd92b38e ENH: reduce reliance on stringListOps functions
- findStrings, findMatchingStrings now mostly covered by matching
  intrinsics in wordRe and wordRes.

  Add static wordRes match() and matching() variants

COMP: remove stringListOps include from objectRegistry.H

- was already noted for removal (NOV-2018)
2024-04-16 10:18:08 +02:00
7006056eae ENH: remove blocking communication for gather patterns
ENH: eliminate unnecessary duplicate communicator

- in globalMeshData previously had a comm_dup hack to avoid clashes
  with deltaCoeffs calculations. However, this was largely due to a
  manual implementation of reduce() that used point-to-point
  communication. This has since been updated to use an MPI_Allreduce
  and now an MPI_Allgather, neither of which need this hack.
2024-03-06 11:10:54 +01:00
71d4a23ec0 ENH: use tmp field factory methods [6] (#2723)
- src/functionObjects
2024-02-21 14:31:40 +01:00
ac574a6ccb STYLE: use static call for regIOobject::store (#1507) 2024-02-20 16:56:22 +01:00
506802bbea BUG: wallHeatFlux: avoid field-name inconsistency (fixes #3102) 2024-02-14 13:40:29 +00:00
52f5a6d039 ENH: additional ensightCloud function object (#3095) 2024-02-02 12:46:42 +01:00
6dadd3d33e ENH: include cloudFunction results in vtkCloud writing (#3094)
- process the contents of the cloud object registry, which enables
  output support for calculated values such as Reynolds, Weber numbers
  etc.

ENH: select any/all clouds by default instead of defaultCloud

- adds robustness
2024-02-01 17:52:21 +01:00
152eceeb56 Use factory Clone for patch fields 2024-01-23 11:22:19 +00:00
5d5f541dd6 ENH: add objectRegistry newIOobject() helper method
- creates an IOobject at the current time instance (timeName) with
  NO_READ/NO_WRITE/NO_REGISTER characteristics.
  This generalises and replaces the Cloud fieldIOobject() to simplify
  some common use.

  // Shorter version (new):
      volScalarField fld
      (
          mesh.newIOobject(name),
         ...
      );

  // Longer version:
      volScalarField fld
      (
          IOobject
          (
              name,
              mesh.time().timeName(),
              mesh,
              IOobject::NO_READ,
              IOobject::NO_WRITE
              IOobject::NO_REGISTER
           ),
           ...
      );
2024-01-17 10:44:17 +01:00
987dbe4589 ENH: use factory Clone method for handling member clone() methods
- reduces code clutter, simplifies modification for new types.
  Handled classes:

    Function1, PatchFunction1, coordinateRotation, coordinateSystem,
    particle, liquidProperties, solidProperties
2024-01-09 11:56:45 +00:00
ad85b684bb STYLE: remove unused/stray methods, fix stray deprecated usages
STYLE: use separate value/dimensions for GeometricField

- simplifies calling parameters

COMP: limit enumeration range when reporting chemkin error
2024-01-08 17:42:55 +01:00
af43f9aa24 ENH: caseInfo - use OF dictionary as default writeFormat
STYLE: checkMesh - removed writeChecks uppercase JSON option
2023-12-19 20:31:08 +00:00
c9a9309b8c ENH: simplify construction of zero-sized Clouds
- use Foam::zero as a dispatch tag

FIX: return moleculeCloud::constProps() List by reference not copy

STYLE: range-for when iterating cloud parcels

STYLE: more consistent typedefs / declarations for Clouds
2023-12-15 16:17:15 +01:00
28b6a5b85a ENH: allow modification of tmp state (cached or uncached)
- simplifies handling.
  * enables unprotecting to avoid accidentally cloning.
  * removes the need for dedicated constructor or factory forms.
  * simplfies DimensionedField and GeometricField New factory methods

- update objectRegistry management method (internal use)

  old:  bool cacheTemporaryObject(...)
  new:  bool is_cacheTemporaryObject(...)

  to clarify that it is a query, not a request for caching etc.
2023-12-11 15:56:00 +01:00
2fa0c7520c ENH: provide faMesh static accessors for registry and single-region
- the fields for finite-area are currently stored directly on the
  polyMesh registry, but for future relocation to a sub-registry
  provide a uniform accessor.

ENH: use thisDb() for faMatrix access and extrapolatedCalculated
2023-12-11 15:56:00 +01:00
ef44df91f2 ENH: support direct lookup of solver controls
OLD:
        pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
        pEqn.solve(mesh.solver("Yi"));

    NEW:
        pEqn.solve(p.select(piso.finalInnerIter()));
        pEqn.solve("Yi");
2023-12-07 17:42:24 +01:00
30a7c22563 ENH: support 'if-present' handling of relaxation coefficients
- new

  scalar relaxCoeff = 0;
  if (solution().relaxEquation(name, relaxCoeff))
  {
      relax(relaxCoeff);
  }

  // or
  scalar relaxCoeff = 0;
  solution().relaxEquation(name, relaxCoeff);

- old

  if (solution().relaxEquation(name))
  {
      relax(solution().equationRelaxationFactor(name));
  }

  // or
  scalar relaxCoeff = 0;
  if (solution().relaxEquation(name))
  {
      relaxCoeff = solution().equationRelaxationFactor(name);
  }
2023-12-07 17:42:24 +01:00
ca25929372 ENH: minor simplifications for handling region meshes
- static version of polyMesh::meshDir(), which takes a region name

      polyMesh::meshDir(regionName)
  vs
      polyMesh::regionName(regionName)/polyMesh::meshSubDir

STYLE: use polyMesh::regionName(..) instead of comparing to defaultRegion

STYLE: use getOrDefault when retrieving various -region options

FIX: polyMesh::dbDir() now checks registry name, not full path (#3033)
2023-12-07 17:42:24 +01:00
6242e70d09 ENH: Added new caseInfo function object
Collects and writes case information to file in OpenFOAM dictionary or JSON
format.  Data includes:

- meta: case name, path, regions, parallel etc.
- dictionaries: entries retrieved from dictionaries - registered or from file
- per region: mesh metrics, boundary and boundary field types
- function object results

Example of function object specification:

    caseInfo
    {
        type            caseInfo;
        libs            (utilityFunctionObjects);

        // Warn when entries are not found
        lookupMode  warn; // none | warn | error;

        // Write format
        writeFormat json; //  dictionary | json;

        dictionaries
        {
            USolver // User-specified names
            {
                // Look up using registered name
                name        "fvSolution";

                // Optionally limit to specific entries
                include
                (
                    "solvers/U/solver"
                );
            }
            fvSchemes
            {
                name        "fvSchemes";

                // include all entries by default
            }
            timeScheme
            {
                name        "fvSchemes";

                include
                (
                    "/ddtSchemes/default"
                );
            }

            turbulence
            {
                name        "turbulenceProperties";

                // include all entries by default
            }
            controlDict
            {
                // Look up using file path
                path        "<case>/system/controlDict";

                include
                (
                    "application"
                    "deltaT"
                    "startTime"
                    "endTime"
                );
            }
        }

        functionObjects (minMax1);
    }
2023-12-01 14:00:52 +00:00
79cd147de0 STYLE: Refactoring use of meshState in {fv|faMesh}
{fv|fa}Mesh classes inherited the [old] data class (renamed meshState)
- meshState removed from inheritance list and added as data members
2023-12-01 11:54:35 +00:00
d0542c7014 Feature evaluation check 2023-11-16 10:33:32 +00:00
9ac7982d64 ENH: mapFields FO - continuation of commit 46faebf783
- cuttingPatches now automatically constructed when createPatchMap is true
2023-11-14 15:19:09 +00:00
46faebf783 ENH: mapFields FO - see #3013
- Added option to automatically create patch map when consistent=false

  Example usage:

      // New optional entry
      createPatchMap    yes;

- Cross-ref: EP2230
2023-11-10 19:04:35 +00:00
f3d939fa10 ENH: electricPotential: add finite-volume constraint hook 2023-11-03 14:32:49 +00:00
a50ee8e2d2 BUG: electricPotential: correct return value of read function 2023-11-03 14:32:49 +00:00
29e2718162 ENH: add face/triFace contains(edge) method (#3004)
STYLE: use contains() and reduce reliance on edgeDirection -1/+1 values
2023-10-26 14:11:28 +02:00
a7bb8edbad COMP: avoid issues with new compilers and/or new C++ standards
- prevent automatic comparison rewriting (c++20)
- no bitwise operations between different enumerations
- template instantiation

ENH: add DimensionedField Internal typedef (simplifies handling)
2023-10-23 09:45:41 +02:00
dafae668d1 ENH: support user specification of ensight time format/precision (#2999)
- new format option keywords: timeFormat, timePrecision

CONFIG: default ensight output is now consistently BINARY

- this removes some uncertainty with the ensightWrite functionObject
  which was previously dependent on the simulation writeFormat
  and makes its behaviour consistent with foamToEnsight

  Note: binary Ensight output is consistent with the
  defaults for VTP output (inline binary)

ENH: minor adjustment of ensight writing methods
2023-10-19 10:28:09 +00:00
d9727fad1c ENH: use updated HashTable methods 2023-10-11 18:11:37 +00:00
a252677618 BUG: Lambda2: reverse the sign of the governing equation (fixes #2731) 2023-09-27 17:09:13 +01:00
2e3f0811a0 ENH: error handling for empty surfaces in surfaceFieldValue (#2966)
- for workflows with appearing/disappearing patches (for example)
  can specify that empty surfaces should be ignored or warned about
  instead of raising a FatalError.

  Note that this handling is additional to the regular top-level
  "errors" specification. So specifying 'strict' will only actually
  result in a FatalError if the "errors" does not trap errors.

- "ignore" : any empty surfaces are simply ignored and no
  file output (besides the header).

- "warn" : empty surfaces are warned about a few times (10)
  and the file output contains a NaN entry

- "strict" : corresponds to the default behaviour.
  Throws a FatalError if the surface is empty.
  This error may still be caught by the top-level "errors" handling.
2023-09-05 15:36:53 +00:00
14f7d44ca0 ENH: patch/zone indices with select/ignore combination
STYLE: prefer indices() to patchSet() with warn=false
2023-08-02 12:34:41 +02:00
db16d80840 ENH: use objectRegistry/IOobjectList sorted instead of lookupClass
- in most cases a parallel-consistent order is required.
  Even when the order is not important, it will generally require
  fewer allocations to create a UPtrList of entries instead of a
  HashTable or even a wordList.
2023-07-31 20:11:32 +02:00
d65e2d89b5 ENH: use MinMax for bounds management in binModels (code simplication) 2023-07-31 20:11:32 +02:00
dc95242cd2 ENH: use sorted order for fieldSelection::selectionNames() (#2819)
- return a sorted wordList instead of a wordHashSet to ensure that
  fields will be processed in consistent order in parallel
2023-07-31 20:11:32 +02:00
ed314b2740 ENH: use sorted order for patch IDs in fieldFunctionObjects (#2819)
- replaces labelHashSet with a sorted labelList to ensure that patches
  will be processed in consistent order in parallel
2023-07-31 20:11:32 +02:00
5397c9ac04 COMP: use csorted() instead of sorted() 2023-07-31 20:11:32 +02:00
4dfafc3c36 ENH: store sorted mesh pointers for vtkWrite, areaWrite
- replaces HashTable of pointers
2023-07-27 16:52:03 +02:00
945e3e41b1 ENH: more consistent use of good() or direct testing instead valid() 2023-07-27 16:52:03 +02:00
8117cde596 ENH: use emplace_set, emplace_back to simplify code
- eg, for cloud fields, tmp emplace when reading fields etc.
2023-07-27 16:52:03 +02:00