Commit Graph

893 Commits

Author SHA1 Message Date
a296bcba51 Removed unused template argument from field reuse classes 2020-08-20 16:30:00 +01:00
f274630f4d unwatchedIOdictionary: Removed with associated clutter
IOdictionary is now used instead of unwatchedIOdictionary
2020-08-20 12:45:29 +01:00
85f043040b Time::controlDict: Returned to IOdictionary and removed fileHandler clutter
By registering controlDict as MUST_READ_IF_MODIFIED automatic re-read is handled
in the same manner as any other IOdictionary.
2020-08-20 11:53:36 +01:00
c5c0b900da localIOdictionary: Added missing constructor for surfaceRedistributePar 2020-08-20 10:01:23 +01:00
540e26f996 localIOdictionary: Added constructor needed by foamDictionary 2020-08-20 08:10:05 +01:00
5dd1ab94c3 IOdictionary, localIOdictionary: Further rationalisation 2020-08-20 00:04:25 +01:00
b1f6fa2ff5 Revert "Time::controlDict: Returned to IOdictionary and removed fileHandler clutter"
This reverts commit d071e40348.
2020-08-19 20:00:14 +01:00
d071e40348 Time::controlDict: Returned to IOdictionary and removed fileHandler clutter
By registering controlDict as MUST_READ_IF_MODIFIED automatic re-read is handled
in the same manner as any other IOdictionary.
2020-08-19 19:09:29 +01:00
67e106c42c localIOdictionary: Now derived from IOdictionary to reduce code duplication 2020-08-19 17:14:38 +01:00
82a5e12c06 dictionary: Corrected global function 2020-08-18 17:01:31 +01:00
edc72c2efc dictionary, codeStream: Updated to handle #calc in all global dictionaries 2020-08-18 16:12:12 +01:00
2df733ef99 lagrangian: Corrected reading of constant/clouds in parallel 2020-08-18 11:28:16 +01:00
17c40d2aa5 UList,FixedList: Updated reverse_iterators for STL compliance
Resolves bug-report https://bugs.openfoam.org/view.php?id=3534
2020-08-17 14:04:42 +01:00
51d763685e thermophysicalModels: Removed pressure field from solid thermos
Solid thermo no longer requires a pressure field, so solid regions of
chtMultiRegionFoam cases no longer need a 0/<solidRegionName>/p file.

In order for solidThermo to continue to use heThermo and the low level
thermo classes, it now constructs a uniformGeometricScalarField for the
pressure with the value NaN. This is passed into the low-level thermo
models by heThermo. The enforces the requirement that low-level thermo
models used by solidThermo should have no pressure dependence. If an
instantiation is made with pressure dependence, the code will fail with
a floating point error.
2020-08-07 12:32:20 +01:00
cbad002697 gnuplotGraph: added offset keyword and terminal consistent with gnuplotSetWriter
Resolves bug-report https://bugs.openfoam.org/view.php?id=3527
2020-08-05 12:03:53 +01:00
2f6543b9c6 debug: Registered the debug switches of some classes 2020-08-04 11:26:24 +01:00
5893e29241 debug: Fixed behaviour of -listSwitches argument
There is now only one -listSwitches argument available to the
applications; -listUnsetSwitches and -listRegisteredSwitches have been
removed. -listSwitches prints everything, now also including the values.
It also categorises the output based on whether the switch has a
default, if it has the same value as that default, and whether or not it
is registered with a re-reader.

The list of debug switches in etc/controlDict has been reduced to only
the switches which have non-zero values. In general the list of valid
switches varies per application and per library, so it is not possible
to keep a single definitive list of all switches. The -listSwitches
argument provides the definitive list on a per applicaton basis.

Setting of defaults for named enum optimisation switches has been added.
2020-08-04 09:36:42 +01:00
b8f9ed8062 fvOptions: Changed to be a MeshObject to support automatic update for mesh changes
Now cellSetOption correctly handles the update of the cell set following mesh
topology changes rather than every time any of the fvOption functions are
called for moving meshes.  This is more efficient and consistent with the rest
of OpenFOAM and avoids a lot of unnecessary clutter in the log.
2020-08-02 18:46:20 +01:00
43d66b5e7c lagrangian: Run-time selectable clouds
The standard set of Lagrangian clouds are now selectable at run-time.
This means that a solver that supports Lagrangian modelling can now use
any type of cloud (with some restrictions). Previously, solvers were
hard-coded to use specific cloud modelling. In addition, a cloud-list
structure has been added so that solvers may select multiple clouds,
rather than just one.

The new system is controlled as follows:

- If only a single cloud is required, then the settings for the
  Lagrangian modelling should be placed in a constant/cloudProperties
  file.

