This package contains classes (layer models) to built ASM1 secondary clarifier models, a n Interfaces sub-library and provides an ASM1 10-layer secondary clarifier model all bases on Haertel`s [1] sedimentation velocity and omega correction functions. A secondary clarifier layer model needs at least a top_layer, a feed_layer and a bottom_layer and may have several upper_layer in between above the feed_layer and several lower_layer in between below the feed_layer.
Main Author: Gerald Reichl Technische Universitaet Ilmenau Faculty of Informatics and Automation Department Dynamics and Simulation of ecological Systems P.O. Box 10 05 65 98684 Ilmenau Germany email: gerald.reichl@tu-ilmenau.de References: [1] L. Haertel: Modellansaetze zur dynamischen Simulation des Belebtschlammverfahrens. TH Darmstadt, Dissertation, 1990.
Copyright (C) 2002 - 2003, Gerald Reichl
The Modelica package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions and the accompanying disclaimer in the documentation of package Modelica in file "Modelica/package.mo".
WasteWater.ASM1.SecClar.Haertel.SecClarModHaertel
This component models an ASM1 10 - layer secondary clarifier with 4 layers above the
feed_layer (including top_layer) and 5 layers below the feed_layer (including bottom_layer)
based on Haertel`s theory.
| Name | Default | Description |
|---|---|---|
| hsc | 4.0 | height of secondary clarifier [m] |
| n | 10 | number of layers of SC model |
| zm | hsc/(1.0*n) | height of m-th secondary clarifier layer [m] |
| Asc | 1500.0 | area of secondary clarifier [m2] |
| ISV | 130 | Sludge Volume Index [ml/g] |
| i | 2 | number of layers above current feed layer in this model |
model SecClarModHaertel
"ASM1 Secondary Settling Tank Model based on Haertel"
extends WasteWater.Icons.SecClar;
extends ASM1.SecClar.Haertel.Interfaces.ratios;
package SCP = ASM1.SecClar.Haertel;
package SI = Modelica.SIunits;
package WI = ASM1.Interfaces;
package WWU = WasteWater.WasteWaterUnits;
parameter SI.Length hsc=4.0 "height of secondary clarifier";
parameter Integer n=10 "number of layers of SC model";
parameter SI.Length zm=hsc/(1.0*n) "height of m-th secondary clarifier layer";
parameter SI.Area Asc=1500.0 "area of secondary clarifier";
parameter WWU.SludgeVolumeIndex ISV=130 "Sludge Volume Index";
parameter Integer i=2
"number of layers above current feed layer in this model";
// total sludge concentration in clarifier feed
WWU.MassConcentration Xf;
// layers 1 to 10
SCP.bottom_layer S1(
zm=zm,
Asc=Asc,
ISV=ISV,
rXs=rXs,
rXbh=rXbh,
rXba=rXba,
rXp=rXp,
rXi=rXi,
rXnd=rXnd);
SCP.lower_layer S2(
hsc=hsc,
zm=zm,
z=(zm + zm/2),
Asc=Asc,
ISV=ISV,
i=i,
Xf=Xf);
SCP.lower_layer S3(
hsc=hsc,
zm=zm,
z=(2*zm + zm/2),
Asc=Asc,
ISV=ISV,
i=i,
Xf=Xf);
SCP.lower_layer S4(
hsc=hsc,
zm=zm,
z=(3*zm + zm/2),
Asc=Asc,
ISV=ISV,
i=i,
Xf=Xf);
SCP.lower_layer S5(
hsc=hsc,
zm=zm,
z=(4*zm + zm/2),
Asc=Asc,
ISV=ISV,
i=i,
Xf=Xf);
SCP.lower_layer S6(
hsc=hsc,
zm=zm,
z=(5*zm + zm/2),
Asc=Asc,
ISV=ISV,
i=i,
Xf=Xf);
SCP.lower_layer S7(
hsc=hsc,
zm=zm,
z=(6*zm + zm/2),
Asc=Asc,
ISV=ISV,
i=i,
Xf=Xf);
SCP.feed_layer S8(
hsc=hsc,
zm=zm,
z=(7*zm + zm/2),
Asc=Asc,
ISV=ISV,
i=i,
Xf=Xf);
SCP.upper_layer S9(
zm=zm,
Asc=Asc,
ISV=ISV);
SCP.top_layer S10(
zm=zm,
Asc=Asc,
ISV=ISV,
rXs=rXs,
rXbh=rXbh,
rXba=rXba,
rXp=rXp,
rXi=rXi,
rXnd=rXnd);
WI.WWFlowAsm1in Feed;
WI.WWFlowAsm1out Effluent;
WI.WWFlowAsm1out Return;
WI.WWFlowAsm1out Waste;
equation
connect(S1.Up, S2.Dn);
connect(S2.Up, S3.Dn);
connect(S3.Up, S4.Dn);
connect(S5.Up, S6.Dn);
connect(S6.Up, S7.Dn);
connect(S7.Up, S8.Dn);
connect(S9.Up, S10.Dn);
connect(S4.Up, S5.Dn);
connect(S8.Up, S9.Dn);
connect(Feed, S8.In);
connect(S1.PQw, Waste);
connect(S10.Out, Effluent);
connect(S1.PQr, Return);
// total sludge concentration in clarifier feed
Xf = 0.75*(Feed.Xs + Feed.Xbh + Feed.Xba + Feed.Xp + Feed.Xi);
// ratios of solid components
rXs = Feed.Xs/Xf;
rXbh = Feed.Xbh/Xf;
rXba = Feed.Xba/Xf;
rXp = Feed.Xp/Xf;
rXi = Feed.Xi/Xf;
rXnd = Feed.Xnd/Xf;
end SecClarModHaertel;
WasteWater.ASM1.SecClar.Haertel.bottom_layer
This class models the lowest layer of an ASM1 secondary clarifier based on Haertel.
No sedimentation flux (mass exchange) with underneath but hydraulic and sedimentation flux
(same direction) with above layer.
From here return and waste sludge is removed.
| Name | Default | Description |
|---|---|---|
| zm | height of m-th secondary clarifier layer [m] | |
| Asc | area of secondary clarifier [m2] | |
| ISV | Sludge Volume Index [ml/g] |
model bottom_layer "Bottom layer of Haertel`s SC model" package WWSC = WasteWater.ASM1.SecClar.Haertel.Interfaces; extends WWSC.SCParam; extends WWSC.SCVar; extends WWSC.ratios; ASM1.Interfaces.WWFlowAsm1out PQr; ASM1.Interfaces.WWFlowAsm1out PQw; WWSC.LowerLayerPin Up; equation // sink velocity vS = WWSC.vSfun(X, ISV); // sedimentation flux in bottom layer Jsm = 0.0; // ODE of solid component der(X) = ((Up.Qr + Up.Qw)/Asc*(Up.X - X) + Up.SedFlux)/zm; // ODEs of soluble components der(Si) = (Up.Qr + Up.Qw)*(Up.Si - Si)/(Asc*zm); der(Ss) = (Up.Qr + Up.Qw)*(Up.Ss - Ss)/(Asc*zm); der(So) = (Up.Qr + Up.Qw)*(Up.So - So)/(Asc*zm); der(Sno) = (Up.Qr + Up.Qw)*(Up.Sno - Sno)/(Asc*zm); der(Snh) = (Up.Qr + Up.Qw)*(Up.Snh - Snh)/(Asc*zm); der(Snd) = (Up.Qr + Up.Qw)*(Up.Snd - Snd)/(Asc*zm); der(Salk) = (Up.Qr + Up.Qw)*(Up.Salk - Salk)/(Asc*zm); // upward connection Up.vS_dn = vS; Up.X_dn = X; // return and waste sludge volume flow rates PQr.Q + Up.Qr = 0; PQw.Q + Up.Qw = 0; // return sludge flow, solid and soluble components (ASM1) PQr.Si = Si; PQr.Ss = Ss; PQr.Xi = rXi*X; PQr.Xs = rXs*X; PQr.Xbh = rXbh*X; PQr.Xba = rXba*X; PQr.Xp = rXp*X; PQr.So = So; PQr.Sno = Sno; PQr.Snh = Snh; PQr.Snd = Snd; PQr.Xnd = rXnd*X; PQr.Salk = Salk; // waste sludge flow, solid and soluble components (ASM1) PQw.Si = Si; PQw.Ss = Ss; PQw.Xi = rXi*X; PQw.Xs = rXs*X; PQw.Xbh = rXbh*X; PQw.Xba = rXba*X; PQw.Xp = rXp*X; PQw.So = So; PQw.Sno = Sno; PQw.Snh = Snh; PQw.Snd = Snd; PQw.Xnd = rXnd*X; PQw.Salk = Salk; end bottom_layer;
WasteWater.ASM1.SecClar.Haertel.lower_layer
This class models the layers between the influent layer (feed_layer) and the lowest layer
(bottom_layer) of an ASM1 secondary clarifier based on Haertel.
Hydraulic and sedimentation flux (mass exchange in same direction) with above
and underneath layer.
Sedimentation flux is calculated based on the sedimentation velocity
function and the omega correction function by Haertel.
| Name | Default | Description |
|---|---|---|
| zm | height of m-th secondary clarifier layer [m] | |
| Asc | area of secondary clarifier [m2] | |
| ISV | Sludge Volume Index [ml/g] | |
| hsc | height of secondary clarifier [m] | |
| i | number of layers above feed layer |
model lower_layer "Layer below influent of Haertel`s SC model"
package WWSC = WasteWater.ASM1.SecClar.Haertel.Interfaces;
extends WWSC.SCParam;
extends WWSC.SCVar;
WWU.MassConcentration Xf "sludge concentration in clarifier feed";
SI.Length z "vertical coordinate of current layer";
parameter SI.Length hsc;
parameter Integer i "number of layers above feed layer";
Real omega;
WWSC.LowerLayerPin Up;
WWSC.LowerLayerPin Dn;
equation
// sink velocity
vS = WWSC.vSfun(X, ISV);
omega = WWSC.omega(z, Xf, hsc, zm, ISV, i);
// sedimentation flux in m-th layer sinking to lower layer
Jsm = if vS < Dn.vS_dn then omega*(vS*X) else omega*min(vS*X, Dn.vS_dn*Dn.
X_dn);
// ODE of solid component
der(X) = ((Up.Qr + Up.Qw)/Asc*(Up.X - X) + Up.SedFlux - Jsm)/zm;
// ODEs of soluble components
der(Si) = (Up.Qr + Up.Qw)*(Up.Si - Si)/(Asc*zm);
der(Ss) = (Up.Qr + Up.Qw)*(Up.Ss - Ss)/(Asc*zm);
der(So) = (Up.Qr + Up.Qw)*(Up.So - So)/(Asc*zm);
der(Sno) = (Up.Qr + Up.Qw)*(Up.Sno - Sno)/(Asc*zm);
der(Snh) = (Up.Qr + Up.Qw)*(Up.Snh - Snh)/(Asc*zm);
der(Snd) = (Up.Qr + Up.Qw)*(Up.Snd - Snd)/(Asc*zm);
der(Salk) = (Up.Qr + Up.Qw)*(Up.Salk - Salk)/(Asc*zm);
// downward connections
Dn.Qr + Up.Qr = 0;
Dn.Qw + Up.Qw = 0;
Dn.X = X;
Dn.SedFlux = -Jsm;
Dn.Si = Si;
Dn.Ss = Ss;
Dn.So = So;
Dn.Sno = Sno;
Dn.Snh = Snh;
Dn.Snd = Snd;
Dn.Salk = Salk;
// upward connections
Up.vS_dn = vS;
Up.X_dn = X;
end lower_layer;
WasteWater.ASM1.SecClar.Haertel.feed_layer
This class models the influent layer of an ASM1 secondary clarifier based on Haertel. It receives the wastewater stream from the biological part (feed). Hydraulic and sedimentation flux (mass exchange in opposite directions) with above layer and hydraulic and sedimentation flux (mass exchange in same direction) with underneath layer. Sedimentation flux is calculated based on the sedimentation velocity function and the omega correction function by Haertel.
| Name | Default | Description |
|---|---|---|
| zm | height of m-th secondary clarifier layer [m] | |
| Asc | area of secondary clarifier [m2] | |
| ISV | Sludge Volume Index [ml/g] | |
| hsc | height of secondary clarifier [m] | |
| i | number of layers above feed layer |
model feed_layer "Influent layer of Haertel`s SC model"
package WWSC = WasteWater.ASM1.SecClar.Haertel.Interfaces;
extends WWSC.SCParam;
extends WWSC.SCVar;
WWU.MassConcentration Xf "sludge concentration in clarifier feed";
SI.Length z "vertical coordinate of current layer";
parameter SI.Length hsc;
parameter Integer i "number of layers above feed layer";
Real omega;
WWSC.LowerLayerPin Dn;
WWSC.UpperLayerPin Up;
ASM1.Interfaces.WWFlowAsm1in In;
equation
// sink velocity
vS = WWSC.vSfun(X, ISV);
omega = WWSC.omega(z, Xf, hsc, zm, ISV, i);
// sedimentation flux in m-th layer sinking to lower layer
Jsm = if vS < Dn.vS_dn then omega*(vS*X) else omega*min(vS*X, Dn.vS_dn*Dn.
X_dn);
// ODE of solid component
der(X) = (In.Q/Asc*Xf - (-Up.Qe)/Asc*X - (-(Dn.Qr + Dn.Qw))/Asc*X + Up.
SedFlux - Jsm)/zm;
// ODE of soluble components
der(Si) = (In.Q*In.Si - (-Up.Qe)*Si - (-(Dn.Qr + Dn.Qw))*Si)/(Asc*zm);
der(Ss) = (In.Q*In.Ss - (-Up.Qe)*Ss - (-(Dn.Qr + Dn.Qw))*Ss)/(Asc*zm);
der(So) = (In.Q*In.So - (-Up.Qe)*So - (-(Dn.Qr + Dn.Qw))*So)/(Asc*zm);
der(Sno) = (In.Q*In.Sno - (-Up.Qe)*Sno - (-(Dn.Qr + Dn.Qw))*Sno)/(Asc*zm);
der(Snh) = (In.Q*In.Snh - (-Up.Qe)*Snh - (-(Dn.Qr + Dn.Qw))*Snh)/(Asc*zm);
der(Snd) = (In.Q*In.Snd - (-Up.Qe)*Snd - (-(Dn.Qr + Dn.Qw))*Snd)/(Asc*zm);
der(Salk) = (In.Q*In.Salk - (-Up.Qe)*Salk - (-(Dn.Qr + Dn.Qw))*Salk)/(Asc*zm)
;
// volume flow rates
In.Q + Up.Qe + Dn.Qr + Dn.Qw = 0;
Dn.SedFlux = -Jsm;
Dn.X = X;
Dn.Si = Si;
Dn.Ss = Ss;
Dn.So = So;
Dn.Sno = Sno;
Dn.Snh = Snh;
Dn.Snd = Snd;
Dn.Salk = Salk;
Up.X_dn = X;
Up.Si = Si;
Up.Ss = Ss;
Up.So = So;
Up.Sno = Sno;
Up.Snh = Snh;
Up.Snd = Snd;
Up.Salk = Salk;
end feed_layer;
WasteWater.ASM1.SecClar.Haertel.upper_layer
This class models the layers between the influent layer (feed_layer) and the effluent layer (top_layer) of an ASM1 secondary clarifier based on Haertel. Hydraulic and sedimentation flux (mass exchange in opposite directions) with above and underneath layer. Sedimentation flux is calculated based on the sedimentation velocity function by Haertel.
| Name | Default | Description |
|---|---|---|
| zm | height of m-th secondary clarifier layer [m] | |
| Asc | area of secondary clarifier [m2] | |
| ISV | Sludge Volume Index [ml/g] |
model upper_layer "Layer above influent of Haertels`s SC" package WWSC = WasteWater.ASM1.SecClar.Haertel.Interfaces; extends WWSC.SCParam; extends WWSC.SCVar; WWSC.UpperLayerPin Dn; WWSC.UpperLayerPin Up; equation // sink velocity vS = WWSC.vSfun(X, ISV); // sedimentation flux in m-th layer sinking to lower layer Jsm = vS*X; // ODE of solid component der(X) = (Dn.Qe/Asc*(Dn.X_dn - X) + Up.SedFlux - Jsm)/zm; // ODEs of soluble components der(Si) = Dn.Qe*(Dn.Si - Si)/(Asc*zm); der(Ss) = Dn.Qe*(Dn.Ss - Ss)/(Asc*zm); der(So) = Dn.Qe*(Dn.So - So)/(Asc*zm); der(Sno) = Dn.Qe*(Dn.Sno - Sno)/(Asc*zm); der(Snh) = Dn.Qe*(Dn.Snh - Snh)/(Asc*zm); der(Snd) = Dn.Qe*(Dn.Snd - Snd)/(Asc*zm); der(Salk) = Dn.Qe*(Dn.Salk - Salk)/(Asc*zm); // downward connection Dn.SedFlux = -Jsm; // upward connections Up.Qe + Dn.Qe = 0; Up.X_dn = X; Up.Si = Si; Up.Ss = Ss; Up.So = So; Up.Sno = Sno; Up.Snh = Snh; Up.Snd = Snd; Up.Salk = Salk; end upper_layer;
WasteWater.ASM1.SecClar.Haertel.top_layer
This class models the top layer of an ASM1 secondary clarifier based on Haertel. No sedimentation flux (mass exchange) with above but hydraulic and sedimentation flux (opposite directions) underneath. From here effluent goes to the receiving water. Sedimentation flux is calculated based on the sedimentation velocity function by Haertel.
| Name | Default | Description |
|---|---|---|
| zm | height of m-th secondary clarifier layer [m] | |
| Asc | area of secondary clarifier [m2] | |
| ISV | Sludge Volume Index [ml/g] |
model top_layer "Effluent layer of Haertel`s SC model" package WWSC = WasteWater.ASM1.SecClar.Haertel.Interfaces; extends WWSC.SCParam; extends WWSC.SCVar; extends WWSC.ratios; WWSC.UpperLayerPin Dn; ASM1.Interfaces.WWFlowAsm1out Out; equation // sink velocity vS = WWSC.vSfun(X, ISV); // sedimentation flux in m-th layer sinking to lower layer Jsm = vS*X; // ODE of solid component der(X) = (Dn.Qe/Asc*(Dn.X_dn - X) - Jsm)/zm; // ODEs of soluble components der(Si) = Dn.Qe*(Dn.Si - Si)/(Asc*zm); der(Ss) = Dn.Qe*(Dn.Ss - Ss)/(Asc*zm); der(So) = Dn.Qe*(Dn.So - So)/(Asc*zm); der(Sno) = Dn.Qe*(Dn.Sno - Sno)/(Asc*zm); der(Snh) = Dn.Qe*(Dn.Snh - Snh)/(Asc*zm); der(Snd) = Dn.Qe*(Dn.Snd - Snd)/(Asc*zm); der(Salk) = Dn.Qe*(Dn.Salk - Salk)/(Asc*zm); // downward connection Dn.SedFlux = -Jsm; // effluent volume flow rate Out.Q + Dn.Qe = 0; // effluent, solid and soluble components (ASM1) Out.Si = Si; Out.Ss = Ss; Out.Xi = rXi*X; Out.Xs = rXs*X; Out.Xbh = rXbh*X; Out.Xba = rXba*X; Out.Xp = rXp*X; Out.So = So; Out.Sno = Sno; Out.Snh = Snh; Out.Snd = Snd; Out.Xnd = rXnd*X; Out.Salk = Salk; end top_layer;