Commit Graph

5675 Commits

Author SHA1 Message Date
c104aac1da Removed duplicate file 2022-01-17 23:58:32 +00:00
75a3d1fd1e fvMeshDistributors::cpuLoad: New class to simply caching multiple CPU loads per cell
Used by fvMeshDistributors::loadBalancer to generate the multi-constraint
weights for mesh redistribution.
2022-01-17 19:58:04 +00:00
472ce5ace6 fvMeshDistributors::loadBalancer: Prototype general CPU load balancer
used in conjunction with the new loadBalancing option in constant/chemistryProperties:

    loadBalancing   on;

which enables per-cell CPU time caching used by the loadBalancer to redistribute
the mesh.  Currently this option is only provided for chemistry integration but
the implementation is general and in future options will be provided to balance
other local cell loads, in particular Lagrangian particles.

The loadBalancer in enabled by specifying a distributor entry in
constant/dynamicMeshDict, e.g.

distributor
{
    type            loadBalancer;

    libs            ("libfvMeshDistributors.so");

    multiConstraint true;

    // How often to redistribute
    redistributionInterval  10;

    // Maximum fractional cell distribution imbalance
    // before rebalancing
    maxImbalance    0.1;
}

with which the mesh is checked for more than 10% load-imbalance every 10
time-steps and redistributed using a multi-constraint method, i.e. separate CPU
load weights are provided for each of the loads, currently that is the chemistry
integration load and the CPU time taken for the rest of the simulation,
transport equations solution etc.

The fvMeshDistributors::loadBalancer uses the distributor specified in
system/decomposeParDict to redistribute the mesh based on the cell CPU loads,
e.g. to use the Zoltan RCB method specify:

distributor     zoltan;
libs            ("libzoltanDecomp.so");

zoltanCoeffs
{
    lb_method   rcb;
}

Unfortunately only a few available redistribution methods support
multi-constraints: Zoltan::RCB, MeTiS, parMeTiS and xtraPuLP, of these only
Zoltan::RCB is currently available in OpenFOAM.  Load-balancing is possible
without using a multi-constraint method (i.e. using any of the other
decomposition methods provided with OpenFOAM and Zoltan) by summing the various
CPU loads which is selected by setting:

    multiConstraint false;

but the load-balancing is likely to be a lot less effective with this option.

Due to the licencing issues with parMeTiS interfacing to xtraPuLP might be the
best option for further work on load-balancing in OpenFOAM, or MeTiS could be
used in parallel by first agglomerating the distribution graph on the master
processor and redistributing the result; this pseudo-parallel option is already
provided for the Scotch method.
2022-01-17 11:31:12 +00:00
3c353761ed tutorials::dynamicMeshDict: Corrected dictionary name 2022-01-17 10:54:11 +00:00
aab660450a fileOperation, timeSelector: Correct handling of negative time directories
Resolves bug-report https://bugs.openfoam.org/view.php?id=3784
2022-01-15 21:15:41 +00:00
8c0dd22f83 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 20220115 2022-01-14 17:59:04 +00:00
76d8280c96 Time: Improved the time directory precision changes for variable time-step cases
Resolves bug-report https://bugs.openfoam.org/view.php?id=3781
2022-01-14 17:58:14 +00:00
40286ba59e setAtmBoundaryLayer: New initialisation utility
This utility initialises the U, k and epsilon fields (if available) to
the output of the atmBoundaryLayer model. This is the same model as used
in the atmBoundaryLayerInlet.* boundary conditions and in the
waveAtmBoundaryLayer wave model.

The settings for the initialisation are read from a
system/setAtmBoundaryLayerDict file and are identical to the settings
required by the other use cases. An example of the settings required
within a system/setAtmBoundaryLayerDict file is shown below:

    zDir            (0 0 1);        // Vertical direction
    flowDir         (1 0 0);        // Direction of far-field flow
    Zref            20;             // Reference height
    Uref            10;             // Speed at reference height
    z0              uniform 0.1;    // Roughness height
    zGround         uniform 0;      // Ground height
