Commit Graph

350 Commits

Author SHA1 Message Date
dfa9d0787d fileOperation: Corrected processor counting for moving mesh cases
Also resolves bug-report https://bugs.openfoam.org/view.php?id=2774
2017-11-28 13:01:08 +00:00
61d4e1a8ec createBaffles: Corrected warning about internalFacesOnly setting 2017-11-22 14:48:46 +00:00
28fdc3c4e8 mirrorMesh: Added support for cellLevel and pointLevel to support dynamic mesh refinement
Patch contributed by Mattijs Janssens
Resolves bug-report https://bugs.openfoam.org/view.php?id=2712
2017-10-27 15:25:29 +01:00
2d5af005e5 blockMesh: Corrected diagram printed with "-help" to be consistent with the documentation
Resolves bug report https://bugs.openfoam.org/view.php?id=2710
2017-10-13 11:30:57 +01:00
e4c2052291 ideasUnvToFoam: Added test for no cells (e.g. 2D mesh)
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2691
2017-09-09 22:34:43 +01:00
def44d0d70 setSet: Add ncurses to link-line if available
Resolves potential issue linking with readline on systems where readline has
ncurses support enabled.

Resolves bug-report https://bugs.openfoam.org/view.php?id=2642
2017-08-01 09:48:04 +01:00
dbb428a3a8 Updated to OpenFOAM-5.x 2017-07-25 14:23:49 +01:00
d09b89d0b2 PVReaders: Update C++ standard specification to 11 2017-07-25 00:03:31 +01:00
aa7f6d12b7 PVReaders: Simplified, rationalized and reorganized source tree and build scripts 2017-07-24 16:57:13 +01:00
5cf5f8d783 PV3Readers: Removed
ParaView version 3 is no longer supported, upgrade to ParaView-5.4.0.
2017-07-24 16:20:40 +01:00
c6f365f6cc refineMesh: Correct parallel operation
Patch contributed by Mattijs Janssens
Resolves bug-report https://bugs.openfoam.org/view.php?id=2621
2017-07-22 22:39:40 +01:00
2c3826ebd9 paraFoam: Render on refresh
The "Refresh Times" button now triggers a re-render of the visualisation
as well as scanning for new times and fields. This prevents old
overwritten data from remaining on screen despite everything else having
been updated.
2017-07-21 14:13:00 +01:00
68089dd574 paraFoam: Updated ParaView to version 5.4.0
ParaView has been updated to version 5.4.0. The C++ panel has been
deleted and replaced with a panel based on the new(er) XML API. This
reader works for ParaView-4.0.1 and newer. The ParaView 3 reader remains
unchanged.

Update issues have also been fixed. All the time directories are now
scanned for fields and clouds when filling the selection lists. This
stops fields from disappearing when the time is changed. The scan is
only done on startup and when the refresh button is pressed.

The list of available Lagrangian fields also now shows a combined set of
all the clouds. Previously, only fields from the first cloud were shown.
If a field does not apply to all the clouds, ParaView will display it's
name in the dropdown menu with a "(partial)" qualifier.

Some undocumented and incomplete bits of code, which were not being
compiled, have been removed.
2017-07-21 12:05:57 +01:00
dee9b200eb snappyHexMeshDict: updated triSurface entries to logical format
in annotated file in snappyHexMesh application source directory.
2017-07-13 12:55:04 -05:00
d04834ccfc setWaves: added Description in header 2017-07-13 10:27:25 -05:00
593df2e92a Removed unintended integer divisions 2017-07-13 09:23:11 +01:00
b4e88f260b masterUncollatedFileOperation: Updated to avoid warning from clang 2017-07-11 15:11:38 +01:00
611f2da837 decomposePar: Removed superfluous rmDir warning messages 2017-07-07 18:37:17 +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
1ff5787000 foamyMesh: Fixed compilation failures
Resolves bug reports https://bugs.openfoam.org/view.php?id=2601 and
https://bugs.openfoam.org/view.php?id=2602
2017-07-05 17:21:19 +01:00
14cc288672 tetrahedron: triangle: Improved barycentric handling on tets and tris
Updated the tetrahedron and triangle classes to use the barycentric
primitives. Removed duplicate code for generating random positions in
tets and tris, and fixed bug in tri random position.
2017-07-05 14:37:53 +01:00
ed8538a85c changeDictionary: Added time-loop
Resolves feature request https://bugs.openfoam.org/view.php?id=2569
2017-06-26 19:12:03 +01:00
a4e755c0dc Replace foamList utility with -list.* options
Provides better context for the available boundary conditions, fvOptions,
functionObjects etc. and thus returns only those available to and compatible
with the particular application.

