//JLJ //Sweep space for speed //Flowrate calculation and visualitation clear; D=0.1;// [m] Internal diameter of pipe R=D/2;//[m] Internal radius of pipe in=100; //Grid spacing, xcord jn=100; //Grid spacing, ycord vmax=2;// [m/s] Max flow speed, centerline speed (x=y=0) dA=D/in*D/jn;//[m^2] //Physical multiples point measurement data ns=5; //Number of different measurements, equidistant stations xp=linspace(-R,R,in); yp=linspace(-R,R,jn); flowrateideal=0; flowratemultipoint=0; dadda=0; i=1; j=1; for i=1:in for j=1:jn r=((xp(i)^2+yp(j)^2)^0.5) if r>R then r=R; end // theta=atan2(yp(j),xp(i)) v(i,j)=vmax*(1-r/R)^(1/7) //Speed magnitude if r