2022-01-14 17:13:09 +00:00
fca30da1fd Time: Corrected the handling of user-time in the write time precision update
Resolves bug-report https://bugs.openfoam.org/view.php?id=3781
2022-01-13 17:38:11 +00:00
62ad471222 multiphaseEulerFoam: Made segregated drag model numerically symmetric 2022-01-13 10:12:20 +00:00
30c877a7ab multiphaseEulerFoam: Use phaseSystem::propertiesName 2022-01-13 10:12:20 +00:00
b58e1f5d5a className: Added define with name for non-template classes 2022-01-12 16:47:46 +00:00
01f0753ac7 cpuTime: Updated to use the POSIX clock() function
which provides better resolution of the CPU time than times function used
previously.  This will be needed for load-balancing chemistry, Lagrangian
etc. for which the CPU time spent per cell is required.
2022-01-11 23:05:29 +00:00
3f1bb7ee13 multiphaseEulerFoam: Minor fixes to population balance function objects
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-01-11 14:07:01 +00:00
32b656f8a7 multiphaseEulerFoam, turbulentDispersionModel: Corrected face-force for multiphase case
This is a completion of commit 64da7a2c. The fix has now also been
applied to the face-momentum equation.
2022-01-11 13:55:46 +00:00
cc96abda03 basicThermo: Cache thermal conductivity kappa rather than thermal diffusivity alpha
Now that Cp and Cv are cached it is more convenient and consistent and slightly
more efficient to cache thermal conductivity kappa rather than thermal
diffusivity alpha which is not a fundamental property, the appropriate form
depending on the energy solved for.  kappa is converted into the appropriate
thermal diffusivity for the energy form solved for by dividing by the
corresponding cached heat capacity when required, which is efficient.
2022-01-10 20:19:00 +00:00
1ae5288274 functionObjects::fieldAverage: Corrected handling of internal fields
Resolves bug-report https://bugs.openfoam.org/view.php?id=3776
2022-01-07 21:16:21 +00:00
a05910e22e Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-01-07 10:21:52 +00:00
0b681597c4 basicSpecieMixture: Corrected test for zero total mass-fraction
Resolves bug-report https://bugs.openfoam.org/view.php?id=3775
2022-01-07 10:20:52 +00:00
794255284f multiphaseEulerFoam: revised sizeDistribution functionObject
Following the addition of the new moments functionObject, all related
functionality was removed from sizeDistribution.

In its revised version, sizeDistribution allows for different kinds of
weighted region averaging in case of field-dependent representative
particle properties.

A packaged function has also been added to allow for command line solver
post-processing.

For example, the following function object specification returns the
volume-based number density function:

    numberDensity
    {
        type                sizeDistribution;
        libs                ("libmultiphaseEulerFoamFunctionObjects.so");
        writeControl        writeTime;
        populationBalance   bubbles;
        functionType        numberDensity;
        coordinateType      volume;
        setFormat           raw;
    }

The same can be achieved using a packaged function:

    #includeFunc sizeDistribution
    (
        populationBalance=bubbles,
        functionType=numberDensity,
        coordinateType=volume,
        funcName=numberDensity
    )

Or on the command line:

    multiphaseEulerFoam -postProcess -func "
    sizeDistribution
    (
        populationBalance=bubbles,
        functionType=numberDensity,
        coordinateType=volume,
        funcName=numberDensity
    )"

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-01-07 09:48:30 +00:00
36c565b9bf multiphaseEulerFoam: new functionObject "moments"
This function calculates integral (integer moments) or mean properties
(mean, variance, standard deviation) of a size distribution computed with
multiphaseEulerFoam. It has to be run with multiphaseEulerFoam, either
at run-time or with -postProcess. It will not work with the postProcess
utility.

