Commit Graph

6128 Commits

Author SHA1 Message Date
63892b01f4 typeInfo: Added typedName functions to supersede the modelName function in IOobject
The typedName functions prepend the typeName to the object/field name to make a
unique name within the context of model or type.

Within a type which includes a typeName the typedName function can be called
with just the name of the object, e.g. within the kEpsilon model

    typeName("G")

generates the name

    kEpsilon:G

To create a typed name within another context the type name can be obtained from
the type specified in the function instantiation, e.g.

    Foam::typedName<viscosityModel>("nu")

generates the name

    viscosityModel:nu

This supersedes the modelName functionality provided in IOobject which could
only be used for IOobjects which provide the typeName, whereas typedName can be
used for any type providing a typeName.
2022-08-25 17:14:47 +01:00
51bb40ce3d mappedPatchBaseTemplates: Added dummy return to avoid compiler warnings 2022-08-25 00:12:56 +01:00
2a0149a8ba polyMesh: Prevent readUpdate from setting write flags
A readUpdate should change face and point instances, but it should not
set the mesh data to be written. Any mesh change as a result of
readUpdate is the result of a read from disk, so it is not necessary for
that change to be written out.
2022-08-23 17:35:53 +01:00
7e018cead8 reconstructPar: Fix to prevent unnecessary reconstruction of multi-region cases 2022-08-23 17:02:18 +01:00
7c5ed3911f fvMesh::readUpdate: Ensure boundary is valid before disconnecting 2022-08-23 16:15:50 +01:00
919972553a NCC: Fix parallelisation bugs when used with meshToMesh mapping 2022-08-23 14:56:09 +01:00
38cc00329c reconstructPar: Fixed reconstruction of badly balanced multi-region cases
This fixes some edge cases in reconstruction which occur when some of
the regions have no cells on some of the processors
2022-08-23 13:40:34 +01:00
c7ccc2dee9 mappedPatchBase: Fixed mapping with interpolation
Mapping with interpolation now behaves correctly when a single cell maps
to multiple faces. In addition, the mapping structure is more compact
and no longer results in copies being made of entire internal fields.

This has been achieved by rewriting the mapping strategy in
mappedPatchBase so that it maps from a reduced set of sampling locations
to the patch faces, rather than directly from the cells/faces to the
patch faces. This is more efficient, but it also permits multiple
sampling locations to be sent to a single cell/face. Values can then be
interpolated to these points before being sent back to the patch faces.

Previously a single cell/face could only be sent a single location onto
which to interpolate; typically that of the first associated patch face.
The resulting interpolated value was then sent back to all associated
patch faces. This meant that some (potentially most) patch faces did
receive a value interpolated to the correct position.
2022-08-23 13:37:29 +01:00
7e798e86d0 decompositionMethods: Added random decomposition method
This is a very silly decomposition method that is useful for very
thoroughly testing parallelised functionality. It is absolutely not a
valid choice for any use case other than testing and debugging.
2022-08-23 09:58:51 +01:00
e38c9b7bd6 mappedPatchBase: Removed unused triangulation options 2022-08-23 09:58:51 +01:00
2b2a75e03b argList: Corrected logic for argList::isArgs test
Resolves bug report https://bugs.openfoam.org/view.php?id=3876
2022-08-23 09:25:17 +01:00
b6818dd901 multiphaseEulerFoam: Prevent population balances from interfering
Population balance models now own their mass transfer rates, rather than
taking a non-constant reference to rates held by the phase system. This
means that they cannot reset or modify rates that relate to other
population balances.
2022-08-23 08:21:06 +01:00
c85a01a6e3 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-08-19 22:09:09 +01:00
d4f9f9efcd fvModel: Added and corrected source functions for consistency with fvModels
Patch contributed by Timo Niemi, VTT.
Resolves bug-report https://bugs.openfoam.org/view.php?id=3875
2022-08-19 22:07:38 +01:00
dafc8f2833 blendingMethods::linear: Fix typo in warning message 2022-08-18 16:18:04 +01:00
484d5ad5d1 polyMesh::reset: when resetting the zones check that the number of zones has not changed 2022-08-17 18:01:52 +01:00
c6eaf30987 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-08-17 16:38:32 +01:00
260faf605b polyMesh: Added resetting of the zones from the new mesh
Used by mesh-to-mesh mapping including zones
2022-08-17 16:37:38 +01:00
c5d70f03c4 caseDicts/postProcessing: Added triSurfaceAverage packaged function object
This is a packaged function object that conveniently computes averages
of fields on tri-surfaces. It can be executed on the command line as
follows:

    foamPostProcess -func "triSurfaceAverage(name=mid.obj, p)"

