Commit Graph

131 Commits

Author SHA1 Message Date
87e32ab499 Code style: Updated line comments to start with a space
//This is a comment   ->   // This is a comment
2018-05-01 11:57:50 +01:00
f12cb590b2 forceCoeffs: Corrected documentation
Resolves bug-report https://bugs.openfoam.org/view.php?id=2909
2018-04-24 10:11:07 +01:00
af88b75e2c wallShearStress: Removed reference to non-existent pressureTools functionObject 2018-04-20 23:21:31 +01:00
00645cdc1a functionObjects: Corrected namespace for NamedEnum
Resolves bug-report https://bugs.openfoam.org/view.php?id=2901
2018-04-13 01:11:20 +01:00
8dcfc9e9f8 streamLine: Added option to track in both directions
Streamlines can now be tracked in both directions from the set of
initial locations. The keyword controlling this behaviour is
"direction", which can be set to "forward", "backward" or "both".

This new keyword superseeds the "trackForward" entry, which has been
retained for backwards compatibility.
2018-04-09 08:36:16 +01:00
01d6aed0e1 Corrected typos in comments
Resolves bug-report https://bugs.openfoam.org/view.php?id=2891
2018-03-27 21:08:37 +01:00
828254ab34 functionObjects::forceCoeffs: normalize liftDir, dragDir and pitchAxis
It may be convenient to specify these directions un-normalized so it is
necessary to normalize them before they are used to calculate the force
coefficients.
2018-03-25 22:20:02 +01:00
8a9bbb9a73 Corrected typos in comment: "the the" -> "the" 2018-03-25 12:09:00 +01:00
0fd3db427f functionObjects::forces: Construct nu without need to specify name and dimensions
Resolved patch request https://bugs.openfoam.org/view.php?id=2880
2018-03-15 00:44:33 +00:00
1073607cb0 Corrected spelling and typo's in comments
Resolves bug report https://bugs.openfoam.org/view.php?id=2845
2018-03-05 20:14:28 +00:00
e08128781e functionObjects::turbulenceIntensity: New functionObject which writes the turbulenceIntensity field
Description
    Evaluates and writes the turbulence intensity field 'I'.

    The turbulence intensity field 'I' is the root-mean-square of the turbulent
    velocity fluctuations normalised by the local velocity magnitude:
    \f[
        I \equiv \frac{\sqrt{\frac{2}{3}\, k}}{U}
    \f]
    To avoid spurious extrema and division by 0 I is limited to 1 where the
    velocity magnitude is less than the turbulent velocity fluctuations.

    Example of function object specification:
    \verbatim
    functions
    {
        .
        .
        .
        turbulenceIntensity
        {
            type        turbulenceIntensity;
            libs        ("libfieldFunctionObjects.so");
        }
        .
        .
        .
    }
    \endverbatim

    or using the standard configuration file:
    \verbatim
    functions
    {
        .
        .
        .
        #includeFunc turbulenceIntensity
        .
        .
        .
    }
    \endverbatim
2018-03-02 14:32:29 +00:00
139ffcc112 functionObject: Fixed bugs in function object time-step adjustment
The logic governing function objects' ability to change the time-step
has been modified so that it is compatible with the time-step adjustment
done in the Time class. The behaviour has been split into a method which
sets the step directly, and another which moidifies the time until the
next write operation (i.e., the time that the solver "aims" for).

This fixes an issue where the adjustments in Time and the function
objects interfere and cause the time step to decrease exponentially down
to machine precision. It also means that the set-time-step function
object now does not break the adjustable run-time setting.

This resolves bug report https://bugs.openfoam.org/view.php?id=2820
2018-02-08 11:22:46 +00:00
fc2b2d0c05 OpenFOAM: Rationalized the naming of scalar limits
In early versions of OpenFOAM the scalar limits were simple macro replacements and the
names were capitalized to indicate this.  The scalar limits are now static
constants which is a huge improvement on the use of macros and for consistency
the names have been changed to camel-case to indicate this and improve
readability of the code:

    GREAT -> great
    ROOTGREAT -> rootGreat
    VGREAT -> vGreat
    ROOTVGREAT -> rootVGreat
    SMALL -> small
    ROOTSMALL -> rootSmall
    VSMALL -> vSmall
    ROOTVSMALL -> rootVSmall

