7768 Commits

Author SHA1 Message Date
a4cba5b0d1 Function1s::Polynomial1: Corrected writing of coefficients
Resolves bug report https://bugs.openfoam.org/view.php?id=4086
2024-05-30 10:35:03 +01:00
4d0b466775 decompositionMethods: Added checks for multiple constraints
Multi-constraint load-balancing is only supported by the Zoltan rcb method and
ParMETIS.
2024-05-29 12:34:15 +01:00
eb68840577 reorderPatches: Corrected addNote 2024-05-29 12:23:55 +01:00
2bb0f6b75d functionObject.H: Updated documentation 2024-05-29 12:20:30 +01:00
5f80ee7f10 dictionary: Removed test diagnostic message 2024-05-29 11:14:57 +01:00
33ad682c38 dictionary: Removed the move constructor and assignment operator
because they cannot update the parent dictionary reference.
2024-05-28 20:39:16 +01:00
dbb6837e47 decompositionMethods::parMetis: Corrected error messages 2024-05-28 17:47:21 +01:00
34c1980f3a Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2024-05-26 14:28:20 +01:00
ed17d3c405 parMetis: Added test for points on all processors
Unfortunately ParMETIS does not support redistribution of empty processors.
2024-05-26 14:27:06 +01:00
8b11d6a27d src/parallel/decompose: Corrected handling of sentinel files 2024-05-24 16:39:09 +01:00
81dd264963 wmake: Fix removal of lnInclude during build of mpi-dependent libraries 2024-05-24 14:00:11 +01:00
0933bd106f decompositionMethods: Moved all the basic decomposition methods into the decompositionMethods namespace 2024-05-24 13:57:47 +01:00
538c369b38 decompositionMethods: Moved scotch, ptscotch, metis and zoltan methods into the new decompositionMethods namespace 2024-05-24 11:41:01 +01:00
b1d9ecd6ef Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2024-05-24 10:31:55 +01:00
18e23ffc5e barotropicCompressibilityModel: Removed redundant thermophysicalModel 2024-05-24 10:31:08 +01:00
fa96e43313 fixedMeanFvPatchField: Prevent evaluate on processor cases 2024-05-24 10:02:02 +01:00
bb9bf33869 decompositionMethod::scaleWeights: Only call reduce if running distributed 2024-05-23 16:25:58 +01:00
d444cb168d multiphaseEuler::phaseSystem::correctBoundaryFlux: Update the phase fluxes from the phase face-velocity and make relative
This update is necessary for mesh topology changes and mesh-to-mesh mapping
which update the phase face-velocity fields but not the fluxes.
2024-05-23 15:41:24 +01:00
f9d03d6ad9 mergeMeshes: Added timeSelector::addOptions()
Resolves bug-report https://bugs.openfoam.org/view.php?id=4078
2024-05-22 16:10:10 +01:00
6692825734 mergePolyMesh: Added missing faceZonesAddedFaces_ resize
Patch contributed by Timo Niemi, VTT.
2024-05-22 15:52:34 +01:00
40bcabf79f decompositionMethods::parMetis: New interface to the ParMETIS distributor for load-balancing
ParMETIS is a parallel version of METIS and can be used as an alternative to
ptScotch or Zoltan, supporting multi-constraints and redistribution:

Description
    ParMetis redistribution in parallel

    Note: parMetis methods do not support serial operation.

    Parameters
    - Method of decomposition
      - kWay: multilevel k-way
      - geomKway: combined coordinate-based and multi-level k-way
      - adaptiveRepart: balances the work load of a graph

    - Options
      - options[0]: The specified options are used if options[0] = 1

      - options[1]: Specifies the level of information to be returned during
        the execution of the algorithm. Timing information can be obtained by
        setting this to 1. Additional options for this parameter can be obtained
        by looking at parmetis.h. Default: 0.

      - options[2]: Random number seed for the routine

      - options[3]: Specifies whether the sub-domains and processors are coupled
        or un-coupled.  If the number of sub-domains desired (i.e., nparts) and
        the number of processors that are being used is not the same, then these
        must be un-coupled. However, if nparts equals the number of processors,
        these can either be coupled or de-coupled. If sub-domains and processors
        are coupled, then the initial partitioning will be obtained implicitly
        from the graph distribution. However, if sub-domains are un-coupled from
        processors, then the initial partitioning needs to be obtained from the
        initial values assigned to the part array.

    - itr: Parameter which describes the ratio of inter-processor communication
      time compared to data redistribution time.  Should be set between 0.000001
      and 1000000.0.  If set high, a repartitioning with a low edge-cut will be
      computed. If it is set low, a repartitioning that requires little data
      redistribution will be computed.  Good values for this parameter can be
      obtained by dividing inter-processor communication time by data
      redistribution time. Otherwise, a value of 1000.0 is recommended.
      Default: 1000.

