Commit Graph

4455 Commits

Author SHA1 Message Date
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
0de581e907 transform: Make rotationTensor generate 180 degree rotations, rather than reflections 2020-03-10 09:45:49 +00:00
3659fb478b tutorials/lagrangian/reactingParcelFoam: Corrected momentum exchange consistent with the film laminar model 2020-03-06 17:57:12 +00:00
46c790dd09 functionObjects::fieldAverage: Simplified the interface by the introduction of defaults
The mean, prime2Mean and base now have default values:

    {
        mean            on;   // (default = on)
        prime2Mean      on;   // (default = off)
        base            time; // time or iteration (default = time)
        window          200;  // optional averaging window
        windowName      w1;   // optional window name (default = "")
    }

so for the majority of cases for which these defaults are appropriate the
fieldAverage functionObject can now be specified in the functions entry in
controlDict thus:

functions
{
    fieldAverage1
    {
        #includeEtc "caseDicts/postProcessing/fields/fieldAverage.cfg"

        fields
        (
            U.air
            U.water
            alpha.air
            p
        );
    }
}

also utilising the new fieldAverage.cfg file.

For cases in which these defaults are not appropriate, e.g. the prime2Mean is
also required the optional entries can be specified within sub-dictionaries for
each field, e.g.

    fieldAverage1
    {
        #includeEtc "caseDicts/postProcessing/fields/fieldAverage.cfg"

        fields
        (
            U
            {
                prime2Mean  yes;
            }

            p
            {
                prime2Mean  yes;
            }
        );
    }
2020-03-06 15:51:49 +00:00
66397001c2 regionModels::kinematicSingleLayer: Rationalised and simplified the handling of the film surface and wall velocities 2020-03-06 15:49:59 +00:00
7c32fe8c8e rhoPimpleFoam, rhoSimpleFoam, buoyantPimpleFoam, buoyantSimpleFoam: Consistency improvements
Various small changes to make comparison between pimple and simple
variants of the single-phase compressible solvers easier
2020-03-05 19:29:49 +00:00
27ab3edc5e buoyantPimpleFoam, chtMultiRegionFoam, rhoReactingBuoyantFoam: Share pEqn.H 2020-03-05 18:08:45 +00:00
f933861c48 pressureControl: Added support for p_rgh
Updated buoyantPimpleFoam to use pressureControl with p_rgh support.
2020-03-05 12:14:58 +00:00
a2f4320c0a reactingEulerFoam::reactingEulerFoam: Copy the limiter field if not a temporary
Ensures correct operation in case a derived limiter function return a
non-temporary field.
2020-03-05 11:10:45 +00:00
da0ecefad5 meshWavePatchDistMethod: Corrected y coupled BCs for interpolation 2020-03-05 09:26:16 +00:00
3068d9701e reactingEulerFoam::wallDampingModel: Corrected dampingf() function to include zeroInNearWallCells option 2020-03-05 09:24:37 +00:00
8dadb0a11f rhoReactionThermo: Added instantiations 2020-03-04 17:37:59 +00:00
b5363ca324 rhoPimpleFoam, rhoSimpleFoam, reactingFoam: Combined pEqn.H and pcEqn.H to reduce duplication 2020-03-04 17:24:56 +00:00
97cda40634 rhoPimpleFoam: Operate in SIMPLE mode
rhoPimpleFoam now produces identical results to rhoSimpleFoam when run
with a steady-state time-scheme. The intention is that this solver can
now be used as a reference when adding steady-state support to other
compressible solvers for which no SIMPLE variant exists.

