Tutorial 2                    

Running Dynamic Simulations


While steady state simulations provide the foundation of a model, the value comes from the ability to run interactive dynamic simulations.

Objectives

This tutorial covers the following topics: 

1.         Setting up graphics and interactive controllers

2.         Running interactive simulations

When you have finished this tutorial, you will be able to run full-scale dynamic treatment process models.  You will learn the procedures for creating time series graphics and interactive controls.  These essentials provide a foundation on which other advanced features are built; therefore, it is important to understand the material in this tutorial first before going on to more complicated tasks.

Creating Input Controls

GPS-X is an interactive simulation program, or simulator, which can run both pre-defined simulations and interactive sessions.  We will now set up an interactive session that allows us to investigate the effects of changes in the influent flow rates on the plant effluent qualities.

Our first task is to create a new Input Control.  An input control is an interactive tool, which can be used to change the value of model variables during a simulation run.  You can create as many input controls as desired. 

Here, we will create a single control for the acid dosage flow rate so that this variable can be changed during a simulation.

1.       Openthe layout built in Tutorial 1 and save it as `tutorial-2 using File > Save As...

 

2.       Switch to Simulation Mode if not already there.

 

3.       Access the input parameter by right-clicking on the acid dosage object and select the Flow Rate Setup item from the Flow sub-menu as shown below.

Graphical user interface, application  Description automatically generated

Figure 21- Accessing Flow Parameter

 

4.       From the Flow Rate Setup entry form, drag the Flow Rate variable to the blank input control area above the layout as shown below.

 

imageimage

Figure 22- Dragging a Variable to the Control Tab

Note that a new tab (labeled “Input: 1”) has been created for the input control. Multiple controls can be placed on a single tab, or on as many tabs as required.

 

image

5.       Edit the input control properties by clicking on the Input Control Properties… button on the Controls toolbar. An entry form window will be displayed.

 

You can use this form to set minimum (Min), maximum (Max), and control increment (Delta) values (if applicable) for a particular variable.

 

Select 0 for Min and 0.5 for Max.  It is not necessary to enter a value in the Delta column, as we will be using a slider-type control, which does not require a value for this attribute.

 

image

Figure 23- Control Properties Window

Note that you have the choice of a variety of controller types (under the Type heading).  Make sure that Slideris selected for the flow rate item.

 

Remember to save your changes by pressing the Accept button.

 

An input control for the plant acid influent flow has now been created.

 

6.       Rename the control tab by double-clicking on the tab name “Input: 1”.  Type “Acid Flow” and press Enter.

 

image

Figure 24- Finalized Input Control

The tab shown in Figure 2‑4 contains a slider that allows you to change the acid dosage flow from 0 to 0.5 m3/d.

You can test the slider control by dragging the small slider knob. Note that the acid flow value will change to the value displayed on the control.

A picture containing wheel  Description automatically generated

Before proceeding, use the Reset button at the far right of the slider to move the slider back to the default position of 0.1 m 3/d (alternatively, you may enter the value into the control box with the keyboard).

Creating Output Graphs

In addition to the summaries available on the Quick Display panels, you can create new custom-designed output graphs for numerous variables located in the Output Variables menu of each object that can be accessed by right-clicking on an object.

These variables cover a wider range of model outputs and can be used to supplement the standard outputs in the Quick Displays. 

image

 

6.       Create a new, blank output tab by clicking on the New Graph Tab button on the Outputs toolbar. A new, blank output tab will be created.

Note that you can also change the name of any output tab by double-clicking on the tab name and entering a new one.

 

7.       Create a graph of the effluent pH from neutralization tank by right-clicking on the neutralization tank object and select Output Variables > Water Chemistry Variables as shown below.

 

Graphical user interface, application  Description automatically generated

Figure 25- Accessing Output Variable Windows

8.       From the Water Chemistry Variable window, drag the estimated pH variable to a blank area on the new tab that you created, as shown below. This will create an X-Y Graph with the estimated pH plotted on the y-axis. Select Accept or Cancel to close the window.

 

image

Figure 26- Dragging Variable to Create a Graph

9.       Next, right click on the Treated Water unit and select Output Variables > Water Chemistry Variable from the pop-up menu.

 

image

Figure 27- Accessing the Output Variable Menu from the Treated Water Object

Alternatively, if the Treated Water object had not been used in the layout, the plant effluent properties could be accessed by right clicking on the neutralization tank’s effluent stream. When the cursor is over the effluent stream, it will change from the Microsoft default cursor to a connecting arrow, as seen in Figure 2‑8. Right-click and select Output Variables > Water Chemistry Variable. Note: ensure the connecting arrow is present as opening an Output window from the center of the object may open a different menu.

image

Figure 28- Connection Point Cursor Change

10.   Drag the total alkalinity variable to the same graph as the influent flow.  This will add another y-axis to the graph for this variable.

 

NOTE:  There is a difference between data entry forms and output variable forms even though both have a similar appearance and may contain the same variable name entries.   

Data entry forms contain a field on the right-hand side for entering data.  In output variable forms this field displays model results and cannot be edited.   

Variables dragged from a data entry form can be placed on input control tabs whereas variables dragged from an output variable form can be placed on graphs in the output field.

 

image

11.   Resize and arrange the graph by clicking on the Auto Arrange button on the Outputs toolbar. Your simulation environment should appear as shown below.

 

Graphical user interface  Description automatically generated

Figure 29- Simulation Environment with Output Graph

image

12.   Access the output graph properties window by right-clicking on the output graph and selecting the Output Graph Properties… item from popup menu. Alternatively, you can press the settings button on the Output toolbar.

 

image

Figure 210- Accessing Output Graph Properties

 

The Output Graph Propertieswindow is used to specify plotting attributes including the min and max y-axis values, the color of the variable’s line and what unit to display the data with.

 

The Autoscale feature can be used to allow the y-axis to automatically set an appropriate max value depending on the data being displayed (it will adjust during the simulation). By selecting this you will not have the option to adjust the minimum and maximum values displayed in the Variable Properties section.

 

The Output Graph Typeitem is also available here. By default, the graph type is X-Y (time series) but this can be changed to several different options.  For this tutorial, we will be leaving it as X-Y.

 

13.   Enter aminimum and maximum value for each variable. Use 0 and 14 for pH, and 0 and 120 mgCaCO3/L for total alkalinity.

 

A close up of a logo  Description automatically generated

 

A close up of a logo  Description automatically generated

 NOTE: You must ‘unlock’ the max fields to be able to edit the y-axis bounds   

 individually otherwise the change in one field will be copied to the others. This is   

 because quite often people will plot variables of similar characteristics on a graph  

 and they’ll want the y-axis to have the same scale.

 

image

Figure 211- Output Properties Showing Unlocked Max Field

Keeping the max fields unlocked,Accept the changes when you are finished.

 

14.   Rename the output graph.  This can be done in the properties window described above, but several of the properties can also be accessed from the popup menu opened by right-clicking on the graph. Do this and select Rename Output Graph….  Enter an appropriate title for the output graph and click OK.

 

image

Figure 212- Rename Output Graph

15.   Double click on the output tab to change the tabs name. Rename the tab Effluent Chemistry.

Running A Dynamic Simulation

You are now ready to run the model.  All the controls that you will need to run a dynamic simulation are located on the Simulation Toolbar at the bottom of the screen.

image

Figure 213- Simulation Toolbar

16.   Specify a simulation duration time of 20 days by either entering the value directly into the Stop Time field or by repeatedly clicking on the up arrow to increment the value by 1 day for each click.

 

image

17.   Start the simulation by clicking on the Start button.

While the simulation is running you can now change the acid flow with the input control slider bar and assess the effect of changes in influent acid flow on the effluent pH and total alkalinity.

 

If the acid flow rate is high enough (say 0.4 m3/d) you will observe a significant decrease in the effluent pH and the total alkalinity will go to zero. This is caused by the acid dosage flow rate exceeding the capacity of the alkaline substances in the water ability to buffer changes in pH.

 

An example simulation run is depicted in Figure 2‑14, where the acid flow rate was increased with the input control slider bar during the simulation run. Note that your output graph will look different than the one presented below depending on how you adjust the slider control during the simulation run.

 

image

Figure 214- Example Run with Acid Flow Increase

If the simulation proceeds too quickly, you can increase the length of the simulation to 40 days instead of 20 days.

 

NOTE:  If the simulation time exceeds the stop time (Stop) the model will halt. At that time, you have two choices:  

  • Restart the simulation by clicking on the Start button in the Simulation Control window; or  
  • Increase the length of the simulation by increasing the value of Stop and clicking Resume to continue the simulation.

 

Analyzing the Plant

We will now take a more detailed look at our plant's performance by investigating the effects of the acid dosage flow rate on the carbonate hardness in the effluent. We will first set-up a new digital output display for the carbonate hardness in the effluent stream. We will then simulate steady-state conditions with an acid dosage of 0.1 m3/d and investigate changes in the effluent carbonate hardness when operating the model at a higher acid dosage flow rate.

18.   Drag the Output Graph previously created in this tutorial aside to create space for a new output graph. This can be done by clicking on the output graph title bar and dragging it to a new location.

 

19.   Access the Water Chemistry Variables of the treated water by right-clicking on the Treated Water object and selecting Output Variables > Water Chemistry Variables.

A screenshot of a cell phone  Description automatically generated

Figure 215– Accessing Water Chemistry Variables

20.   Drag the Carbonate Hardness item to a blank area on the output tab (see Figure 2‑16. By dropping it there, a new X-Y Output Graph will be created on the same output tab.

 

imageimage

Figure 216- Dragging Variable to Blank Space on Output Tab

21.   Change the graph type. In this case, instead of using the default X-Y graph, we would like to use a Digital type output graph. This graph will only display the current numeric value of the variable on the plot.

 

22.   Rename the Plot. Right-click on the graph and select the Rename Output Graph… item from the drop-down menu and enter an appropriate title.

 

23.   Resize the graphs. Press the Auto Arrange button to arrange both plots to fill the output tab.

 

24.   Select the Steady-State option and Startthe simulation with the stop time set to 10-days. Make sure that the acid dosage flow rate is set to 0.1 m3/d on the input controller. Below is a figure that shows the simulation output.

 

image

­ Figure 217- Plant Effluent Graphs

 

A picture containing gear, metalware  Description automatically generated

25.   Increase the acid dosage flow rate to a higher value (i.e. 0.35 m3/d) with the input control. Adjust Stop Time to 20 days and Resume the simulation.

The output graphs will change to reflect the increase in acid dosage flow rate and the diminishing buffer capacity.

image

Figure 218- Effects of an increase in the Acid Dosage Flow Rate on Water Chemistry Variables

26.   Save the layout. Press the Save button on the main toolbar.