e.g.

pimpleFoam -help

Usage: pimpleFoam [OPTIONS]
options:
  -case <dir>       specify alternate case directory, default is the cwd
  -listFunctionObjects
                    List functionObjects
  -listFvOptions    List fvOptions
  -listRegisteredSwitches
                    List switches registered for run-time modification
  -listScalarBCs    List scalar field boundary conditions (fvPatchField<scalar>)
  -listSwitches     List switches declared in libraries but not set in
                    etc/controlDict
  -listTurbulenceModels
                    List turbulenceModels
  -listUnsetSwitches
                    List switches declared in libraries but not set in
                    etc/controlDict
  -listVectorBCs    List vector field boundary conditions (fvPatchField<vector>)
  -noFunctionObjects
                    do not execute functionObjects
  -parallel         run in parallel
  -postProcess      Execute functionObjects only
  -roots <(dir1 .. dirN)>
                    slave root directories for distributed running
  -srcDoc           display source code in browser
  -doc              display application documentation in browser
  -help             print the usage

pimpleFoam listTurbulenceModels

pimpleFoam -listTurbulenceModels
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  dev                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : dev-39c46019e44f
Exec   : pimpleFoam -listTurbulenceModels
Date   : Jun 10 2017
Time   : 21:37:49
Host   : "dm"
PID    : 675
Case   : /home/dm2/henry/OpenFOAM/OpenFOAM-dev
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
SetNaN : Initialising allocated memory to NaN (FOAM_SETNAN).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Turbulence models
3
(
LES
RAS
laminar
)

RAS models
18
(
LRR
LamBremhorstKE
LaunderSharmaKE
LienCubicKE
LienLeschziner
RNGkEpsilon
SSG
ShihQuadraticKE
SpalartAllmaras
kEpsilon
kOmega
kOmegaSST
kOmegaSSTLM
kOmegaSSTSAS
kkLOmega
qZeta
realizableKE
v2f
)

LES models
10
(
DeardorffDiffStress
Smagorinsky
SpalartAllmarasDDES
SpalartAllmarasDES
SpalartAllmarasIDDES
WALE
dynamicKEqn
dynamicLagrangian
kEqn
kOmegaSSTDES
)

Further work will be needed to support the -listTurbulenceModels option in
multiphase solvers.
2017-06-10 21:34:27 +01:00
b255302fba setWaves: Corrected handling of multiple wave-type patches 2017-06-05 08:20:36 +01:00
f1240a853c surfaceFind: output region/zone number of found face 2017-06-02 21:02:01 +01:00
e7e4683f96 waves: Added waves library and setWaves utility
This addition allows for theoretical wave models to be utilised for
initialisation and as boundary conditions. Multiple models can be used
simultaneously, each with differing phases and orientations. If multiple
models are used the shapes and velocities are superimposed.

The wave models are specified in the velocity boundary condition. The
phase fraction boundary condition and the set utility both look up the
velocity condition in order to access the wave model. A velocity
boundary may be specified as follows:

    inlet
    {
        type            waveVelocity;
        origin          (0 0 0);
        direction       (1 0 0);
        speed           2;
        waves
        (
            Airy
            {
                length      300;
                amplitude   2.5;
                depth       150;
                phase       0;
                angle       0;
            }
        );
        scale           table ((1200 1) (1800 0));
        crossScale      constant 1;
    }

