I will use
Code:
dt = h0/vel_max*cfl
where h0 is your estimated minimal mesh size, and vel_max is the estimated maximum velocity magnitude.
I will use a DG-P0 space to calculate vel_max as follows:
Code:
fes_vest = L2(mesh, order=0)
gf_vel = GridFunction(fes_vest)
gf_vel.Set((vel*vel)**0.5) # vel shall be your velocity grid function
vel_max = max(gf_vel.vec)