3.11. Creating and Reading Journal Files

A journal file contains a sequence of Ansys Fluent commands, arranged as they would be typed interactively into the program or entered through the GUI or TUI. The GUI and TUI commands are recorded as Scheme code lines in journal files. You can also create journal files manually with a text editor. If you want to include comments in your file, be sure to put a semicolon (;) at the beginning of each comment line. For an example, see Background Execution on Linux Systems in the Getting Started part of this manual.

The purpose of a journal file is to automate a series of commands instead of entering them repeatedly on the command line. Another use is to produce a record of the input to a program session for later reference, although transcript files are often more useful for this purpose. (For details, see Creating Transcript Files).

Command input is taken from the specified journal file until its end is reached, at which time control is returned to the standard input (usually the keyboard). Each line from the journal file is echoed to the standard output (usually the screen) as it is read and processed.


Important:
  • A journal file is, by design, just a simple record and playback facility. It contains no information about the state in which it was recorded (other than the version of Ansys Fluent that it was created in) or the state in which it is being played back.

  • The precision (single or double) that the journal is recorded in may affect playback when it is read into a session that is running in the other precision.


  • Be careful not to change the folder while recording a journal file. Also, try to re-create the state in which the journal was written before you read it into the program. For example, if your journal file includes an instruction to save a new file with a specified name, you should check that if a file with that name exists in your folder before you read in your journal file. If a file with that name exists and you read in your journal file, when the program reaches the write instruction, it will prompt for a confirmation to overwrite the old file.

    Since the journal file does not contain any response to the confirmation request, Ansys Fluent cannot continue to follow the instructions of the journal file.

  • Other conditions that may affect the program’s ability to perform the instructions contained in a journal file can be created by modifications or manipulations that you make within the program.

    For example, if your journal file creates several surfaces and displays data on those surfaces, you must be sure to read in appropriate case and data files before reading the journal file.


    Important:  At a point of time, only one journal file can be open for recording, but you can write a journal and a transcript file simultaneously. You can also read a journal file at any time.


  • Whenever you start recording a journal file, the text command /file/set-tui-version "XX.X" is added at the top of the file (where XX.X corresponds to the version of Ansys Fluent that is recording the journal file). This text command can help journals created in an older version to work properly when used in a newer version, as it will hide the new text user interface (TUI) prompts and restore the deleted TUI prompts in that newer version.

    If you are writing a journal file in a text editor, it is recommended that you add /file/set-tui-version "XX.X" at the top of the file.


    Note:
    • The specified version must be within two full releases of the version that is running the journal.

    • To specify version 2024 R2, enter "24.2" for "XX.X".


Whether you choose to type the text command in full or use partial strings (as described in Command Abbreviation), complete commands are recorded in the journal files. Consider the following examples:

  • Typing in the TUI

     mesh/smooth-mesh , 5 ,
    

    will be recorded in the journal file as

     /mesh/smooth-mesh "quality based" 5 0.1
    

    where , or Enter signifies default values or entries, as described in Text Prompt System.

  • Typing in the TUI

     so set ur mom 0.2 pres 0.4 
    

    will be recorded in the journal file as two separate commands:

     /solve/set/under-relaxation/mom 0.2
     /solve/set/under-relaxation/pressure 0.4 
    

Important:
  • Only successfully completed commands are recorded. For example, if you stopped an execution of a command using Ctrl+c, it will not be recorded in the journal file.

  • If a GUI event happens while a text command is in progress, the GUI event is recorded first.

  • All default values are recorded (as in the first example above).


For additional information, see the following section:

3.11.1. Procedure

To start the journaling process, select the File/Write/Start Journal... ribbon tab item.

 File Write Start Journal...

After you enter a name for the file in the Select File dialog box, journal recording begins. The Start Journal... menu item becomes the Stop Journal menu item. You can end journal recording by selecting Stop Journal, or by exiting the program.

 File Write Stop Journal

You can read a journal file into the program using the Select File dialog box opened by selecting the File/Read/Journal... ribbon tab item.

 File Read Journal...

Journal files are always loaded in the main (that is, top-level) text menu, regardless of where you are in the text menu hierarchy when you invoke the read command.

3.11.2. Multiple Journal Files

It is possible to read multiple journal files into Fluent at once.

To read multiple journal files through the Select File dialog box:

  1. Open the Select File dialog box.

     File Read Journal...

  2. Select your files in the order you want them read into Fluent.

    The order in which they will be read is indicated by the red box in Figure 3.8: Multiple Selection of Journal Files.

    Figure 3.8: Multiple Selection of Journal Files

    Multiple Selection of Journal Files

  3. Click OK to load the selected files.

Nested Journal Files

It is possible to create a journal file that makes calls to other journal files.

The following is an example of a nested journal file:

/file/read-journal "E:/Example_journals_example1.jou" ""
/file/read-journal "E:/Example_journals_example2.jou" ""
/file/read-journal "E:/Example_journals_example3.jou" ""