Commit Graph

214 Commits

Author SHA1 Message Date
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
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
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
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.
2020-03-15 22:37:54 +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
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
bda904ca95 Corrected the name of tutorials/incompressible/boundaryFoam/boundaryNonNewtonian 2020-02-18 13:57:11 +00:00
1875257198 tutorials/incompressible/boundaryFoam/boundaryNonNewonian: New tutorial to demonstrate non-Netwonian flow capability in boundaryFoam 2020-02-16 00:17:46 +00:00
7282c0575d tutorials/incompressible/pisoFoam/LES/pitzDailyMapped: Reverted blockMeshDict 2020-01-31 23:48:09 +00:00
0dd2e97bd8 CodedFunction1: New Function1 which uses codeStream to dynamically compile the value function code
For example in the new tutorial case:
tutorials/incompressible/pimpleFoam/laminar/pitzDailyPulse
a cosine bell velocity pulse is specified at the inlet by directly defining the
code for it:

    inlet
    {
        type            uniformFixedValue;
        uniformValue    coded;

        name            pulse;

        codeInclude
        #{
            #include "mathematicalConstants.H"
        #};

        code
        #{
            return vector
            (
                0.5*(1 - cos(constant::mathematical::twoPi*min(x/0.3, 1))),
                0,
                0
            );
        #};
    }

which is then compiled automatically and linked into the running pimpleFoam
dynamically and executed to set the inlet velocity.
2020-01-31 23:39:59 +00:00
b55bc28698 sampledSurface::writers: Added writeFormat option to select ascii or binary
e.g. in tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/cuttingPlane

    surfaceFormat   vtk;
    writeFormat     binary;
    fields          (p U);

selects writing the VTK surface files in binary format which significantly
speeds-up reading of the files in paraview.

Currently binary writing is supported in VTK and EnSight formats.
2020-01-29 14:59:31 +00:00
745c95849e coupledPolyPatch:transform() -> transformType()
to facilitate the change to using the transformer class.
2020-01-01 16:01:19 +00:00
02fc637645 coupledPolyPatch: Separated ordering from transformation controls
which will allow the transformation calculation functionality to be moved into
cyclic patches.
2019-12-31 20:24:52 +00:00
7cd43ea5f8 tutorials/incompressible/simpleFoam/roomResidenceTime/validation/plotPos1Data.*: Removed shebang
These scripts are executed directly in gnuplot so the shebang is not necessary
and gnuplot may not be installed in /bin.
2019-12-15 18:48:33 +00:00
5eaf74c3a4 dictionary scalar lookup: simplified syntax using the type templated lookup function
Replaced
    readScalar(dict.lookup("name"))
with
    dict.lookup<scalar>("name")
