- controlled by the the 'printExecutionFormat' InfoSwitch in
etc/controlDict
// Style for "ExecutionTime = " output
// - 0 = seconds (with trailing 's')
// - 1 = day-hh:mm:ss
ExecutionTime = 112135.2 s ClockTime = 113017 s
ExecutionTime = 1-07:08:55.20 ClockTime = 1-07:23:37
- Callable via the new Time::printExecutionTime() method,
which also helps to reduce clutter in the applications.
Eg,
runTime.printExecutionTime(Info);
vs
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
--
ENH: return elapsedClockTime() and clockTimeIncrement as double
- previously returned as time_t, which is less portable.
- The bitSet class replaces the old PackedBoolList class.
The redesign provides better block-wise access and reduced method
calls. This helps both in cases where the bitSet may be relatively
sparse, and in cases where advantage of contiguous operations can be
made. This makes it easier to work with a bitSet as top-level object.
In addition to the previously available count() method to determine
if a bitSet is being used, now have simpler queries:
- all() - true if all bits in the addressable range are empty
- any() - true if any bits are set at all.
- none() - true if no bits are set.
These are faster than count() and allow early termination.
The new test() method tests the value of a single bit position and
returns a bool without any ambiguity caused by the return type
(like the get() method), nor the const/non-const access (like
operator[] has). The name corresponds to what std::bitset uses.
The new find_first(), find_last(), find_next() methods provide a faster
means of searching for bits that are set.
This can be especially useful when using a bitSet to control an
conditional:
OLD (with macro):
forAll(selected, celli)
{
if (selected[celli])
{
sumVol += mesh_.cellVolumes()[celli];
}
}
NEW (with const_iterator):
for (const label celli : selected)
{
sumVol += mesh_.cellVolumes()[celli];
}
or manually
for
(
label celli = selected.find_first();
celli != -1;
celli = selected.find_next()
)
{
sumVol += mesh_.cellVolumes()[celli];
}
- When marking up contiguous parts of a bitset, an interval can be
represented more efficiently as a labelRange of start/size.
For example,
OLD:
if (isA<processorPolyPatch>(pp))
{
forAll(pp, i)
{
ignoreFaces.set(i);
}
}
NEW:
if (isA<processorPolyPatch>(pp))
{
ignoreFaces.set(pp.range());
}
- In addition to the traditional Flex-based parser, added a Ragel-based
parser and a handwritten one.
Some representative timings for reading 5874387 points (1958129 tris):
Flex Ragel Manual
5.2s 4.8s 6.7s total reading time
3.8s 3.4s 5.3s without point merging
- now avoid Istream and token mechanism in favour of a simpler string
parser. This makes the code clearer, smaller, robuster.
- provide convenience ge/gt/le/lt static constructors for scalarRange
for using bounds directly with specifying via a string parameter.
- scalarRange, scalarRanges now follow the unary predicate pattern
(using an operator() for testing). This allows their reuse in
other contexts. Eg, for filtering operations:
myHash.filterValues(scalarRange::ge(100));
- remove unused scalarRanges methods that were specific to handling
lists of time values. These were superseded by timeSelector methods
several versions ago.
- this compact form shows the subscription per host in the unsorted
mpi order
nProcs : 18
Hosts :
(
(node1 6)
(node2 8)
(node3 4)
)
This provides a succinct overview of which hosts have been
subscribed or oversubscribed.
- The longer list of "slave.pid" ... remains available on the
InfoSwitch 'writeHosts'
old "positions" file form
The change to barycentric-based tracking changed the contents of the
cloud "positions" file to a new format comprising the barycentric
co-ordinates and other cell position-based info. This broke
backwards compatibility, providing no option to restart old cases
(v1706 and earlier), and caused difficulties for dependent code, e.g.
for post-processing utilities that could only infer the contents only
after reading.
The barycentric position info is now written to a file called
"coordinates" with provision to restart old cases for which only the
"positions" file is available. Related utilities, e.g. for parallel
running and data conversion have been updated to be able to support both
file types.
To write the "positions" file by default, use set the following option
in the InfoSwitches section of the controlDict:
writeLagrangianPositions 1;
Original commit message:
------------------------
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.
- allows configuration without an environment variable.
For compatibility still respect FOAM_SIGFPE and FOAM_SETNAN
env-variables
- The env-variables are now treated as true/false switch values.
Previously there was just a check for env exists or not, but this
can be fairly fragile for a user's environment.
- use InfoSwitch to disable, or via static method.
- respect the state of the argList banner when deciding to emit
initialization information. Can otherwise end up with unwanted
output rubbish on things like foamDictionary and foamListTimes.
by combining with and rationalizing functionality from
turbulentHeatFluxTemperatureFvPatchScalarField.
externalWallHeatFluxTemperatureFvPatchScalarField now replaces
turbulentHeatFluxTemperatureFvPatchScalarField which is no longer needed and has
been removed.
Description
This boundary condition applies a heat flux condition to temperature
on an external wall in one of three modes:
- fixed power: supply Q
- fixed heat flux: supply q
- fixed heat transfer coefficient: supply h and Ta
where:
\vartable
Q | Power [W]
q | Heat flux [W/m^2]
h | Heat transfer coefficient [W/m^2/K]
Ta | Ambient temperature [K]
\endvartable
For heat transfer coefficient mode optional thin thermal layer resistances
can be specified through thicknessLayers and kappaLayers entries.
The thermal conductivity \c kappa can either be retrieved from various
possible sources, as detailed in the class temperatureCoupledBase.
Usage
\table
Property | Description | Required | Default value
mode | 'power', 'flux' or 'coefficient' | yes |
Q | Power [W] | for mode 'power' |
q | Heat flux [W/m^2] | for mode 'flux' |
h | Heat transfer coefficient [W/m^2/K] | for mode 'coefficent' |
Ta | Ambient temperature [K] | for mode 'coefficient' |
thicknessLayers | Layer thicknesses [m] | no |
kappaLayers | Layer thermal conductivities [W/m/K] | no |
qr | Name of the radiative field | no | none
qrRelaxation | Relaxation factor for radiative field | no | 1
kappaMethod | Inherited from temperatureCoupledBase | inherited |
kappa | Inherited from temperatureCoupledBase | inherited |
\endtable
Example of the boundary condition specification:
\verbatim
<patchName>
{
type externalWallHeatFluxTemperature;
mode coefficient;
Ta uniform 300.0;
h uniform 10.0;
thicknessLayers (0.1 0.2 0.3 0.4);
kappaLayers (1 2 3 4);
kappaMethod fluidThermo;
value $internalField;
}
\endverbatim
Pstream: added maxCommsSize setting to do (unstructured) parallel transfers in blocks.
Tested:
- with maxCommsSize 0 produces exactly same result as plus.develop
- compiles with label64
- with maxCommsSize e.g. 3 produces exactly same result as plus.develop
- with maxCommsSize=0 exactly the same messages (with Pstream::debug = 1) as plus.develop
See merge request !85
which provided warning about backward-compatibility issue with setting div
schemes for steady-state. It caused confusion by generating incorrect warning
messages for compressible cases for which the 'bounded' should NOT be applied to
the 'div(phid,p)'.
Given that the type of the dimensioned internal field is encapsulated in
the GeometricField class the name need not include "Field"; the type
name is "Internal" so
volScalarField::DimensionedInternalField -> volScalarField::Internal
In addition to the ".dimensionedInternalField()" access function the
simpler "()" de-reference operator is also provided to greatly simplify
FV equation source term expressions which need not evaluate boundary
conditions. To demonstrate this kEpsilon.C has been updated to use
dimensioned internal field expressions in the k and epsilon equation
source terms.
Function1 is an abstract base-class of run-time selectable unary
functions which may be composed of other Function1's allowing the user
to specify complex functions of a single scalar variable, e.g. time.
The implementations need not be a simple or continuous functions;
interpolated tables and polynomials are also supported. In fact form of
mapping between a single scalar input and a single primitive type output
is supportable.
The primary application of Function1 is in time-varying boundary
conditions, it also used for other functions of time, e.g. injected mass
is spray simulations but is not limited to functions of time.
When using models which require the wallDist e.g. kOmegaSST it will
request the method to be used from the wallDist sub-dictionary in
fvSchemes e.g.
wallDist
{
method meshWave;
}
specifies the mesh-wave method as hard-coded in previous OpenFOAM versions.
The standard/previous general symmetry type is now named symmetry
both in class and lookup name for consistency. The rigorous
symmetryPlane type is needed for moving-mesh cases in which the
motion it constrained by one or two planes.
To support these changes the need for "Sp" corrections on div-terms has been
eliminated by introducing a "bounded" convection scheme which subtracts the Sp
term from the selected scheme. The equivalent will be needed for the ddt term.
A warning message is generated for steady-state solvers in which the "bounded"
scheme is not selected for the convection terms.
- To-do:
wmake/rules/General/bison
wmake/rules/General/btyacc
wmake/rules/General/btyacc++
wmake/rules/General/byacc
wmake/rules/General/moc
wmake/rules/General/yacc
but these files have <TAB>