The ParMETIS sources can be downloaded and compiled in ThirdParty-dev using the
link in the README file and the compilation commands in Allwmake.

Note the specific license under which ParMETIS is released:

Copyright & License Notice
--------------------------

The ParMETIS package is copyrighted by the Regents of the
University of Minnesota. It can be freely used for educational and
research purposes by non-profit institutions and US government
agencies only. Other organizations are allowed to use ParMETIS
only for evaluation purposes, and any further uses will require prior
approval. The software may not be sold or redistributed without prior
approval. One may make copies of the software for their use provided
that the copies, are not sold or distributed, are used under the same
terms and conditions.

As unestablished research software, this code is provided on an
``as is'' basis without warranty of any kind, either expressed or
implied. The downloading, or executing any part of this software
constitutes an implicit agreement to these terms. These terms and
conditions are subject to change at any time without prior notice.
2024-05-22 15:30:46 +01:00
32b7ba09b3 decompositionMethod::scaleWeights: Automatically filter out weights that are 0 on all processors
for redistribution methods which do not support 0 weights and for efficiency.
2024-05-22 13:54:51 +01:00
89f86f4e18 src/parallel/decompose/*scotch*/Allwmake: Updated to support system installations of scotch
Resolves bug-report https://bugs.openfoam.org/view.php?id=4084
2024-05-21 21:36:01 +01:00
f9165da0b7 IOerror: Print the error message only from the master if the dictionary is global
This avoids error messages from all processors if the dictionary being parsed is
global, in which case the error message from all processors would be the same so
only the master need print it.  This makes many common error messages the same
running in serial and parallel for user convenience.
2024-05-21 18:56:03 +01:00
5a2f1e3fd8 decompositionMethod::decomposeParDict: Return the IOdictionary
to maintain the global state of the dictionary for error messaging
2024-05-21 18:54:47 +01:00
20a1ef7b20 dictionary: Updated the global() function to return the global state of the parent dictionary
if the parent dictionary is valid.
2024-05-21 18:53:38 +01:00
3521d9889a wmake/wmakeLnInclude: removed echo redirections to stderr 2024-05-21 14:16:56 +01:00
f8b5d71e25 Function1: Preferentially construct from separate unit conversion arguments 2024-05-21 12:43:16 +01:00
30afcdc331 decompositionMethods: Standardised the conversion of scalar weights to integer weights
and general rationalisation and cleanup
2024-05-21 11:24:34 +01:00
c437265c80 lumpedMassTemperatureFvPatchScalarField: Updated dimension and unit handling in the constructor 20240520 2024-05-20 11:30:22 +01:00
13ef92ba48 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2024-05-20 10:16:25 +01:00
efc1fe2742 fixedMeanFvPatchField: Evaluate on construction from dictionary
to ensure the values on the patch are consistent with the boundary condition
specification and to avoid the need to specify a potentially inconsistent
"value" entry.
2024-05-20 10:14:59 +01:00
3ab0e63e63 New lumpedMassTemperature boundary condition
This boundary condition is applied to a patch which bounds a solid body,
wholly or partially.  It represents the body as a lumped mass, i.e. by a
single temperature which is fixed across the patch.  The body has a
volume which is either specified by the user, or is calculated when the
patch describes a closed volume (including in 2D meshes). Starting from
an initial temperature, the change in temperature is the calculated over
time according to a specified applied power source and the heat
transferred across the boundary, using a specified density and specific
heat capacity of the lumped mass.
2024-05-20 09:26:19 +01:00
9ed591b6bb src/parallel/decompose: Rationalised the Allwmake and Allclean scripts
so that each .*Decomp library can be compiled individually.
2024-05-17 20:26:15 +01:00
6e989f7213 checkMesh: Print non-orthogonality in degrees 2024-05-17 14:31:03 +01:00
6045c63e36 searchableSurface, topoSet: Checked unit conversion of input parameters 2024-05-16 15:19:26 +01:00
41705e9eca Lagrangian: Added support for automatic run-time load-balancing
Optional CPU load caching can be switched-on for Lagrangian cloud tracking
and/or chemistry integration using the new cpuLoad switch in the cloudProperties
or chemistryProperties dictionary files respectively and used for
multi-constraint load-balancing by the fvMeshDistributorsLoadBalancer specified
in the dynamicMeshDict file

