DIFFUSION
IN
NEAR-SHORE AND RIVERINE
ENVIRONMENTS
-------
TABLE OF CONTENTS
Page
List of Figures ii
List of Tables iii
INTRODUCTION 1
COASTAL DISCHARGES 7
RIVER DISCHARGES 9
BIBLIOGRAPHY 14
APPENDIX A A-l
APPENDIX B B-l
-------
LIST OF FIGURES
Figure Number Page
1 Schematic of discharge field showing
areas in which initial dilution and far-field
dilution occur 2
2 Schematic diagram of waste discharge through
a diffiiser into an an oceanic environment with
constant depth and constant speed perpendic-
ular to the axis of the diffuser 5
3 Discharge to an oceanic environment in the
vicinity of a coastline 8
4 Diffuser source reflected about coastline for
purposes of obtaining a solution to the diffusion/
advection equation 8
5 Discharge to a riverine environment 11
6 Diffuser source reflected about the river boundary
for purposes of obtaining a solution to the diffusion/
advection equation 12
ii
-------
LIST OF TABLES
Table Number Page
A-l FORTRAN source code for estimating
in a coastal environment A-2
A-2 Interactive session for example problem of
discharge to an ocean with a coastal
boundary A-6
A-3 Output from example problem of discharge
along a coastline A-8
B-l FORTRAN source code for estimating diffusion
in a riverine environment B-2
B-2 Interactive session for example problem of
discharge to a river B-7
B-3 Output from example problem of discharge to
a river B-9
iii
-------
INTRODUCTION
The dispersal of industrial or municipal waste discharges through a
diffuser system is generally characterized by the following two phases (Figure 1.)
1) Initial dilution in the vicinity of the discharge. Initial dilution is due to
mixing processes generated by buoyancy and momentum associated with
the discharge.
2) Far-field dilution associated with larger time and distance scales. Far-
field dilution is a result of mixing processes in the receiving waters. Wind
stress, tidal forces and gravitational convection are oceanic and estuarine
processes providing sources of energy for far-field dilution. In rivers,
interaction between the flowing river and its side and bottom boundaries
generate turbulence leading to diffusion-like mixing processes.
For the purposes of estimating the dilution associated with discharge from
a diffuser, the U.S. Environmental Protection Agency has supported the
development of a number of initial dilution models. The theory and software
implementing the theory are described by Muellenhoff et al (1985). Methods for
estimating the far-field dilution are generally based upon solutions of the
diffusion-advection equation
+ u- VC = V- kVC +
-------
Initial
Dilution
Far-field
Dilution
Far-field
Dilution
Figure 1. Schematic of discharge field showing the areas in which initial dilution
and far-field dilution occur.
-------
3
t
= time
T(x,t)
K
= the coefficient of turbulent diffusion for the constituent,
= the source term,
= the sink term.
Under the following assumptions:
1) The vertical extent of the waste field remains constant and the
constituent, C, is mixed uniformly and instantaneously in the vertical.
2) The current is uniform and steady .
3) Turbulent diffusion processes are important only in the lateral (y)
direction.
4) The diffusion coefficient, k, is a function of plume width and plume
width, in turn, is a function of downstream (x) distance, only
5) The decay of constituent, C, is a first-order reaction. This means that the
rate of change of the constituent, C, in a static environment is a linear
function of the constituent, C.
equation (1) reduces to:
u^- = - kC (2)
9x2
By defining a new variable, C\ such that
kx
C(x,y) = C'(x,y) e
u
(3)
equation (2) becomes
-------
4
u-
djy_
dx
= K-
a2c-
dx2
(4)
For a vertical line source in a water body of infinite horizontal extent
discharge at x=0, y=yo, the solution to equation (4) (Edinger and Polk, 1969) is
C e 4 Kt
C'(x,y) = 0 — (5)
2/71 k t
where t = x/u.
Given a vertical line source at x=0, y=yo, the complete solution to equation
(2) is then
w
C e"kte" 4Kt
C'(x,y) = (6)
2V7CKt
For the case of a water body of infinite lateral extent, and for a diffuser
whose center is located at x = 0, y = 0, Brooks (1960) obtained solutions to the
problem of describing the dispersal of effluent from a diffuser of length, B, (Figure
2) by applying the Principle of Superposition. This is accomplished by integrating
equation (6) along the length of the diffuser
-------
Figure 2. Schematic diagram of waste discharge through a diffuser into an oceanic
environment with constant depth and constant speed perpendicular to the axis of
the diffuser (after Brooks, 1960).
-------
6
C e ,
C(x,y) = I
27 it k t J
/ M2
-kt b/2 (y-y)
e 4Kt dy
(7)
-B/2
When the coefficient of lateral eddy diffusivity, k, can be described as a
function of the downstream coordinate, x, such that
k(x) = ko fix)
equation (7) can be solved by defining a transformed x-coordinate
dx' = f(x) dx
and replacing the variable t in equation (5) by t' = x'/u.
Brooks (1960) provides solutions for three different functional forms
I.
II.
III.
K = K
X = X
K
K
L
B
V
.4/3
x
' B
. xl
' B
_1
2p
2p
H + |5|)2-l
where
L = measure of the plume width
P =
uB
In most cases involving the discharge of municipal or industrial effluents,
the body of water receiving the discharge is not of infinite extent. Typically, such
discharges are along a coastline or into a river. In such cases the effects of the
boundaries may be important, and the solution methods used by Brooks must be
modified to account for the effects of the boundaries. This report describes
methods for obtaining solutions when the boundaries are idealized conditions for
discharges along coastlines or into a river.
-------
COASTAL DISCHARGES
This section considers the discharge of effluent through a diffuser of finite
length along a coastline with the ocean current parallel to the coastline (Figure 3).
This problem can be solved by the Principle of Superposition if it is assumed that
there is fictitious discharge in addition to the actual discharge. The fictitious
discharge is in every way the same as the actual discharge with the exception that
it is located such that it is the reflection of the actual discharge with reference to
the coastline (Figure 4). The solution is given by
Equation (8) can be solved numerically by considering the diffuser to be
made up of a large number of very short elements and treating the integrals as
finite sums. The transformed x-coordinate used by Brooks (1960) can be
incorporated into this solution for purposes of accommodating various functional
forms for the coefficient of eddy diffusion coefficient. For open ocean conditions
Brooks (1960) recommends the use of the 4/3 law based upon both theoretical and
experimental results. The existence of boundaries, however, restricts the size of
the eddies characterizing the turbulence and, as a result, some of the
assumptions leading to the 4/3 law may be violated. For coastal discharges the
choice of an appropriate functional form for the coefficient of eddy diffusivity
must, therefore, include consideration of the effects of the boundaries.
2
2
(8)
-------
8
\\\\\\\\\\\\^^^
Figure 3. Discharge to an oceanic environment in the
vicinity of a coastline.
Line of Reflection
Figure 4. Diffuser source reflected about coastline for
purposes of obtaining solution to the diffusion/advection
equation.
-------
9
Software which implements this solution method in FORTRAN 77-
compatible code is described in Appendix A. The software provides the option for
choosing any of the three functional forms for the coefficient of eddy diffusivity
described above. However, the value of the initial diffusion coefficient, Ko, is
estimated within the program using the relationship:
Ko = a B4/3
where B = the length of the diffuser, feet,
a = the dissipation factor, feet2/3
kq = the initial coefficient of eddy diffusivity, feet^/second.
Based upon the results of numerous experiments in oceanic environments
(Fischer et al; 1979), the dissipation factor, a, has a value in the range from 0.0002
to 0.001. The program described in Appendix A assumes a value of 0.001 feet^.
-------
RIVER DISCHARGES
The case of river discharges (Figure 5) can be solved with the method used
by Brooks by considering an infinite number of discharges. The location of these
discharges are reflections with respect to the river shoreline as shown in Figure
6. The solution is given by
„ kt B/2-y„ ®/2+y0
C e r 4k t' (¦ 4k t
C(x,y) = —~ [ f e dy' + e dy'
2 In k t' J J
V 0 -B/2-y _ 2 -B/2+y 2
B/2-2W-y B/2+2W+y /y~y ^
f ° 4Knt' r
+ J e 0 dy' + J e dy'
-B/2-2W-y0 -B/2+2W+y0
+ . . . ] (9)
Equation (9) can be solved numerically by assuming the diffuser is
comprised of a large number of short elements and by considering a finite
number of reflected images. Software implementing this solution method is
described in Appendix B.
For the case of the river discharges, the coefficient of eddy diffusivity is
assumed to be constant for a given set of hydrologic conditions. The coefficient of
eddy diffusivity is estimated within the software from the following equation
(Fischer et al, 1979):
-------
11
x\\\\\\\\\\\\\\^^^^
u,
w
\\\\\\\\\\\\\^^^
Figure 5. Discharge to a riverine environment.
-------
12
Line of Reflection
U,
Line of Reflection
uo
Line of Reflection
U,
Line of Reflection
W
W
W
u»
Line of Reflection
W
Figure 6. Diffuser source reflected about the river boundary for purposes
of obtaining solution to the diffusion/advection equation. 0 signifies that
reflections continue to y=+<» and y=-°°.
-------
13
k = Ko = 0.6*Du*
where
D = the river depth, feet,
u* = ,/gSD = the shear velocity, feet/second.
S = the slope of the channel, feet/feet.
-------
BIBLIOGRAPHY
Brooks, N.H. 1960. Diffusion of sewage effluent in an ocean current. Proceedings
of the International Conference on Waste Disposal in the Marine
Environment, Pergamon Press, pp. 246-267.
Edinger, J.E. and E.M. Polk, Jr. 1969. Initial mixing of thermal discharges into
a uniform current. Report #1, Dept of Environmental & Water Resources
Engineering, Vanderbilt University. 45 pp.
Fischer, H.B., E.J. List, R.C.Y. Koh, J. Imberger and N.H. Brooks. 1979. Mixing
in inland and coastal waters. Academic Press.483 pp.
Muellenhoff, W.P., A.M. Soldate, Jr., D.J. Baumgartner, M.D. Schuldt, L.R.
Davis, and W.E. Frick. 1985. Initial mixing characteristics of municipal
ocean discharges. EPA/600/3-85/073, Environmental Research Laboratory,
Narragansett, ORD, Environmental Protection Agency.
-------
APPENDIX A
USER'S GUIDE TO CDIFF
A MODEL FOR ESTIMATING DIFFUSION
IN A NEAR-SHORE ENVIRONMENT
-------
The FORTRAN source code listed in Table A.l implements the
numerical solution to the diffusion/advection equation for discharges
to an open ocean whose coastline is parallel to the current. The code
is written to be compiled with the Microsoft FORTRAN compiler
running under MS-DOS 2.0 or greater. The following example
demonstrates the use of the program:
Example Problem
Coefficient of eddy diffusivity is a linear function of the downstream
distance
First-order decay constant = 0.5 days" 1
Diffuser width = 100 feet
Current speed = 0.1 feet/second
Initial concentration = 1000
Initial dilution = 20
Distance from center of diffuser to shoreline = 500 feet
Output at 100-foot intervals up to 2000 feet
The interactive session for the example problem is shown in
Table A.2.
-------
A-2
Table A.l FORTRAN source code for estimating the diffusion in
a coastal environment
C
C THIS PROGRAM ESTIMATES THE RATE OF DISPERSAL OF SOME
C CONSTITUENT DISCHARGED THROUGH A DIFFUSER INTO A COASTAL
C ENVIRONMENT NEAR THE SHORELINE. IMPORTANT PROCESSES ARE
C LONGITUDINAL ADVECTION, LATERAL DIFFUSION AND FIRST-ORDER
C DECAY OF THE CONSTITUENT. THE METHOD OF IMAGES IS USED TO
C OBTAIN SOLUTIONS AS A FUNCTION OF THE LONGITUDINAL DISTANCE
C ALONG THE DIFFUSER CENTERLINE AND THE SHORELINE. THREE
C DIFFERENT FUNCTIONAL FORMS ARE AVAILABLE FOR SPECIFYING
C THE COEFFICIENT OF LATERAL EDDY DIFFUSIVITY. FOR MORE
C INFORMATION SEE:
C
C DIFFUSION IN NEAR-SHORE AND RIVERINE ENVIRONMENTS
C EPA 910/9-87-168
C EPA REGION 10
C
REAL*4 KRATE
DIMENSION DIL(50),TITLE(43),CONC(2) , YP (2)
CHARACTER*1 TITLE
CHARACTER*20 OFILE
DATA PI/3.14159/,OFILE/' 1/,YP/0.0,0.0/,IOUT/2/
C
C FUNCTION USED TO ESTABLISH INITIAL VALUE OF THE COEFFICIENT
C OF LATERAL EDDY DIFFUSIVITY. CORRESPONDS TO DISSIPATION
FACTOR
C ALPHA=0.001 FEET * * 4/3
C
EPS(X)=0.01* ( (X*12.*2.54)**1.33)/ (12.*2 .54)**2
C
C BEGIN
C
10 CONTINUE
C
C INPUT PROBLEM SPECIFICATIONS AND COMPUTE IMPORTANT
CONSTANTS
C
WRITE(*,4000)
4000 FORMAT(' INPUT PROBLEM DESCRIPTION")
READ (*,1100) TITLE
WRITE (*,4020)
4020 FORMAT(¦ SPECIFY FUNCTION FOR DIFFUSION'/
' l=CONSTANT,2=F (X),3=F (X**4/3) ')
READ (*,*) ITYPE
OPEN(IOUT,FILE=OFILE,STATUS='NEW')
WRITE (IOUT,2100) TITLE
-------
A-3
Table A.l (cont.) FORTRAN source code for estimating the
diffusion in a coastal environment
WRITE (*,4100)
4100 FORMAT(' DECAY RATE (1/DAYS-BASE E)')
READ (*, *) KRATE
XR=KRATE
KRATE=KRATE/84600.
WRITE(*,4200)
4200 FORMAT (' DIFFUSER WIDTH (FT),CURRENT(FT/SEC) ')
READ(*,*) B0,U0
EPS0=EPS(B0)
CNST=1./(2.*SQRT(PI*EPS0))
WRITE(*,4300)
4300 FORMAT(' EFFLUENT CONCENTRATION, INITIAL DILUTION')
READ(*,*) CO,SO
C1=C0
C0=C0/S0
WRITE(*,4400)
4400 FORMAT(' X-INCREMENT, DISTANCE TO SHORELINE")
READ(*,*) DX, Y0
YP (2)=Y0
WRITE(*,4500)
4500 FORMAT(' NUMBER OF X-INCREMENTS')
READ(*, *) NX
DYY=B0/100.
BETA=12.*EPS0/(U0*B0)
C
C WRITE HEADER FOR OUTPUT FILE ON UNIT=2
C
WRITE(IOUT,2150) XR,B0,U0,Y0,CI, SO
C
C BEGIN CALCULATION LOOP, INDEXING (I) ON THE LONGITUDINAL
C DISTANCE, X
C
DO 199 1=1,NX
X=DX*I
T0=X/U0
C
C COMPUTE TRANSFORMED COORDINATE BASED UPON FUNCTIONAL FORM
C FOR COEFFICIENT OF LATERAL EDDY DIFFUSIVITY
C
TPRIME=XPRIME(BETA,X,B0,ITYPE)/U0
-------
A-4
Table A.l (cont.) FORTRAN source code for estimating the
diffusion in a coastal environment
c
C INDEX (ICC) ON THE TWO Y-COORDINATES FOR OUTPUT.
C YP(2)=DIFFUSER CENTERLINE; YP (1)=SHORELINE
C
DO 129 ICC=1,2
RATIO=0.0
C
C INDEX (J) ON THE TWO MIRROR IMAGES OF THE DIFFUSER
C
DO 99 J=l,2
SSIGN=(-1.)**J
IF(TPRIME.LT.1.OE-IO) GO TO 80
CONST=CNST/SQRT(TPRIME) 80 CONTINUE
SSHORE=l.0E10
C
C INDEX (K) ON THE 100 DIFFUSER INCREMENTS WHICH APPROXIMATE
C POINT SOURCES.
C
DO 99 K=1,100
YK=K
YDFF=(YK-50.)*DYY
YIMG=YSIGN*(YO+YDFF)
Y=YP(ICC)-YIMG
A=-(Y**2)/(4.*EPS0*TPRIME)
RATIO=RATIO+CONST *EXP(A)*DYY
99 CONTINUE
C
C ESTIMATE CONCENTRATION ON DIFFUSER CENTERLINE (ICC=2) AND
C AT SHORELINE (ICC=1)
C
CONC(ICC)=RATIO*CO*EXP(-KRATE*T0)
129 CONTINUE
SMAX=Cl/CONC{2)
IF(CONC(1).LE.1.0E-10) GO TO 150
SSHORE=Cl/CONC(1)
150 CONTINUE
WRITE(*,2200) X,CONC(2),CONC(1)
C
C OUTPUT RESULTS TO UNIT=2
C
WRITE(IOUT,2200) X,CONC (2),CONC(1),SMAX,SSHORE
199 CONTINUE
-------
A-5
Table A.l (cont.) FORTRAN source code for estimating the
diffusion in a coastal environment
c
C CHECK TO SEE IF THERE IS ANOTHER PROBLEM,
C IF THERE IS RETURN TO STATEMENT 10, IF NOT EXIT
C
WRITE(*,4 600)
4600 FORMAT(' NEW PROBLEM (ENTER 1), OR QUIT (ENTER ZERO)1)
READ (*,*) I
IF(I.GT.O) GO TO 10
1100 FORMAT(80A1)
2100 FORMAT(1H1///
.t ****** DIFFUSION/ADVECTION MODEL FOR OCEAN DISCHARGE
******i/
.i ****** EPA REGION 10
******!J
******¦, ix,43A1,3X, •******•//)
2150 FORMAT(
DECAY RATE = ',F8.2,' DAYS**-1'/
DIFFUSER WIDTH = 1,F8.0,' FEET'/
OCEAN CURRENT = ',F8 .1, 1 FEET/SECOND'/
DISTANCE TO SHORELINE = ',F8.0,' FEET'/
EFFLUENT CONCENTRATION = '^8.0,/
INITIAL DILUTION = ',F8.1//
DISTANCE EST. CONCENTRATION EST. DILUTION'/
(FEET) C/L S/L C/L
S/L'//)
2200 FORMAT(6X,F6.0,4X,F8.2,2X,F8.2,6X,F7.1,2X,F7.1)
STOP
END
FUNCTION XPRIME(BETA,X, BO, ITYPE)
C
C THIS FUNCTION COMPUTES THE VALUE OF THE TRANSFORMED X-
COORDINATE
C FOR THREE DIFFERENT FUNCTIONAL FORMS OF THE COEFFICIENT OF
C LATERAL EDDY DIFFUSIVITY. BASED UPON THE WORK OF BROOKS
(1960)
C
GO TO (20,40,60),ITYPE
20 CONTINUE
XPRIME=X
RETURN
40 CONTINUE
XPRIME=B0*((1.+BETA*X/B0)**2-1.)/(2.*BETA)
RETURN
60 CONTINUE
XPRIME=B0*( (1.+2.*BETA*X/(3.*B0))**3-1.)/(2.*BETA)
RETURN
END
-------
A-6
Table A.2 Interactive session for example problem of
discharge toan ocean with a coastal boundary.
C:\> CDIFF
SPECIFY FUNCTION FOR DIFFUSION
1 =CONSTANT.2=F(XI3=F(X**4/3')
1
PROBLEM DESCRIPTION
TESTPROBLEM
File name missing or blank-Please enter name
UNIT 2? CDIFF.OUT
DECAY RATE (1/DAYS- BASE E)
0.5
DIFFUSER WIDTH (FT). CURRENT (FI7SEQ
100,0.1
EFFLUENT CONCENTRATION. INITIAL DILUTION
1000,20
X-INCREMENT. DISTANCE TO SHORELINE
100,500
NUMBER OF X-INCREMENTS
20
CONTINUE WITH NEW PROBLEM (ENTER H. OR STOP (ENTER 0^
0
-------
A -7
where underlined characters are output from the operating system
or the model software and characters without underline are input by
the user. Furthermore, the above examples assumes that the
executable code, CDIFF.EXE, has been transferred from the diskette to
the C:-directory on the PC hard drive. The resulting output from this
problem (Table A.2) is contained in the ASCII file, CDIFF.OUT, located
in the C:-directory on the hard drive.
-------
A-8
Table A.3 Output from example problem of discharge
along coastline.
****** DIFFUSION/ADVECTION
MODEL FOR
OCEAN DISCHARGE ******
******
EPA
REGION 10
******
****** Example Problem
******
DECAY RATE
_
.50
DAYS**-1
DIFFUSER WIDTH
=
100.
FEET
OCEAN CURRENT
=
.1
FEET/SECOND
DISTANCE TO SHORELINE
=
200.
FEET
EFFLUENT
CONCENTRATION
=
1000.
INITIAL DILUTION
=
20.0
DISTANCE
EST. CONCENTRATION
EST.
DILUTION
(FEET)
C/L
S/L
C/L
S/L
100.
44.71
.00
22 .4
*******
200.
37.29
.02
26.8
42967.3
300.
32.28
.21
31.0
4733.1
400.
28.74
.65
34 .8
1530.8
500.
26.09
1.30
38.3
769.5
600.
24.01
2.06
41.6
485.0
700.
22.33
2.87
44 .8
348.9
800.
20.92
3.66
47 .8
273.1
900.
19.73
4.42
50.7
226.3
1000.
18.70
5.12
53.5
195.3
1100.
17.80
5.76
56.2
173.7
1200.
17.01
6.33
58.8
157.9
1300.
16.30
6.84
61.3
146.1
1400.
15.67
7.29
63.8
137.1
1500.
15.10
7.69
66.2
130.0
1600.
14.58
8.04
68.6
124.4
1700.
14.12
8.34
70.8
119.9
1800.
13.69
8.60
73.1
116.2
1900.
13.30
8.83
75.2
113.2
2000.
12.94
9.02
77.3
110.8
-------
APPENDIX B
USER'S GUIDE TO RDIFF
A MODEL FOR ESTIMATING DIFFUSION
IN A RIVERINE ENVIRONMENT
-------
The FORTRAN source code listed in Table B.l implements the
numerical solution to the diffusion/advection equation for discharges to a
river. The code is written to be compiled with the Microsoft FORTRAN
compiler running under MS-DOS 2.0 or greater. The following example
demonstrates the use of the program:
First-order decay constant = 0.5 days"!
River depth = 1 foot
River width = 100 feet
River speed = 1.0 feet/second
Slope of energy grade line = 0.0001 feet/feet
Diffuser width = 10 feet
Distance from center of diffuser to nearest shoreline = 20 feet
Initial concentration = 1000
Initial dilution = 20
Output at 100-foot intervals downstream to 1000 feet
Output at 10-foot interval across the stream
-------
B-2
Table B.l FORTRAN source code for estimating the diffusion in a
riverine environment
c
C THIS PROGRAM ESTIMATES THE RATE OF DISPERSAL OF SOME CONSTITUENT
C DISCHARGED THROUGH A DIFFUSER INTO A RIVER ENVIRONMENT
C IMPORTANT PROCESSES ARE LONGITUDINAL ADVECTION, LATERAL DIF-
C FUSION AND FIRST-ORDER DECAY OF THE CONSTITUENT. THE METHOD OF
C IMAGES IS USED TO OBTAIN SOLUTIONS DOWNSTREAM FROM THE
C DISCHARGE. FOR MORE INFORMATION SEE:
C
C DIFFUSION IN NEAR-SHORE AND RIVERINE ENVIRONMENTS
C EPA 910/9-87-168
C EPA REGION 10
C
REAL*4 KRATE
DIMENSION THETA(50,65),XGRID(200),DIL(50),TITLE(43),QFLO(2)
CHARACTER*1 TITLE
CHARACTER*20 OFILE
DATA PI/3.14159/,OFILE/1 '/,QFLO/1.0,1.0/,YDIFF/100./
C
C BEGIN
C
10 CONTINUE
C
C INPUT PROBLEM SPECIFICATIONS AND COMPUTE IMPORTANT CONSTANTS
C
WRITE(*,4000)
4000 FORMAT(' INPUT PROBLEM DESCRIPTION')
READ(*,1100) TITLE
IOUT=4
OPEN(IOUT,FILE=OFILE, STATUS='NEW)
WRITE(IOUT,2100) TITLE
WRITE(*,4100)
4100 FORMAT(' DECAY RATE (1/DAYS-BASE E)')
READ (*,*) KRATE
XR=KRATE
KRATE=KRATE/8 4 6 0 0.
WRITE(*,4200)
4200 FORMAT(
. ' RIVER WIDTH(FT) , DEPTH(FT),CURRENT(FT/SEC),SLOPE(FT/FT) ')
READ(*, *) WIDTH,DEPTH,UO,SLOPE
USTAR =SQRT(32.2*DEPTH*SLOPE)
EPS0=0.6*USTAR*DEPTH
CNST=1./(2.*SQRT(PI*EPS0))
WRITE(*,4300)
4300 FORMAT(' EFFLUENT CONCENTRATION, INITIAL DILUTION')
READ(*,*) CO,SO
-------
B-3
Table B.l FORTRAN source code for estimating the diffusion in a
riverine environment
C1=C0
co=co/so
WRITE(*,4400)
4400 FORMAT(' DIFFUSER: WIDTH(FT), CENTER TO NEAREST SHORELINE(FT) ')
READ(*,*) BO, Y0
WRITE(*,4450)
4450 FORMAT(' X-INCREMENT')
READ(*,*) DX
WRITE(*,4500)
4500 FORMAT(' NUMBER OF X-INCREMENTS,Y-INCREMENTS')
READ(*,*) NX,NY
Q0=QWST+U0*WIDTH*DEPTH
CNST=1./(2.*SQRT(PI*EPS0))
CMIX=C0*QWST/Q0
CMAX=C0
YNY=NY
NDlFF=YDIFF
DY=WIDTH/YNY
DIFFY=B0/YDIFF
NDFF2=l+NDIFF/2
DO 29 N=1,NX
XN=N
XGRID(N)=DX*XN
29 CONTINUE
NYP1=NY+1
C
C WRITE HEADER FOR OUTPUT FILE ON UNIT=4
C
WRITE(IOUT,2150) XR,DEPTH,WIDTH,U0,B0,Y0,CI, SO
C
C BEGIN CALCULATION LOOP, INDEXING (NN) ON THE LATERAL DISTANCE, Y
C
DO 199 NN=1,NYP1
YN=NN-1
YP=YN*DY
C
C INDEX (N) ON THE DOWNSTREAM COORDINATE, X
C
DO 199 N=l,NX
XPRIME=DX*N
TPRIME=XPRIME/U0
F(ATIO=0.0
-------
B-4
Table B.l FORTRAN source code for estimating the diffusion in a
riverine environment
C INDEX (J) ON THREE IMAGE PAIRS
C
DO 99 J=l,3
YJ=J
C
C INDEX (JJ) ON REFLECTED PAIRS AT EACH J
C
DO 99 JJ=1,2
YSIGN=(-1.)**JJ
C INDEX (JJJ) ON THE 100 DIFFUSER INCREMENTS WHICH APPROXIMATE
C POINT SOURCES
C
DO 99 JJJ=1,NDIFF
YDFF=(JJJ-NDFF2)*DIFFY
YIMG=2.0 *(YJ-2.0)*WIDTH+YSIGN*(YO+YDFF)
Y=YP-YIMG
A=-(Y**2)/(4.*EPS0*TPRIME)
CONST=CNST/SQRT(TPRIME)
RATIO=RATIO+CONST*EXP(A) *DIFFY
99 CONTINUE
IF(RATIO.EQ.0.0) GO TO 120
C
C ESTIMATE CONCENTRATION AT EACH X, Y PAIR SPECIFIED
C
THETA(N,NN)=CMAX*RATIO*EXP(-KRATE*T0)
IF(THETA (N,NN) .GT.CMAX) THETA (N, NN) =CMAX
120 CONTINUE
199 CONTINUE
C
C CHECK TO SEE IF RIVER IS WELL-MIXED
C
DO 239 N=l,NX
CCMAX=0.0
DO 219 NN=1, NY
IF(THETA(N,NN).GT.CCMAX) CCMAX=THETA(N,NN)
219 CONTINUE
-------
B-5
Table B.l FORTRAN source code for estimating the diffusion in a
riverine environment
c
C IF MAXIMUM CONCENTRATION IS LESS THAN THE WELL-MIXED
C CONCENTRATION THEN STREAM IS APPROACHING WELL-MIXED CONDITION
C AND THREE IMAGE PAIRS MAY NOT BE SUFFICIENT. WHEN THIS OCCURS
C THE ESTIMATED CONCENTRATION IS REPLACED BY THE UPSTREAM
C CONCENTRATION WHICH SHOULD LEAD TO APPROXIMATELY WELL-MIXED
C CONDITIONS.
C
IF(CCMAX.GT.CMIX) GO TO 230
DO 229 NN=1,NY
THETA(N,NN)=THETA(N-l,NN)
229 CONTINUE
230 CONTINUE
239 CONTINUE
C
C OUTPUT RESULTS TO UNIT=4
C
WRITE(IOUT,2450) (XGRID(N),N=1,NX)
DO 249 NN=1,NY
YN=NN-1
Y=DY*YN
WRITE(4,2500) Y, (THETA(N,NN),N=l, NX)
249 CONTINUE
CLOSE(4)
C
C CHECK TO SEE IF THERE IS ANOTHER PROBLEM.
C IF THERE IS, RETURN TO STATEMENT 10, IF NOT, EXIT
C
WRITE(*,4600)
4600 FORMAT(' NEW PROBLEM (ENTER 1), OR QUIT (ENTER ZERO)')
READ(*,*) I
IF(I.GT.O) GO TO 10
-------
B-6
Table B.l FORTRAN source code for estimating the diffusion in a
riverine environment
1100 FORMAT(80A1)
2100 FORMAT(1H1///
• ****** ****** i J
« ****** RDIFF ******"/
,« ****** DIFFUSION/ADVECTION MODEL FOR OCEAN DISCHARGE ******'/
ti ****** EPA REGION 10 ****** •/
.¦ ******',ix,43A1,3X,'******/)
2150 FORMAT(
.' DECAY RATE = ',F8.2,' DAYS**-1'/
, ' RIVER DEPTH = 1,F8.2, * FEET'/
RIVER WIDTH = \F8.0," FEET'/
RIVER SPEED = 1,F8 .1, * FEET/SECOND'/
. ' DIFFUSER WIDTH = \F8.1,' FEET'/
.' DISTANCE TO SHORELINE = ',F8.0, ' FEET'/
.* EFFLUENT CONCENTRATION = ",F8.0,/
INITIAL DILUTION = ',F8.1//)
2450 FORMAT(5X,15F5.0//)
2500 FORMAT(/F5.0,15F5.1)
STOP
END
-------
B-7
Table B.2 Interactive session for example problem of discharge to a
river.
C:\> RDIFF
INPUT PROBLEM DESCRIPTION
Example Problem
File name missing or blank-Please enter name
UNIT 4? RDIFF.OUT
DECAY RATE (1/DAYS- BASE E)
0.5
RIVER WIDTH (FT). DEPTH (FD.CURRENT (FT/SEO.SLOPE(FT/Fn
100,1,1,0.0001
EFFLUENT CONCENTRATION. INITIAL DILUTION
1000,20
DIFFUSER: WIDTHfFTV CENTER TONE A REST SHORELINEfFT)
10,20
X-INCREMENT
100
NUMBER OF X-INCREMENTS.Y-INCREMENTS
10,10
NEW PROBLEM (ENTER 1). OR EXIT (ENTER 0^
0
-------
B-8
where underlined characters are output from the operating system or the
model software and characters without underline are input by the user.
Furthermore, the above examples assumes that the executable code,
RDIFF.EXE, has been transferred from the diskette to the C:-directory on
the PC hard drive. The resulting output from this problem (Table B.3) is
contained in the ASCII file, RDIFF.OUT, located in the C:-directory on the
hard drive.
-------
B-9
Table B.3 Output from example problem of discharge to a
river.
****** ******
****** RDIFF ******
****** diffusion/advection model for ocean discharge ******
****** EPA REGION 10 ******
****** Example Problem ******
DECAY RATE
RIVER DEPTH
RIVER WIDTH
RIVER SPEED
DIFFUSER WIDTH
DISTANCE TO SHORELINE
EFFLUENT CONCENTRATION
INITIAL DILUTION
=
.50 DAYS**-1
1.00 FEET
100. FEET
1.0 FEET/SECOND
10.0 FEET
20. FEET
1000.
20.0
100.
200
300.
400.
500
600.
700.
800.
900
1000
0
.0
.0
.0
.2
.5
1.0
1.5
2.1
2.7
3.4
10
. 1.4
4.5
6.8
8.5
9.6
10.5
11.1
11.5
11.8
12.0
20
. 47.2
41.2
36.6
33.1 30.4
28.3
26.6
25.1
23.8
22.8
30
. 1.3
4.3
6.6
8.2
9.4
10.3
10.9
11.3
11.6
11.8
40
.0
.0
.0
.1
.2
.5
.7
1.0
1.3
1.6
50
.0
.0
.0
.0
.0
.0
.0
.0
.0
.1
60
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
70
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
80
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
90
.0
.0
.0
.0
.0
.0
.0
.0
.0
.0
------- |