2019-11-27 14:56:32 +00:00
5f22607df3 tutorials/*/DTCHull, propeller: Clone meshes, if available
These cases now check for a mesh in geometrically identical cases and
copy rather than re-generate if possible. This reduces the run-time of
the test loop by about 20 minutes.
2019-11-04 11:40:40 +00:00
76ba65be69 tutorials: Clean up geometry resources
A surface geometry file should be stored in
$FOAM_TUTORIALS/resources/geometry if it is used in multiple cases,
otherwise it should be stored locally to the case. This change enforces
that across all tutorials.
2019-11-01 12:32:33 +00:00
e62ded842f functionObjects::age: Added caching of the age field
to allow post-processing, e.g. sampling, cutting planes, averaging etc.
2019-10-10 16:16:24 +01:00
a2a74cbb79 functionObjects::age: add optinoal diffusion term and convergence control
to enable the calculation of the residence time for a fluid; mainly used in HVAC
analysis. E.g. residence time of air inside a ventilated room, see the new
tutorial roomResidenceTime.

Contributed by Tobias Holzmann
2019-10-08 16:14:38 +01:00
c8ab2a6e0c tutorials: Updated and simplified using the blockMesh defaultPatch entry
Rather than defining patches for all external block faces to provide name and
type use the defaultPatch entry to collect undefined faces into a single named
and typed patch, e.g.

defaultPatch
{
    name walls;
    type wall;
}
2019-10-07 16:49:11 +01:00
d94a7bf590 tutorials/incompressible/simpleFoam/turbineSiting: Replaced file copying with foamDictionary and .orig 2019-10-01 15:00:55 +01:00
0284c2c906 tutorials/incompressible/simpleFoam/pitzDaily: Removed duplicate functions entry 2019-09-16 08:59:27 +01:00
dbe9fb3b76 functionObjectList: Removed warning for optional entries
Simplified the residuals functionObject call in the tutorials
2019-09-01 21:16:37 +01:00
6e9801e7e8 functionObjectList: Added support for arguments to added to the object list
If the functionObject requires an object list rather than a field list the
non-named arguments are now inserted into the object list, for example

functions
{
    #includeFunc writeObjects(kEpsilon:G)
}

which is equivalent to

functions
{
    #includeFunc writeObjects(objects = (kEpsilon:G))
}
2019-09-01 15:30:09 +01:00
30cceb42c0 objectRegistry: Corrected caching of registered temporary objects
For example the generation term in the k-epsilon turbulence kEpsilon:G is a
temporary field that is specifically named and registered so that it can be
looked-up be the wall-function boundary conditions and requires slightly
different handling compared to normal temporary fields which are not registered.

The tutorials/incompressible/simpleFoam/pitzDaily case now demostrates this
functionality with the addition of

cacheTemporaryObjects
(
    kEpsilon:G
);

functions
{
    #includeFunc writeObjects(objects = (kEpsilon:G))
}

in controlDict which caches kEpsilon:G and writes it at every write time.
2019-09-01 10:18:45 +01:00
81f9320119 functionObject: Improved incorrect and incomplete argument error messages
Both the functionObject call context (the command line for postProcess, and the
controlDict path for run-time post-precessing) and the configuration file
context where the arguments are substituted are now printed in the error
message, e.g.

    postProcess -func 'patchAverage(name=inlet, ields=(p U))'

generates the message

--> FOAM FATAL IO ERROR:
Essential value for keyword 'fields' not set in function entry
    patchAverage(name=inlet, ields=(p U))
    in command line postProcess -func patchAverage(name=inlet, ields=(p U))
    Placeholder value is <field_names>

file: /home/dm2/henry/OpenFOAM/OpenFOAM-dev/etc/caseDicts/postProcessing/surfaceFieldValue/patchAverage from line 13 to line 17.

and with the following in controlDict

functions
{
    #includeFunc patchAverage(name=inlet, ields=(p U))
}

generates the message

--> FOAM FATAL IO ERROR:
Essential value for keyword 'fields' not set in function entry
     patchAverage(name=inlet, ields=(p U))
    in file /home/dm2/henry/OpenFOAM/OpenFOAM-dev/tutorials/incompressible/pimpleFoam/RAS/pitzDaily/system/controlDict at line 55
    Placeholder value is <field_names>

file: /home/dm2/henry/OpenFOAM/OpenFOAM-dev/etc/caseDicts/postProcessing/surfaceFieldValue/patchAverage from line 13 to line 17.
2019-08-10 19:16:25 +01:00
5acfe8b20a reactingMixture: Rationalised the reading of the species thermo and reactions
which are now read directly from the thermophysicalProperties dictionary for
consistency with non-reacting mixture thermodynamics.  The species thermo and
reactions lists can still be in separate files if convenient and included into
the thermophysicalProperties file using the standard dictionary #include.
2019-08-02 22:47:45 +01:00
4a810cbe9d SpalartAllmaras[I][D]DES: Named temporary fields and added optional caching for LESRegion
The various temporary fields used to create the nuTilda equation sources are now
internal fields to avoid unnecessary evaluation of boundary conditions, lowering
storage and reducing CPU time, particularly when running in parallel.  These
temporary fields are now named with respect to the model so that they can be
cached conveniently and written as required.

The LESRegion field can now be contructed on demand if it is requested as a
cached temporary field and written out for diagnostics if needed, for example in
the tutorials/incompressible/pisoFoam/LES/motorBike tutorial:

cacheTemporaryObjects
(
    SpalartAllmarasDDES:LESRegion
);

functions
{
    writeCachedObjects
    {
        type        writeObjects;
        libs        ("libutilityFunctionObjects.so");

        writeControl writeTime;
        writeOption anyWrite;

        objects
        (
            SpalartAllmarasDDES:LESRegion
        );
    }

    #include "cuttingPlane"
    #include "streamLines"
    #include "forceCoeffs"
}
2019-07-23 11:48:14 +01:00
e947e4d301 tutorials: Updated to use the new dictionary "slash" syntax 2019-07-11 19:44:29 +01:00
d0bf565783 tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun: Updated for latest gnuplot 2019-06-08 14:38:23 +01:00
1e2550b6cd Rationalised wall function implementation to avoid complex and inconsistent coefficients
All wall functions now operate collaboratively, obtaining the Cmu, kappa and E
coefficients and yPlusLam from the nutWallFunction base class.  Now these
optional inputs need only be specified in the nut boundary condition with the k,
epsilon, omega, v2 and f wall functions obtaining these values from there.  This
is much simpler to specify and avoids inconsistencies in the operation of the
wall functions for the different turbulence fields.

The code has also been rationalised and simplified avoiding unnecessary code
and duplication.
2019-05-31 19:40:32 +01:00
0889ff91c7 graphField: Moved graphs directory into postProcessing 2019-05-20 10:43:36 +01:00
8803a89407 fvOptions: Added volumeFractionSource and solidEquilibriumEnergySource
The volumeFractionSource represents the effect of a reduction in the
volume of the domain due to the presence of a stationary phase, most
likely a solid porous media. It only represents the dynamic effects
associated with the reduction in volume; it does not does not model
loss, drag or heat transfer. Separate models (e.g., the existing
porosity models) will be necessary to represent these effects. An
example usage, in system/fvOptions, is as follows:

    volumeFraction
    {
        type            volumeFractionSource;
        phase           solid;
        phi             phi;
        rho             rho;
        U               U;
        fields          (rho U e);
    }

The volume fraction will be read from constant/alpha.<phase>, and must
be generated in advance using setFields or a function object. Note that
the names of the flux, density (if compressible) and velocity must all
be specified. Every field for which a transport equation is solved
should also be specified in the "fields" entry.

The solidEquilibriumEnergySource adds the thermal inertia and diffusive
characteristics of a stationary solid phase to the energy equation of
the fluid, assuming that the two phases are in thermal equilibrium. An
example usage is as follows:

    solidEqulibriumEnergy
    {
        type            solidEqulibriumEnergySource;
        phase           solid;
        field           e;
    }

This will read the volume fraction in the same way as the
volumeFractionSource option. In addition, thermal properties of the
solid will be constructed from settings in
system/thermophysicalProperties.<phase>.

Two tutorials have been added, demonstrating use of these options in
both incompressible and compressible simulations. These are
incompressible/pimpleFoam/laminar/blockedChannel and
compressible/rhoPimpleFoam/laminar/blockedChannel.
2019-05-07 08:52:57 +01:00
cd656fbf9b postChannel: Moved postChannelDict from constant to system
Resolves https://bugs.openfoam.org/view.php?id=3224
2019-04-18 11:03:56 +01:00
2dd53c898a turbulenceModels/laminar/Giesekus: Giesekus model for visco-elasticity
Implementation of the Giesekus model for visco-elasticity, derived from the new
generalised form of the Maxwell model which now support additional sources.

    Giesekus, H., 1982.
    A simple constitutive equation for polymer fluids based on the
    concept of deformation-dependent tensional mobility.
    J. Non-Newton. Fluid. 11, 69–109.

This implementation is instantiated for incompressible, compressible and VoF
two-phase flow.
2019-03-28 22:10:59 +00:00
e1e3e2a333 pimpleFoam: Added LTS capability for demonstration and testing
For most steady cases simpleFoam is likely to converge faster than pimpleFoam
with LTS but this capability may be useful for testing meshes, BCs etc. for more
complex solver for which SIMPLE is not stable and LTS is provided instead.
2019-03-28 11:54:55 +00:00
c97e133c04 tutorials/incompressible/simpleFoam/motorBike/system/controlDict: Reverted change 2019-03-15 11:17:07 +00:00
d41166187a writeEntry: Rationalised for consistency, ease of use and maintainability
The writeEntry form is now defined and used consistently throughout OpenFOAM
making it easier to use and extend, particularly to support binary IO of complex
dictionary entries.
2019-03-14 20:54:10 +00:00
82356c7d08 tutorials: windAroundBuildings: Updated snappyHexMesh write flags 2019-01-31 08:55:05 +00:00
c5db440298 dynamicMeshDict: standardised indentation 2019-01-23 11:45:23 +00:00
e033aca111 streamlines: Updated tutorials for new caseDicts 2018-12-18 09:18:20 +00:00
95815460c0 Comment spelling corrections 2018-11-28 10:24:26 +00:00
01763b037d Allmesh scripts: removed unused variables and legacy syntax 2018-11-23 18:41:55 +00:00
ee443e201f Rationalised the handling of "Final" solver and relaxation factor settings
Now for transient simulations "Final" solver settings are required for ALL
equations providing consistency between the solution of velocity, energy,
composition and radiation properties.

However "Final" relaxation factors are no longer required for fields or
equations and if not present the standard value for the variable will be
applied.  Given that relaxation factors other than 1 are rarely required for
transient runs and hence the same for all iterations including the final one
this approach provide simpler input while still providing the flexibility to
specify a different value for the final iteration if required.  For steady cases
it is usual to execute just 1 outer iteration per time-step for which the
standard relaxation factors are appropriate, and if more than one iteration is
executed it is common to use the same factors for both.  In the unlikely event
of requiring different relaxation factors for the final iteration this is still
possible to specify via the now optional "Final" specification.
2018-11-17 19:42:23 +00:00
8c4fa9508e tutorials/incompressible/pimpleFoam/RAS/pitzDaily/system/fvSchemes: removed "bounded"
"bounded" filtering of the convection schemes is only appropriate for stead-state.
2018-11-12 16:50:40 +00:00
224814185c etc/templates: Updated the handling of pcorr 2018-11-12 16:49:34 +00:00
77dd7556c9 offsetCylinder: New tutorial to demonstrate the generalizedNewtonian laminarModel
with the CrossPowerLaw viscosityModel
2018-10-05 11:28:34 +01:00
9d97dc9ffd tutorials/incompressible/SRF.*: Removed spurious "U" entries in BCs
Resolves bug-report https://bugs.openfoam.org/view.php?id=3076
2018-09-25 11:06:01 +01:00
bc6cb51a42 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-08-07 14:36:35 +01:00
d5d304f795 tutorials/incompressible/pimpleFoam/RAS/wingMotion: Corrected U BCs
Resolves bug-report https://bugs.openfoam.org/view.php?id=3029
2018-08-07 14:34:48 +01:00