BALANCE is a map based surface water quality model. The system runs
inside a GIS environment and computes a constituent mass balance for surface
water segments, plotting mass fluxes and loads as it goes. The system uses
an explicit finite differences algorithm. BALANCE is written in ArcView's
Avenue programming language.
Variables
Several attributes need to be specified for the lines and polygons. A utility is available to assign and modify those attributes. If the fields are not present in the attribute tables the system will create them. Specifically the following attributes need to be specified:
Line attributes
Line attribute table:
Note: If you are new to BALANCE you might want to use the Simple Bay sample data to get started. That data was used to create the figures in this section.
The system is in the form of an ArcView project which can be opened
in ArcView like a file. In addition to the project you will need to load
the data. Once the View with the data is active you will see a few buttons
(C, P, B, M, I) appear at the top left
of the ArcView window. Those buttons control BALANCE. Alternatively, you
can control BALANCE from the 'Balance' pull-down menu. Figure 1 illustrates.
The system supports SI, English and Generic units. To configure the
units click on the configuration (C) button. Figure 2 shows the
configuration menu.
Click on 'Units' to bring up the units configuration menu and choose
the desired system of units. Figure 3 shows the units configuration menu
and Table 1 lists the details of each of the units systems.
------------------------------------------------------------------ System Load Conc. Decay Volume Area Flow Bulk Disp. (w) (s) (k) (v) (a) (q) (ep) SI kg/day mg/L 1/day m^3 m^2 m^3/s m^3/s English lbs/day mg/L 1/day ft^3 ft^2 cfs cfs Generic M/T M/V 1/T V A V/T V/T ------------------------------------------------------------------Table 1. Unit Systems. 5.b. Entering/Modifying Attribute Data
The attribute data used by BALANCE is attached to the lines and polygons.
To modify the attributes of a feature make the modify attributes tool active
by clicking on the (M) button. Then make the corresponding theme
active by clicking on it in the View's legend. Clicking on features brings
up the feature attribute modification windows. Figure 4 shows the attribute
modification window for an interior line and Figure 5 shows the attribute
modification window for a boundary line. Note that flows are specified
as positive or negative. A black vector is plotted on the line in the positive
direction to serve as a reference to the user. Figure 6 shows the attribute
modification window for a polygon.
To compute the constituent mass balance activate the line and polygon
themes by clicking on them in the View's legend. Then click on the (B)
button. You will need to specify run control parameters as shown in Figure
7. Run control parameters are described further in Tables 2 and 3.
--------------------------------------------------------------------------------- Parameter Description Delta t Time step used. Converge delta s If the maximum change in concentration from one time step to the next is smaller than this value the system assumes steady state is reached and stops the computation. Diverge delta s If the maximum change in concentration from one time step to the next is larger than this value the system assumes unstable conditions and stops the computation. Max t Maximum time for the computation. User Observation Level Specifies the amount of information conveyed to the user during computation. See Table 3. ---------------------------------------------------------------------------------Table 2. Run Control Parameters.
--------------------------------------------------------------------------------- Level Description 0 Not used yet. 1 The ArcView status bar is updated periodically. Information displayed includes time, maximum change in concentration from last step and percent of maximum time. 2 In addition to 1, the legend is updated periodically. This is useful if, for example, the polygons are colored based on concentration. 3 In addition to 2, the mass balance terms are plotted (see the section on plotting the results). 4 In addition to 3, the system pauses after every time step and displays the time and maximum change in concentration from last step. ---------------------------------------------------------------------------------Table 3. User Observation Levels.
The computation can stop for four different reasons:
The results of the mass balance computation are written to the attribute
tables of the data sets. To examine the results for a feature make the
information tool active by clicking on the (I) button. Then make
the corresponding theme active by clicking on it in the View's legend.
Clicking on features brings up the feature information screen. Line and
polygon information screens are shown in Figures 9 and 10, respectively.
The system has a plot utility which can plot mass fluxes and loads.
This utility is invoked by clicking on the plot (P) button. Note
that the themes for which the mass balance terms are to be plotted have
to be active. If, for example, only the line theme is active, only the
mass fluxes (not the load points) will be plotted.
Plotting is completely user configurable. To configure plotting click
on the configuration (C) button and choose 'Plot Parameters'. The
plot parameter configuration menu is shown in Figure 11. Following that
is a detailed description of all the sub menus
Flux Vectors
Specifies what flux vectors to plot. See Figure 12.
Flux Vector Locations
Specifies the locations for the flux vectors as a fraction of the line.
See Figure 13.
Flux Vector Scales
Specifies the plotting scale for the flux vectors. The user specifies
the magnitude which will be plotted at 1/10th of the View window size.
If the user specifies 0 the maximum magnitude will be plotted at 1/10th
the View window size. Note that the maximum magnitude changes from time
step to time step, which means that if the user specifies 0 the plotting
scale changes during the computation (only applicable for user observation
level greater than 2). See Figure 14.
Flux Vector Colors
Specifies what colors to use for flux vector plotting. The user can
specify black, blue, cyan, gray, green, magenta, red, white and yellow.
See Figure 15.
Load Points
Specifies what load points to plot. See Figure 16.
Load Point Locations
Specifies the plotting locations for the load points. The load points
are plotted on a circle around the centroid of the polygon. The user specifies
the location of the load point plot on that circle by specifying the angle
from the north direction. See Figure 17.
Load Point Scale
Specifies the plotting scale for the load points. The user specifies
the magnitude which will be plotted at 1/10th of the View window size.
If the user specifies 0 the maximum magnitude will be plotted at 1/10th
the View window size. Note that the maximum magnitude changes from time
step to time step, which means that if the user specifies 0 the plotting
scale changes during the computation (only applicable for user observation
level greater than 2). See Figure 18.
load Point Colors
Specifies what colors to use for load point plotting. The user can specify
black, blue, cyan, gray, green, magenta, red, white and yellow. See Figure
19.
Note: If you are new to ftp you might want to read the page entitled Getting Data From CRWR's Anonymous FTP Site.
Address: ftp.crwr.utexas.edu
Login: anonymous
Password: your e-mail address
Directory: /pub/outgoing/crwr/gishydro/balance
Transfer Mode: binary
Files:
Program: balance.apr
Simple Bay Sample Data: baynode.shp,.shx,.dbf, bayline.shp,.shx,.dbf,
baypoly.shp,.shx,.dbf
Simple River Sample Data: rivnode.shp,.shx,.dbf, rivline.shp,.shx,.dbf,
rivpoly.shp,.shx,.dbf
Corpus Christi Bay System Sample Data: ccbmnode.shp,.shx,.dbf, ccbmline.shp,.shx,.dbf,
ccbmpoly.shp,.shx,.dbf
The Simple Bay sample data is based on Sample Problem 3.5 (c), Thomann and Mueller, Principles of Surface Water Quality Modeling and Control, 1987. The bay consists of two segments as shown in Figure 20. The upper segment receives inflow and is subject to diversion flow (5 x inflow). The boundaries between the two segments and to the ocean are diffusive. There is decay. The lower segment is connected to the ocean which has a constituent concentration of 1 mg/L.
Due to the large flow diversion there is a net inflow into the bay from
the ocean, causing advective mass transport into the bay. Advective mass
transport is indicated by green vectors. The net advective load is indicated
by the green squares in the segments. There is also diffusion from the
ocean into the bay. The diffusive mass transport and net diffusive loads
are indicated by the blue vectors and squares, respectively. The decay
load is indicated by the yellow squares. The resulting concentrations for
the upper and lower segments are 0.2016 mg/L and 0.3457 mg/L, respectively.
Those concentrations are consistent with the analytical solution.
Other Information:
The Simple River sample data represents a river divided into 10 segments as shown in Figure 21. Flow is from left to right. All inter-segment boundaries are diffusive. There is no decay. There is a background concentration in the river. There is a point source waste input into the fifth segment.
There is advective mass transport in the direction of flow as indicated
with the green vectors. The green vectors upstream of the point source
are due to the background concentration. There is diffusive transport in
the upstream direction source due to the concentration gradient. Diffusive
mass transport is indicated with the blue vectors.
Other Information:
The Corpus Christi Bay System sample data consists of 23 segments as shown in Figure 22. The constituent modeled is salinity. There is inflow at several locations. All inter-segment boundaries are diffusive. There are diffusive boundaries to the ocean as well as to bay systems to the north and south. Note that this data was developed to test BALANCE. The segmentation and all attribute data are only very rough ballpark estimates.
There is advective mass transport in the direction of flow as indicated
with the green vectors. There is dispersive transport as indicated with
the blue vectors. The results compare well with the analytical solution.
Other Information:
This section is designed for people that want to take a closer look at BALANCE. This includes students wanting to learn more about Avenue programming and developers working on their own modified version of BALANCE. The section consists of two parts. The first part lists and describes the standard programs. The second part is designated to Pro version utilities. Pro version utilities are used to prepare input data for BALANCE. Please e-mail Ferdi if you have a program that could be helpful to others.
8.a. Standard BALANCE Programs
The standard BALANCE system consists of 11 Avenue scripts. Following
is a listing of them in alphabetical order. A short description is give
and the source code is provided. More detailed description is provided
in the code with comments.
Info Message Utility (balabout)
Source Code: balabout.txt
Source Code: balance.txt
Source Code: balar.txt
Source Code: balcir.txt
Source Code: balcon.txt
Source Code: balconp.txt
Source Code: balconu.txt
Source Code: balinfo.txt
Source Code: balmod.txt
Source Code: balplot.txt
This section lists Avenue utility programs designed to work with BALANCE.
This area is currently being researched and will be updated as utilities
are developed.
Bulk Dispersion Coefficient Utility (calcep)
Status: Needs check.
Source Code:calcep.txt
Status: Needs check.
Source Code: calcarea.txt
Status: Needs check.
Source Code: calcvol.txt
Status: Done.
Source Code: editatt.txt
Status: Done.
Source Code: pickgrid.txt
This section lists Avenue utility programs designed to work with BALANCE.
These programs are for preparing nonpoint source pollution inputs to BALANCE.
AGREE: DEM Surface Reconditioning System (agree)
Status: Done.
Source Code:agree.txt
Status: Done. Could be made more flexible, by letting the user enter the formula.
Source Code:rogrid.txt
Status: Done. Could be expanded to work if EMC table is linked to landuse theme.
Source Code:concgrid.txt
Status: Done.
Source Code:wfacgrid.txt
Status: Done. Can the program be modified to handle polygons with centroids outside the polygon boundary?
Source Code: Avenue: connect.txt, AML: connect.aml
Status: Done.
Source Code: Avenue: pickload.txt, AML: pickload.aml
Status: Done. Needs check.
Source Code: pointld.txt
This section lists known bugs that are being worked on. Please e-mail
Ferdi if you know of a bug that is not listed here.
English Units System - Boundary Conditions
This section lists web pages of BALANCE applications. Please e-mail Ferdi if you know of a resource that should be listed here.