function u = CalcBlock(x,v,d,p)
% model for level and concentration 

switch p(2)
    case 0
        u = CalcBlockCase0(x,v,d,p);
    case 1
        u = CalcBlockCase1(x,v,d,p);
    case 2
        u = CalcBlockCase2(x,v,d,p);
    case 3
        u = CalcBlockCase3(x,v,d,p);
    case 4
        u = CalcBlockCase4(x,v,d,p);
    case 5
        u = CalcBlockCase5(x,v,d,p);
    case 6
        u = CalcBlockCase6(x,v,d,p);
    otherwise
        u = v;
end
end