3.1.7 Verifying Functionality Of Flowing In Module
Every module must be verified to determine that it performs to the requirements specified. Even the simplest modules are subjected to a series of tests as part of this verification process. Verification is explained in detail at Chapter 6. Briefly, there are three primary types of test we would conduct on this module to verify it performs as required. These include logical, extreme-value and mass-balance tests.
In the example described in this chapter, we have progressively conducted logical tests. We have compared the results obtained with those calculated using the graphical integration method. This is laborious and would not normally be the case. In the general case, logical tests are devised at the time modelling requirements are determined.
Extreme value tests would be applied, for example, to determine the result of more water flowing in than the bathtub has capacity. If excess water flowed in, the bathtub would simply overflow. To avoid overflowing, the module must be modified. One possible modification scheme would involve stopping Flowing In and pausing the simulation at, say, 298 litres. The simulation would be paused just before BATHTUB reaches the maximum value of 300 litres. Functional details of such a modification are provided in Table 3-3 and Figure 3-28.
Table 3-3. Additional Functionality Defined for Flowing In Module
Variable Name | Functional Definition |
|---|---|
Flowing In | (GRAPH((TIME-STARTTIME),0<<min>>,1<<min>>, {40,40,40,26.66,13.33,0}*1<<l/min>>) +IF((TIME-STARTTIME)>=5<<min>>, 20<<l/min>>,0<<l/min>>)) +IF((TIME-STARTTIME)>=6<<min>> ,-20<<l/min>>,0<<l/min>>)) *IF(BATHTUB>=298<<l>>,0,1) |
Pause When Full | PAUSEIF(BATHTUB>=298<<l>>) |
Sound When Paused | SOUND(IF(BATHTUB>=298<<l>>,1,0)) |

A simple test of functioning would involve temporarily setting the limiting capacity of BATHTUB to 200 litres. When this is done, the simulation stops at the end of the sixth minute.
A mass-balance test would be designed to ensure, for example, that we do not accumulate (in addition to the initial stock) more than we could have physically added during the simulation. Other examples are provided in Chapter 5 (Figures 5-7, 5-15, and 5-16) and Chapter 6 (Figure 6-5).