The alpha boundary only requires the type, unless the name of the
velocity field is non-standard, in which case a "U" entry will also be
needed. The setWaves utility does not require a dictionary file; non-
standard field names can be specified as command-line arguments.

Wave models currently available are Airy (1st order) and Stokes2 (second
order). If a depth is specified, and it is not too large, then shallow
terms will be included, otherwise the models assume that the liquid is
deep.

This work was supported by Jan Kaufmann and Jan Oberhagemann at DNV GL.
2017-05-31 10:09:08 +01:00
df1f4be854 primitiveShapes: Generalised tetrahedron and triangle cutting. Cuts are
now possible with level-sets as well as planes. Removed tetPoints class
as this wasn't really used anywhere except for the old tet-cutting
routines. Restored tetPointRef.H to be consistent with other primitive
shapes. Re-wrote tet-overlap mapping in terms of the new cutting.
2017-05-22 12:23:22 +01:00
72277ed677 Standardized names of extrude2DMesh and polyDualMesh application source files 2017-05-14 15:44:48 +01:00
d05ef92a47 Other utilities: standardised argument naming for files 2017-05-12 15:16:29 +01:00
0314fca170 Thermophysical utilities: standardised argument naming for files 2017-05-12 15:07:54 +01:00
da6b1bf361 Surface utilities: standardised argument naming and ordering
for input and output surface files
2017-05-12 14:43:10 +01:00
8f2735ebba reconstructParMesh: Use tree method to improve speed and scaling
Based on development contributed by Paul Edwards, Intel.
2017-05-09 09:32:25 +01:00
a41f84e925 decomposePar: Added "-dict" option
to specify an alternative name and/or location for the decomposition dictionary.

Based on patch contributed by Niklas Nordin, Scania.
2017-05-03 10:35:08 +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
b0d13b51d8 surfaceLambdaMuSmooth: Added meshTools to link 2017-04-21 16:50:20 +01:00
37cd5434a6 Merged the edgeMesh library into the meshTools library 2017-04-21 10:38:53 +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
4d5505d3ef surfaceFilmModels::perturbedTemperatureDependentContactAngleForce: New contact angle model
Combining a Function1 temperature dependency with a distributionModel stochastic
perturbation.
2017-04-04 00:09:38 +01:00
b3e4c547e8 applyBoundaryLayer: Ensure nut is up-to-date with the current turbulence fields
Resolves bug-report https://bugs.openfoam.org/view.php?id=2511
2017-03-22 10:08:37 +00:00
160ad85b25 applyBoundaryLayer: Provide non-const access to nut, k and epsilon 2017-03-21 15:07:13 +00:00
b14e2af2d4 postProcessing/noise: Updated for changes to Function1 2017-03-16 20:56:09 +00:00
01c758b79a Function1: Rationalized construction to support the simpler sub-dictionary format
e.g.
    ramp
    {
        type     quadratic;
        start    200;
        duration 1.6;
    }

but the old format is supported for backward compatibility:

    ramp linear;
    rampCoeffs
    {
        start    200;
        duration 1.6;
    }
2017-03-16 20:53:08 +00:00
1e6c9a0a54 Updated UPstream::commsTypes to use the C++11 enum class 2017-03-10 19:54:55 +00:00
6c103e247d decomposePar: Added 'copyZero' option
Using

decomposePar -copyZero

The mesh is decomposed as usual but the '0' directory is recursively copied to
the 'processor.*' directories rather than decomposing the fields.  This is a
convenient option to handle cases where the initial field files are generic and
can be used for serial or parallel running.  See for example the
incompressible/simpleFoam/motorBike tutorial case.
2017-03-08 11:48:06 +00:00
c9237fd980 chemkinToFoam: Increase the precision of the thermophysical coefficient written 2017-02-21 11:59:49 +00:00
80123f59ce thermophysicalProperties: New base-class for liquidProperties and in the future gasProperties
Description
    Base-class for thermophysical properties of solids, liquids and gases
    providing an interface compatible with the templated thermodynamics
    packages.

