Compare commits

...

1065 Commits

Author SHA1 Message Date
f00230dfa9 CONFIG: bump patch level 2025-05-28 16:00:35 +02:00
0bb0c1db74 BUG: plicRDF: reconstructing distance func for point neighbours (fixes #3279) 2025-05-28 12:13:52 +01:00
535a4fccb4 Merge branch 'fix-3360-wrong-addressing' into 'master'
BUG: wrong cellZone addressing in uniformityCellZone (fixes #3360)

Closes #3360

See merge request Development/openfoam!738
2025-05-13 10:36:26 +00:00
e1b04cb6a7 BUG: wrong cellZone addressing in uniformityCellZone (fixes #3360)
The mean value, variance and volume fields for each zone were accessed
using the wrong indices
2025-05-13 11:29:18 +03:00
b7ce6bf69d CONFIG: inject -no-recursion into the argument list (#3198)
- sourcing a file with '-no-recursion "$@"' does not work with dash.
  Need to modify the argument list directly.
2025-03-19 15:28:57 +01:00
0a53013499 BUG: foamReport mesh quantities are not parallel (fixes #3338) 2025-03-17 11:53:23 +01:00
47f2ff618d COMP: remove obsolete -fsimdmath flag for ARM64 (#3326) 2025-03-17 09:59:42 +01:00
47575aabf2 COMP: compilation with clang (c++17) and older flex files (fixes #3337)
- The register keyword has been removed from c++17 but old flex
  versions (version < 2.6.0) produce code including it, leading to
  compilation errors when using clang (despite disabling the diagnostic).
  gcc compiles but issues warnings.

- use '#define register' as empty as a workaround
2025-03-17 09:58:20 +01:00
97c8e62fe4 COMP: disambiguate some reactingEuler/multiphaseSystem file names
- poor naming (eg, 'exponential.[CH]') within the same set of library
  files means that the lnInclude/ contents are inconsistent or partly
  meaningless (related to #2520 and !542).
  Remedied by adding model-type qualifiers to the file names.
2025-01-27 09:39:18 +01:00
297fee00f1 COMP: adjustments for nvc++ compiler
- remove unneeded -Wno-old-style flags with boost/cgal elements
- add nvc equivalent to gcc/clang -Wno-invalid-offsetof
- avoid warnings about set-but-unused variable and change of scoping

STYLE: remove wmake 'CGAL' rule
- was a transitional forward to 'cgal' rule since DEC-2020
2025-01-24 10:46:06 +00:00
c987ac228c SUBMODULE: update visualization for v2412 (with c++17 standand) 2025-01-24 11:40:32 +01:00
4fe3f55e4d BUG: Fixes bug in plicRDF interface reconstruction across cyclic boundaries (fixes #3279)
Description:
The plicRDF interface reconstruction scheme calculates a reconstructed distance
function (RDF) in all interface cells and their point neighbours.
In point neighbours to interface cells, the RDF is calculated as a weighted
average of the distances to all adjacent interface cell centres with the weight
being the inverse distance to the cell centre.
By using the zoneDistribute class written by Henning Scheufler, the required
stencil data is communicated efficiently for stencil cells living on different
sides of one or more processor patches.
Some of the data required for the RDF reconstruction are cell centre and
interface centre positions. When a stencil extends across a cyclic patch these
positions have so far not been properly transformed in OpenFOAM. This issue is
fixed by the current contribution.
The fix is done by modifying the zoneDistribute class to hold the required
information about zone cells adjacent to cyclic patches. Positions are then
communicated with a new getPosition function which replaces getValue for
position data in the reconstructedDistanceFunction and plicRDF classes.
The implementation does not change the behaviour for cells not on
a cyclic patch and should have insignificant effect on efficiency for these.
The implementation can probably be optimised in terms of efficiency for zone
cells on cyclic patches, but we note that there are generally only very few of
these (interface cells and their point neighbours on cyclic patches) and so
the potential for speedup is expected to be limited.

Current limitations:

- In parallel, the user must constrain the decomposition to preserve cyclic
patches on the same processor, for the implementation to work properly.
  - See an example here: tutorials/discInConstantFlowCyclicBCs/system/decomposeParDict
- In the case of parallel rotational cyclics that are split by the decomposition
the current bugfix does not work and therefore throws an error. This is ongoing
work and should be reported and fixed by a future patch.

For further details, please see the modified files and the comments therein:
- $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.H
- $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistribute.C
- $FOAM_SRC/finiteVolume/fvMesh/zoneDistribute/zoneDistributeI.H
- $FOAM_SRC/transportModels/geometricVoF/reconstructedDistanceFunction/reconstructedDistanceFunction.C
- $FOAM_SRC/src/transportModels/geometricVoF/reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C

Co-authored-by: David Müller <> KIT
Co-authored-by: Konstantinos Missios <> Roskilde University
Co-authored-by: Johan Roenby <> Roskilde University and STROMNING
2025-01-10 15:52:52 +00:00
cb1aa273fd SUBMODULE: update external-solver, OpenQBMM for v2412 2025-01-09 11:45:11 +01:00
5aa40389c2 BUG: snappyHexMesh: update dependent vars. Fixes #3297 2025-01-06 17:40:45 +00:00
7904a2734f BUG: twoPhaseEuler: incorrect phase. Fixes #3295. 2025-01-06 11:30:02 +00:00
45e7c4a005 Merge branch 'develop' into 'master'
RELEASE: develop branch to master

Closes #3291, #3278, #3286, #3193, #3276, #2457, #3269, #3271, #3267, #3265, #3258, #3259, #3218, #3255, #3088, #3241, #3192, #3204, #3217, and #3191

See merge request Development/openfoam!722
2024-12-24 11:57:24 +00:00
71d3f2344a Merge branch 'openfoam-v2412-rc' into 'develop'
Openfoam v2412 rc

See merge request Development/openfoam!721
2024-12-24 11:50:24 +00:00
d3949086ce RELEASE: Updated headers to v2412 2024-12-24 11:17:31 +00:00
03b470bec0 ENH: Updated completions 2024-12-24 11:17:30 +00:00
131bbaf476 TUT: v2412: optional backwards-compatibility setting 2024-12-24 09:05:49 +00:00
f6f6ffe055 ENH: mesh: added new tutorials 2024-12-24 08:39:39 +00:00
639e87b52f BUG: extrude: handle internal faces. See #3162 2024-12-23 17:53:31 +00:00
18f73c211d TUT: cylinder2D: avoid runtime errors due to the fix b0b1d0f8b2 2024-12-23 15:33:10 +00:00
6eae520af7 BUG: pointBoundaryMesh: use correct db. Fixes #3291 2024-12-23 14:48:43 +00:00
25de821e93 COMP: snappyHexMesh: extraneous code 2024-12-23 12:03:16 +00:00
0733d1cded Merge branch 'feature-distributedTriSurfaceMesh-noFill' into 'develop'
ENH: distributedTriSurfaceMesh: improvements

See merge request Development/openfoam!720
2024-12-23 09:56:50 +00:00
4fdeae66d5 ENH: distributedTriSurfaceMesh: improvements 2024-12-23 09:56:50 +00:00
8bf1108677 Merge branch 'feature-reporting' into 'develop'
Reporting tools

See merge request Development/openfoam!716
2024-12-20 12:46:56 +00:00
cddfe0e324 TUT: motorBike - added example for foamReport 2024-12-20 09:51:42 +00:00
dffb5774d5 ENH: Added new foamReport functionObject
Replaces user-supplied keywords by run-time computed values in a text file.

Usage
    Example using system/controlDict.functions:

    foamReport1
    {
        // Mandatory entries (unmodifiable)
        type            foamReport;
        libs            (foamUtilityFunctionObjects);

        template        "<system>/myTemplate.md";

        substitutions
        {
            divSchemes1
            {
                type        dictionaryValue;
                object      fvSchemes;

                entries
                {
                    divSchemes      "divSchemes";
                }
            }
            fvSolution1
            {
                type        dictionaryValue;
                path        "<system>/fvSolution";

                entries
                {
                    solver_p        "solvers/p/solver";
                    solver_p_tol    "solvers/p/tolerance";
                    solver_p_reltol "solvers/p/relTol";
                    solver_U        "solvers/U/solver";
                    solver_U_tol    "solvers/U/tolerance";
                    solver_U_reltol "solvers/U/relTol";
                }
            }
            controlDict1
            {
                type        dictionaryValue;
                path        "<system>/controlDict";

                entries
                {
                    initial_deltaT       "deltaT";
                }
            }
            continuityErrors
            {
                type        functionObjectValue;
                functionObject continuityError1;

                entries
                {
                    cont_error_local    local;
                    cont_error_global   global;
                    cont_error_cumulative cumulative;
                }
            }
        }
2024-12-20 09:51:42 +00:00
c926f146d4 TUT: motorBike - added example for graphFunctionObject 2024-12-20 09:51:42 +00:00
82e471e045 ENH: Added new graphFunctionObject function object
Accumulates function object result values and renders into a graph in SVG format

Minimal example by using system/controlDict.functions to plot the residuals from
the solverInfo function Object:

    residualGraph
    {
        type            graphFunctionObject;
        libs            (utilityFunctionObjects);
        writeControl    writeTime;

        logScaleX       no;
        logScaleY       yes;

        xlabel          "Iteration";
        ylabel          "log10(Initial residual)";

        functions
        {
            line1
            {
                object      solverInfo1;
                entry       Ux_initial;
            }
            line2
            {
                object      solverInfo1;
                entry       Uy_initial;
            }
            line3
            {
                object      solverInfo1;
                entry       Uz_initial;
            }
            line4
            {
                object      solverInfo1;
                entry       p_initial;
            }
        }
    }
2024-12-20 09:51:42 +00:00
3bc2b5fd74 Merge branch 'feature-deck-renard' into 'develop'
INT: S-A turbulence model - added enhanced DDES shielding function

See merge request Development/openfoam!717
2024-12-19 16:18:13 +00:00
af6e5e75fd INT: S-A turbulence model - added enhanced DDES shielding function
Activated using the [optional] 'shielding' keyword having the options:

- standard: [default] same as v2406 and earlier
- ZDES2020: new option based on the reference:

    Deck, S., Renard, N. (2020).
    Towards an enhanced protection of attached boundary layers in hybrid
    RANS/LES methods.
    Journal of Computational Physics, 400, 108970.
    DOI:10.1016/j.jcp.2019.108970

Contribution from Marian Fuchs at UpstreamCFD GmbH

Integrated by Andrew Heather OpenCFD Ltd.
2024-12-19 16:17:51 +00:00
8a8c2482d7 Merge branch 'feature-cone-nozzle-with-angular-segments' into 'develop'
ENH: ConeNozzle: add injector velocity and angular-segmented disc options

See merge request Development/openfoam!719
2024-12-19 13:43:13 +00:00
29c8a77e04 ENH: ConeNozzle: add injector velocity and angular-segmented disc options 2024-12-19 11:45:00 +00:00
8e98779d70 Merge branch 'feature-schemes-zoneBlended' into 'develop'
ENH: Added new zoneBlended scheme

See merge request Development/openfoam!718
2024-12-19 10:53:12 +00:00
1eb904fc68 ENH: Added new zoneBlended scheme
Multi-faceZone based blending differencing scheme.

Schemes are set in dictonary format according to:

    divSchemes
    {
        .
        .
        div(phi,U)      Gauss zoneBlended
        {
            default         defaultScheme;
            faceZone1       scheme1;
            faceZone2       scheme2;
            ...
            faceZoneN       schemeN;
        }
        .
        .
    }

The default entry specifies the background scheme; additional schemes
can be set per faceZone, e.g. scheme1 is applied to facZone1,
scheme2 is applied to facZone2 etc.
2024-12-19 10:52:43 +00:00
45ee161f23 Merge branch 'feature-film-separation-models' into 'develop'
ENH: regionFaModels: new filmSeparation models for finite-area framework

See merge request Development/openfoam!714
2024-12-19 10:09:57 +00:00
1e6d8d73a0 BUG: OwenRyley: correct the modelling constant (fixes #3278) 2024-12-19 10:09:46 +00:00
51d1050339 ENH: regionFaModels: new filmSeparation models for finite-area framework 2024-12-19 10:09:46 +00:00
83b9c60a88 Merge branch 'fa-parallel-consistency-improvements' into 'develop'
ENH: processorFaPatch: use internal-edge algos for processor edges to ensure parallel consistency

See merge request Development/openfoam!708
2024-12-19 10:09:31 +00:00
2d731e1af3 ENH: processorFaPatch: use internal-edge algos for processor edges to ensure parallel consistency
- The edgeInterpolation::makeCorrectionVectors() disables the non-orthogonality
correction if the calculated non-orthogonality coefficient is below 0.1.
However, this activation routine only considers internal edges, and excludes
any processor edges, resulting in inconsistent parallel calculations. This
routine is removed.
- Fatal errors are replaced with zero-valued fields for non-orthogonality-
and skewness-correction routines.
2024-12-19 10:09:16 +00:00
528ea551ec Merge branch 'feature-write-objects' into 'develop'
ENH: writeObjects: add flag to report registered objects

See merge request Development/openfoam!705
2024-12-18 17:45:47 +00:00
c77cc498d7 ENH: writeObjects: add flag to report registered objects
Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2024-12-18 17:45:15 +00:00
5d0058bc85 STYLE: rename 2024-12-18 17:08:58 +00:00
f265fcc8d0 Merge branch 'feature-moving_source' into 'develop'
Feature moving source

See merge request Development/openfoam!693
2024-12-18 17:05:54 +00:00
e33fb8d0db Feature moving source 2024-12-18 17:05:54 +00:00
3d35bb920f COMP: plugins: updated cfMesh 2024-12-18 15:48:32 +00:00
4423efd313 ENH: fanFvPatchField - refactored; added flowRate option
The basis of the table is specified according to the mode:

- velocity: deltap = F(velocity per face) \[DEFAULT\]
- uniformVelocity: deltap = F(patch area-averaged velocity)
- volumeFlowRate:  deltap = F(patch volume flow rate)
- nonDimensional:  non-dim deltap = F(non-dim volume flow rate)

Example of the boundary condition specification:

    <patchName>
    {
        type            fan;
        patchType       cyclic;
        jumpTable       csvFile;
        mode            velocity; // New entry

        jumpTableCoeffs
        {
            nHeaderLine     1;
            refColumn       0;
            componentColumns 1(1);
            separator       ",";
            mergeSeparators no;
            file            "<constant>/UvsPressure";
        }
        value           uniform 0;
    }
2024-12-18 15:28:11 +00:00
b0b1d0f8b2 ENH: fieldAverage - allow averaging on internal fields - see #3242
BUG: fieldAverage - handle duplicate entries
2024-12-18 15:11:40 +00:00
ed99546b8a ENH: tabulated6DoFMotion: add optional linear interpolation scheme 2024-12-18 15:01:18 +00:00
a2b3187188 ENH: rho/psiReactionThermos: add PengRobinsonGas to the thermos 2024-12-18 13:32:02 +00:00
30d29f2303 COMP: fix SPDP compilation (fixes #3286) 2024-12-18 12:15:48 +00:00
207806e55d COMP: explicitly declare copy construct for (point) symmetry field
- fixes -Wdeprecated-copy complaints
2024-12-18 10:09:49 +01:00
da09e9203f ENH: extraneous file 2024-12-17 18:22:42 +00:00
57b250963d ENH: damBreakLeakage: showcasing cyclicACMI with scale factor
scale factor is
- coded
- time varying
- spatial varying
2024-12-16 16:46:25 +00:00
ea4508c079 ENH: polyDualMesh: demonstrate cellDecomposer,polyDualMesh 2024-12-16 12:24:20 +00:00
1462a5effa BUG: decomposePar: only write pointBoundaryMesh if needed 2024-12-16 12:14:02 +00:00
bd5d32035e CONFIG: set API level to 2412 (initial pre-release state)
- README updated to v2412, project-version updated to v2412
2024-12-16 13:00:09 +01:00
d4d2e4af3d DEFEATURE: remove obsolete optionalData container
- unused and superseded by c++17 std::optional
2024-12-16 12:57:42 +01:00
8a4e3526c3 ENH: improve parsing robustness for foamInstallationTest (#3263) 2024-12-16 12:37:18 +01:00
8340317a46 COMP: missing dynamicMesh,dynamicFvMesh linkage for simpleFoam (#3269) 2024-12-16 10:49:29 +01:00
e64d93ffdb COMP: support compilation with CGAL-6.0 (#3234)
- CGAL-6 uses c++17 std::optional, std::variant instead of boost versions
2024-12-16 10:47:49 +01:00
4c21ad3d3f Merge remote-tracking branch 'origin/master' into develop 2024-12-16 10:07:54 +01:00
011f730309 COMP: SPDP compilation 2024-12-15 11:53:03 +00:00
009faad912 ENH: Test-GAMG: not normalise agglomeration unless specified 2024-12-14 16:58:28 +00:00
462fd687d2 BUG: reconstructParMesh: support for no finite-area. See #3276 2024-12-14 16:30:59 +00:00
1401ce02b5 ENH: badMove: missing directory creation 2024-12-12 16:58:49 +00:00
15059f78b8 Merge branch 'issue-3193-READ_IF_PRESENT' into 'develop'
BUG: READ_IF_PRESENT: return false if not read. Fixes #3193

See merge request Development/openfoam!698
2024-12-12 16:21:59 +00:00
aaaa80589f BUG: READ_IF_PRESENT: return false if not read. Fixes #3193 2024-12-12 16:21:59 +00:00
ab30b0301c Merge branch 'feature-pointMeshIO-shm-bufferlayers' into 'develop'
ENH: snappyHexMesh: add buffer layers before snapping

See merge request Development/openfoam!715
2024-12-12 16:13:32 +00:00
de5d34787c ENH: snappyHexMesh: add buffer layers before snapping 2024-12-12 16:13:32 +00:00
e7cf8a1d59 COMP: missing include. 2024-12-12 15:08:34 +00:00
0a363f2885 BUG: truncated error message when throwing (fixes #3201)
- only affected v2406. Root cause is #3281
2024-12-12 13:14:36 +01:00
44f7a7268a CONFIG: update c++ standard to c++17. 2024-12-12 11:56:39 +00:00
59c74e53ff ENH: objectRegistry - allow recurse into time db 2024-12-11 11:13:46 +00:00
bba45b3022 ENH: caseInfo function object - store data in IOdictionary for external lookup 2024-12-11 11:13:46 +00:00
6c60b19c4a ENH: caseInfo function object - set file extension to output file type 2024-12-11 11:12:46 +00:00
697e6147f4 ENH: writeFile - enable setting of file extension 2024-12-11 11:12:45 +00:00
c37a3f530d Merge branch 'feature-reconstructParMesh-finiteArea' into 'develop'
ENH: reconstructParMesh: support for finite-area. Fixes #3276

See merge request Development/openfoam!711
2024-12-11 09:26:01 +00:00
429d8d0522 ENH: reconstructParMesh: support for finite-area. Fixes #3276 2024-12-11 09:22:44 +00:00
3e80552244 BUG: isoAdvection: conserve volume of fluid across cyclic patches (fixes #2457)
Co-authored-by: David Müller <>
Co-authored-by: Konstantinos Missios <>
2024-12-10 14:32:04 +00:00
a797ac8193 COMP: fix typos in construct ispanstream from std::string_view (#3234) 2024-12-10 15:23:02 +01:00
1cb61b90e7 COMP: missing -pthread flag for intel icx compiler (fixes #3251) 2024-12-10 13:55:54 +01:00
52b530fb82 COMP: missing tmp dereference (fixes #3277)
- only affected v2406
2024-12-10 12:26:46 +01:00
96660cdfac Merge branch 'feature-fusedDiscretisation' into 'develop'
ENH: fused: 'fused' variants of explicit discretisation

See merge request Development/openfoam!712
2024-12-10 09:31:53 +00:00
e65d720164 ENH: fused: 'fused' variants of explicit discretisation 2024-12-10 09:31:53 +00:00
ff6ef5bdf8 Merge branch 'feature-csr-MERGE' into 'develop'
ENH: CSR: cell-cell addressing

See merge request Development/openfoam!713
2024-12-10 09:30:32 +00:00
267bd1af36 ENH: CSR: cell-cell addressing 2024-12-10 09:30:06 +00:00
b9335f4989 Merge branch 'fix-opt-convergence-criteria' into 'master'
BUG: optimisation convergence criteria misbehave w/o a line search (fixes #3268)

Closes #3268

See merge request Development/openfoam!709
2024-12-10 09:28:20 +00:00
23f8480af6 Merge branch 'adjoint-update-pre2412' into 'develop'
ENH: updates in the adjoint library

See merge request Development/openfoam!710
2024-12-10 09:27:50 +00:00
d061be643e TUT: change 'normalize' to 'normalise' in optimisation tutorials 2024-12-10 09:27:24 +00:00
8d0f4eb87a TUT: additional topology optimisation tutorials
- 1_Inlet_2_Outlet/porosityBased/R_10x-init/reEval: showcases the
  initialization of the design variables using topoSet and setFields
- 3DBox/losses-mass-uniformity-SQP-extraVars: showcases the use of the
  so-called 'extra variables' in the QP problem which relax it,
  allowing its solution even if there is no feasible one
2024-12-10 09:27:24 +00:00
f90c7b17fc ENH: Allow setting the initial values of the design variables
in topology optimisation, through a volScalarfield named alpha.
The order of precedence is (top to bottom):
- values read from time/uniform/topOVars (used also for continuation)
- values read from 0/alpha (can be easily set with topoSet + setFields)
- uniform zero
2024-12-10 09:27:24 +00:00
9c5ce8e4f2 ENH: compatibility read for normalise in objective 2024-12-10 09:27:24 +00:00
8d6efa9f1b ENH: added the option to disable damping in ISQP
Can accelerate convergence in cases without constraints
2024-12-10 09:27:24 +00:00
91fb7456a5 ENH: changed the c coefficients in ISQP and MMA
to Function1, to be able to change their value at runtime.  Useful when
constraints are not feasible at the beginning of the optimisation
(frequent in topology optimisation) and we want to leave some room to
the optimiser to not focus heavily on them at the beginning, but respect
them during the last optimisation cycles.

Has a big impact, especially in MMA, when dealing with volume
constraints in topology optimisation.
2024-12-10 09:27:24 +00:00
3ab7d6a088 ENH: outletMappedUniformInletHeatAddition: add Function1-type Q input 2024-12-09 09:45:43 +00:00
a445dd10e1 BUG: simpleFoam: side-effect of reading dynamicMeshDict. See #3269 2024-12-05 09:08:54 +00:00
f0f915b932 BUG: simpleFoam: side-effect of reading dynamicMeshDict. Fixes #3269 2024-12-04 09:40:31 +00:00
86fda799ec BUG: decomposePar: support finiteArea. Fixes #3271 2024-12-02 19:11:53 +00:00
e45b26eaf0 ENH: simpleFoam: add dynamicFvMesh. Fixes #3269 2024-11-28 11:58:48 +00:00
6ad75fe141 Merge branch 'issue-3238-nbx-failure' into 'develop'
ENH: more unique tags to avoid overlapping comms

See merge request Development/openfoam!704
2024-11-27 12:33:29 +00:00
96db337a99 ENH: more unique tags to avoid overlapping comms 2024-11-27 12:33:28 +00:00
0fa5062c7d ENH: GAMG: update some fvSolution for updateInterval settings. See !707 2024-11-27 11:07:11 +00:00
3e00e05e33 Merge branch 'feature-updateInterval' into 'develop'
ENH: GAMGAgglomeration: optional updateInterval for moving mesh cases.

See merge request Development/openfoam!707
2024-11-25 13:38:01 +00:00
e54791019a ENH: GAMGAgglomeration: optional updateInterval for moving mesh cases. 2024-11-25 13:38:00 +00:00
8a508910ba BUG: optimisation convergence criteria misbehave w/o a line search (fixes #3268)
When using the (optional) convergence criteria for the optimisation
loop, adherence to them is checked in the postUpdate phase of the update
of the design variables. If a line search is used, this means that the
flow equations have been solved anew using the new design variables and
the objective reduction check makes sense. If, however, no line search
is used, the objective reduction check happens immediately after the
update of the design variables and before re-solving the flow equations,
giving a reduction in the objective function and terminating the
optimisation loop prematurely.

Solved by calling the convergence check directly after the solution of
the flow equations, in case of a fixedStepUpdate
2024-11-22 18:37:53 +02:00
96ccae977e ENH: surfaceFeatureExtract: do simple non-manifold. Fixes #3267 2024-11-21 13:36:46 +00:00
19601c0976 STYLE: consistent naming 2024-11-20 20:57:47 +00:00
3fb8f5ed69 BUG: thermalBaffle: allow for offset. See also #3260
- extrudePatchMesh holding reference to original patches
- offset not compensated for
2024-11-18 15:57:27 +00:00
f5310ca48c ENH: cyclicAMI-topoChange: allow restart. Fixes #3265 2024-11-18 14:41:46 +00:00
7f1120f6ed BUG: solarCalculator: time wraparound. Fixes #3258 2024-11-14 16:45:49 +00:00
96ada1dd54 COMP: Intel: compilation rule. Fixes #3259 2024-11-14 11:07:39 +00:00
6b08c346f1 Merge branch 'feature-cornerWeights' into 'develop'
ENH: wallFunctions: use cornerWeights linear. Fixes #3218.

See merge request Development/openfoam!703
2024-11-13 14:31:12 +00:00
f321fc73ef ENH: wallFunctions: use cornerWeights linear. Fixes #3218. 2024-11-13 14:29:11 +00:00
791796c67f BUG: cellReduce: use boundary values. Fixes #3255 2024-11-07 15:55:09 +00:00
b73de97f97 ENH: createPatch: demo case 2024-11-06 20:25:39 +00:00
cfdc2330eb ENH: polyBoundaryMesh: use patchID() if available. See #3233 2024-11-04 16:16:05 +00:00
cc580fc108 STYLE: limitFields: correct output for multiple variables
Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2024-10-25 10:45:59 +01:00
77ba7ca4d4 Merge branch 'feature-createPatch-cyclicACMI' into 'develop'
ENH: createPatch: allow duplicating face (for ACMI)

See merge request Development/openfoam!702
2024-10-24 14:51:01 +00:00
ceb2151094 ENH: createPatch: allow duplicating face (for ACMI) 2024-10-24 14:04:55 +00:00
e4f4c73b98 Merge branch 'feature-surface-courant-number' into 'develop'
ENH: surfaceCourantNumber: new finite-area function object

See merge request Development/openfoam!706
2024-10-23 15:32:31 +00:00
1a6f0f997a ENH: surfaceCourantNumber: new finite-area function object
Computes the surface Courant number field at finite-area face centres.
Note: the calculation is performed at face centers, not edge centers.
2024-10-23 15:30:13 +00:00
4f1e7f6343 ENH: DILUPreconditioner: Speedup. Fixes #3088 2024-10-23 11:20:28 +01:00
53052a5eb3 BUG: extrudeToRegionMesh: incorrect bounding box. Fixes #3241 2024-10-21 12:57:43 +01:00
fe0b71280e ENH: octree: avoid copy 2024-10-16 15:05:32 +01:00
5836d280b9 ENH: fvMatrix: avoid whichPatch. See #3233 2024-10-03 18:22:42 +01:00
cd2d81b79a ENH: extrudePatchMesh: support for features. See #2103
Optional 'featureAngle' entry to disable extrusion on
sharp corners
2024-10-03 16:06:03 +01:00
4df27f8be6 GIT: extraneous files. Fixes #3192 2024-10-03 10:19:47 +01:00
4167aababe ENH: phaseModels: add pureMovingSolidPhaseModel 2024-09-20 10:25:33 +01:00
d6b8b49da8 STYLE: mapFields, ensightWrite: print operand fields in rows 2024-09-19 16:29:17 +01:00
a9cc444b79 ENH: switch: move to OptimisationSwitches. See #3215 2024-09-18 14:39:17 +01:00
782f22feb8 ENH: continuity: avoid excess evaluations. See #3225 2024-09-18 14:01:26 +01:00
13146891fe Merge branch 'issue-3215-pointConnectedCells' into 'develop'
Issue 3215 point connected cells

See merge request Development/openfoam!700
2024-09-18 11:07:42 +00:00
d72f51ac23 Issue 3215 point connected cells 2024-09-18 11:07:41 +00:00
1d6396dd3f Merge branch 'feature-solver-function-objects-solution-control' into 'develop'
ENH: solver function objects: add outer-loop convergence checks

See merge request Development/openfoam!699
2024-09-06 10:02:29 +00:00
0ff5eb5687 STYLE: scalarTransport/energyTransport: modernise the code
- Remove redundant copy ctor and assignment operator (already deleted in base class)
- Remove unused header files
- Use default destructor
- Reorder member variables
2024-09-06 10:01:43 +00:00
559f13d450 DOC: scalarTransport/energyTransport: improve header file documentation 2024-09-06 10:01:43 +00:00
fd77d7d9b5 INT: solver function objects: add outer-loop convergence checks
Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
2024-09-06 10:01:43 +00:00
050f27910e ENH: advectionDiffusionPatch: default mesh checking. Fixes #3204 2024-09-04 09:34:25 +01:00
483e9892ee BUG: blockMesh: incorrect sqrt. Fixes #3217 2024-09-04 09:31:23 +01:00
d6df40a5e2 BUG: wall distance: select wall-point connected cells. See #3215 2024-09-03 09:55:02 +01:00
60e5f0e0ae BUG: wall distance: select wall-point connected cells. See #3215 2024-08-22 16:50:51 +01:00
14fcd08f86 DOC: symplectic: add some comment 2024-08-22 16:23:43 +01:00
f72670edff BUG: overset: out-of-date lduAddressing. Fixes #3204
Was triggering update of cell-cell stencil (=meshObject) without
corresponding rebuilding of lduAddressing (= oversetFvMeshBase storage).
- added clearOut to oversetFvMesh(Base)
- added call to clearOut when rebuilding stencil
2024-08-19 15:49:21 +01:00
aacd99c030 ENH: transformPoints: added comment. See #3206 2024-07-31 14:40:01 +01:00
303c3135aa COMP: shm: missing bit. parallel consistency. See #2331 2024-07-18 09:40:11 +01:00
f97f715f66 ENH: shm: parallel consistency. See #2331 2024-07-17 09:14:02 +01:00
bb8f7799d9 ENH: vtkUnstructuredToFoam: construct&write fields. See #3195. 2024-07-10 15:20:54 +01:00
7ec78f6d6d BUG: interpolation: handling of bounds. Fixes #3191 2024-07-04 15:53:06 +01:00
dce009cef1 ENH: make Nastran PLOAD2,PLOAD4 field mappings optional
- PLOAD2 is a reasonable default and PLOAD4 output
  (currently misused for vectors/tensors) is the exception.

- simplify the specification by using optional PLOAD4, PLOAD2 wordRes
  lists to act as allow/deny selectors. In the regular case won't need
  to specify anything or perhaps only the PLOAD4 list.

ENH: atomic creation of Nastran files

FIX: inconsistent Nastran surface output format

- use FREE format by default. Previously had an odd mix of SHORT
  format when created without options and LONG format (as default)
  when created with format options.
2024-06-26 16:53:13 +02:00
d8d3e34d5c COMP: fix dangling references (gcc13+: -Wdangling-reference) 2024-06-26 16:53:05 +02:00
d300fab63a ENH: reduce some allocations in rawTopoChangerFvMesh
- cache and reuse the zero field

STYLE: use templated form of objectRegistry::names<..>
2024-06-26 16:51:12 +02:00
69b2a667c9 BUG: Nastran reading of free format truncates last field (fixes #3189)
- the old logic relied on the presence/absence of a comma to decide
  whether to parse as fixed or free format. This logic is faulty when
  handling the final (trailing) entry and will generally lead to the
  last field being truncated when read in.
  Now the caller decides on fixed vs free.

FIX: inconsistent Nastran surface output format

- use FREE format by default. Previously had an odd mix of SHORT
  format when created without options and LONG format (as default)
  when created with format options.
2024-06-26 16:26:37 +02:00
be01ca7888 Merge branch 'develop' into 'master'
OpenFOAM v2406

Closes #3183, #3149, #2588, #3177, #3146, #3161, #3128, #3163, #3175, #3171, #3115, #3144, #3137, #3138, #3133, #3125, #3126, #3123, #3119, #3105, #3106, #2024, #3102, #3082, #3090, #3089, #3085, and #3077

See merge request Development/openfoam!695
2024-06-25 13:11:36 +00:00
630d60de3b RELEASE: Updated headers to v2406 2024-06-24 09:58:36 +01:00
2390ebbf7e RELEASE: Updated completions 2024-06-24 09:58:35 +01:00
510d9fc5a5 DOC: doxygen - activate treeview 2024-06-24 09:58:35 +01:00
c6399ca920 CONFIG: update third-party compiler versions 2024-06-20 12:52:06 +02:00
cdc1a34bab CONFIG: add top-level Allwmake-modules, Allwmake-plugins scripts 2024-06-19 15:00:51 +02:00
fa49ae252b COMP: fix createViewFactors linkage errors (mingw, lld linker) 2024-06-19 14:31:46 +02:00
0b9391ff3b COMP: avoid remove dangling reference (finiteArea) 2024-06-19 12:14:21 +02:00
7bdc000865 COMP: corrected pointer to temporary 2024-06-19 11:00:15 +01:00
ac099d82eb Merge remote-tracking branch 'origin/master' into develop 2024-06-18 17:09:58 +01:00
fb96927275 Merge branch 'feature-createViewFactors' into 'develop'
ENH: Added new createViewFactors utility

See merge request Development/openfoam!692
2024-06-18 15:30:22 +00:00
ab5f6dbf41 ENH: Added new createViewFactors utility
Creates view factors for the view factor radiation model.

User-selectable models:

- raySearchEngine: model to generate rays, i.e. face-to-face connections
- viewFactorModel: model to compute the view factors

For visualisation, use:

- Write the view factors as a volume field

    writeViewFactors    yes;

- Write the rays using OBJ format:

    writeRays       yes; // default = no

Participating patches must be in the \c vewFactorWall group, i.e. using the
\c inGroups entry of the "\<case\>/polyMesh/boundary" file.

\verbatim
myPatch
{
    type            wall;
    inGroups        2(wall viewFactorWall);
    ...
}
\endverbatim

Reads:

- <constant>/viewFactorsDict : main controls
- <constant>/finalAgglom : agglomeration addressing (from faceAgglomerate)

Generates:

- <constant>/F : view factors (matrix)
- <constant>/mapDist : map used for parallel running
- <constant>/globalFaceFaces : face addressing
2024-06-18 16:27:20 +01:00
7c45670c8b SUBMODULE: update visualization
- bugfix for parallel gather of patch values with serial rendering
2024-06-18 10:32:27 +02:00
58aa8c97c2 ENH: report average surface normal in surfaceInertia utility (#3184)
- can be useful for various orientation-related geometry or mesh
  manipulations during pre-/post-processing:
  * combine with linearDirection to achieve better extrusion results.
  * orientation of transformations, blockMesh, result projections, ...

STYLE: minor code modernizations

Co-authored-by: Mark Olesen <>
2024-06-14 12:45:47 +02:00
9f4bb2d432 BUG: createBaffles: incorrect sizing for overlapping zones. Fixes #3183 2024-06-13 18:20:14 +01:00
24ac8308b3 SUBMODULE: update OpenQBMM
SUBMODULE: update data- and turbulence-community plugins
2024-06-13 17:01:51 +01:00
0e23e6c66c CONFIG: set API level to 2406 (pre-release state)
- README updated to v2406, project-version updated to v2406
2024-06-13 12:03:23 +02:00
21c554d7d0 CONFIG: bump adios and paraview versions
- adios: 2.9.2 -> 2.10.1
- paraview: 5.11.2 -> 5.12.1

Ancillary libs:

- hdf5:  1.14.4.3
- hypre: 2.23.0 -> 2.31.0
- petsc: 3.19.2 -> 3.21.2
2024-06-13 12:03:23 +02:00
391f059335 CONFIG: update foamPackRelease packaging 2024-06-13 12:03:23 +02:00
5873ec1b22 ENH: topoSet: allow transformation of input locations 2024-06-12 15:44:23 +01:00
bb483951b7 ENH: compressibleMultiPhaseTurbulenceModels - added some (tested) RAS models 2024-06-12 09:59:49 +01:00
7b5e605b29 Merge branch 'regression-3144-fvsPatchField' into 'develop'
REGRESSION: missing "value" handling for some surface fields (#3144)

See merge request Development/openfoam!691
2024-06-12 07:58:03 +00:00
732872b9cc REGRESSION: missing "value" handling for some surface fields (#3144)
- changes in 8a8b5db977 were overly aggressive.
  Only need to suppress "value" IO for empty patches types
2024-06-12 07:57:40 +00:00
c6501b799e BUG: ddt2, zeroGradient FOs - set candidates using name match 2024-06-11 19:23:11 +01:00
93ee308ebf CONFIG: Added value to cyclicAMI entry 2024-06-11 16:06:13 +00:00
9d6b8a9c28 TUT: mixerVessel2D: add missing MRF-related keyword 2024-06-11 14:15:29 +01:00
530a5192ca Merge branch 'fix-adjointRotatingWall-sens' into 'master'
BUG: adjointRotatingWallVelocity causes sensitivities to crash. Fixes #3180

Closes #3180

See merge request Development/openfoam!690
2024-06-11 10:39:58 +00:00
d859f7b00f ENH: add comparison operators to exprValue, integrate exprValueFieldTag
- exprValueFieldTag is an extended version of exprValue,
  with additional Field/List uniformity handling

- the exprValueFieldTag reduce() method provides a more efficient
  method than using a regular combine operator. Since fields are
  usually non-uniform, will mostly only need the bitwise reduce and
  not a more expensive gather/combine.

ENH: output of exprValue (scalar type) now includes '.'

- prevents scalar/label ambiguity for values like '100.0', which would
  otherwise be written as '100' and thus interpreted as a label value
  when re-reading.
2024-06-10 16:47:09 +02:00
2ef96e9e43 BUG: adjointRotatingWallVelocity causes sensitivities to crash. Fixes #3180 2024-06-10 14:52:58 +03:00
baa8dccb0a ENH: cellDecomposer: functionObject to map fields.
Left out original files
2024-06-10 11:22:50 +01:00
5059e1ddec COMP: v2406: various missing dependencies 2024-06-10 10:17:10 +01:00
dced6c581e BUG: regionSplit2D: revert to original code. Fixes #3149. 2024-06-10 10:05:36 +01:00
3e64faf605 DOC: cellSetOption: add porous option 2024-06-10 10:05:36 +01:00
3083c32c35 SUBMODULE: update for visualization 2024-06-10 09:39:37 +01:00
51a34f5abc BUG: ThermoSurfaceFilm - corrected FA field caching for Cp. Fixes #3017 2024-06-07 20:47:35 +01:00
f48e617cd2 Merge branch 'feature-cellDecomposer' into 'develop'
ENH: cellDecomposer: functionObject to map fields to 'tet' mesh.

See merge request Development/openfoam!687
2024-06-07 17:21:51 +00:00
1b825b4470 ENH: cellDecomposer: functionObject to map fields to 'tet' mesh. 2024-06-07 17:21:23 +00:00
199a9801ca Merge branch 'feature-mrf' into 'develop'
MRF: compressible energy eqn

See merge request Development/openfoam!689
2024-06-07 14:49:05 +00:00
f6ba6bc40e ENH: MRF - added work term to compressible solver energy eqns 2024-06-07 14:48:47 +00:00
bf9b9204c3 ENH: MRF - added function to return the frame absolute flux 2024-06-07 14:48:47 +00:00
06ee000cb8 Merge branch 'feature-lagrangian-drag' into 'develop'
New Lagrangian models

See merge request Development/openfoam!686
2024-06-07 11:40:15 +00:00
d3861a5dcc ENH: Lagrangian - added tutorial case for particle Tomiyama drag model 2024-06-07 12:39:03 +01:00
8950c9b0c6 ENH: Lagrangian - added particle Tomiyama drag model
Based on the reference

    Tomiyama, A., Kataoka, I., Zun, I., Sakaguchi, T. (1998)
    Drag coefficients of single bubbles under normal and micro gravity
    conditions
    JSME International Journal, 41(2), 472-479.

Example usage

    subModels
    {
        particleForces
        {
            tomiyamaDrag
            {
                sigma       0.07;
                contamination pure; // pure | slight | full
            }
        }
    }
2024-06-07 12:39:03 +01:00
a0fea418e2 ENH: New FreezeParticles cloud function object
Sets the particle active flag to false to freeze the particle in space whilst
allowing it to evolve its physical models.
2024-06-07 12:39:03 +01:00
1bce1e44c4 ENH: propellerInfo - updated to work in postProcess mode. Fixes #2588 2024-06-07 12:36:59 +01:00
440cb83fa7 Merge branch 'feature-axialTurbine_rotating_oneBlade' into 'develop'
INT: cyclicPeriodicAMI: demo case provided by Hakan Nilsson

See merge request Development/openfoam!688
2024-06-07 11:29:01 +00:00
b2532e7769 BUG: extractEulerianParticles - corrected patch index. Fixes #2707 2024-06-07 12:26:03 +01:00
790de0f98e BUG: gltf corrections. Fixes #3179
- corrected scalar bounds (label->scalar), field limit initialisation
- corrected alpha field lookup
- updated header documentation
2024-06-07 12:25:32 +01:00
cf5eaef236 INT: cyclicPeriodicAMI: demo case provided by Hakan Nilsson 2024-06-07 09:53:06 +01:00
d148816bfe ENH: snappyHexMesh: initialise in case of 0 layer. Fixes #3177 2024-06-06 15:48:57 +01:00
f7291c4550 SUBMODULE: add data-community plugin (fixes #3146)
SUBMODULE: update turbulence-community plugin

ENH: README: add info to differentiate the modules from the plugins
2024-06-06 12:38:27 +01:00
eea442e209 BUG: cellSetOption: allow geometric selection update (fixes #3161) 2024-06-05 12:02:24 +01:00
755d354f69 Merge branch 'feature-radiation-ft' into 'develop'
Radiation modelling updates

See merge request Development/openfoam!685
2024-06-04 16:40:15 +00:00
d71b3c4633 ENH: radiation - temperature dependent properties
ENH: radiationModel - expose T()
2024-06-04 16:39:56 +00:00
de39878b9b ENH: radiation - temperature dependent absorption, emissivity, transmissivity
- constantAbsorption - updated a_ and e_ (Function1)
- constantTransmissivity - updated tau_  (Function1)
2024-06-04 16:39:56 +00:00
274fee92dd STYLE: radiation - use const ref/pointer; updated header guards 2024-06-04 16:39:56 +00: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
1bcb90bf79 ENH: surfaceTransformPoints: make consistent with transformPoints.
(added the -cylToCart option)
2024-06-04 16:59:15 +01:00
4deb146118 ENH: cyclicPeriodic: error msg 2024-06-03 17:23:37 +01:00
a87763f6a6 ENH: transformPoints: added cylindrical to Cartesian transform 2024-06-03 17:23:37 +01:00
c61466b6e5 ENH: polyPatch cached areaFraction setter with uniform fraction
STYLE: polyPatch cached areaFraction as std::unique_ptr

- more consistent with other demand-driven data.
  Getter now returns tmp field instead of const reference.
2024-06-03 11:55:01 +01:00
323149ad24 COMP: stray 'inline' prefix, explicit constructor for UniformDimensionedField
STYLE: getObjectPtr instead of const_cast version
2024-05-31 17:06:02 +01:00
e9cf0fba05 SUBMODULE: update for visualization 2024-05-31 16:47:54 +01:00
2d52ee13b1 ENH: icoReactingMultiphaseInterFoam - added frozenFlow option. Fixes #3128 2024-05-31 14:31:00 +01:00
5015883c01 CONFIG: Updated foamPackRelease for plugins directory support 2024-05-31 12:40:07 +01:00
74e118dd32 SUBMODULE: relocate community repos into plugins/ directory
- new landing place for general community repositories
2024-05-31 12:13:21 +01:00
01f501e8e7 CONFIG: increment API level to 2403 2024-05-30 17:30:25 +01:00
60ffaba71d Merge branch 'feature-FaceCellWave-cyclicACMI' into 'develop'
FaceCellWave: travel through coupled ACMI. See #3139

See merge request Development/openfoam!677
2024-05-30 15:15:56 +00:00
056bb4f0a0 FaceCellWave: travel through coupled ACMI. See #3139 2024-05-30 15:15:56 +00:00
30d2e2d3cf Merge branch 'feature-Function1-objectRegistry' into 'develop'
Function1: added 'lookup' Function1

See merge request Development/openfoam!676
2024-05-30 10:25:24 +00:00
c07997d816 Function1: added 'lookup' Function1 2024-05-30 10:25:24 +00:00
495fa6c577 Merge branch 'feature-ensight-single-file' into 'develop'
Add support for reading ensight transient single-file format

See merge request Development/openfoam!682
2024-05-29 14:05:27 +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
ee895577ae ENH: improve OFstream append behaviour (#3160)
- previous support for file appending (largely unused) always
  specified opening with the std::ios_base::app flag.

  Now differentiate between append behaviours:

  APPEND_APP
  ~~~~~~~~~~
  Corresponds to std::ios_base::app behaviour:

  - Existing files will be preserved and a seek-to-end is performed at
    every write. With this mode seeks/repositioning within the file
    will effectively be ignored on output.

  APPEND_ATE
  ~~~~~~~~~~
  Largely approximates std::ios_base::ate behaviour:

  - Existing files will be preserved and a seek-to-end is performed
    immediately after opening, but not subsequently. Can use seekp()
    to overwrite parts of a file.
2024-05-29 14:04:52 +00:00
9f032057b4 Merge branch 'feature-blockLevel-rays' into 'develop'
ENH: shm: blockLevel through ray-shooting

See merge request Development/openfoam!642
2024-05-29 10:11:19 +00:00
10b0c3cfca ENH: shm: blockLevel through ray-shooting 2024-05-29 10:11:18 +00:00
773548c283 Merge branch 'update-GeometricBoundaryField-evaluate' into 'develop'
Improve flexiblity of GeometricBoundaryField evaluate

See merge request Development/openfoam!683
2024-05-29 08:18:53 +00:00
9335b641f1 ENH: GeometricBoundaryField evaluate with specified communication type
- evaluate()
  the communication type is exposed as a parameter to allow for more
  tuning, but default parameter remains defaultCommsType so there is
  no change in behaviour for existing code

- evaluate_if()
  supports a general selection predicate

- evaluateSelected()
  now does initEvaluate() for all patches, waits and then calls
  evaluate(). This avoids potential deadlocks when multiple patches
  are inter-communicating.

ENH: align DimensionedField reading with GeometricField treatment

- use localIOdictionary to obtain the dictionary contents

ENH: update GeometricField code

- change GeometricField writeData() as primary output method
  (not operator<<) for better clarity of purpose

- use unique_ptr for GeometricField demand-driven data
2024-05-28 17:52:09 +01: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
1406f9ec26 ENH: robuster handling of unknown stream/float formats 2024-05-23 21:13:14 +02:00
b81fe70830 ENH: extend readContents IO factory methods
- support wantedType for localIOdictionary::readContents()

- add readContents() for GlobalIOList, GlobalIOField
2024-05-23 13:51:53 +02:00
bbde236be5 ENH: simpler internal handling of stderr in message streams
- delay construction of message buffer

- OStringStream count() method to test if anything has been streamed

STYLE: explicit use of std::ios_base in IOstreams

- document the return information of set flag methods
2024-05-23 13:51:53 +02:00
3b9176665f ENH: add dictionary::findStream() - symmetric with findDict()
- can be used with this type of code:

  ITstream* streamPtr = dict.findStream(name);
  if (streamPtr)
  {
      auto& is = *streamPtr;
      ...
  }

  versus:

  const entry* eptr = dict.findEntry(name);
  if (eptr && eptr->isStream())
  {
      auto& is = eptr->stream();
      ...
  }

ENH: add findStream(), streamPtr(), isStream() to dictionary search

- symmetric with findDict(), dictPtr(), isDict() methods

STYLE: use findDict() instead of found() + subDict() pairing

COMP: define is_globalIOobject trait at top of IOobject header

- more visibility, permits reuse for specializations etc.
2024-05-23 13:51:53 +02: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
3f1d181b42 COMP: provide GeometricFieldFwd.H for internal/boundary/full field
- simplifies forward declarations
2024-05-23 07:41:01 +02:00
8d649d1737 FIX: additional shell quoting for foamInstallationTest (fixes #3163)
- the PATH on WSL will usually contain spaces, so it needs quoting
2024-05-22 21:00:00 +02:00
21a84bdf91 Merge remote-tracking branch 'origin/master' into develop 2024-05-22 20:59:28 +02:00
1ad1957c41 ENH: GAMG: bit more testing of procAgglom+cyclicAMI 2024-05-22 18:02:28 +01:00
4510067e63 CONFIG: bump patch level 2024-05-22 16:26:39 +02:00
8cf757daf0 BUG: GAMG: processorAgglomeration not merging proc coeffs. Fixes #3172 2024-05-22 16:26:39 +02:00
6581c5792a BUG: STL: cannot handle files > 2Gb. Fixes #3171 2024-05-22 16:25:37 +02:00
03fb8f043e ENH: cyclicAMI: restart search with large bounding box. Fixes #3175 2024-05-22 12:37:32 +01:00
45ec64e6c8 BUG: STL: cannot handle files > 2Gb. Fixes #3171 2024-05-20 12:17:04 +01:00
eb17ff1ea3 DOC: cyclicPeriodicAMI: bit of comment 2024-05-18 12:55:55 +01:00
a7538fab57 BUG: interfaceHeight: fix header writing to output files (fixes #3115) 2024-05-08 11:20:34 +01:00
4fb85d1f76 Merge branch 'update-Pstream-large-sends' into 'develop'
ENH: improve handling of multi-pass send/recv

See merge request Development/openfoam!680
2024-05-07 14:29:14 +00:00
d9c73ae489 ENH: improve handling of multi-pass send/recv (#3152)
- the maxCommsSize variable is used to 'chunk' large data transfers
  (eg, with PstreamBuffers) into a multi-pass send/recv sequence.

  The send/recv windows for chunk-wise transfers:

      iter    data window
      ----    -----------
      0       [0, 1*chunk]
      1       [1*chunk, 2*chunk]
      2       [2*chunk, 3*chunk]
      ...

  Since we mostly send/recv in bytes, the current internal limit
  for MPI counts (INT_MAX) can be hit rather quickly.

  The chunking limit should thus also be INT_MAX, but since it is
  rather tedious to specify such large numbers, can instead use

      maxCommsSize = -1

  to specify (INT_MAX-1) as the limit.
  The default value of maxCommsSize = 0 (ie, no chunking).

Note
~~~~
  In previous versions, the number of chunks was determined by the
  sender sizes. This required an additional MPI_Allreduce to establish
  an overall consistent number of chunks to walk. This additional
  overhead each time meant that maxCommsSize was rarely actually
  enabled.

  We can, however, instead rely on the send/recv buffers having been
  consistently sized and simply walk through the local send/recvs until
  no further chunks need to be exchanged. As an additional enhancement,
  the message tags are connected to chunking iteration, which allows
  the setup of all send/recvs without an intermediate Allwait.

ENH: extend UPstream::probeMessage to use int64 instead of int for sizes
2024-05-07 15:33:02 +02:00
e15d696a24 STYLE: use Perr instead of Pout for UPstream::debug and warnComm
- avoids polluting standard output for utilities such as
  foamDictionary etc
2024-05-07 14:45:10 +02:00
dbfd1f90b1 ENH: add single-time handling to timeSelector
- the timeSelector is often used to select single or multiple times
  (eg, for post-processing). However, there are a few applications
  where only a *single* time should be selected and set.

  These are now covered by this type of use:

      timeSelector::addOptions_singleTime();  // Single-time options
      ...
      // Allow override of time from specified time options, or no-op
      timeSelector::setTimeIfPresent(runTime, args);

   In some cases, if can be desirable to force starting from the
   initial Time=0 when no time options have been specified:

      // Set time from specified time options, or force start from Time=0
      timeSelector::setTimeIfPresent(runTime, args, true);

   These changes make a number of includes redundant:

     * addTimeOptions.H
     * checkConstantOption.H
     * checkTimeOption.H
     * checkTimeOptions.H
     * checkTimeOptionsNoConstant.H

ENH: add time handling to setFields, setAlphaField (#3143)

    Co-authored-by: Johan Roenby <>

STYLE: replace instant("constant") with instant(0, "constant")

- avoids relying on atof parse behaviour returning zero
2024-05-06 22:22:42 +02:00
883196981d ENH: add offset support to stringOps::split functions
- for example,

     string buffer = ...;
     SubStrings<string> split;
     {
         auto colon = buffer.find(':');

         if (colon != std::string::npos)
         {
             split = stringOps::splitSpace(buffer, colon+1);
         }
     }

    Not really possible with a substr() since that would create a new
    temporary which then disappears.  Similarly awkward to split and
    then scan for the ':' to decide how many to discard.

ENH: add pop_front() and pop_back() methods to SubStrings

- the content is trivial enough (a pair of iterators) and the total
  number of elements is usually reasonable short so that removal of
  elements is inexpensive

  For example,

     string buffer = ...;
     auto split = stringOps::splitSpace(buffer);

     if (!split.empty() && split[0].str() == "face")
     {
         split.pop_front();
     }
2024-05-02 17:53:53 +02:00
3fed41547f COMP: remove template-id for constructor/destructor
- not allowed in C++20

COMP: avoid hidden overloaded-virtual (edgeMesh, surfMesh)
2024-05-02 16:47:46 +02:00
e22edc5dee STYLE: limitTemperature: consolidate standard output stream 2024-05-02 14:17:48 +01:00
0ef7589979 BUG: sampledMeshSurface sampling on "empty" patch fails
- requires a field size check when copying into the flat boundary
2024-05-02 10:24:28 +02:00
7dc9ccdcaa Merge branch 'update-Pstream-message-count' into 'develop'
Use MPI Get_elements_x() for message sizes

See merge request Development/openfoam!681
2024-04-29 10:25:30 +00:00
b2bbc15463 ENH: use MPI Get_elements_x() for message sizes (#3152)
- ensures more accurate values for message sizes than using
  MPI Get_count(), which trucates at INT_MAX

- add more/better error messages when trying to receive messages
  that exceed INT_MAX or the char buffer lengths
2024-04-29 10:22:24 +02: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
e1d45ec26e ENH: snappyHexMesh: more parallel consistency. See #2331 2024-04-25 15:52:41 +01:00
690d02f9e8 ENH: snappyHexMesh: more parallel consistency. See #2331 2024-04-24 17:10:27 +01:00
31b74cd627 Merge branch 'update-fvsPatchFields-mappers' into 'develop'
Fix fvsPatchFields reading/writing the "value" entry

See merge request Development/openfoam!679
2024-04-24 12:35:11 +00:00
f04ccef588 ENH: improve code consistency for {cell,face,point}Mapper (#3147)
- robuster and more reliable determination of inserted objects
  (previous code could produce false positives).

  Now also determine the number of inserted objects within the
  constructor (instead of simply storing a bool). This allows reuse
  in the address calculations to reduce overheads there.

BUG: dodgy short-circuit logic for insertedObjectLabels()

- as a quick short-circuit it previously created as demand-driven
  pointer with a zero elements. However, this meant that if this code
  was called first (before any other addressing), subsequent calls to
  the addressing would fail.

BUG: bad logic and lookup for faAreaMapper (#3147)

- was using labelHashSet but returning a bool and set using the
  addressing using the unfiltered objects!
  This is a latent bug since interpolated/inserted faces not
  currently supported anyhow.

ENH: use std::unique_ptr for demand-driven data
2024-04-24 14:03:11 +02:00
8a8b5db977 BUG: fvsPatchFields reading/writing the "value" entry (fixes #3144)
- manual revert for 44d0fbd594.

  Unless required for post-processing the "value" entry should not
  written if it is not mandatory for reading.

  This is especially crucial with an 'empty' patch field where the
  field (size 0) has a different size from the patch.

- the changes made align fvsPatchField behaviour with fvPatchField
2024-04-24 14:03:02 +02:00
5fb1181bb2 SUBMODULE: update avalanche tutorials (for new finite-area locations) 2024-04-23 16:57:17 +02:00
411ac5fcfa ENH: adjust return type for token compound factory method
- return autoPtr<token::compound> instead of the derived type,
  otherwise cannot easily construct a token from it

ENH: additional typed version of refCompoundToken()

- symmetric with typed version of transferCompoundToken()
  and isCompound()

- add ITstream::findCompound<Type>() method.
  Useful for searching within token streams
2024-04-23 16:51:38 +02:00
880215e8e6 STYLE: use intermediate variable in openFoamTableReader 2024-04-23 12:16:52 +02:00
3874c1312e Merge branch 'update-argList-mpi-startup' into 'develop'
reduce communication argList at startup

See merge request Development/openfoam!678
2024-04-23 09:20:19 +00:00
09377471a3 ENH: stricter handling when freeing communicator components
- previously automatically skipped the first communicator (which was
  assumed to be MPI_COMM_WORLD), but now simply rely on the
  internal pendingMPIFree_ to track which communicators have actually
  been allocated.
2024-04-23 10:58:41 +02:00
2889dc7248 ENH: add wrapped accessor for MPI_Comm
- UPstream::Communicator is similar to UPstream::Request to
  wrap/unwrap MPI_Comm. Provides a 'lookup' method to transcribe
  the internal OpenFOAM communicator tracking to the opaque wrapped
  version.

- provide an 'openfoam_mpi.H' interfacing file, which includes
  the <mpi.h> as well as casting routines.

  Example (caution: ugly!)

     MPI_Comm myComm =
         PstreamUtils::Cast::to_mpi
         (
             UPstream::Communicator::lookup(UPstream::worldComm)
         );
2024-04-23 10:58:38 +02:00
d75c60d8ae ENH: reduce communication argList at startup (#3142)
- replace point-to-point transmission of the argList args/options with
  a broadcast. This is sufficient for most cases (without distributed
  roots).

  For "normal" cases (non-distributed roots) this will replace the
  nProcs-1 messages with a single broadcast.

- for cases with distributed roots, distinguish between a single,
  identical root and different roots.  An identical root can also be
  subsequently handled with a broadcast. Different roots will still
  require individual point-to-point communication.

  For cases with distributed roots, it will add the overhead of an
  additional broadcast.
2024-04-23 10:55:44 +02:00
582b613d5f ENH: add send/recv static methods for broadcast streams
- adds consistency with regular point-to-point parallel streams.

ENH: add ITstream::tokens() methods

- useful, for example, to disambiguate constructing tokenList from
  a ITstream.

  ITstream& is = otherDict.lookup("original");

  tokenList deepCopy(is);  // Error: from Istream or tokenList??
  tokenList deepCopy(is.tokens());  // OK: from tokenList
2024-04-22 11:46:27 +02:00
6cce1cdc8b STYLE: add push_back() method to dlLibraryTable, cellTable, boundaryRegion
- same as append() did, but with more consistent names

STYLE: replace special purpose append() with container method

STYLE: update code style
2024-04-22 11:46:24 +02:00
b6203a7de5 BUG: overlapping zones: incorrect sizing 2024-04-19 20:19:45 +01:00
701c916764 Merge branch 'update-finiteArea' into 'develop'
update to internal accounting for finite-area

See merge request Development/openfoam!675
2024-04-19 15:52:41 +00:00
d1c4a225a2 CONFIG: increment API level to 2402 (finite-area API changes) 2024-04-19 17:20:09 +02:00
4cfa2ea304 TUT: update for new finite-area location (with foamUpgradeFiniteArea) 2024-04-19 17:20:09 +02:00
b5435cc83e ENH: separate registry and revised file locations for finite-area
- The internal storage location of finite-area changes from being
  piggybacked on the polyMesh registry to a having its own dedicated
  registry:

  * allows a clearer separation of field types without name clashes.
  * prerequisite for supporting multiple finite-area regions (future)

Old Locations:
```
   0/Us
   constant/faMesh
   system/faMeshDefinition
   system/faSchemes
   system/faSolution
```

New Locations:
```
   0/finite-area/Us
   constant/finite-area/faMesh
   system/finite-area/faMeshDefinition  (or system/faMeshDefinition)
   system/finite-area/faSchemes
   system/finite-area/faSolution
```

NOTES:
    The new locations represent a hard change (breaking change) that
    is normally to be avoided, but seamless compatibility handling
    within the code was found to be unworkable.

    The `foamUpgradeFiniteArea` script provides assistance with migration.

    As a convenience, the system/faMeshDefinition location continues
    to be supported (may be deprecated in the future).
2024-04-19 17:20:09 +02:00
1d5b95b5fe BUG: redistributePar: Distributing refinement data. Fixes #3137.
- was using blocking (=buffered) comms
- was running out of MPI_COMM_SIZE buffer space
- now using PstreamBuffers to have non-blocing comms
2024-04-18 11:52:34 +01:00
31aadc5c4d ENH: prefer objectRegistry sorted to lookupClass
- lower memory overhead, consistent access pattern
2024-04-16 10:18:08 +02:00
a803516b16 ENH: use typedef for MeshObject within derived classes
- use an internal 'typedef MeshObject<...> MeshObject_type' within
  derived classes. Reduces clutter and eases any updates.
2024-04-16 10:18:08 +02:00
1b212789e5 ENH: add MeshObject Release() static method
- Delete() will perform a 'checkOut()' which does the following:
  * remove the object from the registry
  * delete the pointer (if owned by the registry)

- Release() does the following:
  * transfer ownership of the pointer (if owned by the registry)

- Store() does the following:
  * transfer ownership of the pointer to the registry

ENH: use UPtrList of sorted objects for MeshObject updates

- few allocations and lower overhead than using a HashTable,
  ensures the same walk order over the objects (in parallel)

STYLE: adjust meshObject debug statements
2024-04-16 10:18:08 +02:00
688fd5f3f1 ENH: add separate handling for clearing mesh phi
STYLE: update code style for phi modification (engine motion)

ENH: pass isMeshUpdate param in fvMesh/polyMesh clearOut() methods

- top-level use of isMeshUpdate parameter to clearOut and
  clearAddressing was being inadvertently filtered out
2024-04-16 10:18:08 +02:00
75e19c3116 REGRESSION: distributedTriSurfaceMesh:::findLocalInstance failure (#3135)
- after the modification of d578d48a4f, the parent was now actually
  searched. However, should be returning "constant" and not trigger a
  FatalError if the file/directory is not found.
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
92c329a8a9 ENH: add const_cast variants for isA<> and refCast<>
- an example of the new, more succinct refConstCast version:

      auto& abc = refConstCast<adjointVectorBoundaryCondition>(Uab);

  older:
      adjointVectorBoundaryCondition& abc =
          refCast<adjointVectorBoundaryCondition>
          (
              const_cast<fvPatchVectorField&>(Uab)
          );
  or:
      adjointVectorBoundaryCondition& abc =
          const_cast<adjointVectorBoundaryCondition&>
          (
              refCast<const adjointVectorBoundaryCondition>(Uab)
          );

- an example of the new, more succinct isA_constCast version:

      auto* acapPtr = isA_constCast<fieldType>(abf[patchi]);

      if (acapPtr)
      {
          auto& acap = *acapPtr;
          ...
      }

  older:
      if (isA<fieldType>(abf[patchi]))
      {
          fieldType& acap =
              const_cast<fieldType&>
              (
                  refCast<const fieldType>(abf[patchi])
              );
          ...
      }

STYLE: remove spurious 'const' qualifier from isA<> use
2024-04-16 10:18:08 +02:00
6546dd3f5b BUG: redistributePar: bypassing reading remote file. See #3137.
- NewIFstream would read complete remote file to decide if
  was collated.
- This limits files to 31bit size
- Instead now have master-only opening of file.
- Still has problem with refinement history/cellLevel etc.
2024-04-15 16:49:45 +01:00
752ab418c9 COMP: avoid ambiguous type conversion in Clang (fixes #3138) 2024-04-11 09:33:51 +01:00
d578d48a4f ENH: improve findInstance handling for optional files
- previously would always return "constant" as the instance for
  an optional dir/file that wasn't found.
  However, this meant retesting to screen out false positives.
  Now support an additional parameter
      'bool constant_fallback = ...'
  to return "constant" or an empty word.

  The method signature changes slightly with a new optional bool
  parameter:

      //! Return \c "constant" instead of \c "" if the search failed
      const bool constant_fallback = true

ENH: code consolidation for findInstancePath

- relocate from Time to TimePaths and provide an additional static
  version that is reused in fileOperations

BUG: distributedTriSurfaceMesh:::findLocalInstance broken (#3135)

- was not checking the parent at all.

COMP: remove unused findInstancePath(const fileName&, ..) method
2024-04-10 15:55:29 +02:00
85771c8985 ENH: simpler topoSet handling of zone/set
- support construct faceZoneSet from faceSet (#3126)

ENH: support unregistered loading of cell/face/point sets
2024-04-10 15:55:29 +02:00
68c5d90ad0 STYLE: rename readContents -> readIOcontents for private/protected method
- leave 'readContents' method name for exposed (public) methods.
  Generally not a problem, but can confuse the compiler when various
  public/private versions are available with the same number of
  parameters.

STYLE: adjust meshObject debug statements
2024-04-10 15:55:29 +02:00
0dcc53ab03 ENH: additional std::unique_ptr support for regIOobject and IOobjectList
- regIOobject::store(std::unique_ptr<...>&& ptr)
- IOobjectList::add(std::unique_ptr<...>&& ptr)

STYLE: io.globalCaseName() instead of io.time().globalCaseName() [#3007]
2024-04-10 15:55:29 +02:00
6ac572a179 BUG: masterUncollatedFileOperation::read() masked return value (#3135)
ENH: combine broadcasts for uncollated master-only handling
2024-04-10 15:55:29 +02:00
7fd962926d ENH: simplify Pstream broadcast stream construction
- the rootProcNo is usually == UPstream::masterNo()
2024-04-10 15:55:29 +02:00
bca093d89c SUBMODULE: update OpenQBMM (compilation change only) 2024-04-08 19:21:12 +01:00
0ef981adbc BUG: cached ensight type not a word (fixes #3133)
- the type/name for field caching were saved as word, but ensight has
  things like "tensor symm" etc, which do not parse very well as
  'word'. Now save as 'string' type.

  Backwards compatibility is OK since a word token will also be
  readable as string etc.
2024-04-05 14:06:36 +02:00
2d61127606 ENH: accept reading unquoted string (ie, word)
- makes string reading consistent with fileName reading.

  Related to #3133 to also allow compatibility when reading existing
  dictionaries written with unquoted string contents.
2024-04-05 14:05:36 +02:00
e099e98b8b STYLE: remove defunct restore0Dir expand of #include [collated]
- used defunct "processors/" directory naming, and includes are now
  addressed by the file-handler anyhow.

ENH: support 'tutorials/Alltest -init'

- for copying/creating test directory without running
2024-04-03 19:00:39 +02:00
2ff67f8ce4 BUG: overlapping zones: incorrect indexing 2024-03-30 16:29:23 +00:00
13f66313d1 BUG: redistributePar: restore. Fix AMIInterpolation. fixes #3125
Problem was that the zero fvMeshSubset constructed did not reset
the distributed flag.
2024-03-28 14:52:28 +00:00
483075b4aa BUG: KinematicCloud: remove hard-coded debug condition 2024-03-27 19:47:32 +00:00
1668519996 BUG: redistributePar: disable parallel when redistributing. Fixes #3125 2024-03-27 11:52:38 +00:00
5091c79e96 BUG: topoSet: allow use of 'set' as input for zones. Fixes #3126 2024-03-27 10:32:16 +00:00
6bd1486a38 ENH: solution: allow Function1 with database 2024-03-27 09:17:18 +00:00
93f6cae46a DOC: topoSet: add zones instead of sets 2024-03-27 09:17:18 +00:00
68e36946fd BUG: externalWallHeatFluxTemperature: prevent FPE in mixedEnergy condition (fixes #3123) 2024-03-21 16:36:22 +00:00
c6ecf3113a COMP: syncTools: move attribute 2024-03-20 09:32:43 +00:00
46e1b00c34 ENH: handle sub-mesh connectivity by subsetting of adjacency matrix
- in renumberMesh replace calculation of a subMesh connectivity
  with calculation of the full mesh connectivity followed by subsetting
  of the full adjacency matrix. This should reduce the overall number of
  operations. (MR !669)
2024-03-19 14:09:22 +01:00
a431e0fe9a ENH: additional parRun selection/protection on syncTools
- allow more control over using parallel communication or not.
2024-03-18 20:59:21 +01:00
6d69506294 STYLE: adjust comments and iterator de-reference
STYLE: replace PackedListCore.H with in-file definition
2024-03-18 20:59:21 +01:00
77ec7ab679 Merge branch 'feature-topoSet-with-zone' into 'develop'
topoSet: allow use of 'zone' instead 'set', 'zones' instead of 'sets' in all set sources

See merge request Development/openfoam!674
2024-03-18 19:58:07 +00:00
6692ecfbbc topoSet: allow use of 'zone' instead 'set', 'zones' instead of 'sets' in all set sources 2024-03-18 19:58:06 +00:00
3ef892b980 Merge branch 'feature-topoSet' into 'develop'
Feature topo set

See merge request Development/openfoam!668
2024-03-18 16:13:52 +00:00
e651d63566 ENH: cyclicAMI - clear finished send/recv requests 2024-03-18 17:00:34 +01:00
a7d6f2720f ENH: add for geometric transformation properties for topoSet
- added solidBodyMotionFunctions to topoSet which allows things like
  moving cellSet selection for fvOptions etc.

COMP: relocate solidBodyMotionFunctions to meshTools

Co-authored-by: Kutalmis Bercin <>
2024-03-18 16:50:16 +01:00
4a0a63999e BUG: cyclicAMI: start without 'value'. Fixes #3119 2024-03-18 12:14:36 +00:00
b1eb3e8746 BUG: fileHandler: disable parallel side effects. Fixes #3105 2024-03-18 11:54:40 +00:00
bc03a538cf ENH: mapDistribute: improved error message 2024-03-18 10:44:54 +00:00
f639538600 Merge branch 'feature-overlapping_zones' into 'develop'
Feature overlapping zones

See merge request Development/openfoam!670
2024-03-13 14:44:14 +00:00
3973cf7a83 Feature overlapping zones 2024-03-13 14:44:13 +00:00
28e212030d CONFIG: increment API level to 2401 2024-03-13 08:21:27 +00:00
cff9c7b60c ENH: singleCellFvMesh - added access to patchFaceAgglomeration 2024-03-11 14:20:36 +00:00
ef47662131 STYLE: liquidFilmModel - report film initial temperature when T0 employed 2024-03-11 14:20:36 +00:00
0c84e50583 ENH: refine renumberMesh and renumberMethod (addenda to !669)
- provide no_topology() characteristic to avoid triggering potentially
  expensive mesh connectivity calculations when they are not required.

- remove/deprecate unused pointField references from the renumber
  methods. These appear to have crept in from outer similarities
  with decompositionMethod, but have no meaning for renumbering.

- remove/deprecate various unused aggregation renumberings since these
  have been previously replaced by pre-calling calcCellCells, or
  using bandCompression directly.

- make regionFaceOrder for block-wise renumbering optional and
  treat as experimental (ie, default is now disabled).

  The original idea was to sort the intra-region and inter-region faces
  separately. However, this will mostly lead to non-upper triangular
  ordering between regions, which checkMesh and others don't really like.

ENH: add timing information for various renumberMesh stages

ENH: add reset of clockTime and cpuTime increment

- simplifies section-wise timings

ENH: add globalIndex::null() and fieldTypes::processorType conveniences

- provides more central management of these characteristics
2024-03-10 17:45:44 +01:00
618faa0ab6 Merge branch 'misc-reduced-overheads' into 'develop'
misc changes for reduced stringstream and MPI overhead

See merge request Development/openfoam!672
2024-03-07 18:11:38 +00:00
5680ce1ee2 STYLE: use spanstream instead of stringstream in more places
- particularly useful in these combinations:

  1.
      OCharStream buf;
      // populate

      ISpanStream is(buf.view());
      // parse

  2.
      // read from file
      ifile.getLine(str);

      ISpanStream is(str);
      // parse

  These avoid making a copy of the character content, compared to
  versions with stringstream:

      OStringStream buf;
      IStringStream is(buf.str());
2024-03-07 15:04:54 +01:00
f6825c7952 ENH: replace listCombineReduce with equivalent
- a few places still used listCombineReduce instead of
  newer constructs (eg allGatherList) with fewer MPI calls.

- align triangulation handling of turbulentDFSEMInlet and
  patchInjectionBase with meshTools/triangulatedPatch
  (will ease future code refactoring)
2024-03-07 11:19:56 +01:00
d89ecc74be Merge branch 'update-matrix-streaming' into 'develop'
Improve streaming matrix and internal memory management

See merge request Development/openfoam!671
2024-03-07 10:18:27 +00:00
27aa7e4e91 ENH: improve procLduMatrix streaming and assembly of LUscalarMatrix
- reduce local overhead prior to sending for master assembly
- non-blocking mode when assembling solution vector
- automatic resizing of pivots
2024-03-07 10:40:30 +01:00
43c0c3989b ENH: handle matrix demand-driven internals with unique_ptr
- align member order between template and non-template versions
- move construct, move assignment
2024-03-07 10:40:26 +01:00
05194796ef Merge branch 'update-renumbering-methods' into 'develop'
ENH: adjust renumbering methods, extend renumberMesh options

See merge request Development/openfoam!669
2024-03-06 22:20:54 +00:00
61aaacd088 ENH: adjust renumbering methods, extend renumberMesh options
- renumberMesh now has -dry-run, -write-maps, -no-fields,
  -renumber-method, -renumber-coeffs options.

  * Use -dry-run with -write-maps to visualize the before/after
    effects of renumbering (creates a VTK file).

  * -no-fields to renumber the mesh only.
    This is useful and faster when the input fields are uniform
    and the -overwrite option is specified.

  * -renumber-method allows a quick means of specifying a different
    default renumber method (instead of Cuthill-McKee).

    The -renumber-coeffs option allows passing of dictionary content
    for the method.

    Examples,

       // Different ways to specify reverse Cuthill-McKee

       *  -renumber-method RCM
       *  -renumber-coeffs 'reverse true;'
       *  -renumber-method CuthillMcKee
       *  -renumber-coeffs 'reverse true;'
       *  -renumber-coeffs 'method CuthillMcKee; reverse true;'

       // Other (without dictionary coefficients)
       *  renumberMesh -renumber-method random

       // Other (with dictionary coefficients)
       renumberMesh \
           -renumber-method spring \
           -renumber-coeffs 'maxCo 0.1; maxIter 1000; freezeFraction 0.99;'

       // Other (with additional libraries)
       renumberMesh -renumber-method zoltan -lib zoltanRenumber

COMP: build zoltan renumbering to MPI-specific location

- zoltan and Sloan renumbering are now longer automatically linked to
  the renumberMesh utility but must be separately loaded by a
  command-line option or through a dictionary "libs" entry.

ENH: add output cellID for decomposePar -dry-run -cellDist
2024-03-06 17:58:47 +01:00
e7f0628d79 ENH: promote IFstream::readContents() to public static function
- reads file contents into a DynamicList<char>, which can then be
  broadcast, moved to a ICharStream etc.
2024-03-06 15:05:36 +01: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
b98f53ceca ENH: make ITstream positioning methods noexcept
ENH: add rank() method for compound tokens

ENH: add IOstream::minPrecision(unsigned)

- reduced typing, more expressive, no namespace ambiguity with max()

    new: IOstream::minPrecision(10);
    old: IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));

STYLE: namespace qualify min/max for some buffer sizing [clang/hipp]
2024-03-06 11:01:57 +01:00
5a70be0846 ENH: use SubList for CompactListList access
- this was previously a UList instead of SubList,
  but SubList supports better assignment of values

ENH: add invertOneToManyCompact

- returns a CompactListList<label> instead of labelListList, which
  allows for reuse as partitioning table etc and/or slightly reduced
  memory overhead
2024-03-06 09:14:42 +01:00
78fc102df1 ENH: minor reduction in allocations for inactive profiling (#3112)
- avoid string conversion/concatenation unless profiling hooks
  are possible (ie, active or Extrae is loaded).
2024-03-06 08:18:08 +01:00
fa2aeec45b Merge branch 'feature-fa-various' into 'develop'
Misc. changes in the finite-area module

See merge request Development/openfoam!661
2024-03-05 18:14:12 +00:00
d03a225061 ENH: finiteArea: reduce various code footprint 2024-03-05 18:13:59 +00:00
abfe30454a ENH: finiteArea: consolidate various IOobject calls 2024-03-05 18:13:59 +00:00
3535d7890d ENH: faPatch: remove intermediate/unused fields 2024-03-05 18:13:59 +00:00
47232ccf66 ENH: finiteArea: replace raw pointers with unique_ptr 2024-03-05 18:13:59 +00:00
cd8bc891f0 ENH: fvMatrix, faMatrix: replace raw pointers with unique_ptr (#3107) 2024-03-05 18:13:59 +00:00
1cbbcf15d3 ENH: finiteArea: remove redundant header files 2024-03-05 18:13:59 +00:00
b393d6eca1 STYLE: finiteArea: add/fix comments
STYLE: finiteArea: consistent use of =delete for removed ctors/assignments
2024-03-05 18:13:59 +00:00
9de77857a6 ENH: add surface patch index to surfaceCheck output
- makes it somewhat easier to find a correspondence of patch names and
  patch index (for paraview)
2024-03-05 16:18:02 +01:00
46e0ef92d3 STYLE: spelling 2024-02-28 09:08:07 +00:00
8b793f8866 ENH: add global point/face/cell addressing to globalMeshData (#3108)
- permits reuse in other places without subsequent communication
2024-02-24 21:08:01 +01:00
337e672d53 ENH: extend globalMeshData::calcCellCells handling
- add convenience forms for common combinations

- avoid allocation for 1:1 identity agglomerations

- support subsetting forms (avoids an intermediate fvMeshSubset)
  that also return the cellMap

- refactored to eliminate code duplication between weighted and
  unweighted forms
2024-02-24 21:07:58 +01:00
04d880e2ce STYLE: use send/recv serializers for globalIndex and mapDistribute etc 2024-02-24 19:51:24 +01:00
4f43f0302d ENH: additional Map/HashTable constructors and ListOp functions
- construct Map/HashTable from key/value lists.

- invertToMap() : like invert() but returns a Map<label>,
  which is useful for sparse numbering

- inplaceRenumber() : taking a Map<label> for the mapper

ENH: construct/reset CStringList for list of C-strings
2024-02-23 18:10:48 +01:00
f7cdd3ef63 ENH: extra objectRegistry::newIOobject form with IOobjectOption
- example use:

      mesh.newIOobject(name, { IOobject::REGISTER });

  vs

      mesh.newIOobject
      (
          name,
          IOobject::NO_READ,
          IOobject::NO_WRITE,
          IOobject::REGISTER
      );
2024-02-23 17:58:21 +01:00
fac940e1cc Merge branch 'feature-regionFa-various' into 'develop'
Misc. changes in the regionFaModels

See merge request Development/openfoam!663
2024-02-23 15:54:08 +00:00
7891960bd1 ENH: KirchhoffShell: reduce code footprint 2024-02-23 12:14:30 +00:00
6e2bdb0613 ENH: liquidFilmBase: remove unused energy source field 2024-02-23 12:14:30 +00:00
05e4001cf2 ENH: regionFaModels: remove redundant header files 2024-02-23 12:14:30 +00:00
b6eb300718 ENH: liquidFilm: consolidate and inline various access funcs 2024-02-23 12:14:23 +00:00
b4d7a31913 STYLE: regionFaModels: add/remove various comments 2024-02-23 12:14:19 +00:00
90e9a070a7 DOC: regionFaModels: improve header documentation 2024-02-23 12:03:07 +00:00
3b966afb9c BUG: snappyHexMesh: parallel inconsistency. Fixes #3106 2024-02-22 16:08:51 +00:00
613959c52b ENH: faceZoneSet: doc. See #2024 2024-02-22 10:08:08 +00:00
25551b23bf BUG: faceZoneSet: allow construction of faceZone. Fixes #2024 2024-02-22 09:56:59 +00:00
73b6ddd760 Merge branch 'md23-update-registry-handling' into 'develop'
Updates to reduce unnecessary registration of tmp fields

See merge request Development/openfoam!665
2024-02-21 15:28:09 +00:00
8b73d06898 ENH: use tmp field factory methods [12] (#2723)
- applications
2024-02-21 14:31:40 +01:00
ec2b1be8c5 ENH: use tmp field factory methods [11] (#2723)
- src/optimisation
2024-02-21 14:31:40 +01:00
c138f89c1f ENH: use tmp field factory methods [10] (#2723)
- src/TurbulenceModels
2024-02-21 14:31:40 +01:00
d9483f5080 ENH: use tmp field factory methods [9] (#2723)
- src/phaseSystemModels
2024-02-21 14:31:40 +01:00
7bf0aaf99c ENH: use tmp field factory methods [8] (#2723)
- src/combustion
2024-02-21 14:31:40 +01:00
51f150d84c ENH: use tmp field factory methods [7] (#2723)
- thermophysicalModels, transportModels
2024-02-21 14:31:40 +01:00
71d4a23ec0 ENH: use tmp field factory methods [6] (#2723)
- src/functionObjects
2024-02-21 14:31:40 +01:00
995a9705e2 ENH: use tmp field factory methods [5] (#2723)
- src/lagrangian
2024-02-21 14:31:39 +01:00
33f20edbb1 ENH: use tmp field factory methods [4] (#2723)
- src/regionModels src/regionFaModels
2024-02-21 14:31:39 +01:00
710eb5c142 ENH: use tmp field factory methods [3] (#2723)
- src/faOptions, src/fvOptions
2024-02-21 14:31:39 +01:00
092db087c9 ENH: use tmp field factory methods [2] (#2723)
- src/finiteVolume, src/finiteArea
2024-02-21 14:31:39 +01:00
21196d8c0b ENH: use tmp field factory methods [1] (#2723)
- src/OpenFOAM, src/meshTools, src/mesh, src/dynamicMesh, src/sampling
  src/topoChanger src/overset src/fvMotionSolver
2024-02-21 14:31:39 +01:00
ac574a6ccb STYLE: use static call for regIOobject::store (#1507) 2024-02-20 16:56:22 +01:00
87eed74e42 Merge remote-tracking branch 'origin/master' into develop 2024-02-20 15:23:47 +01:00
119dd84327 CONFIG: bump patch level 2024-02-20 14:58:28 +01:00
08df023808 BUG: fvSchemes/fvSolution not properly updated on copy from fallback 2024-02-20 14:58:03 +01:00
ec3bca90fc ENH: update polySurface and sampledSurfaces
- surfaceWriter TryNew() factory methods for more failure tolerant
  handling

- reduce communication for sampledSurfaces.
  Track non-empty surfaces as bool, only updated on change
  (expire/update).
2024-02-16 15:08:32 +01:00
8b85e5c932 ENH: cyclicAMI - clear finished send/recv requests 2024-02-14 16:19:33 +01:00
506802bbea BUG: wallHeatFlux: avoid field-name inconsistency (fixes #3102) 2024-02-14 13:40:29 +00:00
0c20009587 ENH: support time-dependent actuationDiskSource disk direction (#3099) 2024-02-13 12:33:26 +01:00
5a0fba84b4 ENH: consolidate stream allocators
- add count() member for output span streams (consistency)

- ITstream construct/parse from span/view

COMP: remove old/unused first()/last() methods from SubStrings
2024-02-13 12:33:26 +01:00
732c8b3330 STYLE: more explicit method name PtrList::count() -> count_nonnull()
STYLE: use two-parameter shallowCopy
2024-02-13 12:30:13 +01:00
a9b451b3e4 SUBMODULE: re-enable turbulence-community build
- compilation issues caused by hidden python dependency now alleviated
2024-02-13 09:31:38 +01:00
ff567dbe71 CONFIG: adjust compile-time value of maxThreadFileBufferSize to 0
- consistent with etc/controlDict default

STYLE: update banner message for collated
2024-02-07 20:20:52 +01:00
e3b7c2e6ee ENH: replace masterUncollatedFileOperation::scatterList()
- use Pstream::listScatterValues() instead of the old hand-rolled
  method.

  Reduces code and since it is mostly used with primitives it
  will use MPI_Scatter directly (see #3087)

COMP: fix some inconsistent masterOp return types
2024-02-07 13:07:22 +01:00
84a1fc9b4f TEST: add standalone test application: Test-checkIOspeed 2024-02-07 13:07:22 +01:00
47c44a5783 ENH: use UList instead of List for some Pstream gather/scatter
- can use UList signature since the routines do not resize the list
  or attempt to broadcast it: useful for SubList handling.

ENH: add IPstream/OPstream send/recv static methods
2024-02-07 10:02:28 +01:00
91a1eaa01b ENH: support invisible formattingEntry 2024-02-07 08:59:30 +01:00
852f66fc11 CONFIG: add user/group libraries into path separately (#2948)
- on Darwin _foamAddLib() also checks the library path existence
  so passing in "path1:path2" together fails.
2024-02-06 22:16:22 +01:00
fcf090410a ENH: additional constructors for triangle and triPoints
STYLE: use Foam::zero{} in expression parsers
2024-02-06 15:36:39 +01:00
08c23685c3 BUG: incorrect cumulative area in triangulatedPatch (fixes #3097)
BUG: bad processor selection. Failed to select anything on non-master
2024-02-06 11:02:26 +01:00
19a6241e08 Merge branch 'feature-ensightCloudFO' into 'develop'
ensight cloud functionObject

See merge request Development/openfoam!666
2024-02-02 13:31:18 +00:00
52f5a6d039 ENH: additional ensightCloud function object (#3095) 2024-02-02 12:46:42 +01:00
fe1d7e01d6 ENH: extend ensightCloud write-measured support
- related to issue #3095
2024-02-02 12:44:03 +01:00
cb416fb3ec ENH: add ensight writeBox method (eg, for simple 'placeholder' geometry)
- related to issue #3095. Some type of geometry is required when
  loading "measured" ensight data.

ENH: emit a fallback geometry-box for foamToEnsight

- eg, with "foamToEnsight -no-internal -no-boundary" and lagrangian
2024-02-02 12:42:48 +01:00
4ae4f0928d ENH: ensightFile writeInt() method to replace two-parameter write
- more explicit/transparent handling
- avoids compiler warnings about non-virtual methods
2024-02-02 12:36:47 +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
3a43aae7c0 Merge branch 'cleanup-Pstream' into 'develop'
Remove obsolete Pstream functions

See merge request Development/openfoam!664
2024-02-01 13:52:49 +00:00
9ad3754ed7 ENH: remove obsolete Pstream functions (#3087)
- the old Pstream::scatter routines (which were largely a misnomer)
  have been superseded by various broadcast routines, but were left in
  the code with #ifndef/#ifdef Foam_Pstream_scatter_nobroadcast
  guards. Now noisily deprecate them, and remove the old manual tree
  communication in favour of MPI broadcast and/or
  serialize/de-serialize with wrapped Pstream::broadcast

- consolidate various gather methods to include the communication
  structure directly. No functional change, but reduces the number of
  methods.

ENH: add parallel guard to UPstream::whichCommunication() method

- returns List::null() as the schedule for non-parallel instead
  of an inappropriate linear or tree schedule

ENH: Pstream::listGatherValues, Pstream::listScatterValues

- like the existing UPstream versions but supporting non-contiguous
2024-02-01 13:52:39 +00:00
d6781b91fe Merge remote-tracking branch 'origin/master' into develop 2024-02-01 13:15:51 +00:00
d9c5a5d1a9 BUG: mapped: register to current, not other mesh. See #2723 2024-02-01 13:14:09 +00:00
fc9820b08a STYLE: mapped: remove defaults from mapped 2024-01-31 13:49:26 +00:00
f9bbd06e57 ENH: mapped: avoid patch check. See #3090 2024-01-31 13:12:24 +00:00
182afc27ba STYLE: noexcept for nullObject functions
STYLE: use nullObject for return values of NotImplemented

STYLE: shallowCopy(nullptr) shortcut
2024-01-25 16:03:09 +01:00
0bf39691ff Merge branch 'fix-createZeroBoundaryPtr' into 'develop'
FIX: replaced temp internalField with DimensionedField::null (fixes #3082)

See merge request Development/openfoam!662
2024-01-24 20:47:16 +00:00
312c7a1c32 FIX: replaced temp internalField with DimensionedField::null (fixes #3082) 2024-01-24 20:46:43 +00:00
0ae3da8560 COMP: using incomplete class edgeMesh 2024-01-24 19:58:27 +01:00
44c594dbff Merge branch 'feature-mappedPatch-movingMesh' into 'develop'
ENH: mapped: keep coupling info. Fixes #3090

See merge request Development/openfoam!659
2024-01-24 16:26:07 +00:00
a889e5eba6 STYLE: mappedPatchBase: abstract common code 2024-01-24 16:25:41 +00:00
3d0cb79be3 ENH: mapped: keep coupling info. Fixes #3090 2024-01-24 16:25:41 +00:00
d310f82402 Merge branch 'style-patchfield-clone' into 'develop'
Use factory Clone for patch fields

See merge request Development/openfoam!660
2024-01-23 11:22:20 +00:00
152eceeb56 Use factory Clone for patch fields 2024-01-23 11:22:19 +00:00
ebe49d4cbd BUG: SlicedGeometricField, slices into field instead of shallow copy (#3080)
- regression introduced by e98acdc4fc

  Affected versions: (v2206, v2212, v2306, v2312)
2024-01-19 18:06:38 +01:00
7cfd053079 ENH: use updated globalIndex methods
- range(proci) instead of localStart(proci), localSize(proci) combination.
  * does the same thing, can be used directly with various other
    routines for slicing etc.

    Eg,
       Foam::identity(globalNumbering.range(myProci))

- globalIndex::calcOffset() instead of constructing a globalIndex and
  taking the localStart(). Avoids intermediate resizing and storing of
  an offsets table (which is then discarded) as well as the subsequent
  lookup into that table
2024-01-19 17:15:29 +01:00
81f0620b7b TUT: fix mesh/parallel/cavity for Alltest mode
- use foamListTimes instead of hard-coded time to track the
  redistribution point. Still slightly fragile...
2024-01-18 12:51:49 +01:00
7b7dde0a6d BUG: memory leak and interpolated fields not updated (fixes #3089)
- in singleCellMesh application:
  also remove the interpolated fields from the registry,
  which ensures they are correctly updated between time steps
2024-01-17 17:31:35 +01:00
f485093d37 STYLE: use patch type instead of cloning list of the same 2024-01-17 14:45:31 +01:00
a4cbb33373 STYLE: use Internal typedef within GeometricBoundaryField
- aligns with GeometricField usage etc
2024-01-17 10:44:17 +01:00
f625a9a0dd ENH: additional DimensionedField, GeometricField New factory methods 2024-01-17 10:44:17 +01: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
646b0aab36 ENH: allow modification of OSstream name
- can be useful when using memory-based streams for buffering,
  in which case the name() can be used to specify the filesystem
  location instead of the default stream names ("input", "output").
2024-01-17 10:43:06 +01:00
d048befbc0 ENH: distributedTriSurfaceMesh: feed through tolerances 2024-01-15 15:36:57 +00:00
26904bf6df ENH: pointConstraints: allow non-facePointPatch. Fixes #3085 2024-01-15 15:24:26 +00:00
62524b140c BUG: protected division - fixes #3084 2024-01-15 15:10:24 +00:00
e3f0521b19 Merge branch 'feature-gcc13' into 'develop'
Code adjustments to avoid gcc-13 warnings about dangling references

See merge request Development/openfoam!656
2024-01-11 10:08:46 +00:00
bb16c493b7 Code adjustments to avoid gcc-13 warnings about dangling references 2024-01-11 10:08:45 +00:00
89cd584440 Merge branch 'style-clone-methods' into 'develop'
factory Clone method for handling member clone() methods

See merge request Development/openfoam!658
2024-01-09 11:56:52 +00:00
2190684914 STYLE: patch field Internal::null() instead of DimensionedField equivalent
- makes for more consistent coding

STYLE: use two-parameter clone when making a copy of patch fields
2024-01-09 11:56:45 +00: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
39e054b0b8 Merge branch 'fix-ISQP-noBounds' into 'develop'
BUG: ISQP crashing with the ShermanMorrison preconditiooner and no bounds (fixes #3077)

See merge request Development/openfoam!657
2024-01-09 11:45:04 +00:00
f6ec5c676e BUG: ISQP crashing with the ShermanMorrison preconditiooner (fixes #3077)
ISQP crashed during the first update of the design variables, if the
latter had no bounds and the ShermanMorrison preconditiooner was used.
2024-01-09 11:44:41 +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
dde4b12687 ENH: add pointPatchField::patchInternalField with three-parameters
- allows extraction without constructing a tmp.
  The definition is similar to {faPatch,fvPatch} handling.
2024-01-08 17:42:55 +01:00
1a1322a2b0 COMP: avoid operator= masking (gcc-13) 2024-01-08 17:42:43 +01:00
8394e45c13 BUG: snappyHexMesh: ignore blockSize. See #3068 2024-01-08 15:42:59 +00:00
a46b310fa4 COMP: g++11: suppress optimisation. See #3024 2024-01-08 14:30:06 +01:00
793231b4aa COMP: g++11: suppress optimisation. See #3024 2024-01-04 08:35:37 +00:00
1dc216eb1f TUT: Corrected references to mut - related to #3057 2024-01-03 09:55:44 +00:00
c4328296b0 TUT: Corrected legacy muTilda -> nuTilda. Fixes 3057 2024-01-03 09:43:23 +00:00
52ab1fc06f TUT: changes in optimisation tutorials
- shape optimisation: SQP failed due to wrong divScheme for the adjoint
  equations
- shape optimisation: tutorials designed to show the impact of different flow
  conditions were actually using the same U
- topology optimisation: tutorials designed to show the impact of the
  flow rate distribution were actually using the same target
  fractions
- topology optimisation: updated old fvSolution syntax
2024-01-02 12:03:21 +00:00
f8bee97897 Merge branch 'fix-adjoint-tutorials' into 'develop'
TUT: changes in optimisation tutorials

See merge request Development/openfoam!655
2024-01-02 11:59:39 +00:00
9f0f9f2dd6 TUT: changes in optimisation tutorials
- shape optimisation: SQP failed due to wrong divScheme for the adjoint
  equations
- shape optimisation: tutorials designed to show the impact of different flow
  conditions were actually using the same U
- topology optimisation: tutorials designed to show the impact of the
  flow rate distribution were actually using the same target
  fractions
- topology optimisation: updated old fvSolution syntax
2024-01-02 11:59:08 +00:00
58787bb166 COMP: avoid ambiguous max() call on MacOS (fixes #3066)
- had max(std::streamsize, label) but this does not resolve properly
  on OSX, so write out in long form instead.

  The similar logic in DynamicList is okay since there it compares
  max(label, label) instead
2023-12-22 15:10:49 +01:00
1d8f0d55f7 SUBMODULE: fix remnant function call in visualization 2023-12-21 16:23:42 +01:00
c39a0f6494 RELEASE: Updated version to v2312 2023-12-21 11:51:03 +00:00
82417d1d8b SUBMODULE: disable turbulence-community build until compilation issues are resolved 2023-12-21 11:48:30 +00:00
f88e06cac2 Merge branch 'fix-function-objects-in-optimisation' into 'develop'
FIX: functions objects in optimisation

See merge request Development/openfoam!654
2023-12-21 09:50:33 +00:00
e5a62a0bdd TUT: removed unnecessary computations of yPlus
in shape optimisation tutorials
2023-12-21 09:50:26 +00:00
d5661b50de FIX: roll-back of the execution of function objects in optimisation
In steadyOptimisation mode, each time-step corresponds to an
optimisation cycle and is sub-cycled, to allow for iterating the flow
and adjoint equations. This sub-cycling does not allow the execution of
function objects. This was circumvented in 8947735b1d, by explicitly
calling the execution of the function objects in the simple solver
of adjointOptimisationFoam.

However, each sub-cycled iteration is a writeTime, if the current
optimisation cycle corresponds to a writeTime. This means that function
objects with a

writeControl write;

will be executed in each iteration of the flow equations, within this
specific optimisation cycle, leading to a lot of disc space and file
clutter, if the function object outputs fields (e.g. yPlus).

8947735b1d is partially rolled back, by protecting the call to the
execution of the function objects with a bool that defaults to false.
2023-12-21 09:50:26 +00:00
9bb189d1d6 RELEASE: update API to v2312 2023-12-20 19:42:55 +01:00
28aad3a03e RELEASE: Updated headers to v2312 2023-12-20 19:42:55 +01:00
f8c20963d2 RELEASE: Updated completions cache 2023-12-20 19:42:51 +01:00
032a4519ff COMP: adjust link parameters (mingw)
- adjointOptimisation : missing link to fileFormats

- snappyHexMesh : add fvMotionSolvers link (#3058)

STYLE: remove remnant -DFULLDEBUG hints

- now more easily covered with wmake -debug ...
2023-12-20 19:22:19 +01:00
cf47600dde ENH: snappyHexMeshDict: some comment 2023-12-20 15:00:40 +00:00
de133af526 FIX: redistributePar problems with lagrangian
- the fileHandler changes included setting cacheLevel(0) to avoid
  blocking with redistributePar. However, this meant if clouds
  were not uniformly present on all ranks the fileHandler would follow
  different code paths and lead to blocking.

  Now switch to distributed mode for the lagrangian operations within
  redistributePar based on the cacheLevel information.

FIX: avoid triggering a false processor check in argList

- when redistributing to few ranks
2023-12-20 15:18:55 +01:00
88be9ef5c6 FIX: provide default uniform scotch weighting (#3063)
- maintains the same code path within scotch
2023-12-20 13:28:17 +01:00
7d9bba67c1 BUG: Fixed keepParticle regression introduced in 8fb148bb 2023-12-20 12:25:37 +00:00
2602d08d8a TUT: mergePairs: cleanup 2023-12-20 11:58:53 +00: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
686f2a3986 Merge branch 'extrae-profiling' into 'develop'
ENH: add profiling hooks for Extrae into the OpenFOAM profiling (#3043)

See merge request Development/openfoam!652
2023-12-19 14:45:43 +00:00
0fbdbb8330 ENH: add profiling hooks for Extrae into the OpenFOAM profiling (#3043)
- the hooks are defined as weak symbols and are compiled into OpenFOAM
  by default. If the library is not loaded (via LD_PRELOAD) the hooks
  have no effect.

    - https://tools.bsc.es/extrae
    - https://tools.bsc.es/paraver
2023-12-19 14:45:32 +00:00
e8f0cfb2a5 Merge branch 'feature-topology-optimization' into 'develop'
ENH: update of the adjoint library and introduction of topology optimisation

See merge request Development/openfoam!649
2023-12-18 18:01:56 +00:00
4c3f9a9772 TUT: added topology optimisation tutorials
using the Borrvall-Petersson method to compute the source terms of the
flow equations.
2023-12-18 18:01:35 +00:00
7868d9251a TUT: added a topology optimisation tutorial using ISQP
to update the design variables
2023-12-18 18:01:35 +00:00
0af46becdd ENH: treating issues with the convergence of ISQP
The solution of the QP subproblem can become quite expensive, especially
for cases with many design variables (e.g. topology optimisation).

A (potentially dense) matrix with the size of the design variables is
solved using a matrix-free CG solver. The convergence speed greatly
depends on the used preconditioner. This commit adds
preconditioner-vector products based on the L-BFGS inverse Hessian and,
more importantly, a preconditioner computed using the Sherman-Morrison
formula. The latter is applicable here since the LHS of the QP problem
is computed as the sum of rank-2 L-BFGS updates, a sum of rank-1 updates
(as many as the flow-related constraints) and a diagonal matrix
depending on the bound constraints.

Additionally, the QP subproblem could have no feasible points. To relax
this, constraints can be applied gradually through the
targetConstraintReduction enty (typical value of 0.1 for topology
optimisation).
2023-12-18 18:01:35 +00:00
0120d7720b BUG: topology optimisation design variables were not written
properly for continuation (written through SubField instead of Field)
2023-12-18 18:01:35 +00:00
afe9b90d04 STYLE: homogenised the use of "topO" instead of "topo"
whenever refering to topology optimisation.
2023-12-18 18:01:35 +00:00
a6e9a29f41 TUT: minor updates to the topology optimisation tutorials
Replaced 'convertToMeters' with 'scale' in blockMeshDicts and added the
creation of the triSurface folder in some re-evaluation cases
2023-12-18 18:01:35 +00:00
634f921831 GIT: removed unused file incompressibleAdjointSolverTemplates.C 2023-12-18 18:01:35 +00:00
28c538f3e1 ENH: the boundary value of the regularised field of design variables
(aTilda) in topology optimisation can now be provided through the 'wallValue' in the
regularisation dictionary (defaults to 1)
2023-12-18 18:01:35 +00:00
3cd2b2c692 ENH: The (final) sensitivities involved in topology optimisation
runs can now be written to files using the 'writeAllFields' flag in the
designVariables dictionary (defaults to false)
2023-12-18 18:01:35 +00:00
c3b212e06c ENH: Input in objectiveFlowRatePartition now reads "targetFractions"
instead of targetPercentages, with a compatibility read on the latter.
Changed corresponding tutorials too.
2023-12-18 18:01:35 +00:00
eabb821926 TUT: updated the topology optimisation tutorials
Most cases now rely on the nullSpace update method, instead of MMA,
since it has proven more reliable.

Also, added some constrained optimisation cases, including constraints
on the flow rate partition and total pressure losses as well as cases
targeting uniformity as the objective function.

Added a 3D topology optimisation case which also includes constraints.
2023-12-18 18:01:35 +00:00
46757d12ec ENH: minor update in levelSet-based topology optimisation,
to keep the regularised design variables and the signed distance in
different fields
2023-12-18 18:01:35 +00:00
1f7fb08060 BUG: wrong numbering when determining the zoneIDs
of the STL written by topology optimisation.

BUG: when determining which mesh faces are cut by iso-surface faces,
only append the latter if it contains more than two points
2023-12-18 18:01:35 +00:00
e5d5e7b0be ENH: added the option to stop the normalisation
of the objective and constraint gradients in MMA, at a specific
optimisation cycle
2023-12-18 18:01:35 +00:00
bf18fb758c ENH: nullSpace will now perturb the design variables
by a small amount, if all of them lay on the lower or upper bounds at
the beginning of the optimisation, to avoid singular matrices when
computing the update of the design variables.
2023-12-18 18:01:35 +00:00
e764f7b573 ENH: flowRate and flowRatePartition objectives are now computed
based on phi, instead of U & Sf
2023-12-18 18:01:35 +00:00
b5b48b66d1 ENH: enabled the postProcess option in adjointOptimisationFoam 2023-12-18 18:01:35 +00:00
741520801a STYLE: minor change on the output of max mags of the adjoint fields 2023-12-18 18:01:35 +00:00
8947735b1d ENH: enable the execution of functions objects in optimisation mode 2023-12-18 18:01:35 +00:00
2ad6c9f5d2 ENH: adjointRASModel will not crash if set to laminar
and the Jacobian of the objective function wrt the turbulence variables
is called (rare/unorthodox case).

Additionally, objectivePowerDissipation dissipation can now be used in
topology optimisation, adding the necessary blockage dependency to it.
2023-12-18 18:01:35 +00:00
753a534382 ENH: changes in topOVariablesBase and derived classes
- Building the iso-surface spliting fluid and solid parts in topology
  optimisation has been re-worked to obtain an iso-surface with unique
  point numbering
- The mechanism behind marchingCells for dynamicTopODesignVariables has
  been slightly reworked
2023-12-18 18:01:35 +00:00
f35b4cc3fb ENH: added a variant of betaMax that computes it
based on the product of the Reynolds and Darcy numbers
2023-12-18 18:01:35 +00:00
2927015824 ENH: added a null space approach to update the design variables 2023-12-18 18:01:35 +00:00
6020fabcdd ENH: added a normalisation mechanism in MMA
The derivatives of the objective and constraint functions can optionally
be normalised in each optimisation cycle, so that MMA does not put an
excesive stress on the constraints, which can negatively affect the
course of the optimisation
2023-12-18 18:01:35 +00:00
adaac7257f INT: integration updates
- Minor code style
- virtual functions
- added some noexcept
2023-12-18 18:01:35 +00:00
bd84860e9b ENH: added references to topology optimisation headers 2023-12-18 18:01:35 +00:00
50d13c6278 ENH: getters in objective are now const 2023-12-18 18:01:35 +00:00
e0ea0973b1 ENH: replace List<objective*> with UPtrList in incompressiblePrimalSolver (fixes #2946) 2023-12-18 18:01:35 +00:00
b435feffde TUT: added tutorials for topology optimisation
A 1-Inlet-2-Outlet geometry is showcased for laminar and turbulent
flows, set-up with different variants of porosity-based and
level-set-based topology optimisation
2023-12-18 18:01:35 +00:00
b23b09fdbd ENH: added adjoint-based topology optimisation (topO) capabilities
Both porosity-based and level-set-based topO frameworks are included
through the topO and levelSet designVariables, respectively.

Both frameworks work by manipulating an underlying field of design
variables, defined in all cells of the computational domain. That field
is then regularised through a Helmholtz-like filter, before being
processed in a different way from the two topO frameworks (the
porosity-based topO sharpens/projects it while the level-set-based topO
computes signed distances around its zero iso-surface). The result of
this processing is then fed into functions that define source terms to
be added to the mean flow and turbulence model equations, to block
off/solidify parts of the mesh that are counterproductive with respect
to the objective function. These source terms are added through
fvOptions.

Since the designed walls are only simulated through source terms, the
outcome of topO should be re-analyzed on a body-fitted grid, to quantify
the actual gain in the objective function. Both topO frameworks output
the designed wall in STL format which can be used, for instance with
snappyHexMesh, to construct such a body fitted grid.
2023-12-18 18:01:35 +00:00
2b2c78309c ENH: added an optional argument to the constructor of patchWave
This provides a list of faces (can be internal ones) to act as
additional seeds for the wave algorithm. The default argument provides
an empty list, so the behaviour of patchWave should not change.

Useful in topology optimisation, for propagating the active design
variables from the seed faces to the interior, with a given number of
cells at a time.
2023-12-18 18:01:35 +00:00
59bf69b92e ENH: changes in advectionDiffusionPatchDistMethod
- advectionDiffusion is frequently used within optimisation loops since
  it is differentiable. In shape optimisation, the re-computation of
  mesh distances is performed at the very beginning of a new
  optimisation cycle, due to inheriting from MeshObject. If the mesh
  quality is poor enough, the advectionDiffusion PDE might diverge and
  crash the run, before the problematic mesh is written to files for
  inspection. The default behaviour now is to check the mesh before
  solving the advectionDiffusion PDE and write the mesh points if some
  mesh check fails.
- fvOptions can now be included in advectionDiffusion (necessary for
  topology optimisation of turbulent flows for models that include the
  distance field)
- Minor changes in the numerical treatment of the diffusion term, to
  enhance stability
2023-12-18 18:01:35 +00:00
58cfb58b1a ENH: extened fvOptions to support sensitivity derivative
computations necessary in topology optimisation
2023-12-18 18:01:35 +00:00
b6a30fae61 ENH: overhaul of the adjoint optimisation library
Parts of the adjoint optimisation library were re-designed to generalise
the way sensitivity derivatives (SDs) are computed and to allow easier
extension to primal problems other than the ones governed by
incompressible flows. In specific:
- the adjoint solver now holds virtual functions returning the part of
  SDs that depends only on the primal and the adjoint fields.
- a new class named designVariables was introduced which, apart from
  defining the design variables of the optimisation problem and
  providing hooks for updating them in an optimisation loop, provides
  the part of the SDs that affects directly the flow residuals (e.g.
  geometric variations in shape optimisation, derivatives of source
  terms in topology optimisation, etc). The final assembly of the SDs
  happens here, with the updated sensitivity class acting as an
  intermediate.

With the new structure, when the primal problem changes (for instance,
passive scalars are included), the same design variables and sensitivity
classes can be re-used for all physics, with additional contributions to
the SDs being limited (and contained) to the new adjoint solver to be
implemented. The old code structure would require new SD classes for
each additional primal problem.

As a side-effect, setting up a case has arguably become a bit easier and
more intuitive.

Additional changes include:
---------------------------

- Changes in the formulation and computation of shape sensitivity derivatives
  using the E-SI approach. The latter is now derived directly from the
  FI approach, with proper discretization for the terms and boundary
  conditions that emerge from applying the Gauss divergence theorem used
  to transition from FI to E-SI. When E-SI and FI are based on the same
  Laplace grid displacement model, they are now numerically equivalent
  (the previous formulation proved the theoretical equivalence of the
  two approaches but numerical results could differ, depending on the
  case).
- Sensitivity maps at faces are now computed based (and are deriving
  from) sensitivity maps at points, with a constistent point-to-face
  interpolation (requires the differentiation of volPointInterpolation).
- The objective class now allocates only the member pointers that
  correspond to the non-zero derivatives of the objective w.r.t. the
  flow and geometric quantities, leading to a reduced memory footprint.
  Additionally, contributions from volume-based objectives to the
  adjoint equations have been re-worked, removing the need for
  objectiveManager to be virtual.
- In constrained optimisation, an adjoint solver needs to be present for
  each constraint function. For geometric constraints though, no adjoint
  equations need to solved. This is now accounted for through the null
  adjoint solver and the geometric objectives which do not allocate
  adjoint fields for this kind of constraints, reducing memory
  requirements and file clutter.
- Refactoring of the updateMethod to collaborate with the new
  designVariables. Additionally, all updateMethods can now read and
  write restart data in binary, facilitating exact continuation.
  Furthermore, code shared by various quasi-Newton methods (BFGS, DBFGS,
  LBFGS, SR1) has been organised in the namesake class. Over and above,
  an SQP variant capable of tackling inequality constraints has been
  added (ISQP, with I indicating that the QP problem in the presence of
  inequality constraints is solved through an interior point method).
  Inequality constraints can be one-sided (constraint < upper-value)
  or double-sided (lower-value < constraint < upper-value).
- Bounds can now be defined for the design variables.
  For volumetricBSplines in specific, these can be computed as the
  mid-points of the control points and their neighbouring ones. This
  usually leads to better-defined optimisation problems and reduces the
  chances of an invalid mesh during optimisation.
- Convergence criteria can now be defined for the optimisation loop
  which will stop if the relative objective function reduction over
  the last objective value is lower than a given threshold and
  constraints are satisfied within a give tolerance. If no criteria are
  defined, the optimisation will run for the max. given number of cycles
  provided in controlDict.
- Added a new grid displacement method based on the p-Laplacian
  equation, which seems to outperform other PDE-based approaches.

TUT: updated the shape optimisation tutorials and added a new one
showcasing the use of double-sided constraints, ISQP, applying
no-overlapping constraints to volumetric B-Splines control points
and defining convergence criteria for the optimisation loop.
2023-12-18 18:01:35 +00:00
ae8b654a86 BUG: cyclicAMI: missing autoMap,rmap 2023-12-18 16:40:12 +00:00
dbacd7bc95 Merge branch 'feature-fileOperation-nProcs' into 'develop'
ENH: fileOperation: fix fileOperation::nProcs to handle multiple candidates

See merge request Development/openfoam!653
2023-12-18 15:59:31 +00:00
d6ba54bfec ENH: fileOperation: fix fileOperation::nProcs to handle multiple candidates 2023-12-18 15:59:31 +00:00
577f584446 Merge branch 'feature-nonblockingGAMG' into 'develop'
ENH: cyclicAMI: add non-blocking for GAMG

See merge request Development/openfoam!651
2023-12-18 12:56:33 +00:00
7a9dd4c0c2 ENH: cyclicAMI: add non-blocking for GAMG 2023-12-18 12:56:33 +00:00
80d7227c3a SUBMODULE: update all the submodules 2023-12-18 11:39:20 +00:00
88b3fb7c2d ENH: foamMonitor: modernise and refactor the script (fixes #2104)
- enhance POSIX compliance
- apply distinct colours and dash type for each line
- standardize the frame size to 1200x627
- dynamically replace the title with <function-object-name>/<file-name>
- address underscore character issues
- introduce legend components for tensors
- resolve a bug caused by parentheses in tensor files

BUG: particleTrackProperties: correct the typo (fixes #3050)
2023-12-15 22:20:27 +00:00
7e0acfa4ed ENH: handle 64-bit memory information (#3060)
- on large memory systems (eg, 6TB) the process information
  exceeds an 'int' range, so adjust parsing of the /proc/..
  to use int64

ENH: update/modernize OSspecific system information

ENH: minor update of profiling code

- std::string, noexcept, lazier evaluations

STYLE: use direct call of memInfo
2023-12-15 17:21:38 +01:00
2045de8345 CONFIG: foamPackRelease handling of recursive submodules 2023-12-15 16:17:16 +01:00
432d65475c ENH: preserve origId in foamFormatConvert (fixes# #3051)
- previously read the cloud directly without any of the
  passiveParticle fields (origProcId, origId), which meant they would
  not actually be converted.
2023-12-15 16:17:16 +01: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
0352a224b7 COMP: access transformedElements by reference, not copy
- better code style and seems to avoid triggering a gcc warning about
  possibly uninitialized values

COMP: JSONformatter writeEntry missing a return value

STYLE: accept 'json' for checkMesh write format

- consistent with caseInfo functionObject
2023-12-15 16:17:15 +01:00
79993bba43 CONFIG: support explicit selection of 'ld' linker
- for clang-based compilers the default linker may be lld or simply ld.
  Support '+link-ld' to explicitly select use of the ld linker.

- consolidate linker rules into single files

STYLE: adjust SPDX Identifier
2023-12-15 16:17:12 +01:00
5cdc8c6fde BUG: redistributePar: Differing communicator. See #3053.
redistributePar -decompose switches communicator when
reading on master. However other processors still get
constructed with the worldComm. >v2306 AMI stores the communicator
from construction time there was a mismatch
2023-12-13 12:56:59 +00:00
f99bcd1f6c BUG: solver performance updates overwrite pimple controls (fixes #3054)
- regression introduced by commit 0ff86ee2
  (only affects recent develop).

- now split off first/final iterations into a separate
  "controls" dictionary (instead of lumping them into "solver") to
  make them persistent between iterations.
2023-12-13 12:34:43 +01:00
35c884971a BUG: redistributePar blocks with -ioRanks (#3005) 2023-12-12 20:35:09 +01:00
a0e4ee0b3e BUG: masterUncollated readStream causes checkOut/checkIn (#2952)
- updating the header information (by copying) was closing the stream,
  removing all watches and doing a checkOut/checkIn, which could lead to
  dangling references.
  Now just close the stream and simply copy the IOobject header
  information directly.

STYLE: mark regIOobject assignment operator as possibly deprecated

- will revisit to revise or remove in the future
2023-12-12 20:06:50 +01:00
c647e68e1f BUG: mismatch in watch file indices (see !605) 2023-12-12 20:06:50 +01:00
56a0f80863 BUG: copy construct of faSchemes/faSolution ignored (see !605)
- the faMesh/fvMesh copy constructors were using the readOption from
  the base-mesh schemes/solution instead of copying their contents.

  This would not really affect fvMesh (since it has its own IOobject
  for the constructor), but did affect faMesh. However, the problem
  only shows up with collated + redistribute, since that is where
  the ranks can be doing uncoordinated IO.

  Only consider as a bug for recent develop since previous versions
  had other problems with collated+redistribute with finite-area
  anyhow.
2023-12-12 20:06:50 +01:00
5b177b44f3 STYLE: update README to v2312 2023-12-12 20:06:50 +01:00
4612238eff BUG: multiWorld: switch to inter-world communicator. Fixes #3053. 2023-12-12 17:26:59 +00:00
3339f25992 Merge branch 'update-registry-handling0' into 'develop'
Improved DimensionedField/GeometricField factory methods

See merge request Development/openfoam!650
2023-12-12 11:57:57 +00:00
7cc6d52345 CONFIG: increment API level to 2310 2023-12-11 15:56:00 +01:00
4cf1691cdd ENH: update DimensionedField and GeometricField New factory methods
- allow separate specification of the registerObject (no/yes/auto)
  to improve the flexibility of the factory methods.
2023-12-11 15:56:00 +01:00
6ea4328ea1 SUBMODULE: update avalanche, visualization 2023-12-11 15:56:00 +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
d086cc5a0e COMP: stricter handling of openmp vs no-openmp
- give precedence to ~openmp (-no-openmp) over +openmp (-openmp)
  in the general rules and in the Makefile. This makes it robuster
  when specifying +openmp in general, but ~openmp for specific build
  components.

- disable openmp for OSspecific and Pstream components.
  Neither should contain any openmp code anyhow.

  Additionally, since OSspecific is generally built as a static
  object, it can become problematic (eg, with AMD ROCm) if the
  compiler generates information that openmp is required but then uses
  static linkage.
2023-12-11 15:56:00 +01:00
cd493897d3 CONFIG: update ADIOS version. From 2.8.3 to 2.9.2 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
05f2d54979 ENH: masterCoarsest: demo case for processorAgglom. See !645 2023-12-11 12:28:08 +00:00
cf4af229b6 ENH: shm: more layer printing. Fixes #3049 2023-12-11 10:26:09 +00:00
ca80affe60 COMP: MapLagrangian: unused reference 2023-12-11 09:06:19 +00:00
d2b2b9fa0f TUT: redistributePar: use instead of decomposePar 2023-12-11 08:54:41 +00:00
bc5aafa0d9 TUT: fileOperation: bit more testing. See #2952 2023-12-08 15:58:12 +00:00
1844f87a0d COMP: pass as labelList as List<int> for MPI 2023-12-08 13:33:30 +00:00
b4f150b095 Merge branch 'feature-patchSeedSet' into 'develop'
Extended patchSeedSet to generate seed points more uniformly

See merge request Development/openfoam!647
2023-12-08 11:42:22 +00:00
ec48e2f309 ENH: Extended patchSeedSet to generate seed points more uniformly 2023-12-08 11:41:55 +00:00
df71026509 ENH: Added triangulatedPatch class to triangulate pacthes for searching
- Provides random local and global points, optionally perturbed away from the
  boundary faces
2023-12-08 11:41:55 +00:00
863dbc68cb Merge branch '2770-wall-functions' into 'develop'
ENH: wall functions: swap the order of switch statements and for loops

See merge request Development/openfoam!635
2023-12-08 11:21:04 +00:00
330bd16390 ENH: wall functions: swap the order of switch statements and for loops 2023-12-08 11:20:24 +00:00
612d9d3431 ENH: omegaWallFunction: change the scope of corner weights
The 'w' factor is factored out to improve consistency with the
'epsilonWallFunction', enhancing uniformity in these wall functions.
2023-12-08 11:20:24 +00:00
64aee19823 BUG: omegaWallFunction: add missing corner weight (fixes #3003) 2023-12-08 11:20:24 +00:00
a737240e13 BUG: wallFunctions: correct blending terms (fixes #2770) 2023-12-08 11:20:24 +00:00
db29d535c8 Merge branch 'feature-cyclicAMI-processorAgglomeration' into 'develop'
ENH: GAMG: processor agglomeration extended for all interfaces

See merge request Development/openfoam!645
2023-12-07 17:33:29 +00:00
8ae0056edd ENH: GAMG: processor agglomeration extended for all interfaces 2023-12-07 17:33:29 +00:00
04e4156403 COMP: remove IOobject template specialization (gcc) 2023-12-07 17:55:27 +01:00
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
43143f21d2 BUG: mis-loading of faMesh in redistribute mode (see !605) 2023-12-07 17:42:25 +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
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
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
f377875bc8 FIX: avoid questionable lookup and casting for interfaceTrackingFvMesh 2023-12-07 17:42:24 +01:00
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
c9e4b0edac FIX: avoid doubled dbDir() in fileOperation::readObjects (#3037) 2023-12-07 17:42:24 +01:00
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
2de1a26c7b STYLE: indentation, comments
ENH: additional faMesh cleanup in CleanFunctions
2023-12-07 17:42:24 +01:00
227480c366 TUT: snappyHexMesh: demo multiple insidePoints 2023-12-07 14:42:22 +00:00
8cd22c1a83 TUT: redistributePar does not write dummy meshes anymore. 2023-12-07 10:22:57 +00:00
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
513fe05c21 ENH: GeometricBoundaryField - added evaluateSelected function
Provides a mechanism to update specific boundary conditions
2023-12-06 14:52:05 +00:00
6c0ee5d177 BUG: shm: fix to unbalancing info printing. See #3034. 2023-12-06 09:46:51 +00:00
9a7e97ab98 BUG: fileHandler: wrong communicator. Fixes #3042 2023-12-05 17:36:51 +00:00
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
1973c75899 STYLE: ReactingWeberNumber: rename WeberNumberReacting function object for consistency 2023-12-05 09:47:23 +00:00
4c6b7217d1 ENH: KinematicWeberNumber: add new cloud function object 2023-12-05 09:47:23 +00:00
9c8c69a5f3 STYLE: less noisy setting of first/final iteration 2023-12-04 16:24:20 +00:00
1482547756 BUG: facGrad: ensure compatibility between caching and corrections (fixes #3039) 2023-12-04 15:34:02 +00:00
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
75790ba540 TUT: Allrun : requires numberOfDomains in decomposeParDict 2023-12-04 14:40:32 +00:00
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
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
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
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
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
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
9d20dd84a9 TUT: Added caseInfo function object example 2023-12-01 15:04:41 +00: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
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
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
0ff86ee2e7 ENH: replaced fragile dict interactions by meshState functions 2023-12-01 11:54:35 +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
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
6da041e61f TUT: added -constant for redistributePar. See !605 2023-11-29 09:14:59 +00:00
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
b4b022f283 BUG: SRFModel: tmp() abuse. Fixes #3038. 2023-11-27 18:03:11 +00:00
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
7c64cdbd01 ENH: cyclicACMI: add non-blocking matrix updates. 2023-11-27 13:58:02 +00:00
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
1a4d2f735f TUT: cylinder2D: add examples for the createROMfields utility 2023-11-24 19:57:11 +00:00
c9d1f741ce ENH: createROMfields: new reduced-order model utility to reconstruct fields 2023-11-24 19:57:11 +00:00
b093e3a709 CONFIG: increment API level to 2309
- filehandler and watched files changes
- addition of turbulence submodule
2023-11-23 22:42:22 +01:00
c5e4b62df7 ENH: improve/simplify streaming of exprValue
- ensure that operator<< and operator>> behave symmetrically
2023-11-23 22:42:22 +01:00
2ab3490552 STYLE: invert ASCII/BINARY checks. Helps if adding other formats
STYLE: use globalIndex::totalSize()
2023-11-23 22:42:20 +01:00
5a29b2b076 ENH: probes: reformat output for third-party readers 2023-11-23 15:32:31 +00:00
2d042268ba ENH: shm: add unbalancing info printing. Fixes #3034. 2023-11-23 15:31:43 +00:00
4ea5bfe2ac SUBMODULE: turbulence-community: add new submodule
SUBMODULE: updated cfmesh
2023-11-23 09:42:33 +00:00
92dc2e0459 BUG: facGrad: correct the gradient calculation (fixes #2979) 2023-11-22 15:31:32 +00:00
0ae6141397 Merge branch 'update-redistributePar' into 'develop'
improve fileHandler support for redistributePar

See merge request Development/openfoam!605
2023-11-21 11:14:45 +00:00
5be652d03c ENH: hostCollated: naming without ranges if running on single rank 2023-11-21 11:14:28 +00:00
31825dd981 BUG: redistributePar: cell/face/pointProcAddressing written to incorrect dir 2023-11-21 11:14:28 +00:00
910713398e ENH: redistributePar: loose matching of processors directories 2023-11-21 11:14:28 +00:00
9ed0bb1e4f ENH: redistributePar: update for distribute mode
- uses read&write handlers
- fixes initialisation of partial handlers
- 'uniform' copied to wrong place
- -overwrite not deleting old processors dirs
2023-11-21 11:14:28 +00:00
af267e0c1b BUG: redistributePar: excessive directories for collated. Fixes #2936.
BUG: collated: cooperate with non-parallel
2023-11-21 11:14:28 +00:00
4183419be0 TUT: redistributePar 2023-11-21 11:14:28 +00:00
259e8c22a5 ENH: improve check for decomposedBlock and simpler startup 2023-11-21 11:14:28 +00:00
c880efb4a6 ENH: improve fileHandler support for redistributePar
- use file handlers to manage where meshes/fields are to be read and
  written.
2023-11-21 11:14:28 +00:00
030a467a23 ENH: broadcast dynamicCode, create missing processor directories
- code is compiled dynamically on the master node.
  In the normal (non-distributed) case, simply poll the NFS
  to see when it appears on the sub-procs.

  For a case with distributed roots, first broadcast it (via MPI)
  to the IO master nodes and then poll afterwards.

- on startup, detect and create missing processorXXX/ subdirectories
  on distributed filesystems
2023-11-21 11:14:28 +00:00
65523e9d24 ENH: add delayed handling of file watches to regIOobject
- this delay the communication of file watches, which helps avoid
  communication deadlocks with master-only reading.

Co-authored-by: Mark Olesen <>
2023-11-21 11:14:28 +00:00
aec4ba30a3 ENH: handle watching included files 2023-11-21 11:14:28 +00:00
bcd873ccfe ENH: Update redistribute clouds with readOnProc/writeOnProc
- when reading, detect all clouds on all processors and uses this when
  reading fields. Similarly, when writing it uses writeOnProc to skip
  clouds that are empty on any particular processor.

Co-authored-by: Mark Olesen <>
2023-11-21 11:14:28 +00:00
eea72282ab ENH: CHT solvers - avoid fvSolution persisting on time db 2023-11-20 14:32:11 +00:00
11ecf55a86 Merge branch 'pstream-updates' into 'develop'
Extend some Pstream, PstreamBuffers and globalIndex functionality

See merge request Development/openfoam!640
2023-11-20 10:10:49 +00:00
8818201196 ENH: extend mpiAllGather to include integer and float types
- was previously limited to 'char' whereas gatherv/scatterv
  already supported various integer and float types

STYLE: rebundle allToAll declarations with macros

ENH: provide a version of allToAllConsensus returning the Map

- simplifies use and avoids ambiguities in the send/recv parameters

- the Map version will now also transmit zero value data if they exist
  in the Map. Unlike the List version, zero values are not necessary to
  signal connectivity with a Map.

COMP: forwarding template parameters for NBX routines

ENH: consolidate PstreamBuffers size exchange options

- had a variety of nearly identical backends for all-to-all,
  gather/scatter. Now combined internally with a dispatch enumeration
  which provides better control over which size exchange algorithm
  is used.

DEFEATURE: remove experimental full-NBX PstreamBuffers variant

- no advantages seen compared to the hybrid NBX/PEX approach.
  Removal reduces some code cruft.

DEFEATURE: remove experimental "double non-blocking" NBX version

- the idea was to avoid blocking receives for very large data transfers,
  but that is usually better accomplished with a hybrid NBX/PEX approach
  like PstreamBuffers allows
2023-11-20 09:39:35 +01:00
3fd1b74b26 ENH: globalIndex contains(), findProcAbove(), findProcBelow() methods
- these help when building upper or lower connected topologies.
  The new findProc() method is a non-failing whichProcID alternative
2023-11-20 09:36:23 +01:00
cfb752647a ENH: globalIndex and CompactListList improvements
- provide a globalIndex::calcOffsets() taking an indirect list, which
  enables convenient offsets calculation from a variety of inputs.

- new CompactListList unpack variant: copy_unpack()
  The copy_unpack() works somewhat like std::copy() in that it writes
  the generated sublists to iterator positions, which makes this
  type of code possible:

      CompactListList<label> compact = ...;
      DynamicList<face> extracted;

      compact.copy_unpack<face>
      (
          std::back_inserter(extracted),
          labelRange(4, 10)
      );

  -and-

      const label nOldFaces = allFaces.size();
      allFaces.resize(allFaces + nNewFaces);

      auto iter = allFaces.begin(nOldFaces);

      iter = compact.copy_unpack<face>(iter, /* selection 1 */);
      ...
      iter = compact.copy_unpack<face>(iter, /* selection 2 */);

ENH: globalIndex resize()

- can be used to shrink or grow the offsets table.
  Any extension of the offsets table corresponds to 'slots'
  with 0 local size.
2023-11-20 09:35:59 +01:00
ef201ecfea STYLE: adjust globalIndex/CompactListList overflow reporting
- report location with previous good offset and the new count that
  would cause overflow. Simpler to report and the (very long) list
  of input sizes is not particularly useful for diagnostics either.

ENH: add globalIndex comparison operators

- for outputting lists of globalIndex
2023-11-20 09:24:17 +01:00
5e0cafa637 COMP: fix constexpr mismatches 2023-11-20 09:11:33 +01:00
d6d28ccfa2 ENH: make sliceRange modifiable - similar to labelRange 2023-11-18 17:25:22 +01:00
a0b9732321 ENH: add support for CHAR_DATA token
- allows construction of string tokens holding character content.
  For example, data that has been serialized and buffered and that
  now needs to be written or sent to another process.
2023-11-18 15:24:15 +01:00
5bcf70081a INT: dictionary formattingEntry
- this is a primitiveEntry for holding purely formatting content
  such as blank lines, comments, other placeholders etc
2023-11-18 15:24:15 +01:00
b1f9fe9d79 STYLE: adjust ITstream naming for empty_stream() 2023-11-18 15:24:15 +01:00
636a654f4a ENH: add standard _byte access for exprValue
- allows UPstream::broadcast and direct read/write

- add operator== for exprValue
2023-11-18 15:24:01 +01:00
24188d70a6 Merge branch 'feature-evaluation-check' into 'develop'
Feature evaluation check

See merge request Development/openfoam!628
2023-11-16 10:33:32 +00:00
d0542c7014 Feature evaluation check 2023-11-16 10:33:32 +00:00
85243dc89d ENH: provide referPatchID() at the coupled patch level (simplifies code)
- the default returns -1 (ie, not found/available). This is overridden
  by processorCyclicPolyPatch to actually perform a search

COMP: explicitly define polyMesh::writeObject in the header

- currently no special treatment, but allows future adjustments
  without affecting the header.
2023-11-15 11:11:35 +01:00
6adac8e0ab ENH: update Nastran surface reader to handle new ANSA conventions (#3009) 2023-11-15 11:11:34 +01:00
17257f9f97 DOC: add -print-context to tutorial/Alltest
- allows separate query/generation of context information
2023-11-15 11:10:10 +01:00
a81d757721 COMP: add missing include for SortList
- extend test to include partition + sort
2023-11-14 22:54:44 +01:00
3524a6f4df FIX: getLine() line counting (adjustment to 459aaad0f9)
ENH: return ITstream::emptyStream() in a 'bad' state

- to indicate that it is invalid for reading
2023-11-14 22:54:44 +01:00
a03077e151 ENH: add IOobjectOption::LEGACY_REGISTER enumeration
- extends the enumeration (NO_REGISTER, REGISTER, LEGACY_REGISTER).
  Can be used to tweak registration preference where required and
  potentially (TDB) to define a different default value in the future
2023-11-14 22:54:44 +01:00
6ea2041122 Merge remote-tracking branch 'origin/master' into develop 2023-11-14 17:52:28 +00:00
dfdc2d95a7 ENH: cloudSolution - updated handling of under-relaxation
- unspecified field names now return a value of 1 by default
- new debug switch can be used to see default selections

STYLE: Minor code reformatting
2023-11-14 17:27:52 +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
20c5b6602d ENH: functionObjectProperties - added fn to return function object results 2023-11-10 19:04:35 +00:00
a833f9cc2e Merge branch 'feature-lagrangian-source-terms' into 'develop'
ENH: Lagrangian: mass exchanges between parcels and carriers

See merge request Development/openfoam!631
2023-11-10 13:36:07 +00:00
0c8bbfeefd ENH: lagrangian - added transfer of parcel to carrier source terms 2023-11-10 13:35:17 +00:00
0b381897c3 ENH: lagrangian - updated calls to cloud function objects 2023-11-10 13:35:17 +00:00
8fb148bb0e ENH: lagrangian cloud function objects - added track data to hooks 2023-11-10 13:35:17 +00:00
c4a8fbcf49 ENH: lagrangian - added mass source exchange for kinematic cloud
STYLE: replace ':' scoping with IOobject::scopedName()
2023-11-10 13:35:17 +00:00
e67f8d0929 TUT: overset: demo some motion. See #2711. 2023-11-09 15:02:51 +00:00
f75aa7fbc8 TUT: steadyBoundaryLayer: ensure compatibility with gnuplot version > 5.4
- fix various scripts
2023-11-09 14:02:13 +00:00
6103303b9a CONFIG: wmakeLnInclude with '-extra' option
- enables symlink for .cpp and .cxx source files
2023-11-08 22:08:16 +01:00
7766854a7e BUG: stringOps::split with keepEmpty accidentally ignores non-empty trailing
- fixes #3025
2023-11-08 15:44:36 +01:00
0e3bb22088 Merge branch 'IOobject-global-paths' into 'develop'
ENH: additional handling for global (non-processor) time paths

See merge request Development/openfoam!638
2023-11-08 10:12:23 +00:00
41b6794e2d ENH: add global (serial) path accessor to IOobject (#3007)
- new methods added to IOobject to ease mixed (serial vs parallel)
  file locations. Some redirect to Time, others are defined for
  IOobject only.

    | "normal" (serial/parallel) | "global" (serial locations) |
    | ---------------------------|-----------------------------|
    | caseName()                 | globalCaseName()            |
    | path()                     | globalPath()          *new* |
    | path(...)                  | globalPath(...)       *new* |
    | objectPath()               | globalObjectPath()    *new* |
2023-11-07 11:52:09 +01:00
507805c330 ENH: partly align globalIndex and CompactListList methods
- CompactListList::size() corresponds to the number of sub-lists
  whereas globalIndex::size() corresponds to the totalSize().
  This difference can lead to potential coding errors when switching
  between pure addressing (eg globalIndex) and addressing with content
  (eg, CompactListList).

  Within the source tree, there are no longer any occurances of
  globalIndex::size() but it is nonetheless unsafe to change its
  meaning now. Instead provide a commonly named length() method that
  corresponds to the natural length: ie, the number of offsets minus 1
  (with guards).

- add CompactListList::writeMatrix for writing the compact contents
  in an unpacked form (eg, for debugging) without actually needing to
  unpack into storage.

- provide globalIndex::whichProcID() two-parameter version
  with myProcNo as the first argument.
  Symmetric with isLocal etc, useful when using a communicator
  that is not worldComm.
2023-11-07 10:33:47 +01:00
269be2f4ea ENH: provide Time::NewGlobalTime factory methods (#3007)
- avoids clutter of argList::envGlobalPath() ...

ENH: allow temporary overwriting of output writeFormat

- allows switching for particular output routines

COMP: explicitly use TimePaths methods with Time

- this simplifies any overloading done at a later stage
2023-11-07 10:33:47 +01:00
0338cf9a84 REVERT: unstable MPI_Mprobe/MPI_Mrecv on intelmpi + PMI-2 (#2796)
- remnant was left in the NBX implementation for Map<Type>.

  Still not entirely certain which vendors/versions handle message
  probe/recv properly, but using the "regular" probe and recv is OK
  since everything is without threaded race conditions.

STYLE: adjust file extension of UPstreamWrapping templates

- avoids it being exposed via lnInclude
2023-11-07 10:33:47 +01:00
07dcdefa02 ENH: support creation of boundaries/zones from list of entries
- this makes it easier to split creation into a two-stage process
  as required

- extend handling for polyBoundaryMeshEntries, faBoundaryMeshEntries
  with more functionality. Ensure that these are never registered.

ENH: addition writeEntry methods for polyBoundaryMesh

- simplifies streaming and collating into other files

ENH: polyMesh rereading - update owner/neighbour header information

- this avoids accidentally reading the "cells" file if the mesh has
  been created with NO_READ and then updated

STYLE: less vertical space when outputting empty PtrList
2023-11-07 10:33:47 +01:00
08a9b03891 ENH: polyBoundaryMesh additional faces() and faceOwner() slice methods
- return a subList view of the mesh faces, owners
2023-11-07 10:33:47 +01:00
98246a438e ENH: simplify calling of decomposition, support CompactListList
- combined most of the unweighted and weighted decomposition routines
  such that an empty weight field is treated as uniform weighting.
  This allows default parameters and cuts down on the number of
  decompose methods.

- for topology-driven decomposition, it is now possible to pass in the
  owner/neighbour connectivity as a CompactListList directly instead
  of first creating a labelListList (which was internally repacked into
  a CompactListList in many cases).
  However, multiLevelDecomp still uses unpacking (to avoid a larger
  reworking of code).

- support direct creation of some methods (eg, random, scotch etc)
  without a dictionary

- fix incorrect neighbour face weighting (fixes #3019)

ENH: relocate calcCellCells from decompositionMethod to globalMeshData

- makes it more universally available
2023-11-07 10:33:47 +01:00
546b204793 COMP: split endian.H into foamEndianFwd.H and foamEndian.H
- usually only need big/little defines (which are now in the Fwd)
  and rarely need byte-swapping.

  Provide endian.H compatibility include, but foamEndianFwd.H or
  foamEndian.H to avoid potential name clashes.
2023-11-07 10:33:47 +01:00
98ccb7df6b ENH: extend VectorSpace traits to include pTraits_cmptType
- The pTraits_cmptType returns the data type of 'cmptType' (for
  arithmetic and VectorSpace types) or is simply a pass-through.

  This can be combined with the pTraits_nComponents for casting.
  For example,

  function
  (
      reinterpret_cast<pTraits_cmptType<Type>::type*>(buf.data()),
      (buf.size()/pTraits_nComponents<Type>::value)
  );

ENH: extend Foam::identityOp so support array indexing (pass-through)
2023-11-07 10:33:47 +01:00
df8efcaf62 REGRESSION: registry filtering not using regIOobject name (fixes #3023)
- was using the derived object name (could be something like "region0")
  instead of the actual registered name (ie, the regIOobject name)
2023-11-07 10:33:47 +01:00
ad2389a37d BUG: foamMeshToFluent: improve compatibility with tmerge (fixes #2820) 2023-11-03 16:26:57 +00:00
8f54827d19 Merge branch 'feature-map-constraint' into 'develop'
ENH: Moving electric sources mapped from external meshes

See merge request Development/openfoam!630
2023-11-03 14:33:10 +00:00
4fa1f723eb ENH: MapFieldConstraint: new fvOption constraint 2023-11-03 14:32:49 +00:00
ef6fa8007a ENH: cellSetOption: enable dictionary-based updates of selections 2023-11-03 14:32:49 +00:00
f54400d5cc ENH: cellSetOption: add new selectionMode for moving points 2023-11-03 14:32:49 +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
6373dfd6ac COMP: linear: duplicate filename in same library 2023-11-02 14:23:31 +00:00
dc7d0ffeaa ENH: add face/triFace find(edge) method (#3004)
- returns the edge index within the face, -1 if not found
2023-10-27 13:48:18 +02: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
b34793c392 ENH: additional globalIndex methods and helpers
- single() method : simply tests if the globalIndex has nProcs == 1,
  which is typically from a gatherNone invocation.
  For example,

     globalIndex gi;
     if (...) gi.reset(localSize);
     else     gi.reset(globalIndex::gatherNone{}, localSize);

     // later...
     const label begin = (gi.single() ? 0 : gi.localStart());
     const label count = (gi.single() ? gi.totalSize() : gi.localSize());

- add front() and back() methods to return the begin/end ranges,
  and begin_value(), end_value() - as per labelRange.

- make more methods noexcept

- calcOffset(), calcRange() helper functions to determine
  the processor-local of a numbering range without the overhead of
  creating a list of offsets.

  For example,

     label myOffset = globalIndex::calcOffset(mesh.nCells());
     labelRange mySlice = globalIndex::calcRange(mesh.nCells());

- add globalIndex localEnd() as per CompactListList method

STYLE: align looping constructs in CompactListList with List

- make more methods noexcept
2023-10-26 14:03:39 +02:00
d9f0587416 ENH: promote ListOps::identity to Foam::identity
- becoming more frequently used and there is no ambiguity in calling
  parameters either - identity(label) vs identity(labelUList&).

  Provide both int32 and int64 versions.
2023-10-26 11:24:57 +02:00
ef92d31493 ENH: construct labelRange from begin/end value pair 2023-10-26 11:11:48 +02:00
1faa143a7c ENH: expose fieldNames() selection for sampledSets/sampledSurfaces
- consistent with probes. Allows reporting/querying
2023-10-26 09:19:18 +02:00
d296713af1 CONFIG: increment API level to 2308
- support for SpanStreams etc
2023-10-24 10:57:49 +02:00
0343ab00f3 DOC: add application/test/README.md
- extraction of Description from the respective tests.
  Relatively incomplete

  Uses the `application/tests/get-descriptions` extractor
2023-10-24 10:57:49 +02:00
870c6a6924 TEST: add standalone test application: Test-surface-sampling 2023-10-24 10:57:22 +02:00
1476de89ee ENH: add unary functor for Foam::zero
- acts somewhat like an identity op that 'swallows' its parameter
  and maps back to zero.
2023-10-23 15:28:34 +02:00
93f48d88ea STYLE: add scoping limit to Field macros 2023-10-23 15:28:08 +02:00
cfa6da5953 COMP: circumvent aggressive compiler branch optimization (clang-17)
- it seems that both sides of the ternary are evaluated despite
  the divide-by-zero protection. Use volatile to force the compiler
  to use in-order evaluation.
2023-10-23 15:27:58 +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
e4745d09ec STYLE: remove virtual from override-qualified methods (surfaceFeatureExtract) 2023-10-23 09:44:54 +02:00
32a8a30b8c CONFIG: bump paraview from 5.11.1 to 5.11.2 2023-10-20 10:29:41 +02:00
2b34412591 Merge branch 'ensight-timeFormat' into 'develop'
support user specification of ensight time format/precision (#2999)

See merge request Development/openfoam!634
2023-10-19 10:39:07 +00:00
ba2e774aac ENH: increase precision for ensight field cache (#2999)
- attempt to minimize rounding in the cached time values
  since these are also used to re-populate the case files

STYLE: remove ancient handling of "meshes" entry

- was superseded by "geometry" entry in OpenFOAM-1912 and later.
  Now remove the transitional shim, which was in place for
  restart migration from 1906.
2023-10-19 10:28:09 +00:00
3618d07134 ENH: support user-defined sampleFreq for noise models (#2999)
CONFIG: downgrade non-uniform time from error to warning

- can be a spurious error when the deltaT is very small

CONFIG: support keywords 'minFreq', 'maxFreq'

- these are the updated naming for 'fl' and 'fu' (still supported)
2023-10-19 10:28:09 +00: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
8ec35d0b26 Merge branch 'update-zone-handling' into 'develop'
ENH: zone improvements

See merge request Development/openfoam!633
2023-10-19 10:23:14 +00:00
05c66ae62d ENH: reduce overhead for readUpdate of mesh zones 2023-10-17 12:33:03 +02:00
6aa8b82744 ENH: zone improvements
- retain group information when copying zones
- support construct empty (add details later)
- improve consistency for zone and boundaryMesh construction

- support front/back/both selection for faceZoneToCell

STYLE: prefer faceZone patch() method instead of operator()

STYLE: use std::unique_ptr instead of manual pointer management

- for zones and core patch types.
  Easier data management, allows default destructors (for example)
2023-10-17 12:33:03 +02:00
59c366525e ENH: add release() method to UPstream::communicator
- allows caller to take ownership of the communicator
2023-10-16 16:42:23 +02:00
c1e2fd6726 ENH: improve consistency of adding tokens to ITstream
- use add_tokens() instead of the old multi-parameter
  append(.., bool) method which was misleading since it added tokens
  at the current tokenIndex, not at the end.

- stringify ITstream contents with CharStream instead of StringStream.
  Allows string_view for copying out the content.

ENH: set namedDictionary dictionary name from Istream

- provides context for error messages etc (#2990)
2023-10-16 14:21:14 +02:00
fb26fcedfc STYLE: use getOrDefault instead of lookupOrDefault
- now mark methods with strict deprecation, to make it easier to find
  their use but without adding extra compilation noise for others

ENH: minor update for Enum methods and iterator

- add warnOnly (failsafe) option for readEntry and getOrDefault

- add good() method to Enum iterator (simliar to HashTable)

- replace unused/fragile Enum find() methods with iterator return
  that can be used more generally
2023-10-16 14:19:19 +02:00
3562565995 ENH: minor updates for globalIndex
- explicit use of UPstream::worldComm in globalIndex methods
  for more clarity

- adjust method declaration ordering:
  de-emphasize the processor-local convenience methods

- consistent use of leading tag dispatch,
  remove unused enum-based dispatch tag

- add begin()/cbegin() with offset (as per List containers)

BUG: missing use of communicator in globalIndex gatherNonLocal

- does not affect any existing code (which all use worldComm anyhow)
2023-10-13 14:44:18 +02:00
c65fac192e REGRESSION: incorrect fill range for ensight writeString
- introduced by b76595df42, only affects recent develop
2023-10-13 14:42:37 +02:00
c423ebecc1 BUG: ConeInjection - corrected parallel restart. Fixes #2998 2023-10-12 11:37:02 +01:00
fc9fb5c150 Merge branch 'update-stringIO-and-containers' into 'develop'
updates for resizing containers, reduced overhead for std::string output etc

See merge request Development/openfoam!632
2023-10-11 18:12:09 +00:00
0fb2c8eb1c STYLE: update applications/tests to use SpanStream/CharStream 2023-10-11 18:11:37 +00:00
3693d61e6c ENH: refine SpanStream and CharStream methods
- support std::string_view (c++17) or span view (older c++) of stream
  buffer contents. This simplifies formatting + reparsing.

  Example,

      OCharStream os;
      os << ...;

      ISpanStream is(os.view());
      is >> ...;

- additional release() method for ICharStream, OCharStream
  that returns the contents as a DynamicList<char> and resets the stream.

- provide a str() method for API compatibility with older
  std::ostringstream etc.
2023-10-11 18:11:37 +00:00
1ddcad820f ENH: multi-parameter IOobject::scopedName 2023-10-11 18:11:37 +00:00
722c528316 ENH: add string::length static methods
- simplifies writing of code that should accept either
  C strings (forwards to strlen) or
  C++ strings (forwards to std::string::length)
2023-10-11 18:11:37 +00:00
b76595df42 ENH: improve stream output of std::string etc.
- change write(const string&) to write(const std::string&).
  This allows output of std::string without an intermediate copy.

- additional writeQuoted method to handle range of char data:

     writeQuoted(const char* str, std::streamsize len, bool)

  This helps with supporting string_view and span<char>

- add operator<< for stdFoam::span<char> and std::string_view (c++17)

- avoid duplicate code in OBJstream

STYLE: add override keyword for IO stream methods
2023-10-11 18:11:37 +00:00
d9727fad1c ENH: use updated HashTable methods 2023-10-11 18:11:37 +00:00
5dcced7b86 ENH: use capacity=0 for HashTable/HashSet/Map default constructors
- default construct is now identical to HashTable(Foam::zero).
  It performs no allocation and is also noexcept.

  The previously used default capacity (128) was a holdover from
  much older versions where set/insert did not properly handle
  insertion into a table with zero capacity (number of buckets).
2023-10-11 18:11:37 +00:00
89d3687278 ENH: HashTable sizing improvements
- earlier deletion of unpopulated HashTable on resizing:

  If the table is already clear (ie, has no entries),
  can immediately remove the old internal table before reallocating
  the newly sized table, which may avoid a needless memory spike.

- reserve() method:

  Naming and general behaviour as per std::unordered_map.
  It behaves similarly to the resize() method but is supplied the
  number of elements instead of the capacity, which can be a more
  natural way of specifying the storage requirements.
  Additionally, reserve() will only increase the table capacity for
  behaviour similar to DynamicList and std::vector, std::string etc.

  Old:
     labelHashSet set;
     set.resize(2*nElems);

  Now:
     labelHashSet set;
     set.reserve(nElems);

- remove unused HashTable(Istream&, label) constructor

STYLE: static_cast of (nullptr) and std::fill_n for filling table
2023-10-11 18:11:37 +00:00
58bd255a73 ENH: handle List<char> I/O in base class
- previously used a template specialization, but now recombined into
  regular readList/writeList methods to consolidate the code logic
2023-10-11 18:11:37 +00:00
96c9bf8615 ENH: add List::resize_unsafe(label)
- changes the addressed list size without affecting list allocation.
  Can be useful for the following type of coding pattern:

  - pre-allocate a List with some max content length
  - populate with some content (likely not the entire pre-allocated size)
  - truncate the list to the length of valid content
  - process the List
  - discard the List

  Since the List is being discarded, using resize_unsafe() instead of
  resize() avoids an additional allocation with the new size and
  copying/moving of the elements.

  This programming pattern can also be used when the List is being
  returned from a subroutine, and carrying about a bit of unused memory
  is less important than avoiding reallocation + copy/move.

  If used improperly, it can obviously result in addressing into
  unmanaged memory regions (ie, 'unsafe').
2023-10-11 18:11:37 +00:00
0f53871fd3 ENH: make various List/Field move constructors noexcept 2023-10-11 18:11:37 +00:00
ce1260cf70 ENH: improve DynamicList shrink and swapping
- shrink_to_fit()
  corresponds to std::vector naming.
  For DynamicList it is a *binding* request.

- shrink_unsafe()
  simply adjusts the capacity() to match the
  current size() without forcing a re-allocation.

  Useful when collapsing to a non-dynamic list to avoid reallocation
  and copying contents. The memory cleanup will still occur properly
  at a later stage.

- DynamicList::swap(List&)
  simple recovery of content into a non-dynamic List that also
  ensures that the capacity is correctly updated.

STYLE: promote List::capacity() to public visibility (like std::vector)

STYLE: remove unused expandStorage() method

- simply a wrapper for resize(capacity())
2023-10-11 18:11:37 +00:00
1d43e45fdd ENH: add test application for fileHander writing
COMP: update applications/test
2023-10-11 18:11:37 +00:00
1af40e7dfe STYLE: remove unused (transitional) methods from CircularBuffer
- old methods (and class) were not widely used
2023-10-11 18:11:37 +00:00
524c953af3 STYLE: use List clear() instead of setSize(0), resize(0)
- adds some consistency
2023-10-11 18:11:37 +00:00
9ac0f03963 ENH: pisoFoam: allow runTimeModifiable. Fixes #2997. 2023-10-11 15:54:30 +01:00
dfb08af3de BUG: ThermoSurfaceFilm: reintroduce energy to film sources (fixes #2996) 2023-10-11 11:23:08 +01:00
3458cea49e FIX: avoid bad copy (foamCloneCase) when time dir is missing (fixes #2975) 2023-10-08 17:58:53 +02:00
a811e25556 DOC: StandardWallInteraction: correct restitution coeff (fixes #2676) 2023-10-04 17:06:43 +01:00
f7dfb02d12 DEFEATURE: remove unused (and partly-broken) SubDimensionedField 2023-09-27 19:37:18 +02:00
a252677618 BUG: Lambda2: reverse the sign of the governing equation (fixes #2731) 2023-09-27 17:09:13 +01:00
99f5d9a7db BUG: overset: correct sizing. Fixes #2985. 2023-09-18 18:12:37 +01:00
133149a1dd ENH: snappyHexMesh: mutliple inside points. Fixes #2981 2023-09-14 16:12:53 +01:00
6396256522 BUG: cyclicAMI: operate on copy. Fixes #2980
also
- steal nbr value
- do not copy nbr value if different internalfield
2023-09-14 15:10:15 +01:00
8fe025cb8e BUG: snappyHexMesh: correct oppositeness checking. Fixes #2971 2023-09-07 11:55:57 +01:00
5d98eec6af ENH: re-toggle warnings in functionObjectList execution (#2973)
- when running with "errors warn;" it will reset the warnings counter
  (if any) when it returns to a good state.
  This re-enables un-suppressed warnings for the next cycle.
  Also reset the warnings counter on end().

ENH: add short-circuit in HashTable::erase(key)

- skip and return false if the table is empty or the key is not found.
  This makes for faster no-op behaviour.
2023-09-06 10:19:38 +02:00
2d76514b5b Merge branch 'issue-2966-errorhandling' into 'develop'
ENH: add error handling for empty surfaces in surfaceFieldValue (#2966)

See merge request Development/openfoam!627
2023-09-05 15:37:33 +00: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
ff2abdf1f0 ENH: relocate functionObjectList errorHandling types to error (#2966)
- was previously private within functionObjectList, now exposed from
  error as 'handlerTypes' and 'handlerNames' enumeration.
2023-09-05 15:36:53 +00:00
f49403969e Merge branch 'extend-list-functionality' into 'develop'
Add SubList re-slicing, find within a List sub-section, uniformity enumeration

See merge request Development/openfoam!626
2023-09-05 15:36:17 +00:00
2e8e259217 CONFIG: increment API level to 2307 2023-09-05 10:15:57 +02:00
0250a1b0bb ENH: support List sub-slice searching, use std::find()
- support UList shallowCopy with pointer/size
  (eg, for slicing into or from span)

ENH: add SubList::reset() functionality

- allows modification of a SubList after construction.
  Previously a SubList had an immutable location after construction
  and there was no way to shift or change its location.

BUG: missed special handling for DynamicList<char>::readList (fixes #2974)

- equivalent to List<char>::readList, in which the stream is
  temporarily toggled from ASCII to BINARY when reading in a List of
  char data.
  This specialization was missed when DynamicList<T>::readList() was
  fully implemented.
2023-09-05 10:15:17 +02:00
aa1b6d9cbd ENH: add ListPolicy uniformity enumeration and algorithm
- defines values for EMPTY, UNIFORM, NONUNIFORM and MIXED
  that allow bitwise OR reduction and provide an algorithm
  for calculating uniformity

ENH: consolidate more efficient uniformity checks in PackedList

ENH: improve linebreak handling when outputting small matrices
2023-09-04 14:40:33 +02:00
df6de6ed33 CONFIG: runParallel with --oversubscribe for openmpi
- not always required, but useful when running some tutorials locally
2023-09-04 14:24:13 +02:00
f800ccc3d9 Merge branch 'update-memory-streams' into 'develop'
update and enhancements for memory-based streams

See merge request Development/openfoam!624
2023-09-01 14:44:56 +00:00
459aaad0f9 ENH: improve robustness of raw reading, file size checks
- use ignore instead of seekg/tellg to swallow input (robuster)

- check for bad gcount() values

- wrap Foam::fileSize() compressed/uncompressed handling into IFstream.

- improve handling of compressed files in masterUncollatedFileOperation.
  Previously read into a string via stream iterators.
  Now read chunk-wise into a List of char for fewer reallocations.
2023-09-01 14:44:49 +00:00
a341d09afc ENH: update and enhancement of memory-streams
- soft renames (ie, old names still available via typedefs) for more
  reasonable names and more coverage with std stream variants.

  The old names could be a bit cryptic.
  For example, uiliststream (== an unallocated/external list storage),
  which is written as std::ispanstream for C++23.

  Could similarly argue that IListStream is better named as
  ICharStream, since it is an input stream of characters and the
  internal storage mechanism (List or something else) is mostly
  irrelevant.

  Extending the coverage to include all std stream variants, and
  simply rewrap them for OpenFOAM IOstream types. This simplifies the
  inheritance patterns and allows reuse of icharstream/ocharstream as
  a drop-in replace for istringstream/ostringstream in other wrappers.

  Classes:
    * icharstream / ICharStream   [old: none / IListStream]
    * ocharstream / OCharStream   [old: none / OListStream]
    * ispanstream / ISpanStream   [old: uiliststream / UIListStream]
    * ospanstream / OSpanStream   [old: none / UOListStream]

  Possible new uses : read file contents into a buffer, broadcast
  buffer contents to other ranks and then transfer into an icharstream
  to be read from. This avoid the multiple intermediate copies that
  would be associated when using an istringstream.

- Use size doubling instead of block-wise incremental for ocharstream
  (OCharStream). This corresponds to the sizing behaviour as per
  std::stringstream (according to gcc-11 includes)

STYLE: drop Foam_IOstream_extras constructors for memory streams

- transitional/legacy constructors but not used in any code
2023-09-01 14:44:49 +00:00
6d7e67408e BUG: snappyHexMesh: correct oppositeness checking. Fixes #2971 2023-08-31 14:06:02 +01:00
313b1f71f1 BUG: mapFields: incorrect patches. Fixes #2944. 2023-08-31 09:45:12 +02:00
61cd298928 COMP: missing compilation of hostUncollated (fixes #2934) 2023-08-31 09:45:12 +02:00
d8f5714d1b Merge branch 'feature-nonblocking-cyclicAMI' into 'develop'
Support non-blocking construction of cyclic AMI

See merge request Development/openfoam!623
2023-08-30 15:52:01 +00:00
69169c5abe ENH: add non-blocking handling for cyclicAMI (#2963)
Co-authored-by: Mark Olesen <>
2023-08-30 13:39:16 +00:00
539d538d5a ENH: mapDistribute consistency improvements
- nonBlocking: receive before send

- nonBlocking: wait for receive requests, process and then wait for
  other requests. Can be extended to use polling...

- the 'fake' send (to self) now send copies into recv buffers instead
  of send buffers.
  This provides a clear separation of send and receive fields

- avoid unnecessary reallocations with PtrList of send/recv buffers

- remove outer looping for accessAndFlip and pass target field
  as parameter for inner looping instead

ENH: refine mapDistribute send/recv requests handling

- separate send/recv requests for finer control
- receive does not need access to PtrList of sendBuffers, since the
  send-to-self now uses the recvBuffers
2023-08-30 13:39:16 +00:00
c09acbb781 ENH: avoid list resizing when reindexing AMIInterpolation::append (#2933)
- create reindexing values as interleaved identity maps directly into
  the remapping lookup.
2023-08-30 13:39:16 +00:00
b931772369 ENH: mapDistribute subMapTotalSize(), constructMapTotalSize()
- the sum of the respective list sizes

COMP: add noexcept to trivial mapDistribute constructors
2023-08-30 13:39:16 +00:00
750d9084d4 ENH: improve addressing into labelRanges (#2933)
- totalSize() returns retrieve the linear (total) size
  (naming as per globalIndex)
- operator[] retrieves the referenced value (linear indexing)
- labels() returns a flattened labelList (as per labelRange itself)
2023-08-30 13:39:16 +00:00
6defeddbff BUG: mapFields: incorrect patches. Fixes #2944. 2023-08-30 11:46:25 +01:00
9d291ab4cc ENH: add Pstream::broadcastList()
- broadcasts list contiguous content as a two-step process:
    1. broadcast the size, and resize for receiver list
    2. broadcast contiguous contents (if non-empty)

  This avoids serialization/de-serialization memory overhead but at
  the expense of an additional broadcast call.
  The trade-off of the extra broadcast of the size will be less
  important than avoiding a memory peak for large contiguous mesh data.

REVERT: unstable MPI_Mprobe/MPI_Mrecv on intelmpi + PMI-2 (#2796)

- partial revert of commit c6f528588b, for NBX implementation.
  Not yet flagged as causing errors here, but eliminated for
  consistency.
2023-08-29 11:24:16 +02:00
0e11f47f74 STYLE: prefer emplace_back() to append() + last() 2023-08-29 11:24:16 +02:00
698e05eeb3 STYLE: prefer push_uniq() to appendUniq
- more consistency with push_back etc.
2023-08-29 11:24:16 +02:00
2395e493d1 ENH: simplify add/remove patch/zone groups
STYLE: reuse polyBoundaryMesh patchSizes(), patchStarts()
2023-08-29 11:24:16 +02:00
12916cd7a3 ENH: additional fstream pointer constructors with IOstreamOption
- allow future tweaking based on the target stream format.

- add ifstreamPointer::open().
  Allows default construct followed by open()
2023-08-29 11:24:13 +02:00
b66369fb37 ENH: add sigFpe::fillNan(char* buf, size_t count)
- simplifies use with other allocators (eg, memory pools).
  Can also be used with other containers.

  vectorField fld = ...;
  sigFpe::fillNan(fld.data_bytes(), fld.size_bytes());

COMP: inline sigFpe::ignore helper class

- now unused (may be removed in the future), but can avoid compiling
  code for it

COMP: missing sigStopAtWriteNow() definition for MSwindows
2023-08-29 10:01:41 +02:00
b236e1493c SUBMODULE: compilation fix for visualization 2023-08-28 18:11:44 +02:00
a6744d0814 ENH: add is_range test to pTraits
- helps support algorithms with list-based forwarding
2023-08-28 15:50:32 +02:00
1e2858e8cb ENH: attachDetach: use parallel sizes. See #2969 2023-08-24 13:17:25 +01:00
09d86dc02b Merge branch 'update-scoped-dictionary' into 'develop'
ENH: change internal dictionary separator to '/' (#1073)

See merge request Development/openfoam!622
2023-08-21 12:35:15 +00:00
36f8542e01 TUT: use '/' dictionary scoping for variables and foamDictionary (#1073)
- leave windAroundBuildings blockMeshDict with older '.' syntax
  (to test compatibility)
2023-08-21 12:12:41 +02:00
886ba89ddb ENH: change internal dictionary separator to '/' (#1073)
- simplifies internal handling (like a fileName) and allows the
  dictionary name to be used with unambiguous addressing.
  The previous dot (.) separator is ambiguous (ie, as dictionary
  separator or as part of a keyword).

ENH: foamDictionary report -add/-set to stderr
2023-08-21 08:40:39 +02:00
778796853d CONFIG: enable use of stricter deprecation warnings
- selected with '+strict' in WM_COMPILE_CONTROL or 'wmake -strict', it
  enables the FOAM_DEPRECATED_STRICT() macro, which can be used to
  mark methods that are implicitly deprecated, but are not yet marked
  as full deprecated (eg, API modification is too recent, generates
  too many warnings).  Can be considered a developer option.
2023-08-21 08:39:36 +02:00
224c3199aa CONFIG: enable xcrun with cc/c++ based on WM_COMPILE_CONTROL (#2965)
- adding in +xcrun into WM_COMPILE_CONTROL changes the compiler
  settings as follows (for MacOS)

      cc         := xcrun cc
      CC         := xcrun c++ -std=c++14
2023-08-18 15:46:25 +02:00
e4f2efec18 COMP: add rpath information to MacOS compilation rules (#2948)
- since the Apple SIP (System Integrity Protection) clears environment
  variables such as DYLD_LIBRARY_PATH, a number of workarounds have
  been used to provide shadow values. However, for a more robust
  installation using -rpath at compilation time appears to be the
  better solution.

  In addition to the usual -rpath specification with absolute file
  paths, MacOS supports (@loader_path, @executable_path) as well.
  Now default to link with rpath information for MacOS, which can be
  disabled by adding `~rpath` in WM_COMPILE_CONTROL

  Explicit library paths handled:
    - FOAM_FOAM_EXT_LIBBIN, FOAM_EXT_LIBBIN/FOAM_MPI

  The executable rpaths are handled assuming a structure of
     install-path/bin
     install-path/lib/$(FOAM_MPI)
     install-path/lib

  Absolute compile-time paths for FOAM_USER_LIBBIN, FOAM_SITE_LIBBIN
  and FOAM_LIBBIN are not handled since these are either too fragile
  (FOAM_USER_LIBBIN and FOAM_SITE_LIBBIN values) or covered via
  @loader_path anyhow (FOAM_LIBBIN).

  Since the value of FOAM_MPI is a compile-time value, this rpath
  treatment makes the installation less suitable for runtime changes
  to the MPI vendor/version.

  Note: no rpath added for c-only compilations since there are
  currently no c-only libraries or executables with dynamic loading
2023-08-18 15:46:12 +02:00
3630333526 ENH: improve FPE handling for Apple and ARM64 (#2956) 2023-08-18 15:44:12 +02:00
97668eab26 STYLE: update noexcept and default construct for signals
- eliminate ClassName in favour of simple debug

- include Apple-specific FPE handling after local definition
  to allow for more redefinitions

COMP: remove stray <csignal> includes
2023-08-18 15:42:18 +02:00
b620152191 ENH: add UPstream::msgType() setter method and UPstream::incrMsgType()
- like UPstream::parRun() etc, returns old value
2023-08-18 15:08:42 +02:00
03ca52b036 ENH: PtrList, PtrDynList, HashPtrTable try_emplace() method
- naming like std::map::try_emplace(), it behaves like emplace_set()
  if there is no element at the given location otherwise a no-op

ENH: reuse existing HashPtrTable 'slot' when setting pointers

- avoids extra HashTable operations
2023-08-18 13:55:32 +02:00
11a1f78338 Merge branch 'feature-delayed-compound-reading' into 'develop'
Extend ITstream handling and provision for delayed reading of compound tokens

See merge request Development/openfoam!621
2023-08-17 08:16:56 +00:00
268de43afc ENH: provision for delayed reading of compound tokens (#2953)
- the construction of compound tokens is now split into two stages:
    - default construct
    - read contents
  This permits a larger variety of handling.

- the new token::readCompoundToken(..) method allows for simpler
  more failsafe invocations.

- forward resize(), read() methods for compound tokens to support
  separate read and population.
  Top-level refCompoundToken() method for modify access.

ENH: split off a private readCompoundToken() method within ISstream

- this allows overloading and alternative tokenisation handling for
  derived classes
2023-08-16 16:22:17 +02:00
43f8b477b7 ENH: additional ITstream access/manipulate methods
- simplifies iteration of ITstream using nRemainingTokens() and skip()
  methods or directly as a list of tokens.

  The currentToken() method returns const or non-const access to
  the token at the current tokenIndex.

  The peekToken(label) method provides failsafe read access to tokens
  at given locations.

ENH: add primitiveEntry construct with moving a single token
2023-08-16 16:22:17 +02:00
bbbab8a9c2 Merge branch 'feature-container-algorithms' into 'develop'
Increase usage of std algoritms within the OpenFOAM List classes. Remove reliance on linked-list during reading

See merge request Development/openfoam!620
2023-08-16 12:58:09 +00:00
2422e6f061 ENH: use std algorithms for copy/move/compare within List containers
ENH: add List resize_fill variant. Fuses resize_nocopy + uniform fill

COMP: avoid cast ambiguity when assigning Foam::zero to UList<char>
2023-08-16 12:28:12 +02:00
eeb9d144e3 STYLE: qualify Swap with Foam:: prefix (visibility)
- drop unnecessary Foam::Swap specializations when MoveConstructible
  and MoveAssignable already apply. The explicit redirect to swap
  member functions was needed before proper move semantics where
  added.

  Removed specializations: autoPtr, refPtr, tmp, UList.
  Retained specialization: DynamicList, FixedList.

     Special handling for DynamicList is only to accommodate dissimilar
     sizing template parameters (which probably doesn't occur in
     practice).
     Special handling for FixedList to apply element-wise swapping.

- use std::swap for primitives. No need to mask with Foam::Swap wrapper
2023-08-16 12:28:09 +02:00
fabd3f4e0c ENH: eliminate reliance on SLList during reading
- fully implement DynamicList::readList() instead of simply
  redirecting to List::readList(). This also benefits DynamicField.
  Leverage DynamicList reading to simplify and improve CircularBuffer
  reading.

- bracket lists are now read chunk-wise instead of using a
  singly-linked list. For integral and vector-space types
  (eg, scalar, vector, etc) this avoids intermediate allocations
  for each element.

ENH: add CircularBuffer emplace_front/emplace_back

STYLE: isolate to-be-deprecated construct/assign forms

- still have construct/assign FixedList from a C-array.
  This is not really needed, can use std::initializer_list

- still have construct/assign List from SLList.
  Prefer to avoid these in the future.

DEFEATURE: remove construct/assign FixedList from SLList

- never used

DEFEATURE: remove move construct/assign List from SLList

- now unused. Retain copy construct/assign from SLList for transition
  purposes.
2023-08-16 12:27:04 +02:00
7828067ef6 BUG: snappyHexMesh: support dryRun. Fixes #2959 2023-08-14 13:01:42 +01:00
53b3fff7d5 Merge branch 'feature-pTraits-vectorspace' into 'develop'
Extend traits to include VectorSpace tests and wrapped access to pTraits static members

See merge request Development/openfoam!619
2023-08-11 12:40:00 +00:00
066a5a997a CONFIG: update compiler minimums (gcc-7.5.0) and standard (c++14) 2023-08-11 10:50:13 +02:00
4daaf6dd2a ENH: support move sematics for get/set putback token 2023-08-10 16:39:31 +02:00
944840f8d6 ENH: polyMesh/faMesh hasGlobalData() query
- test for existing globalData() or perhaps use DIY globalIndex instead

STYLE: check for non-ASCII instead of BINARY with compression

- allows for other non-ASCII formats
2023-08-10 16:39:25 +02:00
1340bc50bd STYLE: qualify zero/one dispatch tags with Foam:: prefix
- use Foam::zero{} instead of Zero with tagged re-dispatch
2023-08-10 11:51:04 +02:00
97a42df7ba ENH: add VectorSpace trait tests and evaluations
- is_vectorspace :
  test existence and non-zero value of the Type 'rank' static variable

- pTraits_rank :
  value of 'rank' static variable (if it exists), 0 otherwise

- pTraits_nComponents :
  value of 'nComponents' static variable (if it exists), 1 otherwise

- pTraits_has_zero :
  test for pTraits<T>::zero member, which probably means that it also
  has one, min, max members as well

Note that these traits are usable with any classes. For example,

  - is_vectorspace<std::string>::value  ==> false
  - pTraits_nComponents<std::string>::value  ==> 1
  - pTraits<std::string>::nComponents  ==> fails to compile

  Thus also allows testing pTraits_rank<...>::value with items
  for which pTraits<...>::rank fails to compile.

  Eg, cyclicAMIPolyPatch::interpolate called by FaceCellWave with a
  wallPoint.

     pTraits<wallPoint>::rank ==> fails to compile
     is_vectorspace<wallPoint>::value ==> false

GIT: relocate ListLoopM.H to src/OpenFOAM/fields/Fields (future isolation)
2023-08-10 10:38:39 +02:00
286de9dde9 BUG: filmPyrolysisRadiativeCoupledMixed - corrected field retrieval. See #2955 2023-08-03 19:47:22 +01:00
5eacd8257b Merge branch 'feature-subsetMesh-exclude-patches' into 'develop'
Support select/ignore patches for subsetMesh, extend select/ignore to general selection (#2947)

See merge request Development/openfoam!618
2023-08-02 15:06:45 +00:00
aad4c2222e ENH: subsetMesh -exclude-patches (#2947)
STYLE: use -exclude-patches instead of -excludePatch for other utilities

- avoids inconsistencies with utilities like foamToVTK etc.
2023-08-02 12:35:10 +02: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
db39f196cc Merge branch 'update-selection-ordering' into 'develop'
Updates to function objects handling of patches / selection names for parallel consistent order

See merge request Development/openfoam!617
2023-08-01 15:26:42 +00:00
2fc2d1f95f TUT: missing ';' for solverInfo 2023-07-31 20:11:32 +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
129b738136 ENH: define IOobjectList::csorted(), deprecate some sorted() const methods
- prefer csorted() method for const access since it ensures that the
  return values are also const pointers (for example) even if
  the object itself can be accessed as a non-const.

- the csorted() method already existed for HashTable and
  objectRegistry, but now added to IOobjectList for method name
  consistency (even although the IOobjectList only has a const-access
  version)

ENH: objectRegistry with templated strict lookup

- for lookupClass and csorted/sorted. Allows isType restriction as a
  compile-time specification.
2023-07-31 20:11:32 +02:00
0eb4354ee0 ENH: use DynamicList for handling stored objects (ReadFields)
- DynamicList can be used as a LIFO with fewer allocations than a
  linked-list would have.

- support generic name matcher for readFields()
2023-07-31 20:11:32 +02:00
f18a29a742 ENH: subsetMesh suppress wildcard selection of processor patches (#2947) 2023-07-31 14:07:17 +02:00
36161e682a STYLE: FOAM_DEPRECATED_FOR instead of FOAM_DEPRECATED
- explains what the preferred replacement should be
2023-07-31 14:07:10 +02:00
a3ec19c344 Merge branch 'update-emplace' into 'develop'
refine PtrList and other emplace methods

See merge request Development/openfoam!616
2023-07-28 14:41:15 +00: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
76efcba4c7 ENH: simpler handling of dictionary start/end line numbers
STYLE: use front(), back(), push_front(), push_back() methods
2023-07-27 16:52:03 +02:00
7cae3b9660 ENH: add HashTable zero-size construct, move construct is noexcept
BUG: HashTable::operator+= self-assignment check was being ignored

STYLE: minor code cleanup for templated Dictionary types
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
63258d0b33 ENH: refine PtrList emplace method, add emplace for autoPtr/refPtr...
* resize_null() methods for PtrList variants
  - for cases where an existing PtrList needs a specific size and
    but not retain any existing entries.

    Eg,
        ptrs.resize_null(100);

    vs.   ptrs.free();     ptr.resize(100);
    or    ptr.resize(100); ptrs.free();

* remove stored pointer before emplacing PtrList elements
  - may reduce memory peaks

* STYLE: static_cast of (nullptr) instead of reinterpret_cast of (0)

* COMP: implement emplace_set() for PtrDynList
  - previously missing, which meant it would have leaked through to the
    underlying PtrList definition

* emplace methods for autoPtr, refPtr, tmp
  - applies reset() with forwarding arguments.
    For example,

        tmp<GeoField> tfld = ...;

    later...

        tfld.emplace(io, mesh);

    vs.
        tfld.reset(new GeoField(io, mesh));
    or
        tfld.reset(tmp<GeoField>::New(io, mesh));

    The emplace() obviously has reduced typing, but also allows the
    existing stored pointer to be deleted *before* creating its
    replacement (reduces memory peaks).
2023-07-27 16:52:03 +02:00
5e334c0686 ENH: more consistent use of AMIInterpolation distributed() query 2023-07-27 16:52:03 +02:00
32903d337e ENH: add slice/range support to UPstream::waitSomeRequests()
- this simplifies polling receives and allows separation from
  the sends

ENH: add UPstream::removeRequests(pos, len)

- cancel/free of outstanding requests and remove segment from the
  internal list of outstanding requests
2023-07-27 16:52:03 +02:00
f717f79833 ENH: simplify copy/filling of List containers. Make swap noexcept
- internal use of std::fill instead of legacy manual code

- use UList<T>::deepCopy() to reduce code duplication
2023-07-27 16:41:13 +02:00
3430ab3aa8 STYLE: add reset() method for labelRange for symmetry with MinMax 2023-07-26 18:48:45 +02:00
bd5021e31c BUG: AMI - areaNormalisationMode now written to boundary file. Fixes #2949 2023-07-26 15:39:02 +01:00
1fc9313c97 BUG: Conservative AMI - use supplied points when resetting the AMI. See #2078 2023-07-26 15:36:25 +01:00
779c3fe11e STYLE: use 'is_sorted()' instead of 'sorted()' for readers, Pair, ...
- avoids naming ambiguity between querying sorted state vs returning a
  sorted list (for example)

ENH: add 'good()' method to a few more classes
2023-07-19 14:10:31 +02:00
8562f4d7a4 STYLE: use UPtrList::test() instead of separate bounds checking 2023-07-19 14:10:31 +02:00
65cddb6120 ENH: specialise bitOr<unsigned char> reduction
STYLE: remove extraneous parRun check before Pstream::combineReduce

- already handled by Pstream::combineReduce itself

STYLE: remove deprecated globalMeshData::ListPlusEqOp

- deprecated/superseded by ListOps::appendEqOp (2020-09)

STYLE: qualify stream format with IOstreamOption (easier to find)
2023-07-19 14:06:23 +02:00
95b820368c Merge branch 'feature-writeLeakFaces' into 'develop'
ENH: snappyHexMesh: write leak-closure faces

See merge request Development/openfoam!615
2023-07-19 11:58:09 +00:00
ab0d4d95ff ENH: snappyHexMesh: write leak-closure faces 2023-07-19 12:55:02 +01:00
a8df552998 ENH: checkMesh: use built-in merging 2023-07-18 12:03:58 +01:00
edb455ca97 TUT: weightedFluxExample: correct plot indices (fixes #2940) 2023-07-13 16:07:49 +01:00
ae6de092d5 ENH: update vscode-settings (fixes #2935) 2023-07-06 16:23:53 +01:00
69dae2e008 ENH: adjust/update debugSurfaceWriter flags
- removed gatherv control.
  The globalIndex information is cached on the merged surface
  and thus not triggered often.

- strip out debug mergeField method which was a precursor to
  what is now within surfaceWriter itself.

- add 'merge' true/false handling to allow testing without
  parallel merging (implies no writing)
2023-07-05 22:08:54 +02:00
63753605a0 STYLE: update surface writers to use UPstream, IOobjectOption naming 2023-07-05 22:03:09 +02:00
7a29eb9b3b STYLE: remove transitional import of std::unique_ptr in Foam namespace 2023-07-05 18:10:15 +02:00
4db98e5de4 COMP: missing compilation of hostUncollated (fixes #2934) 2023-07-05 17:05:44 +02:00
115bbd2699 ENH: reinstate support for cubic Brownian motion (#2922)
- continue to support spherical by default (for compatibility)
  but add the 'spherical' switch to disable that and use a cubic
  distribution instead.

STYLE: reduce number of inline files

  Co-authored-by: Mark Olesen <>
2023-07-05 16:55:58 +02:00
8ee4b52560 ENH: provide MPI native bitOrOp reduce with single/multiple values
- can be used, for example, to track global states:

      // Encode as 0:empty, 1:uniform, 2:nonuniform, 3:mixed
      PackedList<2> uniformity(fields.size());

      forAll(fields, i)
      {
          uniformity.set(i, fields[i].whichUniformity());
      }

      reduce
      (
          uniformity.data(),
          uniformity.size_data(),
          bitOrOp<unsigned>()
      );
2023-07-05 15:14:26 +02:00
f398d7b313 ENH: consolidate PstreamBuffers reduced communication bookkeeping
- can reduce communication by only sending non-zero data (especially
  when using NBX for size exchanges), but proper synchronisation with
  multiply-connected processor/processor patches (eg, processorCyclic)
  may still require speculative sends.

  Can now setup for PstreamBuffers 'registered' sends to avoid
  ad hoc bookkeeping within the caller.
2023-07-05 14:03:54 +02:00
a1e34bb251 ENH: use mapDistribute linear construct order in a few places
- simplifies code by avoiding code duplication:
  * parLagrangianDistributor
  * meshToMesh (processorLOD and AABBTree methods)

BUG: inconsistent mapping when using processorLOD boxes (fixes #2932)

- internally the processorLODs createMap() method used a 'localFirst'
  layout whereas a 'linear' order is what is actually expected for the
  meshToMesh mapping. This will cause of incorrect behaviour
  if using processorLOD instead of AABBTree.
  A dormant bug since processorLOD is not currently selectable.
2023-07-04 20:29:07 +02:00
0d456a4c66 ENH: support alternative construct map layout mapDistributeBase
- when constructing from a sendMap, can now also specify a linear
  receive layout instead of a localFirst layout

  This will make it easier to reduce some code (#2932)

- add missing interface for simple distribute of List/DynamicList
  with a specified commsType. Was previously restricted to
  defaultCommsType only.

ENH: mapDistribute distribute/reverseDistribute with specified commsType

STYLE: prefer UPstream vs Pstream within mapDistribute
2023-07-04 17:29:15 +02:00
728527a345 ENH: use exprValue in exprResult
- replaces previous (similar) union but leverages the type tag for
  handling logic

STYLE: remove unneeded refCount from exprResult

COMP: operator!= as member operator (exprResultDelayed, exprResultStored)

- the operator!= as a free function failed to resolve after removing
  the refCount inheritance
2023-07-04 17:25:26 +02:00
5635e14f81 ENH: add low-level polymorphic/boxed exprValue
- primarily for handling expression results,
  but can also be used as a universal value holder.

  Has some characteristics suitable for type-less IO:
  eg, is_integral(), nComponents()

ENH: add is_pointer() check for expression scanToken
2023-07-04 17:25:26 +02:00
fc2760ab9c ENH: simplify/extend decomposedBlockData retrieve block information
- handle existence/non-existence of a FoamFile header automatically
- support an upper limit when getting the number of blocks and
  use that for a hasBlock(...) method, which will stop reading sooner.
2023-07-04 17:25:25 +02:00
f8987e64ed ENH: add ITstream::emptyStream()
- returns readable reference to an empty ITstream for functions
  needing to return an ITstream reference but which
  don't have anything to return.
2023-07-04 17:25:25 +02:00
a215f94ec4 ENH: expose read option for Time construction
- Time is normally constructed with READ_MODIFIED for its controlDict
  and objectRegistry, but for certain applications (eg, redistributePar)
  it can be useful to construct without file monitoring and specifying
  MUST_READ instead.

  Example,

  Info<< "Create time\n" << Foam::endl;
  Time runTime
  (
      Time::controlDictName,
      args,
      false,   // Disallow functionObjects
      true,    // Allow controlDict "libs"
      IOobjectOption::MUST_READ  // Instead of READ_MODIFIED
  );
2023-07-04 17:25:25 +02:00
d5a0eaeeee STYLE: changes to Time and TimeState
- update TimeState access methods

- use writeTime() instead of old method name outputTime()

- use deltaTValue() instead of deltaT().value()
  to avoids pointless construct of intermediate
2023-07-04 17:25:25 +02:00
7a857b318a DOC: document/warn about GeometricField constructor being always read (#2926)
- no change in behaviour except to emit a warning when called with the
  a non-reading readOption

STYLE: remove redundant size check

- size checking is already done by Field::assign() within the
  DimensionedField::readField
2023-07-04 17:25:22 +02:00
aff5c3b680 DOC: update links to source packs (#2927) 2023-07-03 11:01:48 +02:00
a6e826bd55 Merge branch 'OpenFOAM-v2306-rc1' 2023-06-30 14:43:29 +01:00
763bf4674d RELEASE: Updated headers to v2306 2023-06-28 16:35:48 +01:00
fbf00d6bf2 RELEASE: Updated version to v2306 2023-06-28 16:35:48 +01:00
2d145e070e COMP: chtMultiRegionTwoPhaseEulerFoam: compile local files only 2023-06-28 16:35:47 +01:00
beb0c910a0 REVERT: turbulentTemperatureRadCoupledMixed: remove merge-review updates (!609) 2023-06-28 16:35:47 +01:00
664e8e0060 DOC: Updated contibutor list 2023-06-27 14:28:22 +01:00
7b20e888a8 REGRESSION: inconsistent constructMap order in meshToMesh::calcProcMap
- commit fb69a54bc3 accidentally changed the constructMap compact
  order from linear ordering to local elements first order. Seems to
  interact poorly with other bookkeeping so doing a partial revert,
  but still replacing the old allGatherList with exchangeSizes.

Note:
   the processorLOD method does actually use a constructMap with local
   elements first ordering, so some inconsistency may still exist
   there
2023-06-27 13:20:07 +02:00
c4b4d1e03e BUG: expressions rand() ignores objectRegistry timeIndex (fixes #2923) 2023-06-26 17:49:18 +02:00
4d7c827bd7 ENH: checkMesh: report on processor patch if non-parallel. Fixes #698 2023-06-26 12:14:30 +01:00
d6d319d95a TUT: mixerVessel: update problematic entries 2023-06-26 10:28:58 +01:00
f93b4338d5 ENH: Added new limitTurbulenceViscosity fvOption
Corrects turbulence viscosity field (e.g. nut) within a specified
region by applying a maximum limit, set according to a coefficient
multiplied by the laminar viscosity:

    \nu_{t,max} = c \nu

Corrections applied to:

  nut  | Turbulence vicosity                   [m2/s2]

Usage
    Minimal example by using \c constant/fvOptions:
    \verbatim
    limitTurbulenceViscosity1
    {
        // Mandatory entries (unmodifiable)
        type            limitTurbulenceViscosity;

        // Optional entries (runtime modifiable)
        nut             nut;
        c               1e5;

        // Mandatory/Optional (inherited) entries
        ...
    }
2023-06-26 10:19:22 +01:00
c9645e61a6 ENH: AMI - added option to control area normailisation mode
The optional areaNormalisationMode entry determines how the area normalisation
is performed. Options are:

- `project`: tri face area dotted with patch face normal; same as v2212 (default)
- `mag`: tri face area magnitude (v2206 and earlier)

Example usage:

    AMI1
    {
        type            cyclicAMI;
        ...
        areaNormalisationMode mag;
        //areaNormalisationMode project;
    }
2023-06-26 10:19:22 +01:00
b264d2e913 CONFIG: reinstate FOAM_LD_LIBRARY_PATH adjustments (#2801)
- the special MacOS dlopen handling (commit f584ec97d0)
  did not fully solve the problem with SIP clearing.

  Eg, sourcing the RunFunctions (for runParallel) triggers SIP and
  clears DYLD_LIBRARY_PATH. With the cleared path it finds the dummy
  libraries: the dummy Pstream::init() fails.
2023-06-26 09:47:07 +02:00
c3660b4123 STYLE: AMI - updated output to show AMI patch names
Helps when running/debugging cases with multiple AMI patches

Example:

AMI: Creating AMI for source:AMI1 and target:AMI2
AMI: Patch source faces: 96
AMI: Patch target faces: 96
AMI: Patch source sum(weights) min:1 max:1 average:1
AMI: Patch target sum(weights) min:1 max:1 average:1
2023-06-25 16:49:11 +01:00
642d8a9dfa COMP: guards around #define OMPI_SKIP_MPICXX (avoids compiler warnings) 2023-06-23 16:05:19 +02:00
2afd2320ce ENH: yPlus: support disable of field writing (#2813)
- for simulations where the yPlus is needed for other purposes or
  just for obtaining information on the patches it can be useful
  to disable field writing and save disk space.

  The 'writeFields' flag (as per some other function objects)
  has been added control writing the yPlus volume field.

  If unspecified, the default value is 'true' so that the yPlus
  function object continues to work as before.
  However, this default may change to 'false' in the future to align
  with other function objects.

ENH: wallShearStress: support disable of field writing

- similar to yPlus, the write() method combines writing information
  and writing the fields. The 'writeFields' flag allows some
  separation of that logic.
2023-06-23 16:05:19 +02:00
7edacd3ab0 ENH: yPlus: eliminate field IO control of controlDict (fixes #2813) 2023-06-22 17:34:31 +01:00
6a1e56e6e9 SUBMODULE: updates for OpenQBMM
- https://github.com/OpenQBMM/OpenQBMM/releases/tag/OpenFOAM-v2306
2023-06-22 17:28:08 +02:00
360aad19dc DOC: document the NBX and PstreamBuffers parameters 2023-06-22 17:26:35 +02:00
a3e6af8fcf BUG: processorCyclic: cell->point interpolation. Fixes #2817 2023-06-22 15:10:04 +01:00
183e9511e5 Merge branch 'fix-processorCyclic_reducedSending' into 'develop'
ENH: improve send/recv robustness in the presence of processorCyclic (#2814)

See merge request Development/openfoam!614
2023-06-22 12:19:14 +00:00
c5c7f2b7fe ENH: reduce local overheads in send/recv bookkeeping (#2814)
- replace Map with a List or DynamicList to reduce the number of
  operations and allocations within the loops.

  Use polyBoundaryMesh::nProcessorPatches() for initial capacity
  to avoid reallocations.
2023-06-22 12:16:45 +00:00
d5ed01dc70 ENH: boundary mesh nProcessorPatches() method
- returns the number of processorPolyPatch patches (finiteVolume)
  or else the number of processorFaPatch patches (finiteArea).

  These can be useful when sizing lists etc.
2023-06-22 12:16:45 +00:00
3dee3438d5 ENH: improve send/recv robustness in the presence of processorCyclic (#2814)
- the changes introduced in f215ad15d1 aim to reduce unnecessary
  point-to-point communication. However, if there are also
  processorCyclic boundaries involved, there are multiple connections
  between any two processors, so simply skipping empty sends will cause
  synchronization problems.

  Eg,

    On the send side:
        patch0to1_a is zero (doesn't send) and patch0to1_b does send
        (to the same processor).

    On the receive side:
        patch1to0_a receives the data intended for patch1to0_b !

  Remedy
  ======
     Simply stream all of send data into PstreamBuffers
     (regardless if empty or non-empty) but track the sends
     as a bit operation: empty (0) or non-empty (1)

     Reset the buffer slots that were only sent empty data.
     This adds an additional local overhead but avoids communication
     as much as possible.
2023-06-22 12:16:45 +00:00
0411a75e24 BUG: purgeWrite: not working for overset. Fixes #2815 2023-06-22 12:27:45 +01:00
4a5f542cb4 Merge branch 'feature-snappyHexMesh-no-balance' into 'develop'
ENH: snappyHexMesh: enable late balancing. Fixes #2792

See merge request Development/openfoam!607
2023-06-21 14:25:17 +00:00
d3419e4e56 ENH: snappyHexMesh: enable late balancing. Fixes #2792 2023-06-21 14:25:17 +00:00
da98104a79 COMP: streamFunction: avoid over-eager optimisation (fixes #2603) 2023-06-21 15:03:18 +01:00
aaf1fcf460 SUBMODULE: updates for adios, avalanche, external-solver
- adios: minor updates
- avalanche: bug fixes, improvements, new solver
- external-solver: improved cache handling, error checks, etc
2023-06-21 15:31:47 +02:00
c6741f5073 CONFIG: update completion cache (csh)
- drop the '-doc-source' from csh completion (rarely used option)
- includes the '-mpi-thread' and other newer options
2023-06-21 15:14:21 +02:00
09edb23c1d BUG: collated fails with controlDict watch files
- files might have been set during token reading so only on
  known on master processor.
  Broadcast names to all processors (even alhough they are only
  checked on master) so that the watched states remain synchronised
2023-06-21 14:56:06 +02:00
32386d0b39 TUT: turbulentFlatPlate: tighten solver settings for epsilon (fixes #2810) 2023-06-20 17:33:39 +01:00
3de090e602 BUG: UPstream::shutdown misbehaves with external initialisation (fixes #2808)
- freeCommmunicatorComponents needs an additional bounds check.
  When MPI is initialized outside of OpenFOAM, there are no
  UPstream communicator equivalents
2023-06-20 09:10:47 +02:00
67bd9119ee CONFIG: update kahip (3.15) and petsc (3.19.2) versions
- kahip includes patches to compile with gcc-13,
  improved CMake MPI detection

- petsc is the latest production release
2023-06-19 17:47:03 +02:00
97459771ad ENH: more consistent handling/documentation of 'value' entry (#2703)
- for boundary conditions such as uniformFixed, uniformMixed etc the
  optional 'value' entry (optional) is used for the initial values and
  restarts.  Otherwise the various Function1 or PatchFunction1 entries
  are evaluated and used determine the boundary condition values.

  In most cases this is OK, but in some case such coded or expression
  entries with references to other fields it can be problematic since
  they may reference fields (eg, phi) that have not yet been created.

  For these cases the 'value' entry will be needed: documentation
  updated accordingly.

STYLE: eliminate some unneeded/unused declaration headers
2023-06-19 17:47:03 +02:00
fc86e52451 ENH: extrapolateInternal() method for patch fields
- provides a more succinct way of writing

      {fa,fv}PatchField<Type>::patchInternalField(*this)

  as well as a consistent naming that can be used for patches derived
  from valuePointPatchField

ENH: readGradientEntry helper method for fixedGradient conditions

- simplifies coding and logic.
- support different read construct modes for fixedGradient
2023-06-19 17:47:03 +02:00
e54ead28e8 BUG: zeroFixedValue pointPatch not set correctly (fixes #2807) 2023-06-19 17:47:03 +02:00
34f12219bd ENH: base-level construct patch field with value
- more consistent with fvPatchField
2023-06-19 17:47:02 +02:00
f9d0895707 ENH: avoid spurious library loading for decomposePar, redistributePar
- individual processor Time databases are purely for internal logistics
  and should not be introducing any new library symbols: these will
  already have been loaded in the outer loop.
2023-06-19 17:05:45 +02:00
4412566c58 ENH: support command-line specification of MPI threads (#2791)
- MPI_THREAD_MULTIPLE is usually undesirable for performance reasons,
  but in some cases may be necessary if a linked library expects it.
  Provide a '-mpi-threads' option to explicitly request it.

ENH: consolidate some looping logic within argList
2023-06-19 17:05:45 +02:00
b2217d5e6b ENH: simplify inheritances for fileOperationInitialise
- can be broadly categorised as 'unthreaded'
  or 'collated' (threading requirement depends on buffering)
  without other opaque inheritances.

CONFIG: add hostUncollated to bash completion prompt
2023-06-19 17:05:45 +02:00
66a2894da8 ENH: parProfiling: add few more functionality to test 2023-06-19 15:53:27 +01:00
979b5a20cd ENH: update Visual Studio Code settings for new vscode versions (fixes #2805) 2023-06-19 10:01:49 +01:00
41cb168649 TUT: scalarTransport: avoid excessive number of output directories (fixes #2806) 2023-06-19 09:01:37 +01:00
5894e6ee8b Merge branch 'feature-fan-curve-momentum-source' into 'develop'
Feature: Fan momentum source fvOption based on fan curve

See merge request Development/openfoam!604
2023-06-15 13:21:30 +00:00
0f2bbbcbbe Feature: Fan momentum source fvOption based on fan curve 2023-06-15 13:21:29 +00:00
4c86664aba Merge branch 'feature-axisymmetric-fvdom-bc' into 'develop'
ENH: specularRadiation: add axisymmetric fvDOM boundary condition

See merge request Development/openfoam!610
2023-06-15 12:34:18 +00:00
ee26a36add ENH: specularRadiation: add axisymmetric fvDOM boundary condition 2023-06-15 12:33:38 +00:00
8f46e47931 Merge branch 'feature-preconditioner-cache' into 'develop'
ENH: PCG: cache preconditioner

See merge request Development/openfoam!612
2023-06-15 12:33:25 +00:00
40d6ba19b1 ENH: PCG: cache preconditioner 2023-06-15 12:33:25 +00:00
f1f797a815 Merge branch 'feature-ttrc-debug' into 'develop'
ENH: turbulentTemperatureRadCoupledMixed: add postprocessing elements

See merge request Development/openfoam!609
2023-06-14 14:36:28 +00:00
f4cc4d7652 ENH: turbulentTemperatureRadCoupledMixed: add postprocessing elements
- add writeFile functionality
- enable the optional calculation of heat-transfer coefficient fields

Co-authored-by: mattijs <mattijs>
2023-06-14 14:35:30 +00:00
d2e8c75dc9 Merge branch 'feature-sixdof-constraints-restraints' into 'develop'
ENH: sixDoF: add max/min angle constraints to the axis constraint

See merge request Development/openfoam!613
2023-06-14 14:30:55 +00:00
67c5e63819 ENH: sixDoF: add max/min angle constraints to the axis constraint 2023-06-14 14:29:13 +00:00
789db1d554 ENH: sixDoF: enable time-variant constraints in body motions 2023-06-14 14:29:13 +00:00
bfcf3b2ac4 ENH: sixDoF: add underlying-motion access to constraints 2023-06-14 14:29:13 +00:00
246d927573 Merge branch 'feature-fa-cache-grad' into 'develop'
ENH: finiteArea: enable gradient caches

See merge request Development/openfoam!611
2023-06-14 14:22:07 +00:00
188c303a27 ENH: finiteArea: enable cache-gradient mechanism 2023-06-14 14:21:27 +00:00
70874860b9 CONFIG: bump patch level for maintenance-v2212 2023-06-14 14:57:29 +02:00
528c5ed8eb CONFIG: set API level to 2306 (pre-release state)
- README updated to v2306
2023-06-14 13:55:38 +02:00
f584ec97d0 ENH: reimplement Foam::dlOpen() for macOS (#2801)
- The Apple SIP (System Integrity Protection) clears environment
  variables, which affects the behaviour of dynamic library loading
  (the DYLD_LIBRARY_PATH env variable).

  OpenFOAM shadows this variable as FOAM_LD_LIBRARY_PATH, which has
  been used to restore DYLD_LIBRARY_PATH (eg, in RunFunctions script).

  However, this solution is not quite complete, as it
    (a) requires sourcing of RunFunctions file,
    (b) additional errors appear depending on a user workflow.

  This changeset alleviates the problem by also iterating through
  paths stored in the shadow variable when loading dynamic libraries
  (if the DYLD_LIBRARY_PATH is empty).
2023-06-14 13:55:38 +02:00
83b1ebee6f COMP: replace sprintf with snprintf (MacOS), add note about vfork 2023-06-14 13:55:38 +02:00
ffbd05f72a DOC: add deprecation notes for exprFixed/exprMixed BCs (#2703)
- this functionality can now be handled directly within
  uniformMixedFvPatchField etc, which are also more flexible.
2023-06-14 13:55:38 +02:00
9489a5a101 COMP: replace selfComm/globalComm variables with functions instead (#2799)
- with C++11, static constexpr variables apparently also require
  definition in a translation unit and not just as inlined quantities.
  Mostly not an issue, however gcc with -O0 does not do the inlining
  and thus actually requires them to be defined in a translation unit
  as well.

  These variables were provided for symmetry with worldComm, but only
  used in low-level internal code. Changing to inlined functions
  solves the linkage issue and also aligns with the commWorld()
  function naming.

Mnemonics:
   MPI_COMM_SELF           => UPstream::commSelf()
   overall MPI_COMM_WORLD  => UPstream::commGlobal(), sometimes commWorld()
   local COMM_WORLD        => UPstream::commWorld()
2023-06-14 13:55:38 +02:00
a8cec219c3 ENH: add UPstream request cancellation (#2800)
- useful when speculative receives have been initiated but are no
  longer required.

  Combines MPI_Cancel() + MPI_Request_free() for consistent resource
  management. Currently no feedback provided if the request was
  satisfied by a completed send/recv or by cancellation (can be added
  later if required).
2023-06-14 13:52:58 +02:00
f4df00a4e9 ENH: support alternative registration name for solution "data" (#2797) 2023-06-13 20:41:53 +02:00
1cdba9b269 ENH: make checkMesh writing of bad edges optional (#2771)
- primarily relevant for finite-area meshes, in which case they can be
  considered to be an additional, detailed diagnositic that is
  normally not needed (clutters the file system).

  Writing can be enabled with the `-write-edges` option.
2023-06-13 20:41:53 +02:00
b87db82c05 ENH: particleTracks - reinstated label field output 2023-06-13 14:13:58 +01:00
dbba89fc92 ENH: InterfaceCompositionModel: add new combination 2023-06-13 09:04:27 +01:00
e92975075a ENH: sum reduction of nPoints/nFaces/nCells in a single call (globalMeshData)
STYLE: use labelRange instead of identity(...) for communicator
2023-06-12 15:39:05 +02:00
f096c34a80 REVERT: unstable MPI_Mprobe/MPI_Mrecv on intelmpi + PMI-2 (#2796)
- reverts commit c6f528588b
2023-06-12 15:32:06 +02:00
57c50bda79 CONFIG: re-export FOAM_DYLD_LIBRARY_PATH in foamJob (#2793) 2023-06-12 14:15:47 +02:00
b13c2c042f COMP: resolve clang/MacOS size ambiguities (fixes #2778) 2023-06-12 13:59:48 +02:00
1c9ea038d0 MISC: additional -repeat option for testing MPI_Comm leakage (#1598) 2023-06-12 13:59:47 +02:00
60fc3906dc Merge remote-tracking branch 'origin/master' into develop 2023-06-12 13:59:19 +02:00
2ac4e5f4d6 ENH: MGridGen: adapt to new GAMGAgglomeration API. Fixes #2795 2023-06-09 18:15:59 +01:00
3455d67d7f COMP: word: using uintptr_t needs <cstdint> 2023-06-07 20:22:13 +01:00
7bc3bc9194 DOC: Scalar: fix the comment (fixes #2794) 2023-06-07 15:09:48 +01:00
68c44f3219 COMP: distributedDILU: solveScalar support 2023-06-05 09:51:34 +01:00
9b5b5ecc75 BUG: DarcyForchheimer: fix debug condition for start times (fixes #2787) 2023-06-02 20:22:17 +01:00
f55adf6c5d Merge branch 'feature-distributedDIC' into 'develop'
Feature distributed DIC/DILU preconditioners

See merge request Development/openfoam!608
2023-06-01 16:21:00 +00:00
c8e224b598 ENH: lduMatrix: parallel version of DIC,DILU 2023-06-01 16:21:00 +00:00
ddf96afdfe Merge branch 'feature-particle-histogram' into 'develop'
ENH: ParticleHistogram: refactor PatchParticleHistogram function object

See merge request Development/openfoam!595
2023-06-01 08:24:29 +00:00
2eb2de5f8e ENH: ParticlePostProcessing: refactor PatchPostProcessing function object
- enable 'faceZones' support.
- enable 'writeFile' support to better control file output.
- rename 'PatchPostProcessing' as 'ParticlePostProcessing' for better clarity.
- fix #1808
2023-06-01 08:22:57 +00:00
c177637db2 ENH: ParticleHistogram: refactor PatchParticleHistogram function object
- enable 'faceZone' support.
- introduce 'cloudFunctionObjectTools' to simplify collection of particle info
  on patches or face zones.
- enable 'writeFile' support to better control file output.
- rename 'PatchParticleHistogram' as 'ParticleHistogram' for better clarity.
2023-06-01 08:22:57 +00:00
f0fca75726 Merge branch 'feature-masterCoarsest-restart' into 'develop'
Restarting local agglomeration inside masterCoarsets processor agglomeration

See merge request Development/openfoam!600
2023-06-01 08:19:05 +00:00
e566142f8a ENH: materCoarsest: input renaming 2023-06-01 08:17:58 +00:00
6a66a15b8f ENH: generalise masterCoarsest restart (GAMG) 2023-06-01 08:17:58 +00:00
0680d0c553 Merge branch 'feature-evaluation-check-bugfix-only' into 'develop'
ENH: coupled: enforce consistency. See #2783

See merge request Development/openfoam!606
2023-06-01 08:17:08 +00:00
adc38d55ac ENH: coupled: enforce consistency. See #2783 2023-06-01 08:14:42 +00:00
113fe48d0e ENH: faceAreaWeightAMI - report centre of problenm face. Fixes #2730 2023-05-30 18:00:21 +01:00
d94744e9f7 BUG: parcel injection models - corrected volume calculations. Fixes #2708 2023-05-30 12:07:33 +01:00
dcf005508b BUG: ReversibleReaction::kr - replaced 1e-6 by VSMALL. Fixes #2704 2023-05-30 11:53:47 +01:00
fcbfa40b0b ENH: checkMesh: small message change 2023-05-30 10:41:15 +01:00
30dc465615 ENH: update timeActivatedFileUpdate with distributed fileHandler 2023-05-23 15:03:23 +02:00
4984153d2d ENH: Update faMeshTools and fvMeshTools for read handler
- extend the loadOrCreateMesh functionality to work in conjunction
  with file handlers. This allows selective loading of the mesh parts
  without the ugly workaround of writing zero-sized meshes to disk and
  then reading them back.

Co-authored-by: Mark Olesen <>
2023-05-23 15:03:23 +02:00
8d2bf3fc2e ENH: soft update of autoPtr<fileOperation> to refPtr<fileOperation>
Co-authored-by: mattijs <mattijs>
2023-05-23 15:03:23 +02:00
8a060e87cb ENH: fileHandler support for faMeshDistributor and field distributors
- fatten the interface to continue allowing write control with a bool
  or with a dedicated file handler. This may slim down in the future.

Co-authored-by: mattijs <mattijs>
2023-05-23 15:01:09 +02:00
d34dfbe0b7 ENH: dummy fileOperation: placeholder for interfaces taking a reference
STYLE: align readOnProc/writeOnProc naming within masterUncollated
2023-05-23 11:12:37 +02:00
a34262966b STYLE: use fileOperation nProcs() instead of setNProcs() 2023-05-22 18:04:21 +02:00
5284bc3019 ENH: add fileOperation::New with a subset of ranks
- replicate the given fileHandler properties with
  a subset of (global) ranks
2023-05-22 18:02:43 +02:00
73f6c7fe28 ENH: centralise handling of fileOperations communicator subset
- use local function for the decision making, whether worldComm or a
  dedicated communicator is needed (and which sibling ranks are
  involved)

Co-authored-by: mattijs <mattijs>
2023-05-22 18:02:41 +02:00
401c6646be ENH: support fileHandler in fieldsDistributor 2023-05-22 18:00:06 +02:00
821d395259 ENH: use refPtr fileHandler in decomposeFaFields, faMeshReconstructor 2023-05-22 17:59:33 +02:00
06147dabe7 ENH: more flexible handling of FOAM_IORANKS
- accept plain lists (space or comma separated) as well as the
  traditional OpenFOAM lists. This simplifies argument handling
  with job scripts.

  For example,
     simpleFoam -ioRanks 0,4,8 ...
  vs
     simpleFoam -ioRanks '(0 4 8)'  ...

  It is also possible to select the IO ranks on a per-host basis:

     simpleFoam -ioRanks host  ...

- expose rank/subrank handling as static fileOperation methods
2023-05-22 17:59:30 +02:00
336422e00b ENH: check managed communicator upon construction of fileOperation
- previously checked on destruction, but it is robuster to check for a
  locally defined communicator during construction

- add InfoProxy output for fileOperation

ENH: add fileOperation::storeComm()

- transfers management of the communicator from external to internal.
  Use with caution
2023-05-22 17:54:33 +02:00
abc60d4d20 ENH: use refPtr to manage current fileHandler
- for special cases it can simplify sharing of processor communication
  patterns, but no visible change for most code.

- make fileHandler communicator modifiable (mutable), for special
  cases. The changes from 9711b7f1b9 now make this safer to do.

Continue to support legacy global function using an autoPtr:

   autoPtr<fileOperation> Foam::fileHandler(autoPtr<fileOperation>&&);

However, new code using refPtr uses the following static method since
swapping out file handlers is an infrequent operation that should
also stand out a bit more.

    fileOperation::fileHandler(...);
2023-05-22 17:51:14 +02:00
19254d0cf2 ENH: parallel-consistent check for dynamic library loading
- consolidate file synchronization checks in dynamicCode

STYLE: report missing library on master only (not every rank)

- avoid flooding the output with messages

Co-authored-by: mattijs <mattijs>
2023-05-22 17:49:21 +02:00
8320a1e421 ENH: additional routines to extract number of collated data blocks
- uses file seek instead of read

ENH: broadcast instead of scatterv to sending sizes

Co-authored-by: Mark Olesen <>
2023-05-22 17:48:45 +02:00
11742301f1 ENH: add support for file/directory broadcasting
Co-authored-by: mattijs <mattijs>
2023-05-22 17:48:09 +02:00
1abea53d1a ENH: lazy reading of old volume, old surface area
- avoid explicit isFile() check in favour of a lazy-read.
  With redistributePar + fileHandler, for example, it is possible that
  the master processor finds file but not the subprocs

ENH: lazy reading of tetBasePtIs

- delay reading until needed

Co-authored-by: Mark Olesen <>
2023-05-22 17:47:48 +02:00
16064b60e2 ENH: respect IOobject::readOpt in hexRef8 constructor 2023-05-22 17:47:22 +02:00
505704d290 ENH: allow numberOfSubdomains to be optional in parallel
- allows for a missing or empty file
2023-05-22 17:47:20 +02:00
9cd14bc8b0 STYLE: remove unused isWriteProc() methods from distribute fields 2023-05-22 17:46:16 +02:00
f15e58d3d5 ENH: add nbx.tuning to enable/disable initial barrier
- to prevent NBX from intercepting previous messages an initial
  barrier can help with synchronization. (Gregor Weiss)
2023-05-22 17:43:42 +02:00
5eebc75845 ENH: improved UPstream gather/scatter functionality
- added UPstream::allGatherValues() with a direct call to MPI_Allgather.
  This enables possible benefit from a variety of internal algorithms
  and simplifies the caller

    Old:
        labelList nPerProc
        (
            UPstream::listGatherValues<label>(patch_.size(), myComm)
        );
        Pstream::broadcast(nPerProc, myComm);

    New:

        const labelList nPerProc
        (
            UPstream::allGatherValues<label>(patch_.size(), myComm)
        );

- Pstream::allGatherList uses MPI_Allgather for contiguous values
  instead of the hand-rolled tree walking involved with
  gatherList/scatterList.

-
- simplified the calling parameters for mpiGather/mpiScatter.

  Since send/recv data types are identical, the send/recv count
  is also always identical. Eliminates the possibility of any
  discrepancies.

  Since this is a low-level call, it does not affect much code.
  Currently just Foam::profilingPstream and a UPstream internal.

BUG: call to MPI_Allgather had hard-coded MPI_BYTE (not the data type)

- a latent bug since it is currently only passed char data anyhow
2023-05-22 17:18:35 +02:00
b687c4927c ENH: update UPstream communicator handling
UPstream::allocateCommunicator
  - with contiguous sub-procs. Simpler, more compact handling, ranks
    are guaranteed to be monotonic

UPstream::commWorld(label)
  - ignore placeholder values, prevents accidental negative values

- make communicator non-optional for UPstream::broadcast(), which
  means it has three mandatory parameters and thus always fully
  disambiguated from Pstream::broadcast().

ENH: relax size checking on gatherList/scatterList

- only fatal if the List size is less than nProcs.
  Can silent ignore any trailing elements: they will be untouched.
2023-05-22 17:13:41 +02:00
b45ea8c2aa ENH: centralise communicator clearing (GAMG) 2023-05-22 17:09:50 +02:00
a64357983c BUG: uniformMixed fields not always full initialised (#2703)
- calling the mixed BC dictionary construct with NO_READ leaves the
  fields properly sized, but not initialised.

ENH: add mixed BC constructor zero initialise
2023-05-22 11:51:04 +02:00
302eb7b560 REGRESSION: createBaffles : incorrect dictionary lookup
- was introduced with f7a7f1c14c, only affected very recent develop
2023-05-20 18:59:20 +02:00
6d76b31f29 TUT: provide more git history context for tutorials/Alltest
- sometimes the last commit is not enough information about
  the tested state (especially with extensive rebasing).
  Also provide the short context of some previous commits.
2023-05-20 18:58:37 +02:00
bc51caac32 ENH: remove sign from SHA1Digest cdata_bytes(), data_bytes()
- this refinement of commit 81807646ca makes these methods
  consistent with other objects/containers.

  The 'unsigned char' access is still available via cdata()
2023-05-19 15:54:23 +02:00
28ac15f933 ENH: minor adjustment to BitOps and PackedList
- extend toc/sortedToc wrappers to bitSet and labelHashSet to allow
  use of BitOps::toc(...) in templated code

- size_data() method to return the number of addressed integer blocks
  similar to size_bytes() does, but for int instead of char.
2023-05-19 00:48:14 +02:00
f41d1879b9 STYLE: prefer isHeaderClass<Type>() check instead of Type::typeName
- use typeHeaderOk<regIOobject>(false) for some generic file existence
  checks. Often had something like labelIOField as a placeholder, but
  that may be construed to have a particular something.
2023-05-19 00:48:14 +02:00
bdd384c767 ENH: reset headerClassName within typeHeaderOk
- ensures that read failures can be properly detected

COMP: include refPtr.H instead of autoPtr.H in IOobject.H

- ensures inclusion of autoPtr/refPtr/tmp/stdFoam

ENH: add IOobject::resetHeader() method

- when re-using an IOobject for repeated read operations it enforces
  resetting of headerClassName, scalar/label sizes etc prior to
  reading. Permits convenient resetting of the name too (optional).

  Example,

      IOobject rio("none", ..., IOobject::LAZY_READ);

      rio.resetHeader("U")
      if (returnReduceOr(rio.typeHeaderOk<volVectorField>(false)))
          ...

      io.resetHeader("p")
      if (returnReduceOr(rio.typeHeaderOk<volScalarField>(false)))
         ...
2023-05-19 00:48:14 +02:00
87cb811db2 COMP: fix library linkage (#2784), silence some unused variable warnings 2023-05-19 00:46:52 +02:00
a5d9ad3a5c STYLE: use noexcept creation of InfoProxy and dereference as '*iproxy'
- this removes the 'magic' use of the exposed t_ member in favour
  of a generic dereference
2023-05-18 18:23:46 +02:00
a0005c3a54 ENH: make InfoProxy noexcept, add 'operator*' dereference
- conforms better to general use of '*' dereference.
2023-05-17 11:46:57 +02:00
f7a7f1c14c ENH: reduced warnings about createBaffles on processor patches (#2781)
- coupled patches are treated distinctly and independently of
  internalFacesOnly, it makes little sense to report them with a
  warning about turning off boundary faces (which would not work
  anyhow).

STYLE: update code style for createBaffles
2023-05-17 11:46:57 +02:00
a581a8cb8d ENH: disallow implicit cast of autoPtr to non-const pointer
- permitting a cast to a non-const pointer adds uncertainty of
  ownership.

- adjust PtrDynList transfer. Remove the unused 'PtrDynList::remove()'
  method, which is better handled with pop().
2023-05-17 11:46:57 +02:00
521043094e ENH: replace autoPtr<bool> with Switch (#2777)
- initialise with Switch::INVALID and then test if good() to
  trigger the initial update.

  This avoids some overhead, but primarily avoids ambiguity with
  implicit casting to a 'bool' that autoPtr<bool> has.
2023-05-17 11:46:57 +02:00
687a9528b0 DOC: include 'Environment' as filtered doxygen paragraph 2023-05-17 11:46:57 +02:00
5aeb02e23d Merge branch 'feature-forces-fo-performance' into 'develop'
ENH: forces: avoid redundant volumetric operations

See merge request Development/openfoam!598
2023-05-15 16:19:09 +00:00
59b1cf080e ENH: Tensor/SymmTensor: add devSymm and devTwoSymm funcs to avoid intermediates 2023-05-15 17:05:10 +01:00
f98ecb38dc ENH: forces: avoid redundant volumetric operations 2023-05-15 17:05:10 +01:00
fe50b745ae Merge branch 'feature-particle-coulomb-force' into 'develop'
ENH: Coulomb: new particle electric force model calculating Coulomb forces

See merge request Development/openfoam!602
2023-05-15 15:35:10 +00:00
8dee603193 ENH: Coulomb: new particle electric force model calculating Coulomb forces 2023-05-15 15:34:06 +00:00
c7e5e7f4a2 ENH: electricPotential: enable electric field calculations 2023-05-15 15:34:06 +00:00
efe8220a26 STYLE: electricPotential: simplify read function
- change 'fieldName' to 'Vname' for better clarity
2023-05-15 15:34:06 +00:00
7269cc1d3b ENH: electricPotential: replace operandField with getOrReadField 2023-05-15 15:34:06 +00:00
d92583f4b6 BUG: extrudePatchMesh: disable walking across non-manifold. See #2780
This code can be removed if nInternalEdges excludes non-manifold ones
2023-05-15 16:17:27 +01:00
e9160673a1 CONFIG: update paraview patch version. From 5.11.0 to 5.11.1 2023-05-10 19:14:59 +02:00
d069ffa16a SUBMODULE: removed catalyst handling for paraview 5.5 and earlier 2023-05-10 19:14:51 +02:00
c7fc4891ae COMP: adapt solveScalar to scalar for GAMG residual calculation
STYLE: use tmp<xyz>::New factory in matrix operations

COMP: fix bad non-access tmp access (in unused faceH method)
2023-05-10 18:23:13 +02:00
62a68eeea0 ENH: free/nullify of PtrList and UPtrList
- Allows clearing or freeing pointers without touching the underlying
  list size. Was previously only for PtrDynList, but now available on
  UPtrList, PtrList as well.

- add transfer() method to PtrDynList to avoid potential slicing.
2023-05-10 18:23:13 +02:00
139a8fc6ff STYLE: use SPDX-style for scripts 2023-05-10 18:23:13 +02:00
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
3d091a0d6a ENH: separate nonBlocking send/receive mapDistribute (#2775) 2023-05-09 19:30:58 +02:00
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
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
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
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
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
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
dfa5c05a16 ENH: use New factory methods for Dimensioned/Geometric functions (#2723) 2023-05-09 19:30:58 +02:00
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
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
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
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
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
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
52b225b6d5 STYLE/COMP: include cyclic patch headers earlier 2023-05-09 19:30:57 +02:00
c6f528588b ENH: use Mprobe/Mrecv for IPstream constructor
- retains the queried message without secondary polling.
2023-05-09 19:30:54 +02:00
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
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
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
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
d22c206226 STYLE: fix truncated error message for non-constraint patch types 2023-05-09 14:51:43 +02:00
fd1a70f933 BUG: effectivenessTable: fix the sign for secondary outlet temperature (fixes #2772) 2023-05-09 08:26:43 +01:00
868d6dd778 BUG: VTK write pointSet fails in parallel (fixes #2773)
- de-referenced autoPtr with () instead of ref() will fail on
  non-master ranks.
2023-05-05 15:17:31 +02:00
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
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
b0b3ec0d8e ENH: parProfiling: profile linear solver only 2023-05-03 19:04:10 +00:00
0ae31d4c00 Merge branch 'optimizationBranch' into 'develop'
Optimization to ldu Matrix

See merge request Development/openfoam!601
2023-05-02 16:17:56 +00:00
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
47bb79cb75 ENH: use residual method in GAMGSolverSolve: fuses Amul with b-Amul 2023-05-02 17:54:23 +02:00
b664eea712 ENH: remove redundant distribution in backward sweep (symGaussSeidel) 2023-05-02 17:54:16 +02:00
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
e967305ef2 STYLE: use calculatedType() and zeroGradientType() methods 2023-05-02 13:34:12 +02:00
09ce87135b DOC: kOmega: correct literature reference (fixes #2766) 2023-04-26 17:30:38 +01:00
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
ee39e3d276 STYLE: use explicit REGISTER option when storing fields 2023-04-25 13:45:08 +02:00
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
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
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
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
1d39cdaa17 STYLE: support READ_MODIFIED <-> MUST_READ_IF_MODIFIED as aliases 2023-04-24 15:46:04 +02:00
2b1061420c STYLE: remove trailing space, tabs 2023-04-24 15:37:33 +02:00
7bef18a274 STYLE: document const-ness of isA, refCast 2023-04-21 15:49:27 +02:00
35c2b4b603 BUG: splash model - correction and code refactoring 2023-04-20 13:11:42 +01:00
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
32df7c2e92 ENH: multiLevel: native scotch implementation of multi-level 2023-04-19 13:02:13 +00:00
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
b12e47d9ab CONFIG: increment API level to 2302 2023-04-18 14:08:39 +02:00
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
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
9d3427e0b4 ENH: consolidate UPstream::commsStruct code
- make sizing of commsStruct List demand-driven as well
  for more robustness, fewer unneeded allocations.

- fix potential latent bug with allBelow/allNotBelow for proc 0
  (linear communication).

ENH: remove unused/unusable UPstream::communicator optional parameter

- had constructor option to avoid constructing the MPI backend,
  but this is not useful and inconsistent with what the reset or
  destructor expect.

STYLE: local use of UPstream::communicator

- automatically frees communicator when it leaves scope
2023-04-18 14:08:39 +02:00
b277b913cf ENH: add guards for partially populated communicators
- these are primarily when encountering sparse (eg, inter-host)
  communicators. Additional UPstream convenience methods:

  is_rank(comm)
    => True if process corresponds to a rank in the communicators.
       Can be a master rank or a sub-rank.

  is_parallel(comm)
    => True if parallel algorithm or exchange is used on the process.
       same as

           (parRun() && (nProcs(comm) > 1) && is_rank(comm))
2023-04-18 14:08:39 +02:00
74db18a9c3 ENH: add interface code for MPI_Allgather
COMP: incorrect macro declaration for mpiGather/mpiScatter
2023-04-18 14:08:39 +02:00
2cf200aef4 ENH: more consistent min edge lengths (finite-area)
- for robustness with small edges (which can occur with snappy meshes),
  the Le() and magLe() are limited to SMALL (commit a0f1e98d24).
  Now use factor sqrt(1/3) in the components to maintain magnitude of 1.

ENH: add fvMesh::unitSf() and faMesh::unitLe() methods

- simple wrappers around Sf()/magSf() and Le()/magLe() but with
  the potential for additional/alternative corrections.

STYLE: thisDb() in faMesh code to simplify future changes in storage

ENH: do not register finite-area geometric fields

- consistent with finite-volume treatment
2023-04-18 14:01:17 +02:00
a96dcf706b ENH: robuster handling of inv() of fields with singular tensors (#2724)
- replace the "one-size-fits-all" approach of tensor field inv()
  with individual 'failsafe' inverts.

  The inv() field function historically just checked the first entry
  to detect 2D cases and adjusted/readjusted *all* tensors accordingly
  (to avoid singularity tensors and/or noisy inversions).

  This seems to have worked reasonably well with 3D volume meshes, but
  breaks down for 2D area meshes, which can be axis-aligned
  differently on different sections of the mesh.
2023-04-18 13:59:09 +02:00
3947f3c441 STYLE: use zeroGradientType() instead of hard-coded or typeName 2023-04-13 20:54:50 +02:00
09dd913077 ENH: use primitive fields when calculating triSurface fields (#2758) 2023-04-13 20:54:50 +02:00
6b16a614ca BUG: incorrect function introducer for mixedExpr with point field
- was primed with toPoint(..) expression call instead of point(...)
2023-04-13 20:54:50 +02:00
3d2df7cdf6 COMP: remove unused variables, etc in Cloud 2023-04-13 20:54:50 +02:00
89e1d8c269 ENH: restrict use of MPI_Group to local scope
- don't need to retain group references globally.
  Just retrieve parent group reference on-demand and discard
  immediately afterwards.
2023-04-11 16:00:12 +02:00
1f5cf3958b ENH: add request-driven polling/consumption of processor interfaces
- with (nPollProcInterfaces < 0) it does the following:

  - loop, waiting for some requests to finish
  - for each out-of-date interface, check if its associated
    requests have now finished (ie, the ready() check).
  - if ready() -> call updateInterfaceMatrix()

  In contrast to (nPollProcInterfaces > 0) which loops a specified
  number of times with several calls to MPI_Test each time, the
  (nPollProcInterfaces < 0) variant relies on internal MPI looping
  within MPI_Waitsome to progress communication.

  The actual dispatch still remains non-deterministic (ie, waiting for
  some requests to finish does not mean that any particular interface
  is eligible for update, or in any particular order). However, using
  Waitsome places the tight looping into the MPI layer, which results
  in few calls and eliminates behaviour dependent on the value of
  nPollProcInterfaces.

TUT: add polling to windAroundBuildings case (for testing purposes)
2023-04-11 15:54:32 +02:00
e1cb12509e GIT: remove unused/spurious Amultiplier definition 2023-04-11 14:53:02 +02:00
9fbc484cdf ENH: use bundled MPI_Test when checking processor interface ready()
- fewer calls, potentially more consistent

ENH: update sendRequest state after recvRequest wait

- previously had this type of code:

    // Treat send as finished when recv is done
    UPstream::waitRequest(recvRequest_);
    recvRequest_ = -1;
    sendRequest_ = -1;

  Now refined as follows:

    // Require receive data. Update the send request state.
    UPstream::waitRequest(recvRequest_);
    recvRequest_ = -1;
    if (UPstream::finishedRequest(sendRequest_)) sendRequest_ = -1;

  Can potentially investigate with requiring both,
  but this may be over-contrained.
  Example,

    // Require receive data, but also wait for sends too
    UPstream::waitRequestPair(recvRequest_, sendRequest_);
2023-04-11 14:07:36 +02:00
11065bb029 ENH: MPI_Waitany / MPI_Waitsome interface for internal list of requests
- checks requests from completion, returning true when some requests
  have completed and false when there are no active requests.
  This allows it to be used in a polling loop to progress MPI
  and then respond when as requests become satisfied.

  When using as part of a dispatch loop, waitSomeRequests() is
  probably more efficient than calling waitAnyRequest() and can help
  avoid biasing which client requests are serviced.

  Takes an optional return parameter, to retrieve the indices,
  but more importantly to avoid inner-loop reallocations.

  Example,

      DynamicList<int> indices;
      while (UPstream::waitSomeRequests(startRequest, &indices))
      {
          // Dispatch something ....
      }

      // Reset list of outstanding requests with 'Waitall' for safety
      UPstream::waitRequests(startRequest);

  ---

  If only dealing with single items and an index is required for
  dispatching, it can be better to use a list of UPstream::Request
  instead.

  Example,

      List<UPstream::Request> requests = ...;

      label index = -1;
      while ((index = UPstream::waitAnyRequest(requests)) >= 0)
      {
          // Do something at index
      }

ENH: pair-wise wrappers for MPI_Test or MPI_Wait

- for send/recv pairs of requests, can bundle both together and use a
  single MPI_Testsome and MPI_Waitall instead of two individual
  calls.
2023-04-11 11:58:05 +02:00
aa002122c2 ENH: simplify handling of pushed/freed requests
- previously had an additional stack for freedRequests_,
  which were used to 'remember' locations into the list of
  outstandingRequests_ that were handled by 'waitRequest()'.

  This was principally done for sanity checks on shutdown,
  but we now just test for any outstanding requests that
  are *not* MPI_REQUEST_NULL instead (much simpler).

  The framework with freedRequests_ also had a provision to 'recycle'
  them by popping from that stack, but this is rather fragile since it
  would only triggered by some collectives
  (MPI_Iallreduce, MPI_Ialltoall, MPI_Igather, MPI_Iscatter)
  with no guarantee that these will all be properly removed again.
  There was also no pruning of extraneous indices.

ENH: consolidate internal reset/push of requests

- replace duplicate code with inline functions
  reset_request(), push_request()

ENH: null out trailing requests

- extra safety (paranoia) for the UPstream::Request versions
  of finishedRequests(), waitAnyRequest()

CONFIG: document nPollProcInterfaces in etc/controlDict

- still experimental, but at least make the keyword known
2023-04-08 18:46:39 +02:00
700156b4c5 DEFEATURE: remove unused UPstream allocateTag(), freeTag() routines
- mechanism has been unused for at least a decade or more
  (or was never used). Message tags are assigned on an ad hoc basis
  locally when collision avoidance is necessary.
2023-04-08 18:33:52 +02:00
d826f9259f ENH: properly trap any sub-rank changes in allocatePstreamCommunicator
- not currently used, but it is possible that communicator allocation
  modifies the list of sub-ranks. Ensure that the correct size is used
  when (re)initialising the linear/tree structures.

STYLE: adjust MPI test applications

- remove some clutter and unneeded grouping.
  Some ideas for host-only communicators
2023-04-08 18:33:52 +02:00
d51967d728 ENH: faceAgglomerate: more robust. Fixes #2741
- feature angle compared to real angle
- stop agglomerating if number of marked edges does not change
2023-04-06 13:35:30 +01:00
5de59417f8 ENH: improve suspend/resume handling of Pstream profiling (#2737)
- allow reporting even when profiling is suspended

- consolidate reporting into profilingPstream itself
  (avoids code scatter).

Example of possible advanced use for timing only one section of
code:

    ====
    // Profile local operations
    profilingPstream::enable();

    ... do something

    // Don't profile elsewhere
    profilingPstream::suspend();
    ====
2023-04-05 18:49:58 +02:00
9577a0f6b5 ENH: extend parProfiling (#2737)
- separate broadcast times from reduce/gather/scatter time
- separate wait times from all-to-all time
- support invocation counts, split off requests time/count
  from others to avoid flooding the counts

- support 'detail' switch to increase the output information.
  Format may change in the future
2023-04-05 11:33:39 +02:00
475ed5cc32 STYLE: readOnProc/writeOnProc instead of 'valid' for IO 2023-04-04 15:04:26 +02:00
188e61af16 STYLE: use readValueEntry in BCs. Assign Zero for refValue/refGrad 2023-04-04 09:56:55 +02:00
f8e05934f1 BUG: incorrect dictionary contruction of alphatPhaseChange mDotL 2023-04-03 17:35:07 +02:00
e5e1440020 ENH: align use of extrapolatedCalculated in faMatrix with fvMatrix
STYLE: prefer GeometricField::New factory methods
2023-04-03 15:43:04 +02:00
87eed5e3b8 ENH: place more patch field attributes under template invariant Base
- attributes such as assignable(), coupled() etc

- common patchField types: calculatedType(), zeroGradientType() etc.
  This simplifies reference to these types without actually needing a
  typed patchField version.

ENH: add some basic patchField types to fieldTypes namespace

- allows more general use of the names

ENH: set extrapolated/calculated from patchInternalField directly

- avoids intermediate tmp
2023-04-03 13:33:56 +02:00
bd1e1ec9c7 ENH: uniformFixedValue: avoid unallocated autoPtr error 2023-03-31 08:59:31 +01:00
ddf9d528e2 COMP: TensorI.H: missing ; 2023-03-29 14:32:08 +01:00
b339be2459 BUG: GAMG: avoid inter-level interpolation. Fixes #2710 2023-03-29 09:55:23 +01:00
ed89d97627 BUG: LES: enable sigma model for compressible flows (fixes #2727) 2023-03-24 08:23:51 +00:00
f903707e4a STYLE: Allwmake report api/patch directly from META-INFO
- avoid dependency on etc/openfoam (location may change)
2023-03-23 12:22:00 +01:00
66cae2b9d1 ENH: robuster handling inv() of singular tensor for finite-area LSQ (#2724)
- with the current handling of small edges (finite-area), the LSQ
  vectors can result in singular/2D tensors. However, the regular
  2D handling in field inv() only detects based on the first element.

  Provide a 'failsafe' inv() method for symmTensor and tensor that
  follows a similar logic for avoiding zero determinates, but it is
  applied on a per element basis, instead of deciding based on the
  first field element.

  The symmTensor::inv(bool) and tensor::inv(bool) methods have a
  fairly modest additional overhead.

- unroll the field inv() function to avoid creating an intermediate
  field.  Reduce the number of operations when adjusting/re-adjusting
  the diagonal.
2023-03-23 12:12:44 +01:00
4994456a28 ENH: add 2D det() / inv() methods for Tensor/SymmTensor (#2724)
- for cases where a 3D tensor is being used to represent 2D content,
  the determinant is zero. Can use inv2D(excludeDirection) to compensate
  and invert as if it were only 2D.

ENH: consistent definitions for magSqr of symmTensors, diagSqr() norm

COMP: return scalar not component type for magSqr

- had inconsistent definitions with SymmTensor returning the component
  type and Tensor returning scalar. Only evident with complex.
2023-03-23 10:31:54 +01:00
726787b0d2 BUG: remove overly optimistic short-cut when reading BCs
- had an optimisation to skip attempted reading for zero-sized
  patches. But this leads to inconsistency in the code branching, thus
  removing it.
2023-03-23 10:31:54 +01:00
f6969631a6 ENH: support optional upper limit for printStack
- when only a partial stacktrace is desirable.

ENH: add stack trace decorators

- the 0-th frame is always printStack(), so skip that and emit
  some headers/footers instead. Eg,

  [stack trace]
  =============
  #1  Foam::SymmTensor<double> Foam::inv<double>(...)
  #2  Foam::inv(Foam::UList<Foam::SymmTensor<double>> const&) ...
  ...
  =============
2023-03-23 10:31:54 +01:00
81807646ca ENH: additional SHA1Digest constructors and methods
- data_bytes(), size_bytes() methods to support broadcasting or
  gather/scatter content. Additional construct from raw bytes
  to support transmitting content.
2023-03-23 10:31:54 +01:00
80a416d253 ENH: support construct Geometric field from separate value/dimensions
- can be easier to specify than copying into a dimensioned type.

  Eg,
      volSymmTensorField(io, mesh, Zero, dimLength);

      fluxFieldType
      (
          io
          mesh,
          Zero,
          Uf.dimensions()*dimArea/dimTime
      );

  vs
      volSymmTensorField
      (
          io,
          mesh,
          dimensionedSymmTensor("0", dimLength, Zero)
      );

      fluxFieldType
      (
          io
          mesh,
          dimensioned<typename flux<Type>::type>
          (
              Uf.dimensions()*dimArea/dimTime, Zero
          )
      );
2023-03-23 10:31:54 +01:00
e68acbe314 STYLE: check tmp with is_reference() or movable(), instead of isTmp()
- missed consistency in a few places.

- return nullptr (with automatic conversion to tmp) on failures
  instead of tmp<....>(nullptr), for cleaner coding.

INT: add support for an 'immovable' tmp pointer

- this idea is from openfoam.org, to allow creation of a tmp that is
  protected from having its memory reclaimed in field operations

ENH: tmp NewImmovable factory method, forwards as immovable/movable
2023-03-23 10:31:54 +01:00
13bd644cf4 BUG: regionSizeDistribution: correct droplet volume calculation (fixes #2699) 2023-03-22 17:00:37 +00:00
5614a571f2 COMP: code adjustments for gcc-13 (#2714) 2023-02-28 11:49:58 +01:00
4136b686ba BUG: infinite template recursion in boundaryData readField 2023-02-28 10:02:15 +01:00
14481 changed files with 315625 additions and 92871 deletions

View File

@ -49,10 +49,10 @@
<!--
Providing details of your set-up can help us identify any issues, e.g.
OpenFOAM version : v2212|v2206|v2112|v2106|v2012 etc
Operating system : ubuntu|openSUSE|centos etc
OpenFOAM version : v2412|v2406|v2312|v2306|v2212 etc
Operating system : ubuntu|openSUSE|RedHat etc
Hardware info : any info that may help?
Compiler : gcc|intel|clang etc
Compiler : gcc|clang etc
-->
- OpenFOAM version :

10
.gitmodules vendored
View File

@ -1,8 +1,8 @@
[submodule "cfmesh"]
path = modules/cfmesh
path = plugins/cfmesh
url = https://develop.openfoam.com/Community/integration-cfmesh.git
[submodule "avalanche"]
path = modules/avalanche
path = plugins/avalanche
url = https://develop.openfoam.com/Community/avalanche.git
[submodule "adios"]
path = modules/adios
@ -17,3 +17,9 @@
[submodule "external-solver"]
path = modules/external-solver
url = https://develop.openfoam.com/Modules/external-solver.git
[submodule "turbulence-community"]
path = plugins/turbulence-community
url = https://gitlab.com/openfoam/community/tc-turbulence/turbulence-community.git
[submodule "plugins/data-community"]
path = plugins/data-community
url = https://gitlab.com/openfoam/community/sig-data-modelling/data-community.git

View File

@ -68,19 +68,34 @@ src/Allwmake $targetType $*
# OpenFOAM applications
applications/Allwmake $targetType $*
#------------------------------------------------------------------------------
# Additional components
# Additional components/modules
case "$FOAM_MODULE_PREFIX" in
(false | none)
echo ========================================
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
echo "Can be built separately:"
echo
echo " ./Allwmake-modules -prefix=..."
echo
echo ========================================
echo
;;
(*)
# Use wmake -all instead of Allwmake to allow for overrides
( cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all )
echo ========================================
echo "The optional plugins can be built separately:"
echo
echo " ./Allwmake-plugins -prefix=..."
echo
echo ========================================
echo
esac
#------------------------------------------------------------------------------
# Count files in given directory. Ignore "Test-*" binaries.
_foamCountDirEntries()
{
@ -96,10 +111,12 @@ echo " ${WM_PROJECT_DIR##*/}"
echo " $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo
echo " api = $(etc/openfoam -show-api 2>/dev/null)"
echo " patch = $(etc/openfoam -show-patch 2>/dev/null)"
echo " bin = $(_foamCountDirEntries "$FOAM_APPBIN") entries"
echo " lib = $(_foamCountDirEntries "$FOAM_LIBBIN") entries"
# The api/patch information
sed -e 's/^/ /; s/=/ = /' ./META-INFO/api-info 2>/dev/null || true
echo " bin = $(_foamCountDirEntries "$FOAM_APPBIN") entries"
echo " lib = $(_foamCountDirEntries "$FOAM_LIBBIN") entries"
echo
echo ========================================

39
Allwmake-modules Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
set -- -no-recursion "$@" # Parse arguments only
# Run from OPENFOAM top-level directory only
wmake -check-dir "$WM_PROJECT_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments ]
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments || \
echo "Argument parse error"
else
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
echo " Check your OpenFOAM environment and installation"
exit 1
fi
#------------------------------------------------------------------------------
# Additional components
case "$FOAM_MODULE_PREFIX" in
(false | none)
echo ========================================
echo "OpenFOAM modules disabled (prefix=${FOAM_MODULE_PREFIX})"
echo "Can be built separately:"
echo
echo " ./Allwmake-modules -prefix=..."
echo
echo ========================================
echo
;;
(*)
# Use wmake -all instead of Allwmake to allow for overrides
( cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all )
esac
#------------------------------------------------------------------------------

39
Allwmake-plugins Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
set -- -no-recursion "$@" # Parse arguments only
# Run from OPENFOAM top-level directory only
wmake -check-dir "$WM_PROJECT_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments ]
then . "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments || \
echo "Argument parse error"
else
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
echo " Check your OpenFOAM environment and installation"
exit 1
fi
#------------------------------------------------------------------------------
# Additional components
case "$FOAM_MODULE_PREFIX" in
(false | none)
echo ========================================
echo "OpenFOAM plugins disabled (prefix=${FOAM_MODULE_PREFIX})"
echo "Can be built separately:"
echo
echo " ./Allwmake-plugins -prefix=..."
echo
echo ========================================
echo
;;
(*)
# Use wmake -all instead of Allwmake to allow for overrides
( cd "$WM_PROJECT_DIR/plugins" 2>/dev/null && wmake -all )
esac
#------------------------------------------------------------------------------

View File

@ -5,22 +5,29 @@ It is likely incomplete...
## Contributors (alphabetical by surname)
- Horacio Aguerre
- Yu Ankun
- Tetsuo Aoyagi
- Akira Azami
- Pete Bachant
- William Bainbridge
- Gabriel Barajas
- Kutalmis Bercin
- Julius Bergmann
- Ivor Clifford
- Greg Collecutt
- Jonathan Cranford
- Santiago Marquez Damian
- Sergio Ferraris
- Matej Forman
- Marian Fuchs
- Gabriel Gerlero
- Pawan Ghildiyal
- Chris Greenshields
- Bernhard Gschaider
- Andrew Heather
- David Hill
- Crist<73>bal Ib<49><62>ez
- Yoshiaki Inoue
- Mattijs Janssens
- Andrew Jackson
@ -28,6 +35,7 @@ It is likely incomplete...
- Alexander Kabat vel Job
- Thilo Knacke
- Shannon Leakey
- Sergey Lesnik
- Tommaso Lucchini
- Graham Macpherson
- Alexey Matveichev
@ -40,6 +48,7 @@ It is likely incomplete...
- Victor Olesen
- Evangelos Papoutsis-Kiachagias
- Juho Peltola
- Josep Pocurull
- Johan Roenby
- Henrik Rusche
- Bruno Santos
@ -50,8 +59,12 @@ It is likely incomplete...
- Gavin Tabor
- Zeljko Tukovic
- Eugene De Villiers
- Louis Vittoz
- Vuko Vukcevic
- Yi Wang
- Norbert Weber
- Gregor Weiss
- Volker Weissmann
- Henry Weller
- Niklas Wikstrom
- Guanyang Xue

View File

@ -1,2 +1,2 @@
api=2301
patch=230110
api=2412
patch=250528

View File

@ -40,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted.
If OpenFOAM has already been compiled on your system, simply source
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
For example, for the OpenFOAM-v2212 version:
For example, for the OpenFOAM-v2412 version:
```
source /installation/path/OpenFOAM-v2212/etc/bashrc
source /installation/path/OpenFOAM-v2412/etc/bashrc
```
## Compiling OpenFOAM
@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel
to the OpenFOAM directory. For example,
```
/path/parent
|-- OpenFOAM-v2212
\-- ThirdParty-v2212
|-- OpenFOAM-v2412
\-- ThirdParty-v2412
```
There are, however, many cases where this simple convention is inadequate:
@ -136,7 +136,7 @@ There are, however, many cases where this simple convention is inadequate:
operating system or cluster installation provides it)
* When we have changed the OpenFOAM directory name to some arbitrary
directory name, e.g. openfoam-sandbox2212, etc..
directory name, e.g. openfoam-sandbox2412, etc..
* When we would like any additional 3rd party software to be located
inside of the OpenFOAM directory to ensure that the installation is
@ -156,9 +156,9 @@ when locating the ThirdParty directory with the following precedence:
2. PREFIX/ThirdParty-VERSION
* this corresponds to the traditional approach
3. PREFIX/ThirdParty-vAPI
* allows for an updated value of VERSION, *eg*, `v2212-myCustom`,
* allows for an updated value of VERSION, *eg*, `v2412-myCustom`,
without requiring a renamed ThirdParty. The API value would still
be `2212` and the original `ThirdParty-v2212/` would be found.
be `2412` and the original `ThirdParty-v2412/` would be found.
4. PREFIX/ThirdParty-API
* same as the previous example, but using an unadorned API value.
5. PREFIX/ThirdParty-common
@ -213,4 +213,4 @@ ThirdParty directory will contain either an `Allwmake` file or a
- [Governance](http://www.openfoam.com/governance/), [Governance Projects](https://www.openfoam.com/governance/projects)
- [Contacting OpenCFD](http://www.openfoam.com/contact/)
Copyright 2016-2022 OpenCFD Ltd
Copyright 2016-2024 OpenCFD Ltd

View File

@ -118,7 +118,7 @@ int main(int argc, char *argv[])
fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
pEqn.solve(p.select(piso.finalInnerIter()));
phi = phiHbyA - pEqn.flux();

View File

@ -18,6 +18,6 @@ dimensionedScalar rho("rho", dimDensity, transportProperties);
scalar MaxCo =
max(mesh.surfaceInterpolation::deltaCoeffs()*c0).value()
*runTime.deltaT().value();
*runTime.deltaTValue();
Info<< "Max acoustic Courant Number = " << MaxCo << endl;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -93,24 +94,14 @@ Foam::PDRDragModels::basic::~basic()
Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
{
tmp<volSymmTensorField> tDragDcu
auto tDragDcu = volSymmTensorField::New
(
new volSymmTensorField
(
IOobject
(
"tDragDcu",
U_.mesh().time().constant(),
U_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
U_.mesh(),
dimensionedSymmTensor(dimMass/dimTime/dimVolume, Zero)
)
"tDragDcu",
IOobject::NO_REGISTER,
U_.mesh(),
dimensionedSymmTensor(dimMass/dimTime/dimVolume, Zero)
);
volSymmTensorField& DragDcu = tDragDcu.ref();
auto& DragDcu = tDragDcu.ref();
if (on_)
{
@ -127,24 +118,14 @@ Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
{
tmp<volScalarField> tGk
auto tGk = volScalarField::New
(
new volScalarField
(
IOobject
(
"tGk",
U_.mesh().time().constant(),
U_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
U_.mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
)
"tGk",
IOobject::NO_REGISTER,
U_.mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);
volScalarField& Gk = tGk.ref();
auto& Gk = tGk.ref();
if (on_)
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2020,2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -132,6 +132,11 @@ void PDRkEpsilon::correct()
// Update epsilon and G at the wall
epsilon_.boundaryFieldRef().updateCoeffs();
// Push new cell values to
// coupled neighbours. Note that we want to avoid the re-updateCoeffs
// of the wallFunctions so make sure to bypass the evaluate on
// those patches and only do the coupled ones.
epsilon_.boundaryFieldRef().evaluateCoupled<coupledFvPatch>();
// Add the blockage generation term so that it is included consistently
// in both the k and epsilon equations

View File

@ -69,7 +69,8 @@ Foam::XiEqModels::Gulder::~Gulder()
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
{
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
const volScalarField& epsilon = turbulence_.epsilon();
const tmp<volScalarField> tepsilon(turbulence_.epsilon());
const volScalarField& epsilon = tepsilon();
if (subGridSchelkin_)
{

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -75,8 +76,10 @@ Foam::XiEqModels::SCOPEXiEq::~SCOPEXiEq()
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
{
const volScalarField& k = turbulence_.k();
const volScalarField& epsilon = turbulence_.epsilon();
const tmp<volScalarField> tk(turbulence_.k());
const volScalarField& k = tk();
const tmp<volScalarField> tepsilon(turbulence_.epsilon());
const volScalarField& epsilon = tepsilon();
volScalarField up(sqrt((2.0/3.0)*k));
if (subGridSchelkin_)
@ -91,23 +94,14 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
volScalarField K(0.157*upBySu/sqrt(Rl));
volScalarField Ma(MaModel.Ma());
tmp<volScalarField> tXiEq
auto tXiEq = volScalarField::New
(
new volScalarField
(
IOobject
(
"XiEq",
epsilon.time().timeName(),
epsilon.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
epsilon.mesh(),
dimensionedScalar(dimless, Zero)
)
"XiEq",
IOobject::NO_REGISTER,
epsilon.mesh(),
dimensionedScalar(dimless, Zero)
);
volScalarField& xieq = tXiEq.ref();
auto& xieq = tXiEq.ref();
forAll(xieq, celli)
{

View File

@ -78,11 +78,10 @@ bool Foam::XiEqModel::read(const dictionary& XiEqProperties)
void Foam::XiEqModel::writeFields() const
{
//***HGW It is not clear why B is written here
if (Su_.mesh().foundObject<volSymmTensorField>("B"))
const auto* B = Su_.mesh().cfindObject<volSymmTensorField>("B");
if (B)
{
const volSymmTensorField& B =
Su_.mesh().lookupObject<volSymmTensorField>("B");
B.write();
B->write();
}
}
@ -98,39 +97,26 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
const volSymmTensorField& nsv =
mesh.lookupObject<volSymmTensorField>("nsv");
tmp<volScalarField> tN
auto tN = volScalarField::New
(
new volScalarField
(
IOobject
(
"tN",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh,
dimensionedScalar(Nv.dimensions(), Zero)
)
"tN",
IOobject::NO_REGISTER,
mesh,
dimensionedScalar(Nv.dimensions(), Zero)
);
volScalarField& N = tN.ref();
auto& N = tN.ref();
N.primitiveFieldRef() = Nv.primitiveField()*pow(mesh.V(), 2.0/3.0);
volSymmTensorField ns
auto tns = volSymmTensorField::New
(
IOobject
(
"tns",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
"tns",
IOobject::NO_REGISTER,
mesh,
dimensionedSymmTensor(nsv.dimensions(), Zero)
);
auto& ns = tns.ref();
ns.primitiveFieldRef() = nsv.primitiveField()*pow(mesh.V(), 2.0/3.0);
const volVectorField Uhat

View File

@ -66,7 +66,8 @@ Foam::XiGModels::KTS::~KTS()
Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const
{
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
const volScalarField& epsilon = turbulence_.epsilon();
const tmp<volScalarField> tepsilon(turbulence_.epsilon());
const volScalarField& epsilon = tepsilon();
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -255,24 +256,14 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
scalar phi
) const
{
tmp<volScalarField> tSu0
auto tSu0 = volScalarField::New
(
new volScalarField
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
)
"Su0",
IOobject::NO_REGISTER,
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
);
volScalarField& Su0 = tSu0.ref();
auto& Su0 = tSu0.ref();
forAll(Su0, celli)
{
@ -304,24 +295,14 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
const volScalarField& phi
) const
{
tmp<volScalarField> tSu0
auto tSu0 = volScalarField::New
(
new volScalarField
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
)
"Su0",
IOobject::NO_REGISTER,
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
);
volScalarField& Su0 = tSu0.ref();
auto& Su0 = tSu0.ref();
forAll(Su0, celli)
{
@ -358,24 +339,14 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Ma
const volScalarField& phi
) const
{
tmp<volScalarField> tMa
auto tMa = volScalarField::New
(
new volScalarField
(
IOobject
(
"Ma",
phi.time().timeName(),
phi.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
phi.mesh(),
dimensionedScalar(dimless, Zero)
)
"Ma",
IOobject::NO_REGISTER,
phi.mesh(),
dimensionedScalar(dimless, Zero)
);
volScalarField& ma = tMa.ref();
auto& ma = tMa.ref();
forAll(ma, celli)
{
@ -418,21 +389,12 @@ Foam::laminarFlameSpeedModels::SCOPE::Ma() const
{
const fvMesh& mesh = psiuReactionThermo_.p().mesh();
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"Ma",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("Ma", dimless, Ma(equivalenceRatio_))
)
"Ma",
IOobject::NO_REGISTER,
mesh,
dimensionedScalar("Ma", dimless, Ma(equivalenceRatio_))
);
}
}

View File

@ -27,7 +27,7 @@ if (pimple.transonic())
betav*fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -57,7 +57,7 @@ else
betav*fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -30,7 +30,7 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -66,7 +66,7 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -35,7 +35,7 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -71,7 +71,7 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -223,7 +223,7 @@ if (ign.ignited())
volScalarField R(Gstar*XiEqStar/(XiEqStar - scalar(1)));
volScalarField G(R*(XiEq - scalar(1.001))/XiEq);
//R *= (Gstar + 2*mag(dev(symm(fvc::grad(U)))))/Gstar;
//R *= (Gstar + 2*mag(devSymm(fvc::grad(U))))/Gstar;
// Solve for the flame wrinkling
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -29,7 +29,7 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -64,7 +64,7 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -6,7 +6,7 @@
solve
(
fvm::ddt(rho, Yi) - chemistry.RR(specieI),
mesh.solver("Yi")
"Yi"
);
}
}

View File

@ -1,5 +1,5 @@
if (adjustTimeStep)
{
runTime.setDeltaT(min(dtChem, maxDeltaT));
Info<< "deltaT = " << runTime.deltaT().value() << endl;
Info<< "deltaT = " << runTime.deltaTValue() << endl;
}

View File

@ -1,3 +1,3 @@
dtChem = chemistry.solve(runTime.deltaT().value());
dtChem = chemistry.solve(runTime.deltaTValue());
scalar Qdot = chemistry.Qdot()()[0]/rho[0];
integratedHeat += Qdot*runTime.deltaT().value();
integratedHeat += Qdot*runTime.deltaTValue();

View File

@ -35,7 +35,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
fvOptions.constrain(YiEqn);
YiEqn.solve(mesh.solver("Yi"));
YiEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -36,7 +36,7 @@ while (pimple.correctNonOrthogonal())
+ fvOptions(psi, p_rgh, rho.name())
);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -10,7 +10,8 @@ if (pimple.dict().getOrDefault("hydrostaticInitialization", false))
"0",
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh
)

View File

@ -21,6 +21,11 @@
+ fvOptions(rho, he)
);
if (MRF.active())
{
EEqn += fvc::div(MRF.phi(), p);
}
EEqn.relax();
fvOptions.constrain(EEqn);

View File

@ -34,7 +34,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
fvOptions.constrain(YiEqn);
YiEqn.solve(mesh.solver("Yi"));
YiEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -37,7 +37,7 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -72,7 +72,7 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -49,7 +49,7 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -89,7 +89,7 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -41,7 +41,7 @@ while (pimple.correctNonOrthogonal())
- fvm::laplacian(rhorAUf, p_rgh)
);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -105,7 +105,8 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
if (!this->readValueEntry(dict))
{
fvPatchField<scalar>::operator=(patchInternalField());
// Fallback: set to the internal field
fvPatchField<scalar>::patchInternalField(*this);
}
refValue() = *this;

View File

@ -110,15 +110,6 @@ public:
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new smoluchowskiJumpTFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
smoluchowskiJumpTFvPatchScalarField
(
@ -126,18 +117,22 @@ public:
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
//- Return a clone
virtual tmp<fvPatchField<scalar>> clone() const
{
return fvPatchField<scalar>::Clone(*this);
}
//- Clone with an internal field reference
virtual tmp<fvPatchField<scalar>> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new smoluchowskiJumpTFvPatchScalarField(*this, iF)
);
return fvPatchField<scalar>::Clone(*this, iF);
}
// Mapping functions
//- Map (and resize as needed) from self given a mapping object

View File

@ -118,15 +118,6 @@ public:
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchVectorField> clone() const
{
return tmp<fvPatchVectorField>
(
new maxwellSlipUFvPatchVectorField(*this)
);
}
//- Construct as copy setting internal field reference
maxwellSlipUFvPatchVectorField
(
@ -134,16 +125,19 @@ public:
const DimensionedField<vector, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchVectorField> clone
//- Return a clone
virtual tmp<fvPatchField<vector>> clone() const
{
return fvPatchField<vector>::Clone(*this);
}
//- Clone with an internal field reference
virtual tmp<fvPatchField<vector>> clone
(
const DimensionedField<vector, volMesh>& iF
) const
{
return tmp<fvPatchVectorField>
(
new maxwellSlipUFvPatchVectorField(*this, iF)
);
return fvPatchField<vector>::Clone(*this, iF);
}

View File

@ -135,15 +135,6 @@ public:
const fixedRhoFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new fixedRhoFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
fixedRhoFvPatchScalarField
(
@ -151,16 +142,19 @@ public:
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
//- Return a clone
virtual tmp<fvPatchField<scalar>> clone() const
{
return fvPatchField<scalar>::Clone(*this);
}
//- Clone with an internal field reference
virtual tmp<fvPatchField<scalar>> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new fixedRhoFvPatchScalarField(*this, iF)
);
return fvPatchField<scalar>::Clone(*this, iF);
}

View File

@ -1,10 +1,9 @@
volScalarField& p = thermo.p();
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
const volScalarField& mu = thermo.mu();
bool inviscid(true);
if (max(mu.primitiveField()) > 0.0)
if (max(thermo.mu().cref().primitiveField()) > 0.0)
{
inviscid = false;
}

View File

@ -17,7 +17,7 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> interpolate
vf,
dir,
"reconstruct("
+ (reconFieldName != word::null ? reconFieldName : vf.name())
+ (reconFieldName.empty() ? vf.name() : reconFieldName)
+ ')'
)
);

View File

@ -63,7 +63,7 @@
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
// Rhie & Chow interpolation (part 2)
if (pimple.finalNonOrthogonalIter())

View File

@ -20,6 +20,11 @@
fvOptions(rho, he)
);
if (MRF.active())
{
EEqn += fvc::div(MRF.phi(), p);
}
EEqn.relax();
fvOptions.constrain(EEqn);

View File

@ -29,7 +29,7 @@ if (mesh.changing())
wordList pcorrTypes
(
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
fvPatchFieldBase::zeroGradientType()
);
// Set BCs of pcorr to fixed-value for patches at which p is fixed
@ -72,7 +72,7 @@ if (mesh.changing())
divrhoU()
);
pcorrEqn.solve(mesh.solver(pcorr.select(pimple.finalInnerIter())));
pcorrEqn.solve(pcorr.select(pimple.finalInnerIter()));
//Bypass virtual layer
//mesh.fvMesh::solve(pcorrEqn, d);

View File

@ -56,7 +56,7 @@ if (pimple.transonic())
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -78,7 +78,7 @@ else
{
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -54,7 +54,7 @@ if (pimple.transonic())
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -76,7 +76,7 @@ else
{
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -65,7 +65,7 @@ if (pimple.transonic())
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{
@ -90,7 +90,7 @@ else
{
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAtU, p));
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -14,6 +14,11 @@
fvOptions(rho, he)
);
if (MRF.active())
{
EEqn += fvc::div(MRF.phi(), p);
}
EEqn.relax();
fvOptions.constrain(EEqn);

View File

@ -9,6 +9,11 @@
fvOptions(rho, e)
);
if (MRF.active())
{
EEqn += fvc::div(MRF.phi(), p);
}
EEqn.relax();
fvOptions.constrain(EEqn);

View File

@ -127,7 +127,7 @@ int main(int argc, char *argv[])
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
pEqn.solve(p.select(piso.finalInnerIter()));
if (piso.finalNonOrthogonalIter())
{
@ -167,7 +167,7 @@ int main(int argc, char *argv[])
fvm::laplacian(rABf, pB) == fvc::div(phiB)
);
pBEqn.solve(mesh.solver(pB.select(bpiso.finalInnerIter())));
pBEqn.solve(pB.select(bpiso.finalInnerIter()));
if (bpiso.finalNonOrthogonalIter())
{

View File

@ -7,7 +7,7 @@
*mag(aMesh.edgeInterpolation::deltaCoeffs())
/rhol
)
).value()*runTime.deltaT().value();
).value()*runTime.deltaTValue();
Info<< "Max Capillary Courant Number = " << CoNumSigma << '\n' << endl;
}

View File

@ -5,7 +5,7 @@
(
"h",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
@ -20,7 +20,7 @@
(
"Us",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
@ -34,7 +34,7 @@
(
"phis",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
@ -48,7 +48,7 @@
(
"phi2s",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
@ -67,7 +67,7 @@
(
"Sm",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -82,7 +82,7 @@
(
"Sd",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -96,7 +96,7 @@
(
"Sg",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -112,7 +112,7 @@
(
"ps",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
@ -134,7 +134,7 @@
(
"manningField",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
@ -147,7 +147,7 @@
(
"frictionFactor",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE
),

View File

@ -7,7 +7,7 @@ volVectorField U
(
"U",
runTime.timeName(),
mesh,
mesh.thisDb(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
@ -22,7 +22,7 @@ volScalarField H
(
"H",
runTime.timeName(),
mesh,
mesh.thisDb(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),

View File

@ -87,7 +87,13 @@ int main(int argc, char *argv[])
(
fam::ddt(h, Us)
+ fam::div(phi2s, Us)
+ fam::Sp(0.0125*frictionFactor*mag(Us), Us)
+ fam::Sp
(
0.0125
*frictionFactor.internalField()
*mag(Us.internalField()),
Us
)
==
Gs*h
- fam::Sp(Sd, Us)

View File

@ -47,10 +47,10 @@ if (aMesh.nInternalEdges())
);
CoNum = max(SfUfbyDelta/aMesh.magLe())
.value()*runTime.deltaT().value();
.value()*runTime.deltaTValue();
meanCoNum = (sum(SfUfbyDelta)/sum(aMesh.magLe()))
.value()*runTime.deltaT().value();
.value()*runTime.deltaTValue();
velMag = max(mag(phis)/aMesh.magLe()).value();
}

View File

@ -5,7 +5,7 @@ areaScalarField Cs
(
"Cs",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
@ -26,7 +26,7 @@ areaVectorField Us
(
"Us",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
@ -47,6 +47,7 @@ forAll(Us, faceI)
Us[faceI].z() =
Uinf.value()*0.25*R[faceI].x()*R[faceI].z()/sqr(mag(R[faceI]));
}
Us.boundaryFieldRef().evaluateCoupled<coupledFaPatch>();
Us -= aMesh.faceAreaNormals()*(aMesh.faceAreaNormals() & Us);
@ -57,7 +58,7 @@ edgeScalarField phis
(
"phis",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE
),

View File

@ -1,2 +0,0 @@
// Create Finite Area mesh
faMesh aMesh(mesh);

View File

@ -7,7 +7,7 @@
(
"Cvf",
runTime.timeName(),
mesh,
mesh.thisDb(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
@ -24,7 +24,7 @@
(
"U",
runTime.timeName(),
mesh,
mesh.thisDb(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),

View File

@ -5,7 +5,7 @@ areaScalarField Cs
(
"Cs",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
@ -37,7 +37,7 @@ areaVectorField Us
(
"Us",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
@ -51,7 +51,7 @@ edgeScalarField phis
(
"phis",
runTime.timeName(),
mesh,
aMesh.thisDb(),
IOobject::NO_READ,
IOobject::NO_WRITE
),

View File

@ -1,2 +0,0 @@
// Create Finite Area mesh
faMesh aMesh(mesh);

View File

@ -7,7 +7,7 @@
(
"Cvf",
runTime.timeName(),
mesh,
mesh.thisDb(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
@ -24,7 +24,7 @@
(
"U",
runTime.timeName(),
mesh,
mesh.thisDb(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),

View File

@ -27,7 +27,7 @@
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -29,7 +29,7 @@ if (mesh.changing())
wordList pcorrTypes
(
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
fvPatchFieldBase::zeroGradientType()
);
// Set BCs of pcorr to fixed-value for patches at which p is fixed
@ -72,7 +72,7 @@ if (mesh.changing())
divrhoU()
);
//pcorrEqn.solve(mesh.solver(pcorr.select(pimple.finalInnerIter())));
//pcorrEqn.solve(pcorr.select(pimple.finalInnerIter()));
//Bypass virtual layer
const dictionary& d = mesh.solver
(

View File

@ -50,7 +50,7 @@ while (pimple.correctNonOrthogonal())
- fvm::laplacian(rhorAUf, p_rgh)
);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -52,7 +52,7 @@ while (pimple.correctNonOrthogonal())
compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue
);
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -108,7 +108,7 @@ forAll(fluidRegions, i)
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
dimensionedScalar("hRef", dimLength, Zero) // uses name
dimensionedScalar(word::null, dimLength, Zero)
)
);

View File

@ -1,5 +1,5 @@
derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C
../solid/solidRegionDiffNo.C
solid/solidRegionDiffNo.C
chtMultiRegionTwoPhaseEulerFoam.C
EXE = $(FOAM_APPBIN)/chtMultiRegionTwoPhaseEulerFoam

View File

@ -292,8 +292,7 @@ updateCoeffs()
// Since we're inside initEvaluate/evaluate there might be processor
// comms underway. Change the tag we use.
int oldTag = UPstream::msgType();
UPstream::msgType() = oldTag+1;
const int oldTag = UPstream::incrMsgType();
// Get the coupling information from the mappedPatchBase
const label patchi = patch().index();
@ -471,10 +470,9 @@ updateCoeffs()
<< regionTypeNames_ << nl << exit(FatalError);
}
mixedFvPatchScalarField::updateCoeffs();
UPstream::msgType(oldTag); // Restore tag
// Restore tag
UPstream::msgType() = oldTag;
mixedFvPatchScalarField::updateCoeffs();
}

View File

@ -196,18 +196,6 @@ public:
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
*this
)
);
}
//- Construct as copy setting internal field reference
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
@ -215,20 +203,19 @@ public:
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
//- Return a clone
virtual tmp<fvPatchField<scalar>> clone() const
{
return fvPatchField<scalar>::Clone(*this);
}
//- Clone with an internal field reference
virtual tmp<fvPatchField<scalar>> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
*this,
iF
)
);
return fvPatchField<scalar>::Clone(*this, iF);
}

View File

@ -221,7 +221,7 @@ forAll(fluidRegions, i)
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
dimensionedScalar("hRef", dimLength, Zero)
dimensionedScalar(word::null, dimLength, Zero)
)
);

View File

@ -13,11 +13,11 @@ forAll(cumulativeContErrIO, i)
"cumulativeContErr",
runTime.timeName(),
"uniform",
mesh,
mesh.thisDb(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
dimensionedScalar(dimless, Zero)
dimensionedScalar(word::null, dimless, Zero)
)
);
}

View File

@ -8,11 +8,13 @@
volVectorField& U1 = phase1.URef();
surfaceScalarField& phi1 = phase1.phiRef();
const surfaceScalarField& alphaPhi1 = phase1.alphaPhi();
const tmp<surfaceScalarField> talphaPhi1 = phase1.alphaPhi();
const auto& alphaPhi1 = talphaPhi1();
volVectorField& U2 = phase2.URef();
surfaceScalarField& phi2 = phase2.phiRef();
const surfaceScalarField& alphaPhi2 = phase2.alphaPhi();
const tmp<surfaceScalarField> talphaPhi2 = phase2.alphaPhi();
const auto& alphaPhi2 = talphaPhi2();
surfaceScalarField& phi = fluid.phi();

View File

@ -1,6 +1,6 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
mesh.data().setFinalIteration(true);
}
if (frozenFlow)
@ -35,5 +35,5 @@ else
if (finalIter)
{
mesh.data::remove("finalIteration");
mesh.data().setFinalIteration(false);
}

View File

@ -0,0 +1 @@
../../solid/solidRegionDiffNo.C

View File

@ -1,6 +1,6 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
mesh.data().setFinalIteration(true);
}
{
@ -22,7 +22,7 @@ if (finalIter)
fvOptions.constrain(hEqn);
hEqn.solve(mesh.solver(h.select(finalIter)));
hEqn.solve(h.select(finalIter));
fvOptions.correct(h);
}
@ -35,5 +35,5 @@ if (finalIter)
if (finalIter)
{
mesh.data::remove("finalIteration");
mesh.data().setFinalIteration(false);
}

View File

@ -33,7 +33,7 @@
}
else
{
EEqn.solve(mesh.solver(he.select(finalIter)));
EEqn.solve(he.select(finalIter));
fvOptions.correct(he);
thermo.correct();

View File

@ -28,7 +28,7 @@
- fvc::snGrad(p_rgh)
)*mesh.magSf()
),
mesh.solver(U.select(finalIter))
U.select(finalIter)
);
fvOptions.correct(U);

View File

@ -44,7 +44,7 @@ if (Y.size())
fvOptions.constrain(YiEqn);
YiEqn.solve(mesh.solver("Yi"));
YiEqn.solve("Yi");
fvOptions.correct(Yi);

View File

@ -112,7 +112,7 @@ forAll(fluidRegions, i)
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
dimensionedScalar("hRef", dimLength, Zero) // uses name
dimensionedScalar(word::null, dimLength, Zero)
)
);

View File

@ -13,11 +13,11 @@ forAll(cumulativeContErrIO, i)
"cumulativeContErr",
runTime.timeName(),
"uniform",
mesh,
mesh.thisDb(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
dimensionedScalar(dimless, Zero)
dimensionedScalar(word::null, dimless, Zero)
)
);
}

View File

@ -52,15 +52,12 @@ constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
p_rghEqn.solve
(
mesh.solver
p_rgh.select
(
p_rgh.select
(
(
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);

View File

@ -1,6 +1,6 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
mesh.data().setFinalIteration(true);
}
if (frozenFlow)
@ -36,5 +36,5 @@ else
if (finalIter)
{
mesh.data::remove("finalIteration");
mesh.data().setFinalIteration(false);
}

View File

@ -1,6 +1,8 @@
fvSolution solutionDict(runTime);
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false));
bool coupled = false;
{
fvSolution solutionDict(runTime);
solutionDict.readIfPresent("coupledEnergyField", coupled);
}
autoPtr<fvMatrix<scalar>> fvMatrixAssemblyPtr;

View File

@ -49,11 +49,11 @@ if (adjustTimeStep)
(
min
(
min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaT().value(),
min(maxCo/CoNum, maxDi/DiNum)*runTime.deltaTValue(),
min(runTime.deltaTValue(), maxDeltaT)
)
);
Info<< "deltaT = " << runTime.deltaT().value() << endl;
Info<< "deltaT = " << runTime.deltaTValue() << endl;
}
}

View File

@ -59,12 +59,12 @@ if (adjustTimeStep)
(
min
(
min(deltaTFluid, maxDeltaTSolid)*runTime.deltaT().value(),
min(deltaTFluid, maxDeltaTSolid)*runTime.deltaTValue(),
maxDeltaT
)
);
Info<< "deltaT = " << runTime.deltaT().value() << endl;
Info<< "deltaT = " << runTime.deltaTValue() << endl;
}
// ************************************************************************* //

View File

@ -57,7 +57,7 @@
),
solidRegions[i],
dimensionedSymmTensor(tkappaByCp().dimensions(), Zero),
zeroGradientFvPatchSymmTensorField::typeName
fvPatchFieldBase::zeroGradientType()
)
);

View File

@ -25,10 +25,10 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
mesh.data().setFinalIteration(true);
}
hEqn.solve(mesh.solver(h.select(finalIter)));
hEqn.solve(h.select(finalIter));
fvOptions.correct(h);
@ -39,7 +39,7 @@
if (finalIter)
{
mesh.data::remove("finalIteration");
mesh.data().setFinalIteration(false);
}
}
}

View File

@ -34,7 +34,7 @@ if (!thermo.isotropic())
),
mesh,
dimensionedSymmTensor(tkappaByCp().dimensions(), Zero),
zeroGradientFvPatchSymmTensorField::typeName
fvPatchFieldBase::zeroGradientType()
)
);
volSymmTensorField& aniAlpha = *taniAlpha;

View File

@ -43,6 +43,8 @@ Description
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
@ -64,13 +66,13 @@ int main(int argc, char *argv[])
{
// Solve all primal equations
om.solvePrimalEquations();
// Clear sensitivities
om.clearSensitivities();
// Solve all adjoint equations
om.solveAdjointEquations();
}
// Update primal-based quantities of the adjoint solvers
om.updatePrimalBasedQuantities();
// Solve all adjoint equations
om.solveAdjointEquations();
}
Info<< "End\n" << endl;

View File

@ -85,15 +85,6 @@ public:
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new adjointOutletPressureFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
adjointOutletPressureFvPatchScalarField
(
@ -101,16 +92,19 @@ public:
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
//- Return a clone
virtual tmp<fvPatchField<scalar>> clone() const
{
return fvPatchField<scalar>::Clone(*this);
}
//- Clone with an internal field reference
virtual tmp<fvPatchField<scalar>> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new adjointOutletPressureFvPatchScalarField(*this, iF)
);
return fvPatchField<scalar>::Clone(*this, iF);
}

View File

@ -85,15 +85,6 @@ public:
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchVectorField> clone() const
{
return tmp<fvPatchVectorField>
(
new adjointOutletVelocityFvPatchVectorField(*this)
);
}
//- Construct as copy setting internal field reference
adjointOutletVelocityFvPatchVectorField
(
@ -101,16 +92,19 @@ public:
const DimensionedField<vector, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchVectorField> clone
//- Return a clone
virtual tmp<fvPatchField<vector>> clone() const
{
return fvPatchField<vector>::Clone(*this);
}
//- Clone with an internal field reference
virtual tmp<fvPatchField<vector>> clone
(
const DimensionedField<vector, volMesh>& iF
) const
{
return tmp<fvPatchVectorField>
(
new adjointOutletVelocityFvPatchVectorField(*this, iF)
);
return fvPatchField<vector>::Clone(*this, iF);
}

View File

@ -141,7 +141,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
pEqn.solve(p.select(piso.finalInnerIter()));
if (piso.finalNonOrthogonalIter())
{

View File

@ -114,7 +114,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
pEqn.solve(p.select(piso.finalInnerIter()));
if (piso.finalNonOrthogonalIter())
{

View File

@ -40,7 +40,7 @@ while (pimple.correctNonOrthogonal())
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -33,7 +33,12 @@ Description
\*---------------------------------------------------------------------------*/
{
volScalarField contErr(interpolatedCells*cellMask*fvc::div(phi));
const DimensionedField<scalar, volMesh> contErr
(
interpolatedCells.internalField()
*cellMask.internalField()
*fvc::div(phi)().internalField()
);
scalar sumLocalContErr = runTime.deltaTValue()*
mag(contErr)().weightedAverage(mesh.V()).value();

View File

@ -24,7 +24,7 @@ if (mesh.changing())
wordList pcorrTypes
(
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
fvPatchFieldBase::zeroGradientType()
);
// Set BCs of pcorr to fixed-value for patches at which p is fixed

View File

@ -32,7 +32,7 @@ while (pimple.correctNonOrthogonal())
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -45,7 +45,7 @@ while (pimple.correctNonOrthogonal())
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
pEqn.solve(p.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -26,7 +26,7 @@ while (piso.correctNonOrthogonal())
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
pEqn.solve(p.select(piso.finalInnerIter()));
if (piso.finalNonOrthogonalIter())
{

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -105,6 +106,9 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
// Update settings from the control dictionary
piso.read();
// Pressure-velocity PISO corrector
{
#include "UEqn.H"

View File

@ -135,7 +135,7 @@ int main(int argc, char *argv[])
- fvm::laplacian(ghrAUf, h)
);
hEqn.solve(mesh.solver(h.select(pimple.finalInnerIter())));
hEqn.solve(h.select(pimple.finalInnerIter()));
if (pimple.finalNonOrthogonalIter())
{

View File

@ -5,13 +5,17 @@ EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-ldynamicMesh \
-ldynamicFvMesh \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \

Some files were not shown because too many files have changed in this diff Show More