Commit Graph

129 Commits

Author SHA1 Message Date
e05f780ebc Updated git hooks to check new header format 2018-07-09 17:01:02 +01:00
f445b8a2c1 Rationalized dictionary and configuration file headers 2018-07-09 15:58:01 +01:00
07a640f216 Updated to OpenFOAM-6 2018-07-07 19:44:36 +01:00
bf54ab67e1 Updated OpenFOAM Foundation web-link in headers 2018-07-06 21:42:54 +01:00
d1c4c33ec0 applications/test: Updated to compile 2018-06-20 14:09:53 +01:00
4d09d6c6f5 Test-maxMem: Removed 2018-06-20 14:09:26 +01:00
89f1053f82 Code style: Fixed formatting of banners 2018-06-19 12:01:50 +01:00
002e7d7b06 Random: Replaced drand48 with an in-class implementation
This is faster than the library functionality that it replaces, as it
allows the compiler to do inlining. It also does not utilise any static
state so generators do not interfere with each other. It is also faster
than the the array lookup in cachedRandom. The cachedRandom class
therefore offers no advantage over Random and has been removed.
2018-06-11 11:01:11 +01:00
a6e159ae5f Make/options: Rationalized the layout of the EXE_INC statements 2018-06-10 17:11:22 +01:00
c4d209345e Test-rigidBodyDynamics: Renamed source file 2018-06-04 11:18:13 +01:00
59be3e7113 rigidBodyDynamics: Ported tests to general RBD application 2018-05-09 16:04:46 +01:00
ae5a31e8b7 rigidBodyDynamics: Added test application for general bodies 2018-05-09 15:15:23 +01:00
c3be52bcd6 Corrected 'Class' entries in headers
Using script provided by Bruno Santos
See https://bugs.openfoam.org/view.php?id=2919
2018-05-07 14:18:44 +01:00
400cd4a889 wmake options files: Removed -I options referring to non-existent directories
Resolves bug-report https://bugs.openfoam.org/view.php?id=2917
2018-05-04 17:16:46 +01:00
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
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
019c2c08dc Corrected spelling in comments
Resolves bug-report https://bugs.openfoam.org/view.php?id=2844
2018-02-13 22:17:53 +00:00
0248dd81e3 Corrected comments: inbetween -> in between 2018-02-13 16:38:41 +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
10e75bf28a rigidBodyModelState: Added time value member
The absolute value of the the time has been added to the rigid body
model state. This value is not directly necessary for calculating the
evolution of the rigid body system, it just facilitates the
implementation of sub-models which are in some way time-dependent.
2017-12-13 12:06:53 +00:00
cc4d4433b8 messageStream: Added support for suppressing the printing of log header
This generalizes and replaces the previous "noBanner" option provided by argList
and is extended to include the messages printed by Time.

Resolves bug-report https://bugs.openfoam.org/view.php?id=2782
2017-12-06 11:58:35 +00: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
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
4c49a1ed00 applications/test/liquid, applications/test/tensor: Updated
Resolves bug-report https://bugs.openfoam.org/view.php?id=2557
2017-05-19 08:28:00 +01:00
37cd5434a6 Merged the edgeMesh library into the meshTools library 2017-04-21 10:38:53 +01:00
997b66913d Added robust primitive cubic/quadratic/linear equation solutions.
Applied to eigen-value calculations. Fixed repeated-eigen-value issues
in eigen-vector generation.
2017-03-22 15:11:54 +00:00
1e6c9a0a54 Updated UPstream::commsTypes to use the C++11 enum class 2017-03-10 19:54:55 +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
0f91f62cef Removed trailing blank lines
Resolves bug-report https://bugs.openfoam.org/view.php?id=2438
2017-01-19 20:17:47 +00:00
78a396430b Rationalized the keyword to specify a file name in a dictionary to 'file'
e.g. in tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T

    hot
    {
        type            externalCoupledTemperature;
        commsDir        "${FOAM_CASE}/comms";
        file            "data";
        initByExternal  yes;
        log             true;
        value           uniform 307.75; // 34.6 degC
    }

