Commit Graph

4635 Commits

Author SHA1 Message Date
08e686eb18 TurbulenceModels: Refactored to transfer all heat and specie transport to the new ThermophysicalTransportModels library
This provides an extensible and run-time selectable framework to support complex
energy and specie transport models, in particular multi-component diffusion.
Currently only the Fourier for laminar and eddyDiffusivity for RAS and LES
turbulent flows are provided but the interface is general and the set of models
will be expanded in the near future.
2020-04-12 10:35:52 +01:00
0207f85191 fvOptions/.../semiImplicitSource: Construct functions on read 2020-04-11 11:43:30 +01:00
413429e214 tutorials/.../DTCHull: Changed the atmospheric boundary condition to prghEntrainmentPressure
This has removed all the noise/checkerboarding from the vicinity of the
atmospheric boundary.
2020-04-11 11:43:30 +01:00
25b34809c7 ThermophysicalTransportModels: New library to handle the transport of energy and species
The simplistic energy transport support in compressibleTurbulenceModels has been
abstracted and separated into the new ThermophysicalTransportModels library in
order to provide a more general interface to support complex energy and specie
transport models, in particular multi-component diffusion.  Currently only the
Fourier for laminar and eddyDiffusivity for RAS and LES turbulent flows are
provided but the interface is general and the set of models will be expanded in
the near future.

The ThermalDiffusivity and EddyDiffusivity modelling layers remain in
compressibleTurbulenceModels but will be removed shortly and the alphat boundary
conditions will be moved to ThermophysicalTransportModels.
2020-04-10 18:18:51 +01:00
7f5144312e Renamed turbulenceProperties -> momentumTransport
Following the generalisation of the TurbulenceModels library to support
non-Newtonian laminar flow including visco-elasticity and extensible to other
form of non-Newtonian behaviour the name TurbulenceModels is misleading and does
not properly represent how general the OpenFOAM solvers now are.  The
TurbulenceModels now provides an interface to momentum transport modelling in
general and the plan is to rename it MomentumTransportModels and in preparation
for this the turbulenceProperties dictionary has been renamed momentumTransport
to properly reflect its new more general purpose.

The old turbulenceProperties name is supported for backward-compatibility.
2020-04-10 17:17:37 +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
876845d0f4 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-04-10 09:30:12 +01:00
53ac3f223a reactingEulerFoam::phaseCompressibleTurbulenceModels: Added missing clone functions
Patch contributed by Timo Niemi, VTT.
Resolves bug-report https://bugs.openfoam.org/view.php?id=3478
2020-04-10 09:28:57 +01:00
3f13de8369 Corrected typos
Patch contributed by Timo Niemi, VTT.
2020-04-10 09:26:54 +01:00
ce0cd2fdbd fanPressure, fanPressureJump: Improvements to implementation consistency 2020-04-08 14:38:56 +01:00
6c887be284 Added entrainmentPressure and prghEntrainmentPressure conditions
These provide pressure boundary conditions suitable for use on
boundaries where the flow may reverse or on which the inlet or outlet
state is not known or well defined. The condition takes the following
form:

    p = p0 + 0.5*Un*mag(Un)

In the case of exactly normal inlet velocity, this condition sets the
same pressure as the totalPressure condition. The pressure that is set
increases with increasing outlet velocity and decreases with increasing
inlet velocity. This makes it self-limiting and extremely stable in a
number of configurations which were not easily simulated previously. The
condition also does varies smoothly as the flux reverses, which also
aids stability.

The controls of this boundary condition are exactly the same as for the
totalPressure condition. Note, however, that "p0" is not necessarily the
total pressure any more. It is, in general, a reference pressure.

An example usage is as follows:

    sides
    {
        type    entrainmentPressure;
        p0      100;
    }
