Time and data input/output control

4.3 Time and data input/output control

The OpenFOAM solvers begin all runs by setting up a database. The database controls I/O and, since output of data is usually requested at intervals of time during the run, time is an inextricable part of the database. The controlDict dictionary sets input parameters essential for the creation of the database. The keyword entries in controlDict are listed in Table 4.4. Only the time control and writeInterval entries are truly compulsory, with the database taking default values indicated by  in Table 4.4 for any of the optional entries that are omitted.

Time control


startFrom

Controls the start time of the simulation.

- firstTime

Earliest time step from the set of time directories.

- startTime

Time specified by the startTime keyword entry.

- latestTime

Most recent time step from the set of time directories.

startTime

Start time for the simulation with startFrom startTime;

stopAt

Controls the end time of the simulation.

- endTime

Time specified by the endTime keyword entry.

- writeNow

Stops simulation on completion of current time step and writes data.

- noWriteNow

Stops simulation on completion of current time step and does not write out data.

- nextWrite

Stops simulation on completion of next scheduled write time, specified by writeControl.

endTime

End time for the simulation when stopAt endTime; is specified.

deltaT

Time step of the simulation.

Data writing



writeControl

Controls the timing of write output to file.

- timeStep

Writes data every writeInterval time steps.

- runTime

Writes data every writeInterval seconds of simulated time.

adjustableRunTime

   Writes data every writeInterval seconds of simulated time, adjusting the time steps to coincide with the writeInterval if necessary — used in cases with automatic time step adjustment.

- cpuTime

Writes data every writeInterval seconds of CPU time.

- clockTime

Writes data out every writeInterval seconds of real time.

writeInterval

Scalar used in conjunction with writeControl described above.

purgeWrite

Integer representing a limit on the number of time directories that are stored by overwriting time directories on a cyclic basis. Example of t0 = 5s  \relax \special {t4ht=, Δt = 1s  \relax \special {t4ht= and purgeWrite 2;: data written into 2 directories, 6 and 7, before returning to write the data at 8 s  \relax \special {t4ht= in 6, data at 9 s  \relax \special {t4ht= into 7, etc.

To disable the time directory limit, specify purgeWrite 0;

For steady-state solutions, results from previous iterations can be continuously overwritten by specifying purgeWrite 1;

writeFormat

Specifies the format of the data files.

- ascii

ASCII format, written to writePrecision significant figures.

- binary

Binary format.

writePrecision

Integer used in conjunction with writeFormat described above, 6 by default

writeCompression

Specifies the compression of the data files.

- uncompressed

No compression.

- compressed

gzip compression.

timeFormat

Choice of format of the naming of the time directories.

- fixed

 m.dddddd  \relax \special {t4ht= where the number of d  \relax \special {t4ht=s is set by timePrecision.

- scientific

 m.dddddde    xx  \relax \special {t4ht= where the number of d  \relax \special {t4ht=s is set by timePrecision.

- general

Specifies scientific format if the exponent is less than -4 or greater than or equal to that specified by timePrecision.

timePrecision

Integer used in conjunction with timeFormat described above, 6 by default

graphFormat

Format for graph data written by an application.

- raw

Raw ASCII format in columns.

- gnuplot

Data in gnuplot format.

- xmgr

Data in Grace/xmgr format.

- jplot

Data in jPlot format.

Adjustable time step


adjustTimeStep

  yes/no switch for OpenFOAM to adjust the time step during the simulation, usually according to…

maxCo

  Maximum Courant number, e.g. 0.5

Data reading


runTimeModifiable

  yes/no switch for whether dictionaries, e.g.controlDict, are re-read by OpenFOAM at the beginning of each time step.

Run-time loadable functionality


libs

List of additional libraries (on $LD_LIBRARY_PATH) to be loaded at run-time, e.g.( "libUser1.so" "libUser2.so" )

functions

List of functions, e.g. probes to be loaded at run-time; see examples in $FOAM_TUTORIALS



 denotes default entry if associated keyword is omitted.

Table 4.4: Keyword entries in the controlDict dictionary.

Example entries from a controlDict dictionary are given below:

17  
18  application     icoFoam;
19  
20  startFrom       startTime;
21  
22  startTime       0;
23  
24  stopAt          endTime;
25  
26  endTime         0.5;
27  
28  deltaT          0.005;
29  
30  writeControl    timeStep;
31  
32  writeInterval   20;
33  
34  purgeWrite      0;
35  
36  writeFormat     ascii;
37  
38  writePrecision  6;
39  
40  writeCompression off;
41  
42  timeFormat      general;
43  
44  timePrecision   6;
45  
46  runTimeModifiable true;
47  
48  
49  // ************************************************************************* //

Creative Commons License
This User Guide is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License .