- If multiple clouds are required, then a constant/clouds file should be
  created containing a list of cloud names defined by the user. Each
  named cloud then reads settings from a corresponding
  constant/<cloudName>Properties file. Clouds are evolved sequentially
  in the order in which they are listed in the constant/clouds file.

- If no clouds are required, then the constant/cloudProperties file and
  constant/clouds file should be omitted.

The constant/cloudProperties or constant/<cloudName>Properties files are
the same as previous cloud properties files; e.g.,
constant/kinematicCloudProperties or constant/reactingCloud1Properties,
except that they now also require an additional top-level "type" entry
to select which type of cloud is to be used. The available options for
this entry are:

    type    cloud;                   // A basic cloud of solid
                                     // particles. Includes forces,
                                     // patch interaction, injection,
                                     // dispersion and stochastic
                                     // collisions. Same as the cloud
                                     // previously used by
                                     // rhoParticleFoam
                                     // (uncoupledKinematicParticleFoam)

    type    collidingCloud;          // As "cloud" but with resolved
                                     // collision modelling. Same as the
                                     // cloud previously used by DPMFoam
                                     // and particleFoam
                                     // (icoUncoupledKinematicParticleFoam)

    type    MPPICCloud;              // As "cloud" but with MPPIC
                                     // collision modelling. Same as the
                                     // cloud previously used by
                                     // MPPICFoam.

    type    thermoCloud;             // As "cloud" but with
                                     // thermodynamic modelling and heat
                                     // transfer with the carrier phase.
                                     // Same as the limestone cloud
                                     // previously used by
                                     // coalChemistryFoam.

    type    reactingCloud;           // As "thermoCloud" but with phase
                                     // change and mass transfer
                                     // coupling with the carrier
                                     // phase. Same as the cloud
                                     // previously used in fireFoam.

    type    reactingMultiphaseCloud; // As "reactingCloud" but with
                                     // particles that contain multiple
                                     // phases. Same as the clouds
                                     // previously used in
                                     // reactingParcelFoam and
                                     // simpleReactingParcelFoam and the
                                     // coal cloud used in
                                     // coalChemistryFoam.

    type    sprayCloud;              // As "reactingCloud" but with
                                     // additional spray-specific
                                     // collision and breakup modelling.
                                     // Same as the cloud previously
                                     // used in sprayFoam and
                                     // engineFoam.

The first three clouds are not thermally coupled, so are available in
all Lagrangian solvers. The last four are thermally coupled and require
access to the carrier thermodynamic model, so are only available in
compressible Lagrangian solvers.

This change has reduced the number of solvers necessary to provide the
same functionality; solvers that previously differed only in their
Lagrangian modelling can now be combined. The Lagrangian solvers have
therefore been consolidated with consistent naming as follows.

    denseParticleFoam: Replaces DPMFoam and MPPICFoam

    reactingParticleFoam: Replaces sprayFoam and coalChemistryFoam

    simpleReactingParticleFoam: Replaces simpleReactingParcelFoam

    buoyantReactingParticleFoam: Replaces reactingParcelFoam

fireFoam and engineFoam remain, although fireFoam is likely to be merged
into buoyantReactingParticleFoam in the future once the additional
functionality it provides is generalised.

Some additional minor functionality has also been added to certain
solvers:

- denseParticleFoam has a "cloudForceSplit" control which can be set in
  system/fvOptions.PIMPLE. This provides three methods for handling the
  cloud momentum coupling, each of which have different trade-off-s
  regarding numerical artefacts in the velocity field. See
  denseParticleFoam.C for more information, and also bug report #3385.

- reactingParticleFoam and buoyantReactingParticleFoam now support
  moving mesh in order to permit sharing parts of their implementation
  with engineFoam.
2020-07-31 09:35:12 +01:00
165bcee48b PackedList: Added documentation 2020-07-31 09:28:29 +01:00
ccae22cbc5 PackedList: Added default constructor to avoid warning from clang 2020-07-31 09:25:38 +01:00
e0e448a8bb slicedFvPatchField, slicedFvsPatchField: Removed from New selection tables
Sliced Fv? patch fields are explicitly constructed and lookup from the
fv?PatchField constructor tables is not necessary or appropriate
2020-07-29 21:51:59 +01:00
4b6d0aefc3 plane: Made the sub-dictionary optional
This means a plane can now be specified like this:

    planeType   pointAndNormal;
    point       (0 0 0);
    normal      (0 0 1);

As well as this:

    planeType   pointAndNormal;
    pointAndNormalDict
    {
        point       (0 0 0);
        normal      (0 0 1);
    }