2020-04-08 14:31:59 +01:00
2606e4931e Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-04-08 11:46:57 +01:00
3bd86e85e5 TurbulenceModels: Removed the redundant propertiesName constructor and selector argument 2020-04-08 11:46:24 +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
b6f91de72c semiImplicitSource: Made operable on multiple different types
The scalarSemiImplicitSource, vectorSemiImplicitSource, etc...,
fvOptions have been replaced by a single semiImplicitSource fvOption.
This allows sources to be specified for multiple fields regardless of
type. For example:

    massSource
    {
        type            semiImplicitSource;

        timeStart       1;
        duration        500;

        selectionMode   points;
        points
        (
            (0.075 0.2 0.05)
        );

        volumeMode      absolute;

        sources
        {
            thermo:rho.steam
            {
                explicit    1.0e-3; // kg/s
                implicit    0;
            }

            U.steam
            {
                explicit    (0 1e-1 0); // kg*m/s^2
                implicit    0;
            }

            h.steam
            {
                explicit    3700; // kg*m^2/s^3
                implicit    0;
            }
        }
    }
2020-04-07 17:02:27 +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
b7b678bceb tutorials: Updated the momentum transport model type selection
renaming the legacy keywords
    RASModel -> model
    LESModel -> model
    laminarModel -> model

which is simpler and clear within the context in which they are specified, e.g.

RAS
{
    model               kOmegaSST;
    turbulence          on;
    printCoeffs         on;
}

rather than

RAS
{
    RASModel            kOmegaSST;
    turbulence          on;
    printCoeffs         on;
}

The old keywords are supported for backward compatibility.
2020-04-07 13:11:50 +01:00
d98c83e62b TurbulenceModels: Removed the redundant propertiesName constructor and selector argument
The ability to specify the file name of the turbulenceProperties dictionary
during construction was added to support multi-phases but now that the handling
of the phase name extension has been completely rationalised and standardised
this complexity and code clutter is no longer used, needed or appropriate.
2020-04-07 11:07:31 +01:00
57e685b8de reaction::thirdBodyEfficiencies: Improved the error message
from a mismatch in the numbers of efficiencies and species, providing the
context including the reaction name and line in the dictionary file.
20200405
2020-04-03 13:39:18 +01:00
2ff102c5aa Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-04-03 13:36:16 +01:00
0bcbc8c282 reaction::thirdBodyEfficiencies: Corrected the error message
from a mismatch in the numbers of efficiencies and species.
2020-04-03 13:35:06 +01:00
1414f02299 etc/config.csh/paraview: Corrected setenv syntax 2020-04-02 09:52:27 +01:00
95b5ef4458 fvOptions::SemiImplicitSource: Added support for Function1 specifications of the explicit and implicit sources
This significant improvement is flexibility of SemiImplicitSource required a
generalisation of the source specification syntax and all tutorials have been
updated accordingly.

Description
    Semi-implicit source, described using an input dictionary.  The injection
    rate coefficients are specified as pairs of Su-Sp coefficients, i.e.

        \f[
            S(x) = S_u + S_p x
        \f]

    where
    \vartable
        S(x)    | net source for field 'x'
        S_u     | explicit source contribution
        S_p     | linearised implicit contribution
    \endvartable

    Example tabulated heat source specification for internal energy:
    \verbatim
    volumeMode      absolute; // specific
    sources
    {
        e
        {
            explicit table ((0 0) (1.5 $power));
            implicit 0;
        }
    }
    \endverbatim

    Example coded heat source specification for enthalpy:
    \verbatim
    volumeMode      absolute; // specific
    sources
    {
        h
        {
            explicit
            {
                type coded;
                name heatInjection;
                code
                #{
                    // Power amplitude
                    const scalar powerAmplitude = 1000;

                    // x is the current time
                    return mag(powerAmplitude*sin(x));
                #};
            }
            implicit 0;
        }
    }
    \endverbatim