distributor
{
    type            loadBalancer;

    libs            ("libfvMeshDistributors.so");

    multiConstraint true;
    redistributionInterval  10;
}

which used the distributor specified in the decomposeParDict file, e.g.

numberOfSubdomains 12;

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

simpleCoeffs
{
    n           (2 2 3);
}

zoltanCoeffs
{
    lb_method   rcb;
}

The incompressibleDenseParticleFluid/cyclone case has been updated to
demonstrate this new functionality and shows a speedup ~50% using the Zoltan RCB
multi-constraint distributor.  The multicomponentFluid/counterFlowFlame2D_GRI
case has also been updated to use the new cpuLoad switch.
2024-05-16 13:46:20 +01:00
476bb42b04 unitConversion: Unit conversions on all input parameters
The majority of input parameters now support automatic unit conversion.
Units are specified within square brackets, either before or after the
value. Primitive parameters (e.g., scalars, vectors, tensors, ...),
dimensioned types, fields, Function1-s and Function2-s all support unit
conversion in this way.

Unit conversion occurs on input only. OpenFOAM writes out all fields and
parameters in standard units. It is recommended to use '.orig' files in
the 0 directory to preserve user-readable input if those files are being
modified by pre-processing applications (e.g., setFields).

For example, to specify a volumetric flow rate inlet boundary in litres
per second [l/s], rather than metres-cubed per second [m^3/s], in 0/U:

    boundaryField
    {
        inlet
        {
            type            flowRateInletVelocity;
            volumetricFlowRate 0.1 [l/s];
            value           $internalField;
        }

        ...
    }

Or, to specify the pressure field in bar, in 0/p:

    internalField   uniform 1 [bar];

Or, to convert the parameters of an Arrhenius reaction rate from a
cm-mol-kcal unit system, in constant/chemistryProperties:

    reactions
    {
        methaneReaction
        {
            type    irreversibleArrhenius;
            reaction "CH4^0.2 + 2O2^1.3 = CO2 + 2H2O";
            A       6.7e12 [(mol/cm^3)^-0.5/s];
            beta    0;
            Ea      48.4 [kcal/mol];
        }
    }

Or, to define a time-varying outlet pressure using a CSV file in which
the pressure column is in mega-pascals [MPa], in 0/p:

    boundaryField
    {
        outlet
        {
            type            uniformFixedValue;
            value
            {
                type            table;
                format          csv;
                nHeaderLine     1;
                units           ([s] [MPa]); // <-- new units entry
                columns         (0 1);
                mergeSeparators no;
                file            "data/pressure.csv";
                outOfBounds     clamp;
                interpolationScheme linear;
            }
        }

        ...
    }

(Note also that a new 'columns' entry replaces the old 'refColumn' and
'componentColumns'. This is is considered to be more intuitive, and has
a consistent syntax with the new 'units' entry. 'columns' and
'componentColumns' have been retained for backwards compatibility and
will continue to work for the time being.)

Unit definitions can be added in the global or case controlDict files.
See UnitConversions in $WM_PROJECT_DIR/etc/controlDict for examples.
Currently available units include:

    Standard: kg m s K kmol A Cd

     Derived: Hz N Pa J W g um mm cm km l ml us ms min hr mol
              rpm bar atm kPa MPa cal kcal cSt cP % rad rot deg