2020-07-24 12:12:19 +01:00
b2c402365e fvMatrix: Added division by scalar and scalar fields scaling operations 2020-07-24 12:02:10 +01:00
6c8732df5b dictionary: Set the default scoping syntax to 'slash'
The new optional 'slash' scoping syntax is now the default and provides a more
intuitive and flexible syntax than the previous 'dot' syntax, corresponding to
the common directory/file access syntax used in UNIX, providing support for
reading entries from other dictionary files.

In the 'slash' syntax
    '/' is the scope operator
    '../' is the parent dictionary scope operator
    '!' is the top-level dictionary scope operator

Examples:

    internalField 3.4;

    active
    {
        type            fixedValue;
        value.air       $internalField;
    }

    inactive
    {
        type            anotherFixedValue;

        value           $../active/value.air;
        anotherValue    $!active/value.air;

        sub
        {
            value           $../../active/value.air;
            anotherValue    $!active/value.air;
        }
    }

    "U.*"
    {
        solver GAMG;
    }

    e.air
    {
        $U.air;
    }

    external
    {
        value $testSlashDict2!active/value.air;
    }

    active2
    {
        $testSlashDict2!active;
    }

If there is a part of the keyword before the '!' then this is taken to be the
file name of the dictionary from which the entry will be looked-up using the
part of the keyword after the '!'.  For example given a file testSlashDict containing

    internalField 5.6;

    active
    {
        type            fixedValue;
        value.air       $internalField;
    }

entries from it can be read directly from another file, e.g.

    external
    {
        value $testSlashDict2!active/value.air;
    }

    active2
    {
        $testSlashDict2!active;
    }

    which expands to

    external
    {
        value           5.6;
    }

    active2
    {
        type            fixedValue;
        value.air       5.6;
    }

These examples are provided in applications/test/dictionary.

The the default syntax can be changed from 'slash' to 'dot' in etc/controlDict
to revert to the previous behaviour:

OptimisationSwitches
{
.
.
.
    // Default dictionary scoping syntax
    inputSyntax slash;  // Change to dot for previous behaviour
}

or within a specific dictionary by adding the entry

See applications/test/dictionary/testDotDict.
2020-07-23 20:36:51 +01:00
efd50eae81 dictionary::functionEntries::calcEntry: Change code dictionary construction so variable lookup works as expected
For example

    thermo:rho.air1
    {
        explicit 3e-07;
        implicit 0;
    }

    f1.air1.bubbles
    {
        value       3.5;
        explicit    #calc "$value*$../thermo:rho.air1/explicit";
        implicit    0;
    }

now works, whereas previously an extra level of '../' was required:

        explicit    #calc "$value*$../../thermo:rho.air1/explicit";

because #calc created its own sub-dictionary.  The '$value' would have also
needed a '../' except that the 'value' entry is in the direct parent and could
be looked-up automatically by the parent search.
2020-07-18 13:24:46 +01:00
51af92baae stringOps: Updated handling of environment variable lookup 2020-07-17 18:00:39 +01:00
e1c41275ac stringOps: Added support for the dictionary "slash" variable scope syntax 2020-07-17 11:12:55 +01:00
e8a2c4570b surfaceFeatures: Prevent floating point error when edge is parallel to plane 2020-07-01 14:33:41 +01:00
3b2230d6c7 ILList: Added explicit call to base constructor
Prevents a compiler warning when using the "transfer" method
2020-06-12 16:29:53 +01:00
f2ad07bd12 face: Created static versions of area and centre methods
This lets you run the calculations with any list of points defining a
face, without having to allocate an identity face.
2020-06-09 11:58:08 +01:00
44cf9977c3 Use the new primitive mesh magFaceAreas where appropriate 2020-06-03 17:11:56 +01:00
19d4f192f9 primitiveMesh: Added magFaceAreas
fvMesh: magSf() now returns the sliced primitiveMesh::magFaceAreas
2020-05-14 17:06:53 +01:00
4561d9f813 HashSet: Added construction from std::initializer_list 2020-05-09 14:39:31 +01:00
a4fb8c6460 functionObject.H: Corrected documentation of the end() member function
Resolves bug-report https://bugs.openfoam.org/view.php?id=3487
2020-04-22 10:10:18 +01:00
de66b1be68 MomentumTransportModels: Update of the TurbulenceModels library for all flow types
providing the shear-stress term in the momentum equation for incompressible and
compressible Newtonian, non-Newtonian and visco-elastic laminar flow as well as
Reynolds averaged and large-eddy simulation of turbulent flow.

