Skip to content

Multiple Scenario Project Tool

When establishing a mathematical model of a system, it is very common to perform a variety of runs with different values of the most significant parameters to see their effects. In some cases, it is also useful to have the model run the scenario without a project and within a project. In previous versions of the plugin this had to be done in separate QGIS projects, which involved making copies of the project folders and data, which can bring problems with data handling and access. This version of the OilFlow2D plugin for QGIS allows the management of multiple scenarios within the same project. Variants of the same model can be created as subprojects, keeping the scenarios organized in one project.

New interface elements for managing multi-scenario projects in OilFlow2D

The OilFlow2D toolbar includes a scenario drop-down list. The first toolbar button opens the New OilFlow2D Project/Scene menu, which contains New OilFlow2D Project, New Scenario, and Delete Scenario. The OilFlow2D Tools menu contains Import Single to MultiScenario Project for converting an existing single-scenario project. The figures below show these current OilFlow2D controls in workflow order.

OilFlow2D toolbar with the scenario list

OilFlow2D New Scenario menu item

OilFlow2D Import Single to MultiScenario Project menu item

Creating a new OilFlow2D multiple-scenario project using QGIS

  1. Open Plugins > OilFlow2D MS > New OilFlow2D Project/Scene and select New OilFlow2D Project.

    OilFlow2D menu to create a new project

  2. In the Create New OilFlow2D Project dialog, choose the project directory and review the layers to include. The Name initial scenario : field is initially of2d_base in the current interface. Use a short scenario name without spaces, for example base, before confirming the project.

    OilFlow2D Create New OilFlow2D Project dialog

The selected project directory contains a subfolder with the initial scenario name. That scenario folder contains the shape data folder and the other OilFlow2D layer data. Each additional scenario receives its own scenario folder and shape data folder.

Create a new scenario

After creating a multi-scenario project, or after converting an existing project as described below, create an additional scenario from the current scenario.

  1. Open Plugins > OilFlow2D MS > New OilFlow2D Project/Scene and select the visible New Scenario action.

    OilFlow2D menu for creating a new scenario

  2. In the Add New Scenario to OilFlow Project dialog, enter a short name without spaces in New Scenario Name :. The configured example uses scenario_a, as shown below, and then confirms with OK.

    Add New Scenario to OilFlow Project dialog configured with scenario_a

The new scenario is based on the input layers of the current scenario. OilFlow2D creates the new scenario folder, copies the required input-layer files, updates the layer paths, and adds the new name to the scenario list. Post-processing products such as maps and animations are not copied.

Switching scenarios

  1. Open the scenario list in the OilFlow2D toolbar and select the desired scenario. The example below shows base and scenario_a in the list.

    OilFlow2D scenario list with base and scenario_a

  2. When changing from the current scenario, OilFlow2D displays the OilFlow2D confirmation dialog with the message Do you want change scenario?. Choose Yes to switch or No to remain in the current scenario.

    OilFlow2D confirmation dialog for switching scenarios

When a scenario is switched, the state of the layers in the current scenario is saved automatically.

Deleting scenarios

  1. Open Plugins > OilFlow2D MS > New OilFlow2D Project/Scene and select the visible Delete Scenario action.

    OilFlow2D Delete Scenario menu item

  2. Complete the deletion through the visible OilFlow2D dialog and prompts.

Do not delete a scenario folder manually from the project directory. The project can become unusable; use the OilFlow2D action instead.

Import an OilFlow2D project into Multi-scenario mode

The multi-scenario tool can convert an existing single-scenario OilFlow2D project.

  1. Open Plugins > OilFlow2D MS > OilFlow2D Tools and select the exact visible action Import Single to MultiScenario Project.

    OilFlow2D Tools menu with Import Single to MultiScenario Project

  2. In the visible import window, choose the source .DAT file and confirm the import.

OilFlow2D creates a scenario subfolder for the imported project, copies the project data into that scenario folder, and updates the QGIS project metadata and layer sources to the new locations. The scenario list is then updated with the imported scenario.

The original project files remain in the project folder. Keep the QGIS project file (.qgz) and remove the original data only when it is no longer needed.

This concludes the tutorial on using the Multiple Scenario Project tool within the QGIS OilFlow2D toolbar.