Commit Graph

1069 Commits

Author SHA1 Message Date
d39b8a5c94 ENH: binField: remove an unused field
- skip the reduce operation for serial mode
- fix typos
2025-09-24 19:34:17 +01:00
b30d42c391 ENH: age: improve field access pattern
- cache the repeated evaluations
2025-09-24 11:55:42 +01:00
1fa20428a8 STYLE: code cleanup for surfaceCourantNumber (#3422)
- simplify some handling. Use reference (not copy) for internalField
2025-09-23 17:02:01 +02:00
d4019e497d ENH: add/subtract/multiply: validate minimum field count requirement 2025-09-20 18:51:53 +01:00
8be698528a ENH: comfort: improve object performance and readability
- Cache wall patch metadata to avoid repeated computation
- Pre-calculate static dimensioned scalars
- Fix minor typos and enhance code readability
- Improve convergence checking with explicit loop vs max reduction
2025-09-19 20:14:21 +01:00
3a78203863 DEFEATURE: remove mixed precision support for streaming particles (#3412)
- since direct streaming of particles is only ever used internally and
  never for disk I/O (which is collated by property), mixed precision
  will never occur when constructing a particle from a stream.

  Due to padding issues, the previous code would have been faulty anyhow.
  Thus remove that code and replace with a simple sanity check.
2025-08-19 10:56:23 +00:00
821cdf6681 ENH: energyTransport: transfer write control from controlDict to function object (#3303) 2025-08-13 16:30:51 +01:00
1642841868 ENH: allow modifiable access to IOobject local(), as per instance()
ENH: simplify code by using fieldTypes::is_xxx() tests
2025-08-13 11:57:15 +02:00
6a72b0e607 DEFEATURE: remove OStringStream::count() method (issue #3281)
- as seen in #3201, using count() based on the ostringstream tellp
  is not reliable since it is not updated with reset or copying.

STYLE: minor changes to string/char/span streams

- update docs to only mention string_view
- use auto return, without extra trailing 'decltype'

ENH: add IOstream size check helper methods

  * checkNativeSizes() : test only
  * fatalCheckNativeSizes() : an assert with FatalIOError
2025-08-12 09:24:46 +02:00
954a54ea73 BUG: heatTransferCoeff: correct the radiation-contribution sign (fixes #3325) 2025-08-08 15:35:00 +01:00
53af711c6a ENH: simplify assign zero for Dimensioned and Geometric fields (#3402)
- regular or forced assignment from `zero` does not need dimension
  checking:

    Old:  U = dimensionedVector(U.dimensions(), Zero);
    New:  U = Zero;

  this eliminates a fair bit of clutter and simplifies new coding
  without losing general dimension checking capabilities.
2025-07-30 09:29:53 +02:00
4d702d25a6 Merge remote-tracking branch 'origin/master' into develop 2025-06-27 09:41:03 +01:00
053f895b2e ENH: fieldStatistics: new function object
- calculates various statistics (min, max, mean, variance)
  of specified fields
2025-06-24 15:52:32 +02:00
1078234f18 ENH: Added new bladeForces function object
Calculates thrust, drag, torque and lift/drag/pressure coefficients
of single or multiple blades (eg, propeller, turbine blades)

This function object differs from the propellerInfo and forces
function objects in that all forces are calculated within the local
cylindrical coordinate system, which yields thrust and drag values
within the expected reference frame.

The output comprises:
- coefficients per radial bin
- area-weighted total coefficients
- integrated forces and torque

For convenient post-processing, the results are also written in a VTK
(.vtp) output format. All surface results are registered internally,
which makes them available for other function objects.
2025-06-18 21:16:03 +02:00
be278abcc0 ENH: revise patch group selection to ensightMesh
- supports inGroup while also respecting allow/deny semantics

- support inGroup for cellZone/faceZone selection
2025-06-13 10:29:32 +02:00
93f980834b ENH: support patch group selection
- vtkWrite, foamToVTK, surfaceMeshExtract
2025-06-13 10:29:32 +02:00
34df4eaf40 ENH: ensightWrite: allow inGroup names in patches and excludePatches 2025-06-11 13:36:14 +01:00
9bc6f2f91f ENH: support 'rpm' input for propeller functionObject (as per rotorDisk)
- update code style for forces/propeller.
- simplify coordinate handling in propeller functionObject
2025-06-10 10:32:03 +02:00
d6e6450834 ENH: add missing construct GeometricField from primitive field (tmp)
ENH: improvements for GeometricBoundaryField evaluation

- early termination from evaluate_if() and evaluateCoupled().

- evaluateCoupled() now forwards to evaluate_if() and receives
  additional handling for a 'void' parameter type.

BREAKING: extra template parameter for overset correctBoundaryCondition

- the true/false flag as a template parameter instead of as an
  argument to use 'if constexpr' code
2025-05-28 17:50:55 +02:00
a9b59ad27e ENH: control local boundary consistency checks from FieldBase settings
- avoids multiple definitions for various template specializations
2025-05-22 13:55:04 +00:00
ebbeef27b4 ENH: avoid the build-up of the background solver dictionary
The solverPerformanceDict gets larger due to the addition of a SolverPerformance
data per field at every outer iteration within the same main iteration/time
step.

However, the subsequent functionalities seem to use only the first and last
element of this dictionary per field; therefore, storing the interim values
was revealed to be redundant.

The change removes the interim values by transforming the `List` container
into the `Pair` container, and modifying the relevant algorithms.
2025-05-06 15:20:45 +01:00
59f3c55871 STYLE: avoid implicit cast of UList to List 2025-04-09 15:58:30 +02:00
01727c84f1 ENH: use gMinMax() instead of separate gMin(), gMax()
- for reciprocal values, gMinMax() first and then calculate the
  reciprocal, which avoids creating temporaries

STYLE: prefer MinMax to separate min/max accounting

COMP: namespace qualify min/max for deltaT, CourantNo, etc (#3348)
2025-04-09 15:58:30 +02:00
7f062a8f5e ENH: return plain List instead of shrinking the DynamicList
Using 'return List<T>(std::move(dynList))' for transfer of content
  (with implicit shrinking) into a plain List, and leave copy elision
  to do the rest. The implicit transfer (move construct List from
  DynamicList) will normally invoke resize (new/delete and moving
  elements).

  With 'return dynList.shrink()', it will first invoke an internal
  resize (new/delete and moving elements), followed by a copy
  construct as a plain list.

STYLE: avoid implicit cast to 'const List&' in constructors
2025-04-08 11:26:11 +02:00
a9863d9a3f ENH: add size_type to Matrix and VectorSpace
- easier to create type-specific looping in templated code

STYLE: pass 'direction' and 'label' by value instead of reference

COMP: qualify Foam::min() in dense matrix classes
2025-03-31 15:58:55 +02:00
b9b0d1b3aa STYLE: use weighted average/sum in a few places
- minor adjustments to some BCs construction:
  * ensure origin/axis are zero-initialized
  * use dictionary get<> instead of lookup
2025-03-20 11:14:39 +01:00
0a53013499 BUG: foamReport mesh quantities are not parallel (fixes #3338) 2025-03-17 11:53:23 +01:00
20b2f46315 STYLE: prefer listReduce() to using listCombineReduce() when possible
- potentially allows access into the builtin MPI operations
2025-03-06 16:54:31 +01:00
0aecb25024 ENH: update MinMax to accept multiple values for add()
- now also provide its own member data (previously inherited from
  Tuple2) to provide better isolation from future changes
2025-02-24 09:03:19 +01:00
14b2302b38 COMP: remove 'special purpose' minMaxOp (#3326)
- replace with plusOp for reductions. The old use didn't necessarily work
  well with compiler resolution in all cases.
  Simplify to use plusOp (and removed the old version).
  [Does not affect very much code...]

COMP: incorrect include ordering for GeometricFieldFunctions

- header was included after the template code

REGRESSION: combineAllGather mapped to incorrect method (81fa7d08ee)

STYLE: use UPstream::commWarn(...) setter method
2025-02-24 08:57:36 +01:00
512ec01328 ENH: rationalize some globalIndex gather routines
- replace gatherValues() with listGatherValues(), which returns the
  gathered values instead of passing by argument. This makes it less
  fragile and more convenient. Naming as per
  Pstream::listGatherValues(), but still retaining the original
  parameter order.

- rename inplace 'gather' variant as 'gatherInplace' for clarity.

- changed signature of lowest-level globalIndex::gather routines from
  List<Type> to UList<Type> for the output and removed any resizing.
  This means that the caller is responsible for ensuring that the
  receiving field is adequately sized (on master). This change allows
  potential reuse of 'work' arrays etc.

  The only code change for using this low-level gather was in
  GAMGAgglomeration.
2025-02-13 12:31:16 +01:00
cf2b305b4f ENH: upgrade to use some C++17 constructs
- 'if constexpr (...)'
   * instead of std::enable_if
   * terminate template recursion
   * compile-time elimination of code

- use C++14 '_t', '_v' versions,
  eg, std::is_integral_v<T> instead of std::is_integral<T>::value

- std::begin, std::end, std::void_t instead of prev stdFoam versions

- provide is_contiguous_v<..> as short form of is_contiguous<..>::value
  with the additional benefit of removing any cv qualifiers.

ENH: include is_rotational_vectorspace trait

- tests for vector-space and nComponents > 1 (ie, not sphericalTensor)

ENH: improve robustness of pTraits_.. tests by removing cv qualifiers
2025-01-31 09:51:44 +01:00
77cdf22eac STYLE: cellDecomposer: print operand fields in rows 2025-01-13 11:29:44 +00:00
d072ad0e3f STYLE: update code style for point-smoothing 2025-01-08 15:04:12 +01: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
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
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
b0b1d0f8b2 ENH: fieldAverage - allow averaging on internal fields - see #3242
BUG: fieldAverage - handle duplicate entries
2024-12-18 15:11:40 +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
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
d6b8b49da8 STYLE: mapFields, ensightWrite: print operand fields in rows 2024-09-19 16:29:17 +01: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
ac099d82eb Merge remote-tracking branch 'origin/master' into develop 2024-06-18 17:09:58 +01:00
c6501b799e BUG: ddt2, zeroGradient FOs - set candidates using name match 2024-06-11 19:23:11 +01: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
1b825b4470 ENH: cellDecomposer: functionObject to map fields to 'tet' mesh. 2024-06-07 17:21:23 +00:00