Commit Graph

26780 Commits

Author SHA1 Message Date
Mark Olesen
47062b614c GIT: remove supplementary IOobjectOption handling for faMesh
- was previously used to suppress loading of faSchemes/faSolution,
  but now superfluous.
2023-12-07 17:42:25 +01:00
Mark Olesen
205719d449 ENH: use demand-driven schemes and solution w/o compatibility layer 2023-12-07 17:42:25 +01:00
Mark Olesen
916d3b902f INT: introduce demand-driven fvSchemes and fvSolution
- functionality similar to that introduced by openfoam.org

  fvSchemes/fvSolution now demand-driven and accessed by their respective
  member functions schemes() and solution().

  This means that the corresponding system files are not required upon
  construction (which simplifies initialization) and potentially allows
  supporting different file locations (TBD).

  The trailing 'Schemes' suffix has been dropped since the context is
  apparent from the member function. For example,

      Old:  mesh.ddtScheme(fieldName)
      New:  mesh.schemes().ddt(fieldName)

  This is however a non-breaking change with legacy naming continuing
  to be supported (may be noisily deprecated in the future)
2023-12-07 17:42:25 +01:00
Mark Olesen
13352861c8 ENH: improve consistency in handling of global IOobjects (#3045)
- replace typeGlobal() global function with is_globalIOobject
  traits for more consistent and easier overriding.

- relocate typeFilePath() global function as a member of IOobject
  for consistency with typeHeaderOk.

BUG: faSchemes, fvSchemes not marked as global file types

- caused issues with collated
2023-12-07 17:42:25 +01:00
Mark Olesen
43143f21d2 BUG: mis-loading of faMesh in redistribute mode (see !605) 2023-12-07 17:42:25 +01:00
Mark Olesen
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
Mark Olesen
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
Mark Olesen
42feffc794 ENH: harmomize schemes-lookup and solution internal accessor names
FIX: correct the schemes internal dictionary name

- change from '.' to '/' delimiter as per 886ba89ddb (#1073)
2023-12-07 17:42:24 +01:00
Mark Olesen
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
Mark Olesen
f377875bc8 FIX: avoid questionable lookup and casting for interfaceTrackingFvMesh 2023-12-07 17:42:24 +01:00
Mark Olesen
149cd7042f ENH: use thisDb reference when referencing/creating finite-area fields
COMP: remove faMesh::operator()() in favour of mesh() or thisDb() instead

- makes the purpose and usage clearer
2023-12-07 17:42:24 +01:00
Mark Olesen
c9e4b0edac FIX: avoid doubled dbDir() in fileOperation::readObjects (#3037) 2023-12-07 17:42:24 +01:00
Mark Olesen
09fdeaa38a ENH: more consistent use of endEntry (issue #3035)
- enables capturing of end entry as an event
2023-12-07 17:42:24 +01:00
Mark Olesen
2de1a26c7b STYLE: indentation, comments
ENH: additional faMesh cleanup in CleanFunctions
2023-12-07 17:42:24 +01:00
mattijs
227480c366 TUT: snappyHexMesh: demo multiple insidePoints 2023-12-07 14:42:22 +00:00
mattijs
8cd22c1a83 TUT: redistributePar does not write dummy meshes anymore. 2023-12-07 10:22:57 +00:00
Andrew Heather
0d16e1a7c6 ENH: variableHeightFlowRateInletVelocity BC - update for moving meshes. See #3012
Dynamic mesh updates trigger a velocity field update. For [this] BC the update
can fail if the dependent alpha field has not already been updated.
2023-12-06 14:52:05 +00:00
Andrew Heather
513fe05c21 ENH: GeometricBoundaryField - added evaluateSelected function
Provides a mechanism to update specific boundary conditions
2023-12-06 14:52:05 +00:00
mattijs
6c0ee5d177 BUG: shm: fix to unbalancing info printing. See #3034. 2023-12-06 09:46:51 +00:00
mattijs
9a7e97ab98 BUG: fileHandler: wrong communicator. Fixes #3042 2023-12-05 17:36:51 +00:00
Andrew Heather
aa71de0db3 Merge branch 'feature-kinematic-weber-no' into 'develop'
ENH: KinematicWeberNumber: New cloud function object

See merge request Development/openfoam!648
2023-12-05 09:48:42 +00:00
Kutalmis Bercin
1973c75899 STYLE: ReactingWeberNumber: rename WeberNumberReacting function object for consistency 2023-12-05 09:47:23 +00:00
Kutalmis Bercin
4c6b7217d1 ENH: KinematicWeberNumber: add new cloud function object 2023-12-05 09:47:23 +00:00
Mark Olesen
9c8c69a5f3 STYLE: less noisy setting of first/final iteration 2023-12-04 16:24:20 +00:00
Kutalmis Bercin
1482547756 BUG: facGrad: ensure compatibility between caching and corrections (fixes #3039) 2023-12-04 15:34:02 +00:00
mattijs
4609aa38e1 BUG: redistributePar: fix global object headerOk. See !605
- mesh/parallel/cavity not yet working since zero-sized mesh
  not written on new processors.
2023-12-04 14:40:32 +00:00
mattijs
75790ba540 TUT: Allrun : requires numberOfDomains in decomposeParDict 2023-12-04 14:40:32 +00:00
Mark OLESEN
f2dcd88f1e Merge branch 'develop-feature-abaqus' into 'develop'
Added Abaqus sampling and writing

See merge request Development/openfoam!644
2023-12-04 10:36:29 +00:00
Andrew Heather
a1819a5411 ENH: Added new abaqus sampledSet
Generates sample positions from points specified in a file as Abaqus mesh
points.

Example usage:

    sets
    {
        cone25 // user-specified set name
        {
            type        abaqusMesh;
            file        "abaqusMesh.inp";

            // Optional entries

            // Scale, e.g. mm to m
            scale       0.001;

            // Search distance when the sample point is not located in a cell
            maxDist     0.25;

            ...
        }
    }
2023-12-04 10:34:14 +00:00
Andrew Heather
d3b3a5a41e ENH: Added new abaqus coordSet writer
Write coordSet(s) as Abaqus point fields

Example usage

    T
    {
        type        sets;
        setFormat   abaqus;
        fields      (T);
        sets
        {
            ...
        }
    }
    \endverbatim

    Optional format options
    \verbatim
    formatOptions
    {
        abaqus
        {
            format          ascii;

            // Optional entries

            // Custom header: $ entries are substituions
            header
            (
                "** OpenFOAM abaqus output"
                "** Project $FOAM_CASE"
                "** File $FILE_NAME"
                "** $FIELD_NAME Time t=$TIME"
            );

            // Write geometry in addition to field data
            writeGeometry   yes;

            // Null value when sample value is not found
            // Default is scalar::min
            nullValue       0;

            // Insert additional time sub-directory in the output path
            // - yes : postProcessing/<fo-name>/<time>/<file>
            // - no  : postProcessing/<fo-name>/<file>
            useTimeDir      no;

            // Available when 'useTimeDir' is 'no' to disambiguate file names

            // Time base for output file names:
            // - 'time'      : <base>.inp_<field>.<time>
            // - 'iteration' : <base>.inp_<field>.<iteration>
            timeBase        iteration;

            // Optional start counters when using timeBase iteration
            writeIndex
            (
                T 1
            );

            ...
        }
    }
2023-12-04 10:05:29 +00:00
Andrew Heather
3944c7a628 ENH: coordSetWriter - brought across field scaling and offsets from surface writers
Example:

    formatOptions
    {
        <writer>
        {
            // Apply offsets to field values
            fieldLevel
            {
                T   273.15; // Convert from K to C by subtracting 273.15
            }

            // Note: scale applied after application of field level
            fieldScale
            {
                p   0.001;  // Convert pressure from Pa to kPa by scaling by 0.001
            }
        }
    }
2023-12-04 09:57:08 +00:00
Mark OLESEN
0ba821a96d Merge branch 'feature-caseInfo-json' into 'develop'
Extract case and solver information

See merge request Development/openfoam!646
2023-12-04 09:51:33 +00:00
Andrew Heather
f8742146a7 ENH: checkMesh - added -writeChecks option
Added -writeChecks <format> option

- writes computed mesh metrics to file in using <format>
- currently supported formats are OpenFOAM dictionary and JSON
2023-12-01 15:04:41 +00:00
Andrew Heather
9d20dd84a9 TUT: Added caseInfo function object example 2023-12-01 15:04:41 +00:00
Andrew Heather
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
Andrew Heather
d77db0edb9 ENH: Added new JSONformatter to write Ostream content in JSON format
New Ostream wrapper that writes entries as JSON objects/convert OpenFOAM
dictionaries to JSON dictionaries, e.g.

    dictionary dict ...

    // Create file for writing
    OFstream os("myData.json");

    // Wrap Ostream
    JSONformatter json(os);

    // Write dictionary as JSON
    json.writeDict(dict);
2023-12-01 11:54:35 +00:00
Andrew Heather
c7a639d0dd ENH: polyMeshCheck - added mesh quality metrics to meshState dictionary
Quality metrics, e.g. non-orthogonality, skewness etc are calculated/reported
in polyMeshCheck functions. These results are now added to the meshState/mesh
dictionary to enable external access.
2023-12-01 11:54:35 +00:00
Andrew Heather
0ff86ee2e7 ENH: replaced fragile dict interactions by meshState functions 2023-12-01 11:54:35 +00:00
Andrew Heather
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
Andrew Heather
da20ff2666 STYLE: renamed/moved 'data' to 'meshState'
ENH: added 'mesh' dictionary to meshState to hold mesh properties

- solver information now stored in a 'solver' dictionary (was solverPerformance)
  - {first|final}Iteration entry now stored in solver dict instead of top level
- mesh data (new) stored in 'mesh' dictionary
2023-12-01 11:54:34 +00:00
mattijs
6da041e61f TUT: added -constant for redistributePar. See !605 2023-11-29 09:14:59 +00:00
mattijs
6c08e995ba BUG: redistributePar: handle lagrangian in decompose mode. See !605
- only affects recent develop
- fixed by supplying invalid casename for non-master ranks
2023-11-28 16:50:51 +00:00
mattijs
b4b022f283 BUG: SRFModel: tmp() abuse. Fixes #3038. 2023-11-27 18:03:11 +00:00
Andrew Heather
1c0f59c0e2 Merge branch 'feature-nonblockingACMI' into 'develop'
ENH: cyclicACMI: add non-blocking matrix updates.

See merge request Development/openfoam!641
2023-11-27 13:58:02 +00:00
Mattijs Janssens
7c64cdbd01 ENH: cyclicACMI: add non-blocking matrix updates. 2023-11-27 13:58:02 +00:00
Andrew Heather
7c8daed124 Merge branch 'feature-rom' into 'develop'
ENH: Reduced-order modelling field reconstruction with DMD

See merge request Development/openfoam!639
2023-11-24 19:57:18 +00:00
Kutalmis Bercin
1a4d2f735f TUT: cylinder2D: add examples for the createROMfields utility 2023-11-24 19:57:11 +00:00
Kutalmis Bercin
c9d1f741ce ENH: createROMfields: new reduced-order model utility to reconstruct fields 2023-11-24 19:57:11 +00:00
Mark Olesen
b093e3a709 CONFIG: increment API level to 2309
- filehandler and watched files changes
- addition of turbulence submodule
2023-11-23 22:42:22 +01:00
Mark Olesen
c5e4b62df7 ENH: improve/simplify streaming of exprValue
- ensure that operator<< and operator>> behave symmetrically
2023-11-23 22:42:22 +01:00