%
%  Test of Clarifier Model from Diehl and Jeppsson
%
%----------------------------------------------------------------
%
%         nn     = number of nodes
%         ssi    = initial suspended solids (length nn)
%         fv     = flowrate vector [ feed overflow underflow ]
%         sv     = suspended solids vector [ ssf 0 0 ]
%         cht    = clarifier height
%         tht    = thickener height
%         delt   = time increment
%         tmax   = end of calculation time
%         area   = cross-sectional area
%         c      = coefficient vector for settling velocity model
%
%nn = 5;
%ssi = [ 0*ones(2,1); 1196*ones(2,1); 8840.6 ];
%nn = 10;
%ssi = [ 0*ones(4,1); 1196*ones(4,1); 3882.2; 8840.6 ];
nn = 20;
ssi = [ 0*ones(9,1); 1196*ones(9,1); 3882.2; 8840.6 ];
fv = [ 450 250 200 ];
sv = [ 5390 0 0 ];
cht = 1.8;
tht = 2.2;
delt = 0.05;
tmax = 7.5;
area = 500;
c = [ 145/24 0.00042 ];
%         
% calculate the profile
%
[ xt, sv ] = Clarifier_Model( nn, ssi, fv, sv, cht, tht, delt, tmax, ...
                         area, c, 0, 0 );
%
[ n, m ] = size( xt );
k = round( n / 25 );
font = 16;
figure
mesh( xt(1:k:n,2:nn+1) );
axis([0 nn 0 26 0 10000])
set( gca, 'fontsize', font );
xlabel( 'Layer' );
ylabel( 'Time Steps' );
zlabel( 'Solids (mg/l)' );
%
%-----------------------------------------------------------
% The End
