FlowSheet test
PARAMETERS
u(3) as Real;
SET
u = [2,4,-1];
VARIABLES
x(4) as Real;
EQUATIONS
diff(x(1)) = x(1) + x(2) + min(u);
diff(x(2)) = x(2) + x(3) + max(x);
diff(x(3)) = x(1) + x(3) + max([0, min([u,x])]);
diff(x(4)*x(3)) = 2*x(2)*x(4) - min([x, max(u)]);
OPTIONS
Dynamic = false;
end
FlowSheet newtest
PARAMETERS
v0p as Real (Default = 250); # Maximum settling velocity (m.d^-1)
v0 as Real (Default = 474); # Maximum Vesilind settling velocity (m.d^-1)
rh as Real (Default = 0.000576); # Hindered zone settling parameter (m3.(g SS)^-1)
rp as Real (Default = 0.002860); # Flocculant zone settling parameter (m3.(g SS)^-1)
fns as Real (Default = 0.002860); # Non-settleable fraction (dimensionless)
Xt as Real (Default = 3000); # Threshold concentration for settler (g.m^-3)
fr as Real (Default = 4/3); # Coefficient for TSS calculation
VARIABLES
XD(nlayer) as Real (Lower = 0);
vs(nlayer) as Real (Lower = 0);
Js(nlayer) as Real (Lower = 0);
Jclar(nlayer) as Real (Lower = 0);
EQUATIONS
Xf = 2665.3;
for i in [1:nlayer]
#vs(i) = max([0, min([v0p, v0*(exp(-rh*(XD(i) - fns*Xf)) - exp(-rp*(XD(i) - fns*Xf)))])]);
aux1(i) = v0*(exp(-rh*(XD(i) - fns*Xf)) - exp(-rp*(XD(i) - fns*Xf)));
aux2(i) = min([v0p, aux1(i)]);
vs(i) = max([0, aux2(i)]);
end
Js = vs*XD;
Jclar([1:flayer]) = 2;
for i in [flayer+1:nlayer]
if XD(i-1) > 3000 then
Jclar(i) = min([Js(i), Js(i-1)]);
else
Jclar(i) = Js(i);
end
end
end