Commit Graph

255 Commits

Author SHA1 Message Date
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
a95c904390 tutorials/propeller: Mesh AMI-s as a face-zone, rather than patches
snappyHexMesh now generates a face-zone for the AMI-s, and createBaffles
and mergeOrSplitPoints -split are used to create the patches. Before,
snappy generated AMI patches directly, which were then converted to
AMI-s with createPatch.

This way, the AMI-s match exactly at the start of the simulation. For
more complicated cases that may be derived from this tutorial, this
could be important.
2018-08-07 13:12:53 +01:00
4dfaf1bac6 tutorials/incompressible/simpleFoam/turbineSiting: Corrected initialization 2018-07-13 15:25:28 +01:00
fdbf3c134f Rationalized dictionary and configuration file headers 2018-07-09 15:40:05 +01:00
e8bb954fb0 Corrected functionObject configuration file headers 2018-07-09 12:28:56 +01:00
bf54ab67e1 Updated OpenFOAM Foundation web-link in headers 2018-07-06 21:42:54 +01:00
019ae8bab3 tutorials: Changed compressed ascii output to binary to improve IO performance
also rationalized the writeCompression specification
2018-06-27 15:25:52 +01:00
3ef4c803cd sampledSet: Consistent renaming, documentation, and code maintenance
The sampled sets have been renamed in a more explicit and consistent
manner, and two new ones have also been added. The available sets are as
follows:

    arcUniform: Uniform samples along an arc. Replaces "circle", and
    adds the ability to sample along only a part of the circle's
    circumference. Example:

        {
            type        arcUniform;
            centre      (0.95 0 0.25);
            normal      (1 0 0);
            radial      (0 0 0.25);
            startAngle  -1.57079633;
            endAngle    0.52359878;
            nPoints     200;
            axis        x;
        }

    boundaryPoints: Specified point samples associated with a subset of
    the boundary. Replaces "patchCloud". Example:

        {
            type        boundaryPoints;
            patches     (inlet1 inlet2);
            points      ((0 -0.05 0.05) (0 -0.05 0.1) (0 -0.05 0.15));
            maxDistance 0.01;
            axis        x;
        }

    boundaryRandom: Random samples within a subset of the boundary.
    Replaces "patchSeed", but changes the behaviour to be entirely
    random. It does not seed the boundary face centres first. Example:

        {
            type        boundaryRandom;
            patches     (inlet1 inlet2);
            nPoints     1000;
            axis        x;
        }

    boxUniform: Uniform grid of samples within a axis-aligned box.
    Replaces "array". Example:

        {
            type    boxUniform;
            box     (0.95 0 0.25) (1.2 0.25 0.5);
            nPoints (2 4 6);
            axis    x;
        }

    circleRandom: Random samples within a circle. New. Example:

        {
            type        circleRandom;
            centre      (0.95 0 0.25);
            normal      (1 0 0);
            radius      0.25;
            nPoints     200;
            axis        x;
        }

    lineFace: Face-intersections along a line. Replaces "face". Example:

        {
            type        lineFace;
            start       (0.6 0.6 0.5);
            end         (0.6 -0.3 -0.1);
            axis        x;
        }

    lineCell: Cell-samples along a line at the mid-points in-between
    face-intersections. Replaces "midPoint". Example:

        {
            type        lineCell;
            start       (0.5 0.6 0.5);
            end         (0.5 -0.3 -0.1);
            axis        x;
        }

    lineCellFace: Combination of "lineFace" and "lineCell". Replaces
    "midPointAndFace". Example:

        {
            type        lineCellFace;
            start       (0.55 0.6 0.5);
            end         (0.55 -0.3 -0.1);
            axis        x;
        }

    lineUniform: Uniform samples along a line. Replaces "uniform".
    Example:

        {
            type        lineUniform;
            start       (0.65 0.3 0.3);
            end         (0.65 -0.3 -0.1);
            nPoints     200;
            axis        x;
        }

    points: Specified points. Replaces "cloud" when the ordered flag is
    false, and "polyLine" when the ordered flag is true. Example:

        {
            type        points;
            points      ((0 -0.05 0.05) (0 -0.05 0.1) (0 -0.05 0.15));
            ordered     yes;
            axis        x;
        }

    sphereRandom: Random samples within a sphere. New. Example:

        {
            type        sphereRandom;
            centre      (0.95 0 0.25);
            radius      0.25;
            nPoints     200;
            axis        x;
        }

    triSurfaceMesh: Samples from all the points of a triSurfaceMesh.
    Replaces "triSurfaceMeshPointSet". Example:

        {
            type        triSurfaceMesh;
            surface     "surface.stl";
            axis        x;
        }

The headers have also had documentation added. Example usage and a
description of the control parameters now exists for all sets.

In addition, a number of the algorithms which generate the sets have
been refactored or rewritten. This was done either to take advantage of
the recent changes to random number generation, or to remove ad-hoc
fixes that were made unnecessary by the barycentric tracking algorithm.
2018-06-21 08:41:44 +01:00
247378332d Relocated etc/caseDicts/foamyHexMeshDict -> etc/caseDicts/mesh/generation/foamyHexMeshDict 2018-06-10 22:44:58 +01:00
2bd229df02 tutorials: Added the new Allmesh scripts 2018-06-10 17:40:12 +01:00