9.2.3. Step 3: Set Up a Working Folder for the System Coupling Run

Now create a working directory where you will run the System Coupling simulation. Create in this directory:

  1. A subfolder for the Forte runs driven by System Coupling. This folder must contain the Forte .ftsim project file.

  2. A subfolder for the other Participants (For example, Fluent) in this System Coupling run.

  3. If using the Command-Line Interface (CLI) System Coupling (see Step 4a: Create a System Coupling Python Run Script) you need to place a System Coupling python script that defines and controls the run in the working directory. Alternatively, the System Coupling Graphical User Interface can be used (see Step 4b: Use the System Coupling Graphical User Interface).

  4. This working directory should also contain System Coupling participant files (.scp) that are required by other Participants, such as a Fluent .scp file.

Figure 9.4: Content in the working directory of a Forte-Fluent System Coupling simulation provides an example. This working directory contains the following files and folders:

  • Subfolder "fluent": this folder contains Metal_block.cas, the project file of the Fluent simulation. This is where Fluent will run during the coupled simulation.

  • Subfolder "forte": this folder contains Engine.ftsim, the project file of the Forte simulation. This is where Forte will run during the coupled simulation.

  • fluent.scp: the System Coupling participant file for Fluent.

  • run.py: the python script used to run CLI System Coupling.

Figure 9.4: Content in the working directory of a Forte-Fluent System Coupling simulation

Content in the working directory of a Forte-Fluent System Coupling simulation


Note:  Forte does not use an .scp file; everything that is required for a System Coupling run is already contained in the Forte project file that you already prepared.


You may choose any arbitrary names for the subfolders containing the Forte and Fluent projects and choose any arbitrary names for the project files. However, you must make sure that the names are consistently specified in the following ways:

First, check the beginning lines of the .scp file. It should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<CouplingParticipant>
<ExecutionControl>
<WorkingDirectory>fluent</WorkingDirectory>
<InitialInput>Metal_block</InitialInput>
</ExecutionControl>

Make sure that the text between <WorkingDirectory> and </WorkingDirectory> is consistent with Fluent's subfolder name (in this case, "fluent"). Also, make sure that the text between <InitialInput> and </InitialInput> is consistent with Fluent's project name (in this case, "Metal_block").


Note:  In certain .scp files, there is no specification of <WorkingDirectory> and </WorkingDirectory>. This happens when you write a new .scp file from the Participant's project. In this case, System Coupling will assume no subfolder exists for this participant and that its input file is located in System Coupling's working directory. It is recommended that you add the specification of <WorkingDirectory> and </WorkingDirectory> as shown in the above example and place the participant's input file in the subfolder.


Then, if you are using CLI System Coupling, check the beginning lines of the Python script ("run.py"). They should look like this:

import os
# Add Forte as coupling participant
forte = AddParticipant(InputFile = os.path.join('forte', 'Engine.ftsim'))
# Add Fluent as coupling participant
fluent = AddParticipant(InputFile = 'fluent.scp')

In the code line adding Forte as coupling participant, make sure that the two arguments of os.path.join (in this case, forte and Engine.ftsim) are consistent with the names of the Forte subfolder and the Forte project, respectively. In the code line adding Fluent as coupling participant, make sure that the System Coupling participant file (in this case, fluent.scp) is the one in the working directory.