A user-time unit is also provided if user-time is in operation. This
allows it to be specified locally whether a parameter relates to
real-time or to user-time. For example, to define a mass source that
ramps up from a given engine-time (in crank-angle-degrees [CAD]) over a
duration in real-time, in constant/fvModels:

    massSource1
    {
        type        massSource;
        points      ((1 2 3));
        massFlowRate
        {
            type        scale;
            scale       linearRamp;
            start       20 [CAD];
            duration    50 [ms];
            value       0.1 [g/s];
        }
    }

Specified units will be checked against the parameter's dimensions where
possible, and an error generated if they are not consistent. For the
dimensions to be available for this check, the code requires
modification, and work propagating this change across OpenFOAM is
ongoing. Unit conversions are still possible without these changes, but
the validity of such conversions will not be checked.

Units are no longer permitted in 'dimensions' entries in field files.
These 'dimensions' entries can now, instead, take the names of
dimensions. The names of the available dimensions are:

    Standard: mass length time temperature
              moles current luminousIntensity

     Derived: area volume rate velocity momentum acceleration density
              force energy power pressure kinematicPressure
              compressibility gasConstant specificHeatCapacity
              kinematicViscosity dynamicViscosity thermalConductivity
              volumetricFlux massFlux

So, for example, a 0/epsilon file might specify the dimensions as
follows:

    dimensions      [energy/mass/time];

And a 0/alphat file might have:

    dimensions      [thermalConductivity/specificHeatCapacity];

*** Development Notes ***

A unit conversion can construct trivially from a dimension set,
resulting in a "standard" unit with a conversion factor of one. This
means the functions which perform unit conversion on read can be
provided dimension sets or unit conversion objects interchangeably.

A basic `dict.lookup<vector>("Umean")` call will do unit conversion, but
it does not know the parameter's dimensions, so it cannot check the
validity of the supplied units. A corresponding lookup function has been
added in which the dimensions or units can be provided; in this case the
corresponding call would be `dict.lookup<vector>("Umean", dimVelocity)`.
This function enables additional checking and should be used wherever
possible.

Function1-s and Function2-s have had their constructors and selectors
changed so that dimensions/units must be specified by calling code. In
the case of Function1, two unit arguments must be given; one for the
x-axis and one for the value-axis. For Function2-s, three must be
provided.

In some cases, it is desirable (or at least established practice), that
a given non-standard unit be used in the absence of specific
user-defined units. Commonly this includes reading angles in degrees
(rather than radians) and reading times in user-time (rather than
real-time). The primitive lookup functions and Function1 and Function2
selectors both support specifying a non-standard default unit. For
example, `theta_ = dict.lookup<scalar>("theta", unitDegrees)` will read
an angle in degrees by default. If this is done within a model which
also supports writing then the write call must be modified accordingly
so that the data is also written out in degrees. Overloads of writeEntry
have been created for this purpose. In this case, the angle theta should
be written out with `writeEntry(os, "theta", unitDegrees, theta_)`.
Function1-s and Function2-s behave similarly, but with greater numbers
of dimensions/units arguments as before.

The non-standard user-time unit can be accessed by a `userUnits()`
method that has been added to Time. Use of this user-time unit in the
construction of Function1-s should prevent the need for explicit
user-time conversion in boundary conditions and sub-models and similar.