rhoReactingFoam has also been updated to support SIMPLE operation, as it
shares a pressure equation with rhoPimpleFoam.
2020-03-04 15:31:06 +00:00
9a71022d93 reacting*EulerFoam/.../populationBalanceModel: Corrected mass-transfer source terms
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2020-03-04 14:40:02 +00:00
8c8ecafc26 primitiveMesh: Corrected formatting 2020-03-03 09:09:34 +00:00
d513d8dc85 SubField: Added assignment to Type 2020-03-03 09:09:16 +00:00
d98efdbcb3 SlicedGeometricField: Include empty patches in the splice function
for consistency with slicing.
2020-03-03 09:07:15 +00:00
779ed4de1f reactingEulerFoam::alphatPhaseChangeWallFunctionFvPatchScalarField: Corrected restart reading of dmdtLf 2020-03-02 15:57:28 +00:00
58f3ed7276 patchToPatchInterpolation: Updated typedef to correspond to new definition of PrimitivePatch
Resolves bug-report https://bugs.openfoam.org/view.php?id=3463
20200301
2020-02-29 15:12:31 +00:00
46d54df9a3 SlicedGeometricField: Added splice member function
to splice the SlicedGeometricField into a complete contiguous Field.
e.g. to splice the flux field phi:

    scalarField completePhi
    (
        slicedSurfaceScalarField
        (
            IOobject
            (
                "slicedPhi",
                runTime.timeName(),
                mesh
            ),
            phi,
            false
        ).splice()
    );
2020-02-29 10:07:53 +00:00
50814f8d89 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-02-28 17:11:21 +00:00
2ee5c7de12 buoyantPimpleFoam: Added topology change support to ddtCorr 2020-02-28 17:10:54 +00:00
d23a8a62b1 alphatWallBoilingWallFunction: Check if saturationModel is found
ThermalPhaseChangePhaseSystem enables phase change for phase pairs that
have saturationModels. This change makes alphatWallBoilingWallFunction
work in the same way; i.e., it disables evalulation of the wall boiling
models if a saturation model is not found.

Patch contributed by Juho Peltola, VTT.
2020-02-28 17:08:56 +00:00
e10a214c6b buoyantPimpleFoam: Added correction of rhoUf and dpdt for moving meshes 2020-02-28 17:06:24 +00:00
8173999d10 buoyantPimpleFoam: Updated header description 2020-02-28 17:01:18 +00:00
fc8a57ea9a Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-02-28 16:53:21 +00:00
38fff77d35 buoyantPimpleFoam: Added moving and changing mesh capability 2020-02-28 16:52:49 +00:00
cbdd4077c7 tutorials/.../angledDuct: Swictched to bounded schemes
This change greatly reduces the transients generated at the start of the
iteration sequence.
2020-02-28 12:07:56 +00:00
88405e4c94 thermoPhysicalModels/.../hConstThermo, eConstThermo: Added reference state
The hRefConst and eRefConst thermos that were local to
reacting*EulerFoam have been removed and the reference state that they
used has been incorporated into the standard hConst and eConst thermos.

The hConst thermo model now evaluates the enthalpy like so:

    Ha = Hf + Hs
       = Hf + Cp*(T - Tref) + Hsref (+ equation of state terms)

Where Ha is absolute enthalpy, Hs is sensible enthalpy, Cp is specific
heat at constant pressure, T is temperature, Tref is a reference
temperature and Hsref is a reference sensible enthalpy. Hf, Cp, Tref and
Hsref are user inputs. Of these, Tref and Hsref are new. An example
specification is as follows:

    thermodynamics
    {
        Hf          -1.34229e+07;
        Cp          2078.4;
        Tref        372.76;
        Hsref       128652;
    }

The ref quantities allows the user to specify a state around which to
linearise the relationship between temperature and enthalpy. This is
useful if the temperature range of the simulation is small enough to
consider the relationship linear, but linearity does not hold all the
way to standard conditions.

To maintain backwards compatibility, Tref defaults to standard
temperature, and Hsref defaults to zero, so a case using hConst thermo
requires no modification as a result of this change.

The only change to the default operation is that to calculate sensible
enthalpy Cp is multiplied by the difference between the current
temperature and the standard temperature, whether as previously Cp was
multiplied by the current temperature only. This means that at standard
conditions sensible enthalpy is now zero, and absolute enthalpy equals
the formation enthalpy. This is more consistent with the definitions of
the various enthalpies, and with other thermo models such as janaf. This
change should only affect reacting cases that use constant thermo
models.
2020-02-28 12:07:56 +00:00
6061ed363f Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-02-27 16:19:34 +00:00