Flow against bicycle
Aim:
To calculate the drag force against a cyclist.
Governing Equation:
Fd= 1/2*r*A*V^2
where
Fd=drag force
r=density of the fluid which the body is resisting
A=frontal area
V=velocity
Objective:
- To plot a graph between velocity and drag force at a constant drag coefficient.
- To plot a graph between drag coefficient and drag force at a constant velocity.
Assumptions:
- Frontal area of the cyclist is assumed to be 0.1 m^2.
- Fluid is taken as air and density is taken as 1.225 kg/m^3.
- Velocity is assumed from 5 to 15 m/s.
- For plotting velocity and drag force, drag coefficient is taken as 0.8.
- For plotting drag coefficient and drag force, velocity is taken as 10 m/s.
Description:
Drag force is a force acting opposite to the relative motion of any object moving with respect to a surrounding fluid. It depends upon frontal area, density of the fluid which it is resisting, velocity of the body and a dimensionless quantity called drag coefficient.
Code:
Programming language used – Python
# Program to calculate the drag force
# By : Anubrat Padhee
# Importing matplotlib for plotting
import matplotlib.pyplot as plt
# Inputs
# Drag coefficient unit-dimensionless
c_d=0.8
# Frontal area unit-m^2
a=0.1
# Density of air unit=kg/m^3
rho=1.225
#velocities unit-m/s
velocities=[5,6,7,8,9,10,11,12,13,14,15]
# Declaring an empty dragforce array
drag_forces=[]
# Calculating drag forces
for velocity in velocities:
drag_forces.append(0.5*rho*a*c_d*velocity*velocity)
# Plotting velocity vs. drag force at constant drag coefficient
plt.figure()
plt.plot(velocities,drag_forces)
plt.xlabel("Velocity")
plt.ylabel("Drag force")
plt.title("velocity vs. drag force")
plt.show()
# Now to plot drag force vs drag coefficient at constant velocity
# Taking velocity constant unit-m/s
c_velocity=10
# Drag coefficient for different shapes
# Sphere=0.47
# Half sphere=0.42
# Cone=0.50
# Cube=1.05
# Angled cube=0.80
# Long cylinder=0.82
# Short cylinder=1.15
# Streamlined body=0.04
# Streamlined half body=0.09
C_d_s=[0.47,0.42,0.50,1.05,0.80,0.82,1.15,0.04,0.09]
Drag_forces=[]
# Calculating drag forces
for C_d in C_d_s:
Drag_forces.append(0.5*rho*a*C_d*velocity*velocity)
# Plotting drag coefficient vs. drag force at constant velocity
plt.figure()
plt.plot(C_d_s,Drag_forces)
plt.xlabel("Drag coefficient")
plt.ylabel("Drag forces")
plt.title("drag coefficient vs. drag force")
plt.show()
Steps :
- First the matplotlib library was imported for using plot function.
- First, to plot drag force vs velocity certain inputs were given.
- Drag coefficient was taken as 0.8.
- Frontal area was assumed 0.1 m^2.
- Density of air is taken as 1.225 kg/m^3.
- An array of velocities were taken from 5 to 15 m/s.
- Then for each velocity drag force was calculated using for loop and the formula mentioned above.
- Drag forces were stored in an array.
- Then, drag force vs velocity was plotted using plot function of matplotlib.
- Second, to plot drag force vs drag coefficient.
- Same input were taken except velocity which was taken as 10 m/s.
- Drag coefficient of different shapes were stored in an array.
- Then for each drag coefficient drag force was calculated using for loop and the formula mentioned above.
- Drag forces were stored in an array.
- Then, drag force vs drag coefficient was plotted using plot function of matplotlib.
Output:
Conclusion:
As we can see from the graph drag force varies quadractically with velocity and linearly with drag coefficient.