Some models might contain non-typed stream-based lookups of the form
`dict.lookup("p0") >> p0_` (e.g., in a re-read method), or
`Umean_(dict.lookup("Umean"))` (e.g., in an initialiser list). These
calls cannot facilitate unit conversion and are therefore discouraged.
They should be replaced with
`p0_ = dict.lookup<scalar>("p0", dimPressure)` and
`Umean_(dict.lookup<vector>("Umean", dimVelocity))` and similar whenever
they are found.
2024-05-16 09:01:46 +01:00
d21e75ac74 fvMesh::distributing: New member function to check if the mesh will redistribute 2024-05-13 12:02:36 +01:00
408e332ac8 ParticleForceList: Added missing initialisation calls in copy constructor 2024-05-13 12:01:39 +01:00
23946e8347 incompressibleDenseParticleFluid: call storeGlobalPositions for redistribution 2024-05-13 12:00:53 +01:00
17b667c3f3 MPPIC: PackingModels::Implicit: Improved time handling
The alpha equation in this model has been changed to a d2dt2 scheme,
rather than a hard-coded correction on a ddt scheme that relies on the
old-time value remaining unchanged from the previous timestep. This
modification makes the model compatible with some forms of mesh change.
2024-05-10 14:04:03 +01:00
2c2e6aafec edgeMeshFormats, surfaceFormats: Removed unused code 2024-05-10 08:42:49 +01:00
47fa9bc620 snappyHexMesh: Corrected use of layer featureAngle
The 'featureAngle' control defines the included angle between faces
above which layer extrusion is prevented. Its use within snappyHexMesh
was incorrect in that the cosine was not being taken before being
compared to dot products of face normals. This has now been corrected.

Existing 'featureAngle' settings may need changing to recover equivalent
behaviour. Any angle previously set to 58 degrees or above previously
resulted in no reduction of layer coverage. A large angle between 90 and
180 degrees is likely to be an appropriate replacement for cases such as
this. Angles previously set to 57 degrees and below can be equivalently
replaced by a value of (180/pi)*arccos(<angle>*(pi/180)).

Note that changing the feature angle also affects the slip feature
angle. The slip feature angle is taken to be half the feature angle if a
'slipFeatureAngle' is not specified.
2024-05-09 14:15:38 +01:00
cdef200385 MRF: Make flux relative following correctPhi
This fixes an incompatibility between MRF and adaptive mesh refinement
2024-05-07 14:45:21 +01:00
fb4d7abf42 dictionary::lookupCompoundScoped: New member function to return a reference to a compound token type
lookupCompoundScoped is used by dictionary via stringOps to provide fast access
to compound tokens without the need to construct the container for every access,
e.g.

listU           List<vector> ((1.1 2.1 1.1) (2.1 3.2 4.1) (4.3 5.3 0));
magU1           #calc "mag($listU[1])";
magU2           #calc "mag($listU[2])";

where the listU is declared as a List<vector> compound token which is then
accessed directly by $listU without the need to specify the type and the data is
accessed directly by reference which is more efficient, particularly if the list
is large.
20240506
2024-05-05 17:42:20 +01:00
ff7fce900c token: Generalised the handling of the type name of the primitive token types
The new token::typeName() function is used in stringOps to provide dictionary
with better support for automatic type inference for variables in #calc
expressions.
2024-05-04 14:11:01 +01:00
97b4a26a4c triIntersect: Fixes to rejection of invalid intersection topologies
This change corrects some of the logic governing whether a geometry is
determined to result in a valid intersection or not. It has fixed some
issues with regards to intersections being erroneously duplicated or
omitted and has thereby increased the proportion of intersections that
result in unity or near-unity coverage.
2024-05-03 08:51:57 +01:00
bf5a843c82 CloudFunctionObject: Prevent overwrite of existing results on foamPostProcess
Cloud functions are now not created at all during foamPostProcess. These
functions mostly usually compute state during tracking, so they cannot
produce anything useful when run as a post-process. In addition, in a
few cases, their initialisation can overwrites valid post-processing
files created at run-time.

A more "complete" system might distinguish between the few cloud
functions that can be evaluated instantaneously (e.g., sizeDistribution,
relativeVelocity, ...) and those those that cannot (e.g., fluxes,
patchCollisionDensity, ...) and only construct and execute the former
within foamPostProcess. This could be achieved with appropriate
support/funding.

In addition, volFieldValue and surfaceFieldValue have been modified so
that they do not write anything if no fields are available. This also
prevents the overwriting of valid run-time results in some cases.
2024-05-01 11:28:50 +01:00
0b130b5620 engineTime, rotorDisk: Optional angular velocity specification
Angular velocity can be specified either as 'rpm' or 'omega',
consistently with other parts of OpenFOAM.
2024-04-29 22:02:23 +01:00