A new constraint patch has been added which permits AMI coupling in
cyclic geometries. The coupling is repeated with different multiples of
the cyclic transformation in order to achieve a full correspondence.
This allows, for example, a cylindrical AMI interface to be used in a
sector of a rotational geometry.
The patch is used in a similar manner to cyclicAMI, except that it has
an additional entry, "transformPatch". This entry must name a coupled
patch. The transformation used to repeat the AMI coupling is taken from
this patch. For example, in system/blockMeshDict:
boundary
(
cyclic1
{
type cyclic;
neighbourPatch cyclic2;
faces ( ... );
}
cyclic2
{
type cyclic;
neighbourPatch cyclic1;
faces ( ... );
}
cyclicRepeatAMI1
{
type cyclicRepeatAMI;
neighbourPatch cyclicRepeatAM2;
transformPatch cyclic1;
faces ( ... );
}
cyclicRepeatAMI2
{
type cyclicRepeatAMI;
neighbourPatch cyclicRepeatAMI1;
transformPatch cyclic1;
faces ( ... );
}
// other patches ...
);
In this example, the transformation between cyclic1 and cyclic2 is used
to define the repetition used by the two cyclicRepeatAMI patches.
Whether cyclic1 or cyclic2 is listed as the transform patch is not
important.
A tutorial, incompressible/pimpleFoam/RAS/impeller, has been added to
demonstrate the functionality. This contains two repeating AMI pairs;
one cylindrical and one planar.
A significant amount of maintenance has been carried out on the AMI and
ACMI patches as part of this work. The AMI methods now return
dimensionless weights by default, which prevents ambiguity over the
units of the weight field during construction. Large amounts of
duplicate code have also been removed by deriving ACMI classes from
their AMI equivalents. The reporting and writing of AMI weights has also
been unified.
This work was supported by Dr Victoria Suponitsky, at General Fusion
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.
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
In constant/chemistryProperties in addition to the specification of the initial
ODE integration time-step used at the start of the run:
initialChemicalTimeStep 1e-12;
this time step may now also be specified for every chemistry integration by
setting the optional entry maxChemicalTimeStep, e.g.
maxChemicalTimeStep 1e-12;
OpenFOAM can now be compiled with single, double or long double scalars by
setting the WM_PRECISION_OPTION environment variable to either SP, DP or LP
respectively.
On most 64bit systems long double is stored as 128bit but computed in the
floating point hardware to 80bit. Due to the increased storage compared to
double precision cache and memory access is significantly more time consuming
causing a slow-down of floating point intensive operations by a factor of 2 to
3.
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)
When etc/controlDict::writeJobInfo is set to 1 jobInfo.<pid> files are written
to the case directory containing a summary of the execution of the job containing
startDate
startTime
userName
foamVersion
code
argList
currentDir
PPID
PGID
foamBuild
root
case
nProcs
When the job completes the following additional entries are written:
cpuTime
endDate
endTime
termination
The original etc/controlDict::writeJobInfo control has been renamed writeJobControl and when set
to 1 writes the ~/OpenFOAM/jobControl/runningJobs and finishedJobs files for job control.
Specifying default fields for complex and multi-phase cases is simplified and
generalized by using wildcards to select sets of related field names, e.g.
defaultFields (p p_rgh U "U\..*" T "T\..*" "alpha\..*");
selects the velocity, temperature and phase-fraction fields of all phases in
addition to the pressure fields.
The default patch types specified in the new defaultPatchTypes entry of the
etc paraFoam configuration dictionaries:
defaultPatchTypes (patch wall);
Wildcards are supported, for example to specify that all patches loaded simply set
defaultPatchTypes to
defaultPatchTypes (".*");
The new default paraFoam configuration is in the files OpenFOAM-dev/etc/paraFoam
containing the entry
defaultFields (U p p_rgh T alpha.water alpha.air);
specifying the set of fields which are loaded by default if available. This
setting maybe overridden by providing additional paraFoam configuration files in
any of the OpenFOAM etc directories searched, listed using
foamEtcFile -list
e.g.
~/.OpenFOAM/dev
~/.OpenFOAM
~/OpenFOAM/site/dev
~/OpenFOAM/site
~/OpenFOAM/OpenFOAM-dev/etc
The new configurable set of default fields loaded replaces the original hard-coded default of
"p" and "U" and is much more convenient for current OpenFOAM usage.
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.
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.
"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.
In addition to local Doxygen HTML directories an optional HTTP server directory
may be specified:
Documentation
{
docBrowser "firefox";
doxyDocDirs
(
"$WM_PROJECT_USER_DIR/html"
"~OpenFOAM/html"
"$WM_PROJECT_DIR/doc/Doxygen/html"
"http://cpp.openfoam.org/dev"
);
doxySourceFileExt "_8C.html";
}
from which the Doxygen documentation files may be obtained so now the "-doc"
command-line option may be used even if if Doxygen has not been run locally,
e.g.
pimpleFoam -doc
When typing OpenFOAM commands, the bash completion system will
complete option names, e.g. -help, -parallel, etc. After typing an
option that includes an argument, e.g. -case <dir>, completion will
adjust to the type of argument, e.g. present directories if the
argument is a directory. Similarly, for applications with mandarory
file arguments, file (and directory) names will appear on the
completion list.