This will compute the average of the field "p" on a surface file in
"constant/geometry/mid.obj".

The calculation could also be done at run-time by adding the following
entry to the functions section of the system/controlDict

    #includeFunc triSurfaceAverage(name=mid.obj, p)
2022-08-17 15:41:34 +01:00
d6c62a9e7a interpolatingSolidBodyMotionSolver: Added mapMesh function
to support run-time mesh-to-mesh mapping.  The points0 are reset to the points
of the new mesh, i.e. the displacement is assumed 0 after mapping and the motion
functions need to take this into account.
2022-08-17 11:53:07 +01:00
c0950a2aa9 solvers::incompressibleFluid, isothermalFluid: Updated Courant number before mesh update
to ensure the phi field is complete and correct.
2022-08-16 22:29:35 +01:00
6d63ebcb75 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-08-16 21:57:07 +01:00
58408136cb fvMeshTopoChangersMeshToMesh: Corrected the timeIndices list
for consistency with the lookup and comparison to make the mesh time directory
search more robust.
2022-08-16 21:55:03 +01:00
bdc272a2be mappedPatchBase: Removed unused constructor 2022-08-16 10:03:09 +01:00
4761ace529 mappedPatchBase: Removed unused code and sampling modes and minimise public interface 2022-08-16 09:54:32 +01:00
a9dc5e1934 thermalBaffleModel: Simplification
Removed unused run-time selection mechanism for the baffle model.
Removed two layers of unnecessary base class (thermalBaffleModel and
regionModel1D). Simplified the handling of thickness and made apply
regarduess of dimensionality. Made thickness data a dimensioned field,
so that mesh changes get applied to it automatically. Replaced ad-hoc
baffle thickness calculation with a "proper" parallel-aware wave-based
method.
2022-08-16 08:57:34 +01:00
ac0eea9610 polyCellSet: General cell set selection class
Description
    General cell set selection class for models that apply to sub-sets
    of the mesh.

    Currently supports cell selection from a set of points, a specified cellSet
    or cellZone or all of the cells.  The selection method can either be
    specified explicitly using the \c selectionMode entry or inferred from the
    presence of either a \c cellSet, \c cellZone or \c points entry.  The \c
    selectionMode entry is required to select \c all cells.

Usage
    Examples:
    \verbatim
        // Apply everywhere
        selectionMode   all;

        // Apply within a given cellSet
        selectionMode   cellSet; // Optional
        cellSet         rotor;

        // Apply within a given cellZone
        selectionMode   cellZone; // Optional
        cellSet         rotor;

        // Apply in cells containing a list of points
        selectionMode   points; // Optional
        points
        (
            (2.25 0.5 0)
            (2.75 0.5 0)
        );
    \endverbatim

Also used as the base-class for fvCellSet which additionally provides and
maintains the volume of the cell set.
2022-08-13 16:32:19 +01:00
7fdde885fe fvCellSet: The selectionMode entry is now optional
Description
    General cell set selection class for models that apply to sub-sets
    of the mesh.

    Currently supports cell selection from a set of points, a specified cellSet
    or cellZone or all of the cells.  The selection method can either be
    specified explicitly using the \c selectionMode entry or inferred from the
    presence of either a \c cellSet, \c cellZone or \c points entry.  The \c
    selectionMode entry is required to select \c all cells.

Usage
    Examples:
    \verbatim
        // Apply everywhere
        selectionMode   all;

        // Apply within a given cellSet
        selectionMode   cellSet; // Optional
        cellSet         rotor;

        // Apply within a given cellZone
        selectionMode   cellZone; // Optional
        cellSet         rotor;

        // Apply in cells containing a list of points
        selectionMode   points; // Optional
        points
        (
            (2.25 0.5 0)
            (2.75 0.5 0)
        );
    \endverbatim

All tutorials updated and simplified.
2022-08-12 18:44:52 +01:00
2da5edec29 Function1s::omega: New user convenience class to handle the input of time-varying rotational speed
Description
    User convenience class to handle the input of time-varying rotational speed
    in rad/s if \c omega is specified or rpm if \c rpm is specified.