The original capitalized are still currently supported but their use is
deprecated.
2018-01-25 09:46:37 +00:00
d008fe4468 timeFunctionObject: New functionObject which writes run, CPU and clock time
and optionally the CPU and clock times per time step.

Example of function object specification:
time
{
    type            time;

    libs            ("libutilityFunctionObjects.so");

    writeControl    timeStep;
    writeInterval   1;

    perTimeStep     no;
}

Adding

    #includeFunc time

to the functions list in the controlDict of the motorBike tutorial generates

0               1.190000e+00    1
1               1.640000e+00    1
2               1.940000e+00    2

Enabling the optional writing of the CPU and clock time per time step is
straight forward:

    #includeFunc time(perTimeStep=yes)
2018-01-23 10:10:10 +00:00
853406b8ec wallHeatTransferCoeff: Corrected dimensions of the wallHeatTransferCoeff field 2017-12-19 23:34:42 +00:00
99841e29b7 wallHeatTransferCoeff: New functionObject to calculate the wall heat transfer coefficient
for incompressible flow simulated using simpleFoam, pimpleFoam or pisoFoam.

Description
    Calculates and write the estimated incompressible flow heat transfer
    coefficient at wall patches as the volScalarField field
    'wallHeatTransferCoeff'.

    All wall patches are included by default; to restrict the calculation to
    certain patches, use the optional 'patches' entry.

    Example of function object specification:
    wallHeatTransferCoeff1
    {
        type        wallHeatTransferCoeff;
        libs        ("libfieldFunctionObjects.so");
        ...
        region      fluid;
        patches     (".*Wall");
        rho         1.225;
        Cp          1005;
        Prl         0.707;
        Prt         0.9;
    }

Usage
    Property | Description                   | Required | Default value
    type     | Type name: wallHeatTransferCoeff | yes   |
    patches  | List of patches to process    | no       | all wall patches
    region   | Region to be evaluated        | no       | default region
    rho      | Fluid density                 | yes      |
    Cp       | Fluid heat capacity           | yes      |
    Prl      | Fluid laminar Prandtl number  | yes      |
    Prt      | Fluid turbulent Prandtl number| yes      |

Note
    Writing field 'wallHeatTransferCoeff' is done by default, but it can be
    overridden by defining an empty \c objects list. For details see
    writeLocalObjects.
2017-12-06 16:10:34 +00:00
9fb9dbe922 wallHeatFlux: Filter out coupled patches
Resolves bug-report https://bugs.openfoam.org/view.php?id=2776
2017-11-30 19:56:39 +00:00
396259f105 wallHeatFlux: Changed sign of radiative heat flux contribution
to compensate for the inconsistent definition of this flux

Resolves bug-report https://bugs.openfoam.org/view.php?id=2722
2017-11-29 11:00:38 +00:00
c2835a450b functionObjects::ddt: New functionObject which calculates and writes the Eulerian time derivative of a field
Based on patch contributed by Tobias Holzmann
Resolves feature-request https://bugs.openfoam.org/view.php?id=2525
2017-11-05 10:58:07 +00:00
6d06f737cd functionObjects: nearWallFields: Fixed failed patch faces
Corrected a few issues with the utilisation of the tracking within the
nearWallFields function object. The tracking is now done over a
displacement from the initial location, which prevents trying to track
to a location outside the mesh when the patch face is warped and the
centre lies outside the tracking decomposition. Also fixed the end
criteria so that it does not suffer from round off error in the step
fraction.

The upshot of these changes is that the faces on which the near wall
cells were not being set are now being set properly, and uninitialised
data is no longer being written out.
2017-10-20 15:15:39 +01:00
aa24a97c8b functionObjects: nearWallFields: Fixed particle not found error
Removed all the special handling for awkward particles from the
nearWallFields function object. The version 5+ tracking already handles
this more robustly.

Resolves bug-report https://bugs.openfoam.org/view.php?id=2728
2017-10-20 11:38:13 +01:00
e903a088ee functionObjects::nearWallFields: Set patch types of the sampled field to calculated
Resolves bug-report https://bugs.openfoam.org/view.php?id=2729
2017-10-20 10:38:05 +01:00
6584fa6ce0 functionObjects::wallHeatFlux: More efficient evaluation of heat-flux
which avoids the need for field interpolation and snGrad specification and
evaluation.

