OpenFOAM 2.1.0: Run-time Control
Timing of data writes
Version 2.1.0 includes some new controls for timing the writing of results to file.
Secondary controls in controlDict
In addition to the standard writeControl and writeInterval settings, optional secondary write controls are now available in the controlDict file through the secondaryWriteControl and secondaryWriteInterval keywords. For example, for an extra dump of results every hour of cpu time, e.g. in case of case termination, the user can add the following entries.
secondaryWriteControl cpuTime; secondaryWriteInterval 3600;
Sending a signal to a process
The option of writing data based on sending a signal to a process is controlled by two entries in the global controlDict file, i.e. in the $WM_PROJECT_DIR/etc directory. If any of these entries is set to a positive integer, the integer is interpreted as the signal to intercept and force a write of results at the next timestep. In the case of the stopAtWriteNowSignal, the solver will also terminate. Signals can be sent to the process with the kill command, e.g. kill -10 <PID>, where <PID> is the process ID.
OptimisationSwitches
{
    ...
    // Force dumping (at next timestep) upon signal
    writeNowSignal              10;
    // Force dumping (at next timestep) and clean exit upon signal
    stopAtWriteNowSignal        20; //-1;
}
Function objects
The following changes/additions have been made to function objects.
- Users can now supply a start time to activate the function object.
 - A coefficient of variance calculation has been added to 
fieldValuesfunction object. - A new 
windowoption has been added tofieldAverageto sample over a fixed time interval. - A new 
fieldCoordinateSystemTransformfunction object can transform fields from global co-ordinate system into a local co-ordinate system. - Users can now specify the interpolation method for the 
streamLinefunction object. - A new 
particleErosioncloud function object is available that outputs a volume field to describe the volume of material eroded by particle/patch interactions. 
Run-time code compilation
A shortcut for the #codeStream syntax has been introduced to perform one line calculations. The shortcut uses the #calc directive, e.g. to do an algebraic operation between two scalars, a and b, the syntax is:
a 1.0; // force a to be a scalar b 3; c #calc "$a/$b";