Usage
    For specifying the rotational speed in rpm of an MRF zone:
    \verbatim
        MRF
        {
            cellZone    rotor;

            origin     (0 0 0);
            axis       (0 0 1);

            rpm        60;
        }
    \endverbatim
    or the equivalent specified in rad/s:
    \verbatim
        MRF
        {
            cellZone    rotor;

            origin     (0 0 0);
            axis       (0 0 1);

            rpm        6.28319;
        }
    \endverbatim
    or for a tabulated ramped rotational speed of a solid body:
    \verbatim
        mover
        {
            type            motionSolver;

            libs            ("libfvMeshMovers.so" "libfvMotionSolvers.so");

            motionSolver    solidBody;

            cellZone        innerCylinder;

            solidBodyMotionFunction  rotatingMotion;

            origin      (0 0 0);
            axis        (0 1 0);

            rpm         table
            (
                (0    0)
                (0.01  6000)
                (0.022  6000)
                (0.03  4000)
                (100   4000)
            );
        }
    \endverbatim

The following classes have been updated to use the new Function1s::omega class:
    solidBodyMotionFunctions::rotatingMotion
    MRFZone
    rotatingPressureInletOutletVelocityFvPatchVectorField
    rotatingTotalPressureFvPatchScalarField
    rotatingWallVelocityFvPatchVectorField

and all tutorials using these models and BCs updated to use rpm where appropriate.
2022-08-12 16:52:04 +01:00
26a8e20763 rotatingTotalPressureFvPatchScalarField, rotatingTotalPressureFvPatchScalarField: standardised input specification
Now the input specification for rotation in all rotating BCs is 'origin', 'axis'
and a scalar Function1 for rotational speed omega.
2022-08-12 11:51:45 +01:00
6b2dc3c21e MRFZone: Improved check for the need to update boundary conditions for the new MRF 2022-08-11 18:52:16 +01:00
160ee637f9 MRF: Further developed to replace SRF
MRF (multiple reference frames) can now be used to simulate SRF (single
reference frame) cases by defining the MRF zone to include all the cells is the
mesh and applying appropriate boundary conditions.  The huge advantage of this
is that MRF can easily be added to any solver by the addition of forcing terms
in the momentum equation and absolute velocity to relative flux conversions in
the formulation of the pressure equation rather than having to reformulate the
momentum and pressure system based on the relative velocity as in traditional
SRF.  Also most of the OpenFOAM solver applications and all the solver modules
already support MRF.

To enable this generalisation of MRF the transformations necessary on the
velocity boundary conditions in the MRF zone can no longer be handled by the
MRFZone class itself but special adapted fvPatchFields are required.  Although
this adds to the case setup it provides much greater flexibility and now complex
inlet/outlet conditions can be applied within the MRF zone, necessary for some
SRF case and which was not possible in the original MRF implementation.  Now for
walls rotating within the MRF zone the new 'MRFnoSlip' velocity boundary
conditions must be applied, e.g. in the
tutorials/modules/incompressibleFluid/mixerVessel2DMRF/constant/MRFProperties
case:

boundaryField
{
    rotor
    {
        type            MRFnoSlip;
    }

    stator
    {
        type            noSlip;
    }

    front
    {
        type            empty;
    }

    back
    {
        type            empty;
    }
}

similarly for SRF cases, e.g. in the
tutorials/modules/incompressibleFluid/mixerSRF case:

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (0 0 -10);
    }

    outlet
    {
        type            pressureInletOutletVelocity;
        value           $internalField;
    }

    rotor
    {
        type            MRFnoSlip;
    }

    outerWall
    {
        type            noSlip;
    }

    cyclic_half0
    {
        type            cyclic;
    }

    cyclic_half1
    {
        type            cyclic;
    }
}

For SRF case all the cells should be selected in the MRFproperties dictionary
which is achieved by simply setting the optional 'selectionMode' entry to all,
e.g.:

SRF
{
    selectionMode   all;

    origin      (0 0 0);
    axis        (0 0 1);

    rpm         1000;
}

In the above the rotational speed is set in RPM rather than rad/s simply by
setting the 'rpm' entry rather than 'omega'.

The tutorials/modules/incompressibleFluid/rotor2DSRF case is more complex and
demonstrates a transient SRF simulation of a rotor requiring the free-stream
velocity to rotate around the apparently stationary rotor which is achieved
using the new 'MRFFreestreamVelocity' velocity boundary condition.  The
equivalent simulation can be achieved by simply rotating the entire mesh and
keeping the free-stream flow stationary and this is demonstrated in the
tutorials/modules/incompressibleFluid/rotor2DRotating case for comparison.