2020-04-01 18:53:09 +01:00
c1587d5fc6 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-04-01 17:04:28 +01:00
4867477252 radiationModels::P1: Ensure qr is read if present for post-processing
Resolves bug-report https://bugs.openfoam.org/view.php?id=3473
2020-04-01 17:03:16 +01:00
04d5e6a72a setToCellZone, setToFaceZone, setToPointZone: More flexible and consistent input
All of these sets will now take either "set" as the input entry, or
"cellSet"/"faceSet"/"pointSet" as appropriate. Previously cell and point
only accepted the "set" keyword whilst face only took "faceSet".
2020-03-31 12:08:39 +01:00
a3c8fc80e6 pre-commit-hook, pre-recieve-hook: Corrected HookFunctions source path 2020-03-31 09:09:10 +01:00
14e7dbdd76 topoSet: Added planeToFaceZone
This is a topoSetSource which selects faces based on the adjacent cell
centres spanning a given plane. The plane is defined by a point and
normal vector.

Additionally, an include entry can be specified. When omitted or set to
"all", then all faces that meet the criteria are included in the set. When
set to "closest", just the faces that belong to the closest contiguous
region to the plane point are included. This latter setting is useful when
defining face zones through channels on which the flow rate is to be
computed, as it keeps the set local to a single channel.

An example usage (in system/topoSetDict) is as follows:

    actions
    (
        {
            name    f0;
            type    faceZoneSet;
            action  new;
            source  planeToFaceZone;
            sourceInfo
            {
                point   (0 0 4);
                normal  (1 0 0.2);
                include closest;
            }
        }
    );

This would then allow the flow rate through the created face zone to be
accurately reported by the following command:

    postProcess -func "flowRateFaceZone(name=f0,field=phi)"
2020-03-26 20:51:59 +00:00
7db506b527 ops: Added not-equal operations 2020-03-26 09:43:41 +00:00
4be01b4e70 meshToMesh0::cellAddressing slight speed up for some geometries
Based on patch contributed by Kevin Nordin-Bates
Resolves patch request https://bugs.openfoam.org/view.php?id=3458
2020-03-24 16:45:48 +00:00
8a1017cb15 ISstream::readDelimited: Changed to dynamic buffering
to read an arbitrary length string so that any number of lines can be read.
20200322
2020-03-19 16:45:11 +00:00
28b2f4cd8e string: Added construction from UList<char> 2020-03-19 16:44:28 +00:00
4c08b463fd snappyHexMesh::shellSurfaces: Added support for span refinement based on internal or external "closeness"
The closeness option in surfaceFeatures set in surfaceFeaturesDict, e.g.

    closeness
    {
        // Output the closeness of surface points to other surface elements.
        pointCloseness          yes;
    }

calculates and writes both the internal and external surface "closeness"
measures either of which could be used to set the span refinement in
snappyHexMesh depending on which side of the surface is being meshed which is
specified with either refinement mode "insideSpan" or "externalSpan", e.g. in
the tutorials/mesh/snappyHexMesh/pipe case the inside of the pipe is meshed and
refined based on the internal span using the following specification:

    refinementRegions
    {
        pipeWall
        {
            mode insideSpan;
            levels ((1000 2));
            cellsAcrossSpan 40;
        }
    }
2020-03-18 18:06:55 +00:00
42e0dc05c0 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-03-17 20:19:48 +00:00
0177c7dd59 functionObjects::fieldAverage: Simplified the controls
Rather than specifying the controls per field it is simpler to use a single set
of controls for all the fields in the list and use separate instances of the
fieldAverage functionObject for different control sets:

    Example of function object specification setting all the optional parameters:
    fieldAverage1
    {
        type                fieldAverage;
        libs                ("libfieldFunctionObjects.so");

        writeControl        writeTime;

        restartOnRestart    false;
        restartOnOutput     false;
        periodicRestart     false;
        restartPeriod       0.002;

        base                time;
        window              10.0;
        windowName          w1;

        mean                yes;
        prime2Mean          yes;

        fields              (U p);
    }

This allows for a simple specification with the optional prime2Mean entry using

    #includeFunc fieldAverage(U, p, prime2Mean = yes)

or if the prime2Mean is not needed just

    #includeFunc fieldAverage(U, p)
2020-03-17 20:15:17 +00:00
eb73f38176 reacting*EulerFoam/.../ThermalPhaseChangePhaseSystem: Corrected heat transfer in n-phase simulations
Corrected the use of the lagged thermal phase change dmdt in interfacial
heat transfer calculations of n-phase simulations

