Commit Graph

7349 Commits

Author SHA1 Message Date
a671b738c9 MPPIC: Removed moment averaging method
Resolves bug report https://bugs.openfoam.org/view.php?id=4047
2024-01-17 16:04:35 +00:00
11b2951a79 Prevent warnings from Gcc 13.2.1 and Clang 17.0.6 2024-01-16 14:09:38 +00:00
2f724bdc91 multiphaseEuler::phaseModel: Changed the phase-fraction field construction to work around a problem with Clang
The Clang compiler does not use std::move to transfer the result of the ternary
operator into the phase-fraction field resulting in it not being registered to
the database.  To work around this limitation/bug the ternary operator is now
provided with tmp fields the result of which is passed with an IOobject to the
final field constructor to ensure it is registered and the IO options set
correctly.
2024-01-12 15:18:07 +00:00
ddeaa566ef coded: Permit both untyped and typed substitutions
Coded functionality now supports basic un-typed substitutions from the
surrounding dictionary. For example:

    value 1.2345;

    #codeExecute
    {
        scalar s = $value;
        ...
    };

It also now supports the more functional typed substitutions, such as:

    direction (1 0 0);

    #codeExecute
    {
        vector v = $<vector>direction;
        ...
    };

These substitutions are now possible in all code blocks. Blocks with
access to the dictionary (e.g., #codeRead) will do a lookup which will
not require re-compilation if the value is changed. Blocks without
access to the dictionary will have the value directly substituted, and
will require recompilation when the value is changed.
2024-01-10 15:41:57 +00:00
97f88d4991 uniformInletOutletFvFieldSource: Corrected documentation 2024-01-09 15:19:24 +00:00
1218bd08ee epsilonWallFunction, omegaWallFunction: Reimplementation of "corner" weighting
These wall functions modify the turbulent properties (epsilon or omega,
and G) in the adjacent cells. When a cell has multiple wall faces, a
weighting process is used to combine the values from the different
walls. This weighting process has been rewritten and centralised into a
common base class. It is now based on an area-weighted average and is
applied to the fields in an order-independent manner. It is now fully
consistent with multiple simultaneous non-conformal connections.
2024-01-09 11:47:47 +00:00
53ddbda670 solutionControl: Added finalIter_ initialisation
Resolves bug-report https://bugs.openfoam.org/view.php?id=4045
2024-01-09 10:09:34 +00:00
144f75d65c truncatedConeCell, hemisphereToCell: New cell topoSetSources
Cell sets based on hemisphere and truncated cone geometries.

Example usage:

hemisphereToCell:
{
    name c1;
    type cellSet;
    action new;
    source hemisphereToCell;
    centre  (0 0.01 0);
    radius 0.008;
    axis (0 1 0);
}

truncatedConeToCell:
{
    name c2;
    type cellSet;
    action new;
    source truncatedConeToCell;
    point1  (0 0.05 0);
    point2  (0 0.06 0);
    radius1  0.001;
    radius2  0.006;
}

Patch contributed by Bulut Tekgül, Wärtsilä Finland.
2024-01-05 17:19:16 +00:00
17dd64112a MeshZones: Added findIndices
//- Find and return the zone indices for all matches
        labelList findIndices(const wordRe&) const;

It may also be useful to provide versions taking a list of word or wordRe which
will be added as required.
2024-01-04 16:48:32 +00:00
d5869d7413 pointDist: Added optional maximum distance parameter
such that the point-edge wave can be stopped when the distance from the
originating surface exceeds the specified maximum if distances beyond this are
of no interest as is the case for rigid-body motion with a specified outer
distance.  Stopping the point-edge in this manner can significantly speed-up the
calculation, particularly in parallel as the number of expensive communications
is reduced.
2024-01-04 15:01:33 +00:00
6945fc3b0a HashList: Optimise for repeated usage with different sizes 20240104 2024-01-04 10:37:55 +00:00
ffc09d830b HashList: Clear entire table on resizeAndClear 2024-01-04 10:37:55 +00:00
57aa5ffc0a fluentUnitNumbers.txt: Corrected accidental edit 2024-01-02 21:15:21 +00:00
62d5798ad7 triIntersect: Prevent generation of partial topology for failed intersections 2023-12-28 12:08:31 +00:00
4ec2510b59 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-12-25 13:42:16 +00:00
69da8f3d7b stitchMesh: Replacement utility based on the new patchIntersection algorithm
The mergePatchPairs functionality in blockMesh also now uses patchIntersection.

The new mergePatchPairs and patchIntersection replaces the old, fragile and
practically unusable polyTopoChanger::slidingInterface functionality the removal
of which has allowed the deletion of a lot of other ancient and otherwise unused
clutter including polyTopoChanger, polyMeshModifier, polyTopoChange::setAction
and associated addObject/*, modifyObject/* and removeObject/*.  This
rationalisation paves the way for the completion of the update of zone handling
allowing mesh points, faces and cells to exist in multiple zones which is
currently not supported with mesh topology change.

Application
    stitchMesh

Description
    Utility to stitch or conform pairs of patches,
    converting the patch faces either into internal faces
    or conformal faces or another patch.

Usage
    \b stitchMesh (\<list of patch pairs\>)

    E.g. to stitch patches \c top1 to \c top2 and \c bottom1 to \c bottom2
        stitchMesh "((top1 top2) (bottom1 bottom2))"

    Options:
      - \par -overwrite \n
        Replace the old mesh with the new one, rather than writing the new one
        into a separate time directory

      - \par -region \<name\>
        Specify an alternative mesh region.

      - \par -fields
        Update vol and point fields

      - \par -tol
        Merge tolerance relative to local edge length (default 1e-4)

See also
    Foam::mergePatchPairs
2023-12-25 13:32:39 +00:00
061e6d8180 turbulentMixingLengthFrequencyFvScalarFieldSource: Corrected value 2023-12-22 16:00:03 +00:00
602347f6c1 prghUniformTotalPressureFvPatchScalarField: Added p_rgh variant of the time-varying uniform pressure BC
Patch contributed by Stanislau Stasheuski, Aalto University.
2023-12-22 12:20:46 +00:00
73a3fbe446 patchToPatches::intersection: Fix error part calculation for reversed targets 2023-12-21 19:26:43 +00:00
431c58d3fe triIntersect: Fix edge case where source is entirely within target 2023-12-21 19:26:43 +00:00
3a909790fe Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-12-21 16:31:57 +00:00
68342a46a1 meshCheck::checkGeometry,checkTopology: Now cell and face sets are written only if the setWriter is valid 2023-12-21 16:18:39 +00:00
d600bd11e4 triIntersect: Move stabilisation in to geometry construction
Source-point-to-target-triangle projections might be done in order to
determine the location outside of the target triangle, as well as the
location inside. Forcing the source point inside the target triangle is
therefore only appropriate when constructing the intersection geometry.
2023-12-21 12:57:55 +00:00
705a4999bd triIntersect: Stabilise source-point-to-target-triangle projections 2023-12-21 10:38:07 +00:00
f9b4027b05 vtkWriteOps: Protect against float overflow 2023-12-21 10:38:07 +00:00
cd133a28f5 fvMeshTopoChangers::refiner: Fix hang in parallel
This has required switching the order of dependence of the fvMesh
geometry (i.e., Sf, Cf, and C), and the interpolation weights. The
weights are now considered dependent on the geometry fields, and the
geometry fields must therefore construct without reference to the
weights.
2023-12-21 10:38:07 +00:00
20f5235ecf Renamed ID() -> Index()
Index is a better name to describe a label index than ID which may be an
integer, word or other means of identification.
2023-12-20 18:39:55 +00:00
7df07d2660 tutorials: Updated for the changes to triSurfaceMesh 2023-12-20 18:13:55 +00:00
a99155d0f0 Renamed IDs() -> Indices()
Indices is a better name to describe label indices than IDs which may be an
integers, words or other means of identification.
2023-12-20 14:29:23 +00:00
2057174b55 fvMeshStitcher: New stabilisation calculation
This calculation more carefully constructs the direction of the area
stabilisation so as to ensure that it does not oppose the area being
stabilised. This prevents the creation of faces with zero area.

Resolves bug report https://bugs.openfoam.org/view.php?id=4040
2023-12-20 13:52:50 +00:00
b94ade6e61 triSurfaceMesh: Rationalised the handling of the now required "file" entry 2023-12-20 11:38:55 +00:00
a5939b0f0a etc/caseDicts/annotated/topoSetDict: Updated documentation for triSurfaceMesh 2023-12-20 11:08:00 +00:00
3c347ca566 solvers::solid::thermophysicalPredictor: Moved thermo correction into the non-orthogonality correction loop
Resolves bug-report https://bugs.openfoam.org/view.php?id=4043
2023-12-20 10:23:13 +00:00
195dfbe168 MomentumTransportModels::k-omega model: Improved omega bounding using nutMaxCoeff
Omega lower limit bounding is now based on a maximum turbulence viscosity nut
rather than a minimum omega value which improves stability and robustness of
the k-omega models in case of numerical boundedness problems.

The maximum nut value is calculated by multiplying the laminar viscosity by
nutMaxCoeff which defaults to 1e5 but can be set by the user in the
momentumTransport dictionary.
2023-12-19 22:50:10 +00:00
b1c6ddb197 entrainmentPressure boundary condition: updated header documentation 2023-12-19 17:58:32 +00:00
c541070fbd Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-12-19 16:27:47 +00:00
854f454178 MomentumTransportModels::k-epsilon model: Improved epsilon bounding using nutMaxCoeff
Epsilon lower limit bounding is now based on a maximum turbulence viscosity nut
rather than a minimum epsilon value which improves stability and robustness of
the k-epsilon models in case of numerical boundedness problems.

The maximum nut value is calculated by multiplying the laminar viscosity by
nutMaxCoeff which defaults to 1e5 but can be set by the user in the
momentumTransport dictionary.
2023-12-19 16:22:31 +00:00
2a9a2d0e7a Template cases: apply entrainmentPressure BC for p at outlet patches
The boundary condition applied to pressure at open boundaries and outlets is switched
from totalPressure to entrainmentPressure. The latter boundary condition is more robust
since it calculates the pressure for inflow using (velocity) fluxes rather than velocity
on the patch.
2023-12-19 15:56:25 +00:00
6a361d675d PDRMesh: Added support for generic patches
Required now that activeBaffleVelocity and activePressureForceBaffleVelocity
have been moved into PDRFoam.
2023-12-16 17:38:03 +00:00
4ebf1e87a0 polyBoundaryMesh: Renamed groupPatchIDs -> groupPatchIndices
Index is a better name to describe a label index than ID which may be an
integer, word or other means of identification.
2023-12-16 17:36:59 +00:00
621740e90b polyBoundaryMesh::findPatchID,findPatchIDs: renamed findIndex,findIndices
Index is a better name to describe a label index than ID which may be an
integer, word or other means of identification.
2023-12-16 13:27:12 +00:00
cad6a99777 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-12-15 22:27:11 +00:00
77f0b172a9 MeshZones: Renamed findZoneID -> findIndex
Index is a better name to describe a label index than ID which may be an
integer, word or other means of identification.
2023-12-15 22:25:02 +00:00
eb8e221f15 functionObjects::layerAverage: Volume averaging, and weight fields
This function has been changed to volume average, making it appropriate
to use on layered meshes in which the cells have non-uniform geometry
within their layers. A 'weightFields' (or 'weightField') control has
also been added, so that mass or phase weighted averages can be
performed within the layers.
2023-12-15 14:51:28 +00:00
5cf2109eff functionObjects::histogram: Corrected data file header
Resolves bug report https://bugs.openfoam.org/view.php?id=4041
2023-12-15 11:28:27 +00:00
fa6e3fb706 aactiveBaffleVelocity, activePressureForceBaffleVelocity: Moved into PDRFoam
These conditions are legacy and should not be considered for general
use. They require specific, unintuitive mesh structuring (i.e.,
duplicated boundary faces) that only PDRMesh can now create.

If an an interface is needed which opens or closes based on modelling
criteria, then this should be implemented as an extension of NCC. That
would be more flexible, parallelisable, and would not require
modification of the underlying polyheral mesh.
2023-12-15 10:58:13 +00:00
fc59bb71b8 coefficientPhaseChange: Added prototype fvModel for phase change
This simple model generates a phase change between two phases calculated
from the following expression:

    \dot{m}/V = C \alpha \grad \alpha

Where:

    \dot{m}/V | mass transfer rate per unit volume
    C         | coefficient
    \alpha    | volume fraction of the source phase

Example usage:

    coefficientPhaseChange
    {
        type            coefficientPhaseChange;

        phases          (liquid vapour);

        C               [kg/m^2/s] 0.1;
    }

This model may be of use in simple situations, but it is primarily
designed to serve as a prototype for more complex and physical
mechanisms of phase changes.
2023-12-15 10:53:42 +00:00
d5df0a96f1 populationBalance: Allocation coefficient bounds handling
An enumeration has been added to the arguments of the allocation
coefficient function, eta, to allow specification of how to allocate out
of bounds of the population balance size-groups. There are two options:

- "Clamp" will create an out-of-bounds allocation coefficient of exactly
  one. This partitions unity across all size-space.

- "Extrapolate" will create an out-of-bounds allocation coefficient in
  proportion to the ratio between the given size and the nearest
  size-group size. This does not partition unity outside the range of
  the size-groups.

The previous operation is equivalent to "Extrapolate".

It is not yet clear which method is preferable and under what
circumstances. More testing is required. The enumeration has been
created to facilitate this testing.
2023-12-15 10:05:43 +00:00
c21ff68e79 polyBoundaryMesh,MeshZones: Changed argument of findIndex from wordRe to word
as it makes no sense to search for a regular expression which may provide
multiple results and then arbitrarily return the first of them.
2023-12-14 23:07:36 +00:00
a362774c1d collapseEdges: Reinstated 2023-12-14 23:06:47 +00:00