The special SRFSimpleFoam and SRFPimpleFoam solvers are now redundant and have
been replaced by redirection scripts providing details of the case migration
process.
2022-08-11 18:23:15 +01:00
9068d5cc9b tutorials: coolingCylinder2D: Move zone creation into blockMeshDict
This prevents the need for a topoSet configuration. It also avoids a
potential error associated with duplicate specification of the geometry
of the solid region.

Also, the unnecessary ./Allclean has been removed, and some minor
re-naming has been done for clarity.
2022-08-11 09:52:05 +01:00
d3ec1c09f1 tutorials: coolingCylinder2D: Simplified blockMeshDict 2022-08-11 08:40:49 +01:00
ceac941f4c createNonConformalCouples: Support patchType overrides
Field settings can now be specified within
createNonConformalCouplesDict. This allows for patchType overrides; for
example to create a jump condition over the coupling.

An alternate syntax has been added to facilitate this. If patch fields
do not need overriding then the old syntax can be used where patches
that are to be coupled are specified as a pair of names; e.g.:

    fields      yes;

    nonConformalCouples
    {
        fan
        {
            patches         (fan0 fan1);
            transform       none;
        }
    }

If patch fields do need overriding, then instead of the "patches" entry,
separate "owner" and "neighbour" sub-dictionaries should be used. These
can both contain a "patchFields" section detailing the boundary
conditions that apply to the newly created patches:

    fields      yes;

    nonConformalCouples
    {
        fan
        {
            owner
            {
                patch       fan0;

                patchFields
                {
                    p
                    {
                        type        fanPressureJump;
                        patchType   nonConformalCyclic;
                        jump        uniform 0;
                        value       uniform 0;
                        jumpTable   polynomial 1((100 0));
                    }
                }
            }

            neighbour
            {
                patch       fan1;

                patchFields
                {
                    $../../owner/patchFields;
                }
            }

            transform       none;
        }
    }

In this example, only the pressure boundary condition is overridden on
the newly created non-conformal cyclic. All other fields will have the
basic constraint type (i.e., nonConformalCyclic) applied.
2022-08-10 16:26:18 +01:00
b1d6e64d02 createNonConformalCouples: Put non-conformal couple settings in a sub dictionary
Settings for the individual non-conformal couples can now be put in a
"nonConformalCouples" sub-dictionary of the
system/createNonConformalCouplesDict. For example:

    fields  no;

    nonConformalCouples // <-- new sub-dictionary
    {
        nonConformalCouple_none
        {
            patches         (nonCouple1 nonCouple2);
            transform       none;
        }

        nonConformalCouple_30deg
        {
            patches         (nonCoupleBehind nonCoupleAhead);
            transform       rotational;
            rotationAxis    (-1 0 0);
            rotationCentre  (0 0 0);
            rotationAngle   30;
        }
    }

This permits settings to be #include-d from files that themselves
contain sub-dictionaries without the utility treating those
sub-dictionaries as if they specify a non-conformal coupling. It also
makes the syntax more comparable to that of createBafflesDict.

The new "nonConformalCouples" sub-dictionary is optional, so this change
is backwards compatible. The new syntax is recommended, however, and all
examples have been changed accordingly.
2022-08-10 16:25:54 +01:00
65b7979147 foanToVTK: Compatibility with NCC
foamToVTK now supports cases with non-conformal patches. These are
excluded from the final output because their faces do not correspond to
anything in the conformal polyMesh.

In addition, patches are now excluded due to type or selection
consistently, regardless of the presence of the -allPatches option.
2022-08-10 11:28:05 +01:00
436c6e4403 test/fvMeshTools: Updated following changes to reconstructPar
Resolves bug report https://bugs.openfoam.org/view.php?id=3873
2022-08-10 10:42:36 +01:00
bfa40570ad bin/tools/RunFunctions: Added getSolver function for use with foamPostProcess 2022-08-10 09:37:10 +01:00
19f984d58d test/postProcessing/channel/Allrun: updated postProcess to foamPostProcess
Resolves bug-report https://bugs.openfoam.org/view.php?id=3873#c12708
2022-08-10 09:27:00 +01:00
c26130acb8 domainDecomposition: Correct typo 2022-08-09 14:33:30 +01:00
a84bcc98ff domainDecomposition: Prevent overwriting existing meshes 2022-08-09 14:28:15 +01:00
cd829836eb tutorials/modules/incompressibleFluid/mixerSRF: New tutorial to demonstrate an SRF simulation using MRF 2022-08-09 13:25:09 +01:00
557c472f07 setDeltaT: Reinstate effect of deltaT setting in controlDict
The time step adjustment now starts from the minimum of the deltaT
calculated from Courant condition (and other physical limits), and the
deltaT specified in the system/controlDict.

