Flow over Bicycle in Python
Drag Force Calculations for Flow Over Bicycle
1.AIM:
- To calculate drag force acting on a cyclist driving the cycle using Python.
2.GOVERNING EQUATIONS IF ANY:
`(F)= 1/2 ρAV^2 C_d`
Where, `ρ`= density of the fluid in which cycle and cyclists exist ()
A= Frontal area / front area of exposure of cyclist ()
v= velocity of the cyclist respective to the fluid ()
C_d= Drag coefficient (unitless)
Pressure = and thus, Drag Force = Pressure x Area x (some constant)
So, we get Drag Force (F) = A
3.OBJECTIVES OF THE PROJECT:
- To find the total drag force acting on cyclist and cycle travelling with some velocity through a fluid medium.
- Write a python program to calculate drag force against a cyclist.
- Write a program to plot Velocity vs Drag force.
- Write a program to plot Drag Co-efficient vs Drag force.
4.FLOW OF THE PROJECT
- Assign values to the input variables.
- Get the value of drag force using the formula.
- Plot the graphs mentioned in the objectives.
5.PYTHON CODE
- plot for velocity vs drag force
import matplotlib.pyplot as plt
#input parameters
#Coefficent of Drag
c_d=0.9
#Density (kg/m^3)
rho=1.2
#frontal Area(m^2)
A=0.1
#velocity as an array (m/s)
v=[2 ,3 ,4 ,5 , 6 ,7, 8, 9, 10]
drag_force=[]
for velocity in v: #for loop to repeat process for all values of velocity
formula= 0.5*c_d*rho*A*velocity*velocity #Drag force value stored in a
drag_force.append(formula) #append all the values in drag force list.
plt.plot(v,drag_force) #plot the data
plt.xlabel('velocity') #label x axis as velocity
plt.ylabel('Drag Force') #label y axis as Drag Force
plt.savefig("plotadi1.png") #save
plt.show() #show
- Plot for cd and Drag Force
import matplotlib.pyplot as plt
#input paramters
#Coefficent of Drag as an array
cd=[0.4, 0.48, 0.82, 0.9, 1.15]
#Density (kg/m^3)
rho=1.2
#frontal Area(m^2)
A=0.1
#velocity (m/s)
v=2
drag_force=[]
for Coeffi in cd: #for loop to repeat process for all values of velocity
formula=0.5*Coeffi*rho*A*v*v #Drag force value stored in a
drag_force.append(formula) #append all the values in drag force list.
plt.plot(cd,drag_force) #plot the data
plt.xlabel('coefficent of Drag') #label x axis as velocity
plt.ylabel('Drag Force') #label y axis as Drag Force
plt.savefig("plotadi2.png") #save
plt.show() # show
6.OBSERVATION:
Figure 1: Velocity vs. Drag Force
Figure 2: Drag Coefficient vs Drag Force
7.CONCLUSION:
- From figure 1, we can say that as velocity increases, drag force also increases. The plot verifies the quadratic nature of the direct proportion of drag force with velocity.
- From figure 2, we can say that as drag coefficient increases, drag force also increases. The plot verifies the linear nature of direct proportion of drag coefficient with drag force.