Post on 19-Jan-2016
description
Conventional Pollutants in Rivers and Estuaries
OXYGEN
CARBONDIOXIDE
ORGANICMATTER
INORGANICNUTRIENTS
DECOMPOSITION(bacteria/animals)
PRODUCTION(plants)
Chemicalenergy
Solarenergy
Principle of Superposition
• Mass balance for DO deficit
• In terms of L and N
)PR(H
SNk
LkDkx
DU
t
D
n
da
)PR(H
SeNk
eLkDkx
DU
t
D
U/xk0n
U/xk0da
n
r
Diurnal Variations
PHOTOSYNTHESIS CHARACTERISTICS• Dissolved oxygen deficit mass balance
)PR(Dkx
DU
t
Da
1n
p
Pnm 2
Tft
T
n2cosb
f2P)t(P
22n )n2()f/(
f/4)fncos(b
1n Pa
1p
p2
p2a
nm Tk
n2tan
2
Tft
T
n2cos
)T/n2(k
bP
D)t(D
ak
PRD
• function ee=errordef(x)• ka=x(1);• Pm=x(2);• Dm=x(3);• dox=[…] • tt=[…]• n=10;• f=13./24;• bn=1:2;• for i=1:10
bn(i)=cos(i*pi*f)*4*pi/f/((pi/f)^2-(2*pi)^2*i*i);
• end• d=1:24;• Tp=1.;• for t=1:24• d(t)=Dm;• for i=1:10•
d(t)=d(t)-Pm*bn(i)/(ka^2+(2*pi*i/Tp)^2)^0.5* ...
• cos(2*pi*i/Tp*(t/24.-f*Tp/2.)-atan(2*pi*i/ka/Tp));
• end• end• ta=tt+273.15;• os=ta;
for i=1:24 os(i)=-139.34411+1.575701e5/ta(i)- … 6.642308e7/ta(i)^2+1.2438e10/ta(i)^3- ... 8.621949e11/ta(i)^4;endos=exp(os);d=os-d;ee=norm(dox-d);
DYNAMIC APPROACH
• Routing water (St. Venant equations)
– Continuity equation
– Momentum equation (Local acceleration + Convective acceleration+pressure + gravity + friction = 0
0t
A
x
Q c
0SSgx
yg
A
Q
xA
1
t
Q
A
1fo
c
2
cc
Kinematic wave
Diffusion wave
Dynamic wave
KINEMATIC ROUTING
• Geometric slope = Friction slope
• Manning’s equation
• Express cross section area as a function of flow
0SS fo
2/1f3/2
3/5c S
P
A
n
1Q
QAc
5/3
S
nP5/3
0
3/2
KINEMATIC ROUTING (ctd)
• Express the continuity equation exclusively as a function of Q
• Discretize continuity equation and solve it numerically
0t
x
Q 1
1 2 3 4 n n-1 n5
k
k+1
x
t
KINEMATIC ROUTING (ctd)
• Discretize continuity equation and solve it numerically
• Example– Q=2.5m3s-1; S0=0.004
– B=15m; n0=0.07
– Qe=2.5+2.5sin(wt); w=2pi(0.5d)-1
0t
2
x
QQ ki
1ki
1k1i
ki
k1i
ki
)1(ki
1k1i
)1(ki
1k1i1k
i1k
1i1k
i
2QQ
xt
2QQ
QQxt
Q
S0=0.004;B=15;n0=0.07;n=80;Q=zeros(2,n)+2.5;dx=1000.; %metersdt=700.; %secondsalpha=(n0*B^(2./3.)/sqrt(S0))^(3./5.)beta=3./5.;for it=1:150 if it*dt/24/3600 < 0.25 Q(2,1)=2.5+2.5* …
sin(2.*pi*it*dt/(0.5*24*3600)); else Q(2,1)=2.5; end for i=2:n Q(2,i)=(dt/dx*Q(2,i-1)* …
((Q(1,i)+Q(2,i-1))/2.)^(1-beta)... +alpha*beta*Q(1,i))/…
(dt/dx*((Q(1,i)+Q(2,i-1))/2.)^(1-beta)... +alpha*beta); end Q(1,:)=Q(2,:); if floor(it/40)*40==it x=1:n; plot(x,Q(1,:)); hold on end
end
ROUTING POLLUTANTS
• Mass conservation
• Discretized mass balance equation
0t
)cA(
x
)Qc( c
1 2 3 4 n n-1 n5
k
k+1
x
t
0t
cAcA
x
cQcQ ki
kci
1ki
1kci
k1i
k1i
ki
ki
tQQV
tcQcQcVc
ki
k1i
ki
ki
ki
k1i
k1i
ki
ki1k
i
ROUTING POLLUTANTS (ctd)
• Alternate formulation
• Example – u = 1 ms-1
x = 1000 m t = 500 m
ki
k1i
ki
1ki cc
x
tucc
u=1.; %m/sdx=1000; %mdt=500; %sn=100;x=1:100;y=x-20;c0=exp(-0.015*y.*y);c1=c0;plot(x,c0);hold onfor it=1:120 for i=2:n-1 c1(i)=c0(i)+u*dt/dx* …
(c0(i-1)-c0(i)); end c0=c1; if fix(it/40)*40==it plot(x,c0); endendxlabel('x (km)');ylabel('C mgL^{-1}');
ROUTING POLLUTANTSNumerical Example
ROUTING POLLUTANTS (ctd)• Second order (both time and space) formulation
• Stability condition
k1i
ki
k1i2
22
k1i
k1i
ki
1ki
cc2cx2
tu
ccx2
tucc
1x
tu
ROUTING POLLUTANTS (ctd)• Numerical oscillations
OXYGEN BALANCE GENERAL NUMERICAL APPROACH
• Do spatial discretization
• Route the water for each reach
• Apply water continuity at junctions– Q8+Q15=Q16
• Route the pollutants for each reach
• Apply pollutant continuity junctions
• Solve the production/decomposition
for each grid point
1
2
3
4
5
6
7
8
910
1112
16
17
18
19
20
21
22
1314
15Reach
2
Reach3
Reach1
Sensitivity Analysis
• First order analysis– y=f(x)
– y0=f(x0)
0
0
x
2
22
0
x00
x
f)xx(
x
f)xx()x(f)x(f
2
x
20
20
0x
fxxyy
Sensitivity Analysis
• Monte Carlo Analysis– 1. Generate dx0 = N(0,x)
– 2. Determine y=f(x0+dx0)
– 3. Save Y={Y | y}
– 4. i=i+1
– 5. If i < imax go to 1
– 6. Analyze statistically Y
xspan=0:100;%parameter definitionLr=zeros(100,101);Dr=zeros(100,101);global ka kd UU=16.4;y0=[10 0]';%initial concentrations are given in mg/Lfor i=1:100, ka=2.0+0.3*randn; kd=0.6+0.1*randn; while ka < 0 | kr < 0,
ka=2.0+0.3*randn; kd=0.6+0.1*randn;
end [x,y] = ODE45('dydx_sp',xspan,y0) ;
Lr(i,:)=y(:,1)'; Dr(i,:)=y(:,2)'; endsubplot 211plot(x, mean(Lr,1),'linewidth',1.25)hold onplot(x, mean(Lr,1)+std(Lr,0,1),'--', …
'linewidth',1.25)plot(x, mean(Lr,1)-std(Lr,0,1),'--', …
'linewidth',1.25)ylabel('mg L^{-1}')title('BOD vs. distance')subplot 212plot(x, mean(Dr,1),'r','linewidth',1.25);hold onplot(x, mean(Dr,1)+std(Dr,0,1),'r--', …
'linewidth',1.25);plot(x, mean(Dr,1)-std(Dr,0,1),'r--', …
'linewidth',1.25);xlabel('Distance (mi)')title('DO Deficit vs. distance')print -djpeg bod_mc.jpeg