Resolves patch request https://bugs.openfoam.org/view.php?id=2725
2017-10-17 12:17:24 +01:00
d923beb85b functionObjects: forces: Write global and local values on the same line
The forces function object, when specified with a full coordinate
system, previously wrote forces and moments out in the following format:

    time-0 forces-0 moments-0
    time-0 localForces-0 localMoments-0
    time-1 forces-1 moments-1
    time-1 localForces-1 localMoments-1
    # etc ...

There are two rows of values per time. This complicates the definition
of the table and means that filtering has to be done before the data
series can be visualised. The format has now been changed to the
following form:

    time-0 forces-0 moments-0 localForces-0 localMoments-0
    time-1 forces-1 moments-1 localForces-1 localMoments-1
    # etc ...

There is one row per time, and each column is therefore a continuous
series of one variable that can be plotted.
2017-10-12 10:43:19 +01:00
422556fd3f sixDoFRigidBodyState: Moved to src to avoid build order problems
Resolves bug-report https://bugs.openfoam.org/view.php?id=2707
2017-09-27 11:32:46 +01:00
85fbc130c7 functionObjects: Added sixDoF state library to Allwmake 2017-09-25 13:32:58 +01:00
018adc16c9 Corrected file conditional compilation macro names to be consistency with the file names
Scripts contributed by Bruno Santos
Resolves request https://bugs.openfoam.org/view.php?id=2692#c8735
2017-09-12 13:39:48 +01:00
27ca59be80 functionObjects: Rationalized the use of "tab" rather than token::TAB 2017-09-09 19:03:16 +01:00
7dc61879a6 sixDoFRigidBodyState: New functionObject which writes the rigid-body state
Based on code contributed by SeongMo Yeon
Resolves feature request https://bugs.openfoam.org/view.php?id=2656
2017-09-09 19:00:56 +01:00
b3e675ea43 lagrangian: Removed unnecessary patch argument from hit methods
The patch can be determined from the particle when it is needed. Most of
the time it is not.
2017-09-04 12:01:28 +01:00
dc10cfd686 lagrangian: Removed duplicate data from method arguments
A lot of methods were taking argument data which could be referenced or
generated from the parcel class at little or no additional cost. This
was confusing and generated the possibility of inconsistent data states.
2017-09-04 12:01:28 +01:00
4fd4fadab2 lagrangian: Un-templated the tracking data
Tracking data classes are no longer templated on the derived cloud type.
The advantage of this is that they can now be passed to sub models. This
should allow continuous phase data to be removed from the parcel
classes. The disadvantage is that every function which once took a
templated TrackData argument now needs an additional TrackCloudType
argument in order to perform the necessary down-casting.
2017-09-04 12:01:28 +01:00
adffa0f33d Lagrangian: Enabled tracking through ACMI patches and minor code improvements
Particle collisions with ACMI patches are now handled. The hit detects
whether the location is within the overlap or the coupled region and
recurses, calling the hit routine appropriate for the region.

The low level tracking methods are now more consistently named. There is
now a distinction between tracking to a face and hitting it. Function
object side effects have been moved out of the base layer and into the
parcels on which they are meaningful.
2017-08-10 15:31:24 +01:00
8b8e5b9492 functionObjects::residuals: Writes "N/A" for fields not solved
Patch contributed by Bruno Santos
Resolves bug-report https://bugs.openfoam.org/view.php?id=2608
2017-07-10 12:23:52 +01:00
7c301dbff4 Parallel IO: New collated file format
When an OpenFOAM simulation runs in parallel, the data for decomposed fields and
mesh(es) has historically been stored in multiple files within separate
directories for each processor.  Processor directories are named 'processorN',
where N is the processor number.

This commit introduces an alternative "collated" file format where the data for
each decomposed field (and mesh) is collated into a single file, which is
written and read on the master processor.  The files are stored in a single
directory named 'processors'.

The new format produces significantly fewer files - one per field, instead of N
per field.  For large parallel cases, this avoids the restriction on the number
of open files imposed by the operating system limits.

The file writing can be threaded allowing the simulation to continue running
while the data is being written to file.  NFS (Network File System) is not
needed when using the the collated format and additionally, there is an option
to run without NFS with the original uncollated approach, known as
"masterUncollated".

The controls for the file handling are in the OptimisationSwitches of
etc/controlDict:

OptimisationSwitches
{
    ...

    //- Parallel IO file handler
    //  uncollated (default), collated or masterUncollated
    fileHandler uncollated;

    //- collated: thread buffer size for queued file writes.
    //  If set to 0 or not sufficient for the file size threading is not used.
    //  Default: 2e9
    maxThreadFileBufferSize 2e9;

    //- masterUncollated: non-blocking buffer size.
    //  If the file exceeds this buffer size scheduled transfer is used.
    //  Default: 2e9
    maxMasterFileBufferSize 2e9;
}