Patch contributed by Juho Peltola, VTT.
2020-03-17 08:41:36 +00:00
54b38778f1 reacting*EulerFoam/.../MultiComponentPhaseModel: Fix to species fraction clipping
Made consistent with reactingFoam

Patch contributed by Timo Niemi, VTT.
2020-03-17 08:31:05 +00:00
fbe98c6e84 surfaceFeatures: Added optional input of maximum angle between opposite points considered close
To handle the additional optional specification for the closeness calculation
these settings are now is a sub-dictionary of surfaceFeaturesDict, e.g.

    closeness
    {
        // Output the closeness of surface elements to other surface elements.
        faceCloseness           no;

        // Output the closeness of surface points to other surface elements.
        pointCloseness          yes;

        // Optional maximum angle between opposite points considered close
        internalAngleTolerance  80;
        externalAngleTolerance  80;
    }
2020-03-16 19:29:28 +00:00
99982d0358 turbulenceModels/laminar/PTT: New implementation of the PTT viscoelastic model for polymer flows
Description
    PTT model for viscoelasticity using the upper-convected time
    derivative of the stress tensor with support for multiple modes.

    Reference:
    \verbatim
        Thien, N. P., & Tanner, R. I. (1977).
        A new constitutive equation derived from network theory.
        Journal of Non-Newtonian Fluid Mechanics, 2(4), 353-365.
    \endverbatim

Currently the common exponential form of the PTT model is provided but it could
easily be extended to also support the linear and quadratic forms if the need
arises.
20200316
2020-03-15 22:37:54 +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
c60cef9027 etc/caseDicts/postProcessing/fields/fieldAverage: New functionObject configuration file for field averaging
to support the more convenient #includeFunc specification in both

    #includeFunc fieldAverage(U.air, U.water, alpha.air, p)

and

    #includeFunc fieldAverage(fields = (U.air, U.water, alpha.air, p))

forms.
2020-03-12 10:11:36 +00:00
57f924feef turbulenceModels/laminar::Maxwell: Updated handling of single mode
A single mode may now be specified either with the 'modes' list containing a
single entry:

        // Example 1-mode specification
        modes
        (
            {
                lambda          0.01;
            }
        );

or by specifying the 'lambda' entry without 'modes'

        // Single mode coefficient
        lambda          0.03;

If both are provided the 'modes' entry will be used and a warning about the
unused 'lambda' entry printed.
2020-03-12 08:21:12 +00:00
a7eb350536 turbulenceModels/laminar: Maxwell, Giesekus: Added multi-mode support
By specifying a list of coefficients in turbulenceProperties, e.g. for the
generalised Maxwell model:

        modes
        (
            {
                lambda          0.01;
            }

            {
                lambda          0.04;
            }
        );

of for the generalised Giesekus model:

        modes
        (
            {
                lambda          0.01;
                alphaG          0.05;
            }

            {
                lambda          0.04;
                alphaG          0.2;
            }
        );

Visco-elasticity stress tensors (sigma0, sigma1...) are solved for each mode and
summed to create the effective stress of the complex fluid:

Any number of modes can be specified and if only one mode is required the
'modes' entry is not read and the coefficients are obtained as before.

The mode sigma? fields are read if present otherwise are constructed and
initialised from the sigma field but all of the mode sigma? fields are written
for restart and the sigma field contains the sum.

    References:
        http://en.wikipedia.org/wiki/Generalized_Maxwell_model

        Wiechert, E. (1889). Ueber elastische Nachwirkung.
        (Doctoral dissertation, Hartungsche buchdr.).

        Wiechert, E. (1893).
        Gesetze der elastischen Nachwirkung für constante Temperatur.
        Annalen der Physik, 286(11), 546-570.
2020-03-11 23:24:08 +00:00
262a3366f9 rhoCentralFoam: Updated BCs to support mesh refinement and unrefinement 2020-03-11 23:23:29 +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
ab88bc3ee2 reactingEulerFoam::alphatWallBoilingWallFunctionFvPatchScalarField: Corrected constructor for clang 2020-03-10 15:21:37 +00:00