Previously both 'file' and 'fileName' were used inconsistently in different
classes and given that there is no confusion or ambiguity introduced by using
the simpler 'file' rather than 'fileName' this change simplifies the use and
maintenance of OpenFOAM.
2017-01-07 09:38:54 +00:00
8060826b2a LList, SLList: Added construction from and assignment to initializer_list
SLList: now a C++11 template alias rather than a wrapper-class.
2016-08-12 10:01:41 +01:00
c4f844a68b FixedList: Added void operator=(std::initializer_list<T>) 2016-08-11 22:02:05 +01:00
275a59af66 HashTable: Added void operator=(std::initializer_list<Tuple2<Key, T>>) 2016-08-11 21:41:55 +01:00
5602c48426 List: Added void operator=(std::initializer_list<T>) 2016-08-09 20:36:32 +01:00
65207e29ea HashTable: Added C++11 initializer_list constructor
e.g.
    HashTable<label, string> table1
    {
        {"kjhk", 10},
        {"kjhk2", 12}
    };

    HashTable<label, label, Hash<label>> table2
    {
        {3, 10},
        {5, 12},
        {7, 16}
    };
2016-08-05 22:30:26 +01:00
d2982c18ab Test-fileName: Added recent etcFiles.H 2016-08-05 17:25:56 +01:00
7656c076c8 C++11: Replaced the C NULL with the safer C++11 nullptr
Requires gcc version 4.7 or higher
2016-08-05 17:19:38 +01:00
42e6cf574d FixedList: Add constructors from iterators and C++11 initializer_list using C++11 constructor delegation 2016-08-05 16:25:18 +01:00
438c9b901b Test-List: Add demonstration of C++11 initializer list in conjunction with uniform initialization of vector
List<vector> list5
     {
         {5, 3, 1},
         {10, 2, 2},
         {8, 1, 0}
     };
2016-08-05 16:22:51 +01:00
22574e7133 List: Reinstated construction from two iterators and added construction from an initializer list
Until C++ supports 'concepts' the only way to support construction from
two iterators is to provide a constructor of the form:

        template<class InputIterator>
        List(InputIterator first, InputIterator last);

which for some types conflicts with

        //- Construct with given size and value for all elements
        List(const label, const T&);

e.g. to construct a list of 5 scalars initialized to 0:

    List<scalar> sl(5, 0);

causes a conflict because the initialization type is 'int' rather than
'scalar'.  This conflict may be resolved by specifying the type of the
initialization value:

    List<scalar> sl(5, scalar(0));

The new initializer list contructor provides a convenient and efficient alternative
to using 'IStringStream' to provide an initial list of values:

    List<vector> list4(IStringStream("((0 1 2) (3 4 5) (6 7 8))")());

or

    List<vector> list4
    {
        vector(0, 1, 2),
        vector(3, 4, 5),
        vector(6, 7, 8)
    };
2016-08-02 09:31:41 +01:00
857915dabd LUscalarMatrix: Added processor-local matrix inverse function 2016-07-17 14:44:50 +01:00
8a5304edf6 Doxygen documentation: Standardized the 'See also' heading 2016-06-17 17:31:34 +01:00
4500971827 Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
fe43b80536 GeometricField: Renamed internalField() -> primitiveField() and dimensionedInternalField() -> internalField()
These new names are more consistent and logical because:

primitiveField():
primitiveFieldRef():
    Provides low-level access to the Field<Type> (primitive field)
    without dimension or mesh-consistency checking.  This should only be
    used in the low-level functions where dimensional consistency is
    ensured by careful programming and computational efficiency is
    paramount.

internalField():
internalFieldRef():
    Provides access to the DimensionedField<Type, GeoMesh> of values on
    the internal mesh-type for which the GeometricField is defined and
    supports dimension and checking and mesh-consistency checking.
2016-04-30 21:40:09 +01:00
e1e996746b GeometricField::internalField() -> GeometricField::internalFieldRef()
Non-const access to the internal field now obtained from a specifically
named access function consistent with the new names for non-canst access
to the boundary field boundaryFieldRef() and dimensioned internal field
dimensionedInternalFieldRef().

See also commit a4e2afa4b3
2016-04-30 14:25:21 +01:00
53e13f10a5 Updated header 2016-04-29 17:18:33 +01:00
064d3046b9 List: Removed unused constructor from iterators
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2074
2016-04-29 17:17:45 +01:00
f0d25904e4 GeometricField, volFields: Added experimental member function ".v()" and perfix operator "~"
both of which return the dimensionedInternalField for volFields only.

These will be useful in FV equation source term expressions which need
not evaluate boundary conditions.
2016-04-26 20:45:53 +01:00
a8bf4be58a Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00