The following function object specification for example returns the first
moment of the volume-based number density function which is equivalent to
the phase fraction of the particulate phase:

    moments
    {
        type                moments;
        libs                ("libmultiphaseEulerFoamFunctionObjects.so");
        executeControl      timeStep;
        writeControl        writeTime;
        populationBalance   bubbles;
        momentType          integerMoment;
        coordinateType      volume;
        order               1;
    }

The same can be achieved using a packaged function:

    #includeFunc moments
    (
        populationBalance=bubbles,
        momentType=integerMoment,
        coordinateType=volume,
        order=1,
        funcName=moments
    )

Or on the command line:

    multiphaseEulerFoam -postProcess -func "
        moments
        (
            populationBalance=bubbles,
            momentType=integerMoment,
            coordinateType=volume,
            order=1,
            funcName=moments
        )"

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-01-07 09:48:30 +00:00
07c43e9c5d setWriter, surfaceWriter: Added lists of fields to the variadic interface 2022-01-07 09:48:30 +00:00
1041a0c21b Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-01-06 15:38:21 +00:00
b56f6d9109 cyclicFvPatchField: Corrected handling of rotated cyclic transformation for tensors
This correction applies to the handling of the implicit part of the matrix for
the segregates solution of the tensor components, e.g. when solving for the
Reynolds stress in cases with rotated cyclic patches.
2022-01-06 15:26:05 +00:00
6d0b384400 lagrangian: PhaseChangeModel: Added access to the parcel 2022-01-06 14:48:29 +00:00
c64fcd709d Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-01-05 19:03:22 +00:00
ef9707eaa7 tutorials/multiphase/interFoam/RAS/waterChannel: Now calculates the volumetric flux of the water
Resolves bug-report https://bugs.openfoam.org/view.php?id=3774
2022-01-05 19:02:22 +00:00
5e1b006edc dynamicCode: Removed duplicate reaction 2022-01-05 17:33:17 +00:00
b3e785579a codedFvModelTemplate: Added distribute(const mapDistributePolyMesh&) for mesh redistribution 2022-01-04 23:48:36 +00:00
1b116fdddd Allwmake: use wmake -a to replace (cd ... && ./Allwmake... 2022-01-03 16:42:40 +00:00
689a4de88a entrainmentPressureFvPatchScalarField: Corrected documentation 2022-01-03 10:46:55 +00:00
390cbb404c src/parallel/decompose/Allwmake, src/renumber/Allwmake: Removed unnecessary additional checks 2022-01-03 10:46:12 +00:00
db531767cb Zoltan: Corrected test logic for the availability of the Zoltan library
for zoltanRenumber and zoltanDecomp
2022-01-03 10:35:01 +00:00
9f6e8e5eff POSIX::cp: removed problematic eof test
Resolves bug-report https://bugs.openfoam.org/view.php?id=3772
2021-12-28 15:15:48 +00:00
d1d7963cf8 cellCuts: Removed unused constructor 2021-12-27 23:26:09 +00:00
811fb750ee fvMesh: Corrected mapping of surfaceSphericalTensorFields
Resolves bug-report https://bugs.openfoam.org/view.php?id=3768
2021-12-27 23:12:08 +00:00
dbf600af43 lagrangian: Added interface for mesh redistribution 2021-12-26 12:03:45 +00:00
340856ad38 zoltanDecomp: New parallel decomposition/redistribution method using the Zoltan library
Zoltan only work in parallel so zoltanDecomp can only be used for redistribution
but is much more flexible than ptscotch and provides a range of geometric, graph
and hypergraph methods which can operate in either "partition" or "repartition",
the latter being particularly useful for dynamic load-balancing by migrating
cells between processors rather than creating a completely different
decomposition, thus reducing communication.

Class
    Foam::zoltanDecomp

Description
    Zoltan redistribution in parallel

    Note: Zoltan methods do not support serial operation.

    Parameters
    - lb_method : The load-balancing algorithm
      - block : block partitioning
      - random : random partitioning
      - rcb : recursive coordinate bisection
      - rib : ecursive inertial bisection
      - hsfc : Hilbert space-filling curve partitioning
      - reftree : refinement tree based partitioning
      - graph : choose from collection of methods for graphs
      - hypergraph : choose from a collection of methods for hypergraphs

    - lb_approach The desired load balancing approach. Only lb_method =
      hypergraph or graph uses the lb_approach parameter. Valid values are

      - partition : Partition without reference to the current distribution,
        recommended for static load balancing.

      - repartition : Partition starting from the current data distribution
        to keep data migration low, recommended for dynamic load balancing.

      - refine : Quickly improve the current data distribution

      Default values
      - debug_level     0
      - imbalance_tol   1.05
      - lb_method       graph
      - lb_approach     repartition

Usage
    To select the Zoltan graph repartition method add the following entries to
    decomposeParDict:

        distributor     zoltan;
        libs            ("libzoltanRenumber.so");

    The Zoltan lb_method and lb_approach can be changed by adding the
    corresponding entries to the optional zoltanCeoffs sub-dictionary, e.g.:

    zoltanCoeffs
    {
        lb_method       hypergraph;
        lb_approach     partition;
    }

An example of using Zoltan for redistribution during snappyHexMesh is provided
commented out in

tutorials/incompressible/simpleFoam/motorBike/system/decomposeParDict

and fordynamic load-balancing in

tutorials/multiphase/interFoam/RAS/floatingObject/system/decomposeParDict.

Note that Zoltan must first be compiled in ThirdParty-dev by downloading from
the link in the README file and running Allwmake and then compiling zoltanDecomp
by running Allwmake in src/parallel/decompose.
2021-12-25 11:04:47 +00:00
9691eb13a6 compressibleInterFoam::VoFClouds: Added prototype call to redistribute the clouds 2021-12-24 17:17:01 +00:00
5ed8dbb463 fvModels: Added support for mesh redistribution and load-balancing 2021-12-24 15:02:30 +00:00
4267bb6c37 fvConstraints: Added support for mesh redistribution and load-balancing 2021-12-24 11:32:06 +00:00
a4e02fb247 MeshObject: Added DistributeableMeshObject for mesh distribution and load-balancing
The new DistributeableMeshObject MeshObject provides the interface for the
distribute(const mapDistributePolyMesh&) function used to distribute mesh
related objects following redistribution.
2021-12-24 10:05:23 +00:00
ebfe26b2b3 TimeState: Removed temporary protected status of the private member data
This temporary change is no longer needed now that integration of user-time into
Time is complete.
2021-12-24 00:11:31 +00:00
74917f80cc Zoltan: Added configuration file for zoltanRenumber 2021-12-22 17:01:16 +00:00
526b3840c7 renumberMethods::zoltanRenumber: set default ORDER_METHOD to LOCAL_HSFC
also adding optional "libs" entry to renumberMeshDict so that the
libzoltanRenumber.so can be loaded at run-time rather than having to recompile
and relink the renumberMesh utility to support it.
2021-12-20 22:48:37 +00:00
7934ed693c surfaceFilmModels::surfaceFilm: Cache the fieldNames to simplify equation source selection 20211218 2021-12-17 15:13:09 +00:00
083b51e30d chemistryReduction: Restore default selection of no reduction if settings are absent 2021-12-17 09:21:29 +00:00
cc3b257ce3 LiquidEvaporation: Added condensation switch
This switch controls whether or not the model clips a droplet's outlet
mass flow rate to zero or permits it to become negative and thereby
represent condensation. By default condensation is not permitted.
2021-12-17 09:21:29 +00:00
145eb5392a surfaceFilmModels::kinematicSingleLayer: Added access function for the phaseName 2021-12-17 09:17:06 +00:00
19d3da81ae basicChemistryModelTemplate: Added compilation rules for LangmuirHinshelwood and MichaelisMenten reactions 2021-12-17 08:44:27 +00:00