liquidProperties, solidProperties and thermophysicalFunction libraries have been
combined with the new thermophysicalProperties class into a single
thermophysicalProperties library to simplify compilation and linkage of models,
libraries and applications dependent on these classes.
2017-02-18 21:53:20 +00:00
abc50e214c thermophysicalModels: Changed specie thermodynamics from mole to mass basis
The fundamental properties provided by the specie class hierarchy were
mole-based, i.e. provide the properties per mole whereas the fundamental
properties provided by the liquidProperties and solidProperties classes are
mass-based, i.e. per unit mass.  This inconsistency made it impossible to
instantiate the thermodynamics packages (rhoThermo, psiThermo) used by the FV
transport solvers on liquidProperties.  In order to combine VoF with film and/or
Lagrangian models it is essential that the physical propertied of the three
representations of the liquid are consistent which means that it is necessary to
instantiate the thermodynamics packages on liquidProperties.  This requires
either liquidProperties to be rewritten mole-based or the specie classes to be
rewritten mass-based.  Given that most of OpenFOAM solvers operate
mass-based (solve for mass-fractions and provide mass-fractions to sub-models it
is more consistent and efficient if the low-level thermodynamics is also
mass-based.

This commit includes all of the changes necessary for all of the thermodynamics
in OpenFOAM to operate mass-based and supports the instantiation of
thermodynamics packages on liquidProperties.

Note that most users, developers and contributors to OpenFOAM will not notice
any difference in the operation of the code except that the confusing

    nMoles     1;

entries in the thermophysicalProperties files are no longer needed or used and
have been removed in this commet.  The only substantial change to the internals
is that species thermodynamics are now "mixed" with mass rather than mole
fractions.  This is more convenient except for defining reaction equilibrium
thermodynamics for which the molar rather than mass composition is usually know.
The consequence of this can be seen in the adiabaticFlameT, equilibriumCO and
equilibriumFlameT utilities in which the species thermodynamics are
pre-multiplied by their molecular mass to effectively convert them to mole-basis
to simplify the definition of the reaction equilibrium thermodynamics, e.g. in
equilibriumCO

    // Reactants (mole-based)
    thermo FUEL(thermoData.subDict(fuelName)); FUEL *= FUEL.W();

    // Oxidant (mole-based)
    thermo O2(thermoData.subDict("O2")); O2 *= O2.W();
    thermo N2(thermoData.subDict("N2")); N2 *= N2.W();

    // Intermediates (mole-based)
    thermo H2(thermoData.subDict("H2")); H2 *= H2.W();

    // Products (mole-based)
    thermo CO2(thermoData.subDict("CO2")); CO2 *= CO2.W();
    thermo H2O(thermoData.subDict("H2O")); H2O *= H2O.W();
    thermo CO(thermoData.subDict("CO")); CO *= CO.W();

    // Product dissociation reactions

    thermo CO2BreakUp
    (
        CO2 == CO + 0.5*O2
    );

    thermo H2OBreakUp
    (
        H2O == H2 + 0.5*O2
    );

Please report any problems with this substantial but necessary rewrite of the
thermodynamic at https://bugs.openfoam.org

Henry G. Weller
CFD Direct Ltd.
2017-02-17 11:22:14 +00:00
4b251034d3 Removed unhelpful clutter 2017-01-26 17:47:24 +00:00
eaebd650ce snappyHexMesh: Added "noRefinement" writeFlag to control the writing of cellLevel, pointLevel etc. files
By default snappyHexMesh writes files relating to the hex-splitting process into
the polyMesh directory: cellLevel level0Edge pointLevel surfaceIndex

but by setting the noRefinement flag:

writeFlags
(
    noRefinement
    .
    .
    .
);

these optional files which are generally not needed are not written.

If you run the three stages of snappyHexMesh separately or run a dynamic mesh
solver supporting refinement and unrefinement these files are needed
and "noRefinement" should not be set.
2017-01-24 22:28:36 +00:00