This means that a small deltaT setting in system/controlDict results in
a gradual increase up to the Courant number limited value. This can be
useful in maintaining stability at the start of a simulation.

This functionality is an accidental side-effect at best. It is being
reinstated as existing cases are reliant upon it. If additional control
of the time step in the initial stages of a simulation is needed, then
that should be achieved with a more explicit user control.
2022-08-09 10:29:22 +01:00
995b9165d1 fvMeshStitchers::moving: Correct meshPhi with a wave
This is more efficient than the previous algorithm, and it also fixes
some bugs with regards to operation on 2D and wedge cases
2022-08-09 09:00:21 +01:00
ca89189ecd solvers::incompressibleFluid: New solver module for incompressible fluid flow
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces pimpleFoam, pisoFoam and simpleFoam and all
the corresponding tutorials have been updated and moved to
tutorials/modules/incompressibleFluid.

Class
    Foam::solvers::incompressibleFluid

Description
    Solver module for steady or transient turbulent flow of incompressible
    isothermal fluids with optional mesh motion and change.

    Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
    pseudo-transient and steady simulations.

    Optional fvModels and fvConstraints are provided to enhance the simulation
    in many ways including adding various sources, constraining or limiting
    the solution.

    Reference:
    \verbatim
        Greenshields, C. J., & Weller, H. G. (2022).
        Notes on Computational Fluid Dynamics: General Principles.
        CFD Direct Ltd.: Reading, UK.
    \endverbatim

SourceFiles
    incompressibleFluid.C

See also
    Foam::solvers::fluidSolver
    Foam::solvers::isothermalFluid
2022-08-08 22:46:51 +01:00
80d869974e foamToC: Only print the table base-type if it differs from the table name 2022-08-08 18:38:34 +01:00
49af47bbf2 foamToC: Added printing of the libraries for table entries for specific options
-functionObjects  List functionObjects
  -fvConstraints    List fvConstraints
  -fvModels         List fvModels
  -scalarBCs        List scalar field boundary conditions (fvPatchField<scalar>)
  -vectorBCs        List vector field boundary conditions (fvPatchField<vector>)

e.g.

    foamToC -fvModels -allLibs

now prints:

fvModels:
Contents of table fvModel, base type fvModel:
    VoFClouds                               libVoFClouds.so
    VoFSurfaceFilm                          libVoFSurfaceFilm.so
    VoFTurbulenceDamping                    libVoFTurbulenceDamping.so
    accelerationSource                      libfvModels.so
    actuationDiskSource                     libfvModels.so
    buoyancyEnergy                          libfvModels.so
    buoyancyForce                           libfvModels.so
    clouds                                  liblagrangianParcel.so
    coded                                   libfvModels.so
    compressible::VoFTurbulenceDamping      libcompressibleVoFTurbulenceDamping.so
    effectivenessHeatExchangerSource        libfvModels.so
    explicitPorositySource                  libfvModels.so
    heatSource                              libfvModels.so
    heatTransfer                            libfvModels.so
    interRegionExplicitPorositySource       libfvModels.so
    interRegionHeatTransfer                 libfvModels.so
    interfaceTurbulenceDamping              libmultiphaseEulerFoamFvModels.so
    isotropicDamping                        libfvModels.so
    massSource                              libfvModels.so
    phaseLimitStabilisation                 libfvModels.so
    phaseTurbulenceStabilisation            libmultiphaseEulerFoamFvModels.so
    radialActuationDiskSource               libfvModels.so
    radiation                               libradiationModels.so
    rotorDisk                               libfvModels.so
    semiImplicitSource                      libfvModels.so
    sixDoFAccelerationSource                libfvModels.so
    solidEquilibriumEnergySource            libfvModels.so
    solidificationMeltingSource             libfvModels.so
    surfaceFilm                             libsurfaceFilmModels.so
    verticalDamping                         libfvModels.so
    volumeFractionSource                    libfvModels.so
2022-08-08 18:04:56 +01:00
99fa1ce318 src/renumber/Allwmake: Compile the renumberMethods library before zoltanRenumber
as the zoltanRenumber library depends on the renumberMethods
2022-08-08 14:34:35 +01:00
beb9e22d3c Libraries: Resolved various library dependency issues to ensure foamToC can load ALL libraries
without error or warning and hence populate ALL the run-time selection tables of
contents.
2022-08-08 13:34:34 +01:00