When using the collated file handling, memory is allocated for the data in the
thread.  maxThreadFileBufferSize sets the maximum size of memory in bytes that
is allocated.  If the data exceeds this size, the write does not use threading.

When using the masterUncollated file handling, non-blocking MPI communication
requires a sufficiently large memory buffer on the master node.
maxMasterFileBufferSize sets the maximum size in bytes of the buffer.  If the
data exceeds this size, the system uses scheduled communication.

The installation defaults for the fileHandler choice, maxThreadFileBufferSize
and maxMasterFileBufferSize (set in etc/controlDict) can be over-ridden within
the case controlDict file, like other parameters.  Additionally the fileHandler
can be set by:
- the "-fileHandler" command line argument;
- a FOAM_FILEHANDLER environment variable.

A foamFormatConvert utility allows users to convert files between the collated
and uncollated formats, e.g.
    mpirun -np 2 foamFormatConvert -parallel -fileHandler uncollated

An example case demonstrating the file handling methods is provided in:
$FOAM_TUTORIALS/IO/fileHandling

The work was undertaken by Mattijs Janssens, in collaboration with Henry Weller.
2017-07-07 11:39:56 +01:00
1b377dd439 interfaceHeight: Improved the description 2017-06-30 12:08:00 +01:00
0c24327b32 functionObjects::fieldMinMax: corrected parallel operation of the file logging 2017-06-28 14:20:28 +01:00
7bdbab7f4e Rationalize the "pos" function
"pos" now returns 1 if the argument is greater than 0, otherwise it returns 0.
This is consistent with the common mathematical definition of the "pos" function:

https://en.wikipedia.org/wiki/Sign_(mathematics)

However the previous implementation in which 1 was also returned for a 0
argument is useful in many situations so the "pos0" has been added which returns
1 if the argument is greater or equal to 0.  Additionally the "neg0" has been
added which returns 1 if if the argument is less than or equal to 0.
2017-06-22 14:32:18 +01:00
ab2b257269 functionObjects/field: Added interfaceHeight
This function object reports the height of the interface above a set of
locations. It writes the height above the location, above the boundary,
and the point on the interface. It uses an integral approach, so if
there are multiple interfaces above or below a location, this method
will compute an average.

It can be enabled with the following entry in the system/controlDict:

    functions
    {
        interfaceHeight1
        {
            type           interfaceHeight;
            libs           ("libfieldFunctionObjects.so");
            alpha          alpha.water;
            locations      ((0 0 0) (10 0 0) (20 0 0));
        }
    }

This work was supported by Jan Kaufmann and Jan Oberhagemann at DNV GL.
2017-05-31 10:08:59 +01:00
f6a9aa063d codedFunctionObject.H: Removed spurious '"'
Resolves bug-report https://bugs.openfoam.org/view.php?id=2554
2017-05-18 12:39:34 +01:00
3aec2ad4ac src/functionObjects/field/Make/options updated 2017-05-12 11:07:50 +01:00
56283c39e5 functionObjects::wallHeatFlux: Added support for solid regions
Patch contributed by Stephan Goeke
2017-05-12 11:05:45 +01:00
9fbe68fca6 Replacing const_cast lookupObject to lookupObjectRef 2017-05-11 14:42:59 +01:00
e8f9d6a7fe Replacing const_cast lookupObject to lookupObjectRef 2017-05-10 16:07:45 +01:00
371762757d Lagrangian: Rewrite of the particle tracking algorithm to function in
terms of the local barycentric coordinates of the current tetrahedron,
rather than the global coordinate system.

Barycentric tracking works on any mesh, irrespective of mesh quality.
Particles do not get "lost", and tracking does not require ad-hoc
"corrections" or "rescues" to function robustly, because the calculation
of particle-face intersections is unambiguous and reproducible, even at
small angles of incidence.

Each particle position is defined by topology (i.e. the decomposed tet
cell it is in) and geometry (i.e. where it is in the cell). No search
operations are needed on restart or reconstruct, unlike when particle
positions are stored in the global coordinate system.