The general deviatoric shear-stress term provided by the MomentumTransportModels
library is named divDevTau for compressible flow and divDevSigma (sigma =
tau/rho) for incompressible flow, the spherical part of the shear-stress is
assumed to be either included in the pressure or handled separately.  The
corresponding stress function sigma is also provided which in the case of
Reynolds stress closure returns the effective Reynolds stress (including the
laminar contribution) or for other Reynolds averaged or large-eddy turbulence
closures returns the modelled Reynolds stress or sub-grid stress respectively.
For visco-elastic flow the sigma function returns the effective total stress
including the visco-elastic and Newtonian contributions.

For thermal flow the heat-flux generated by thermal diffusion is now handled by
the separate ThermophysicalTransportModels library allowing independent run-time
selection of the heat-flux model.

During the development of the MomentumTransportModels library significant effort
has been put into rationalising the components and supporting libraries,
removing redundant code, updating names to provide a more logical, consistent
and extensible interface and aid further development and maintenance.  All
solvers and tutorials have been updated correspondingly and backward
compatibility of the input dictionaries provided.

Henry G. Weller
CFD Direct Ltd.
2020-04-14 20:44:22 +01:00
b9c7428619 functionObjectList::wordAndDictionary: Added null constructor for pre-7 gcc versions
Resolves bug-report https://bugs.openfoam.org/view.php?id=3479
2020-04-10 16:08:04 +01:00
3a83ac7b85 functionObjectList: Removed unused sub-class 2020-04-08 11:04:26 +01:00
81188fefaa functionObjectList: Improved flexibility of field argument parsing
Additional flexibility for handling of field arguments has been extended
to dictionary lists of field settings, as well as word lists of field
names. This means that the following syntax is now supported:

    postProcess -func "fieldAverage(p, U { prime2Mean on; }, T)"

    postProcess -func "fieldAverage(fields=(p U { prime2Mean on; } T))"
2020-04-08 09:03:23 +01:00
ad12d3a8c1 functionObjectList: Improved flexibility of field argument parsing
Function object argument parsing now takes all "field", "fields" and
"objects" arguments and combines them into a single list of
fields/objects that the function should operate on. This means that the
following postProcess executions are now all equivalent and function as
expected:

    postProcess -func "
        flowRatePatch
        (
            name=outlet,
            phi,
            alphaRhoPhi.air,
            alphaRhoPhi.particles
        )"

    postProcess -func "
        flowRatePatch
        (
            name=outlet,
            fields=(phi alphaRhoPhi.air alphaRhoPhi.particles)
        )"

    postProcess -func "
        flowRatePatch
        (
            name=outlet,
            objects=(phi),
            alphaRhoPhi.air,
            field=alphaRhoPhi.particles
        )"

As are the following:

    postProcess -func "mag(U.air)"

    postProcess -func "mag(field=U.air)"
2020-04-07 17:02:27 +01:00
7db506b527 ops: Added not-equal operations 2020-03-26 09:43:41 +00:00
8a1017cb15 ISstream::readDelimited: Changed to dynamic buffering
to read an arbitrary length string so that any number of lines can be read.
2020-03-19 16:45:11 +00:00
28b2f4cd8e string: Added construction from UList<char> 2020-03-19 16:44:28 +00:00
d105124afc Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-03-13 23:15:25 +00:00
7dc08ed86a dictionary::functionEntry: Simplified the handling of multi-line argument lists
The \ continuation line marker is no longer required, multi-line argument lists
are parsed naturally by searching for the end ), e.g. in

tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/titaniaSynthesis/system/controlDict

    #includeFunc writeObjects                         \
    (                                                 \
        d.particles,                                  \
        phaseTransfer:dmidtf.TiO2.particlesAndVapor   \
    )

is now written in the simpler form:

    #includeFunc writeObjects
    (
        d.particles,
        phaseTransfer:dmidtf.TiO2.particlesAndVapor
    )
2020-03-13 23:12:32 +00:00
3284153e77 cyclicTransform: Corrected length scale check for closed patches 2020-03-13 09:05:03 +00:00
b78df458e3 functionObjectList: Add support for additional field attributes in the fields argument to #includeFunc
e.g.

    #includeFunc fieldAverage(fields = (U.air {prime2Mean yes;} U.water {prime2Mean yes;}))
2020-03-12 14:02:19 +00:00
220507b4f5 UListIO: Ensure that the type of the list is provided for non-uniform field entries
even if there are no elements in the list.

Resolves bug report https://bugs.openfoam.org/view.php?id=3466
2020-03-11 23:20:54 +00:00
0de581e907 transform: Make rotationTensor generate 180 degree rotations, rather than reflections 2020-03-10 09:45:49 +00:00
8c8ecafc26 primitiveMesh: Corrected formatting 2020-03-03 09:09:34 +00:00