Week 1 - Flow over Bicycle
Introduction
Drag is a force acting opposite to the relative motion of any object moving with respect to a surrounding fluid in this case air. To calculate drag force velocity, drag coefficient, frontal area, density of air are required to be known.
The formula used to calculate Drag Force `D = 0.5*Cd * A *ρ * v^2`
where,
`Cd=`Coefficient of drag
`A=`Frontal Area
`ρ=`Density of Air
`v=`Velocity
Inputs
Coefficient of Drag is taken from internet for different shapes-
- Streamlined Body : 0.04
- Streamlined Half-Body : 0.09
- Half-Sphere : 0.42
- Sphere : 0.47
- Cone : 0.5
- Angled Cube : 0.8
- Long Cylinder : 0.82
- Cube : 1.05
- Short Cylinder : 1.15
Area and Density are taken inputs from the user in this case `0.1 m^2` and `1.2 kg*m^-3`. Velocity is entered as a row matrix 1 to 50. Two variables m and n are input as 1.
Code
- Inputs are entered for drag force to be calculated.
- First for loop is used to calculate drag force and plot drag force vs velocity for coefficient of drag of different shapes.
- Second for loop is used to calculate drag force and plot coefficient of drag vs drag force for velocity equal to `5, 10, 15, 20, 25, 30, 35, 40, 45 and 50 m/s`.
- Every plot is saved in the current directory.
% A program to calculate the drag force on a cyclictclose allclear allclc% Inputs% Drag coefficients of different shapescd=[0.04 0.09 0.42 0.47 0.5 0.8 0.82 1.05 1.15];% Displaying Drag Coefficients for different shapesdisp('Streamlined Body : 0.04');disp('Streamlined Half-Body : 0.09');disp('Half-Sphere : 0.42');disp('Sphere : 0.47');disp('Cone : 0.5');disp('Angled Cube : 0.8');disp('Long Cylinder : 0.82');disp('Cube : 1.05');disp('Short Cylinder : 1.15');% Area of the cyclict m^2A=input('Enter the area of the cyclist : ');% Density kg/m^3rho=input('Enter density of the Air : ');% Velocity m/sv=[1:50];% Variables = 1 for sprintfn=m=1;% Plotting drag force vs velocity for every value of cdfor i=1:length(cd) drag_Force=rho*A*v.^2*cd(i)*0.5; plot(v, drag_Force); xlabel('Velocity (m/s)'); ylabel('Drag Force (N)'); grid on file_plot=sprintf('Velocity_vs_Drag_Force_%d.png',n); saveas (gca, file_plot); n=n+1;end% Plotting cd vs drag force for velocity = 5,10,15,20,25,30,35,40,45,50for j=1:length(v)/5 v1=v(j*5); drag_Force_1=rho*A*v1^2*cd*0.5; plot(drag_Force_1,cd); ylabel('Coefficient of Drag'); xlabel('Drag Force (N)'); grid on file_plot1=sprintf('Drag_Force_vs_cd_%d.png',m); saveas (gca, file_plot1); m=m+1;endErrors
Instead of using v1 in calculating drag force v was used which is a higher order matrix.
Output
The plots for drag force vs velocity-
Streamlined Body : 0.04
Streamlined Half-Body : 0.09
Half-Sphere : 0.42
Sphere : 0.47
Cone : 0.5
Angled Cube : 0.8
Long Cylinder : 0.82
Cube : 1.05
Short Cylinder : 1.15
Plots of coefficient of drag vs drag force for velocity equal to `5, 10, 15, 20, 25, 30, 35, 40, 45 and 50 m/s`-
Velocity : `5ms^-1`
Velocity : `10ms^-1`
Velocity : `15ms^-1`
Velocity : `20ms^-1`
Velocity : `25ms^-1`
Velocity : `30ms^-1`
Velocity : `35ms^-1`
Velocity : `40ms^-1`
Velocity : `45ms^-1`
Velocity : `50ms^-1`