The particle positions file now contains particles' local coordinates
and topology, rather than the global coordinates and cell. This change
to the output format is not backwards compatible. Existing cases with
Lagrangian data will not restart, but they will still run from time
zero without any modification. This change was necessary in order to
guarantee that the loaded particle is valid, and therefore
fundamentally prevent "loss" and "search-failure" type bugs (e.g.,
2517, 2442, 2286, 1836, 1461, 1341, 1097).

The tracking functions have also been converted to function in terms
of displacement, rather than end position. This helps remove floating
point error issues, particularly towards the end of a tracking step.

Wall bounded streamlines have been removed. The implementation proved
incompatible with the new tracking algorithm. ParaView has a surface
LIC plugin which provides equivalent, or better, functionality.

Additionally, bug report <https://bugs.openfoam.org/view.php?id=2517>
is resolved by this change.
2017-04-28 09:25:10 +01:00
9801c25788 The "<type>Coeffs" sub-dictionary is now optional for most model parameters
except turbulence and lagrangian which will also be updated shortly.

For example in the nonNewtonianIcoFoam offsetCylinder tutorial the viscosity
model coefficients may be specified in the corresponding "<type>Coeffs"
sub-dictionary:

transportModel  CrossPowerLaw;

CrossPowerLawCoeffs
{
    nu0         [0 2 -1 0 0 0 0]  0.01;
    nuInf       [0 2 -1 0 0 0 0]  10;
    m           [0 0 1 0 0 0 0]   0.4;
    n           [0 0 0 0 0 0 0]   3;
}

BirdCarreauCoeffs
{
    nu0         [0 2 -1 0 0 0 0]  1e-06;
    nuInf       [0 2 -1 0 0 0 0]  1e-06;
    k           [0 0 1 0 0 0 0]   0;
    n           [0 0 0 0 0 0 0]   1;
}

which allows a quick change between models, or using the simpler

transportModel  CrossPowerLaw;

nu0         [0 2 -1 0 0 0 0]  0.01;
nuInf       [0 2 -1 0 0 0 0]  10;
m           [0 0 1 0 0 0 0]   0.4;
n           [0 0 0 0 0 0 0]   3;

if quick switching between models is not required.

To support this more convenient parameter specification the inconsistent
specification of seedSampleSet in the streamLine and wallBoundedStreamLine
functionObjects had to be corrected from

    // Seeding method.
    seedSampleSet   uniform;  //cloud; //triSurfaceMeshPointSet;

    uniformCoeffs
    {
        type        uniform;
        axis        x;  //distance;

        // Note: tracks slightly offset so as not to be on a face
        start       (-1.001 -0.05 0.0011);
        end         (-1.001 -0.05 1.0011);
        nPoints     20;
    }

to the simpler

    // Seeding method.
    seedSampleSet
    {
        type        uniform;
        axis        x;  //distance;

        // Note: tracks slightly offset so as not to be on a face
        start       (-1.001 -0.05 0.0011);
        end         (-1.001 -0.05 1.0011);
        nPoints     20;
    }

which also support the "<type>Coeffs" form

    // Seeding method.
    seedSampleSet
    {
        type        uniform;

        uniformCoeffs
        {
            axis        x;  //distance;

            // Note: tracks slightly offset so as not to be on a face
            start       (-1.001 -0.05 0.0011);
            end         (-1.001 -0.05 1.0011);
            nPoints     20;
        }
    }
2017-04-20 09:14:48 +01:00
8aac0a1808 radiation: Corrected the name of the radiative heat flux from Qr to qr
The standard naming convention for heat flux is "q" and this is used for the
conductive and convective heat fluxes is OpenFOAM.  The use of "Qr" for
radiative heat flux is an anomaly which causes confusion, particularly for
boundary conditions in which "Q" is used to denote power in Watts.  The name of
the radiative heat flux has now been corrected to "qr" and all models, boundary
conditions and tutorials updated.
2017-04-08 22:23:40 +01:00
51af7c4d78 functionObjects:functionObjects:: Corrected documentation 2017-03-31 20:46:03 +01:00
c95bf5e31d functionObjects::fieldAverage: Initialize totalTime_ for new fields following restart
Patch contributed by Timo Niemi, VTT.
Resolves bug-report https://bugs.openfoam.org/view.php?id=2510
2017-03-22 18:30:51 +00:00
d7e54d5c92 setTimeStepFunctionObject: Corrected typo
Resolves bug-report https://bugs.openfoam.org/view.php?id=2507
2017-03-20 17:57:06 +00:00