Project

Drag Force variation wrt Velocity and Drag Coeff for Flow over a Bicycle Rider in PYTHON


import matplotlib.pyplot as plt

# Inputs #

# Air density in Kg/m^3
density = 1.2

# Constant Frontal Area of Cyclist in m^2
area = 0.4



# (1) For "Drag Force vs Vel" for a constant Drag Coeff #

# Velocities of the cycle in m/sec
V = [1,2,3,4,5,6]

# Constant Drag Coefficient
cd_const = 0.47

fD = []

for v in V:

    fD.append(0.5*density*area*v*v*cd_const)       # Drag force(N) wrt Velocity

print(fD)

# Plotting "Drag Force vs Vel" for constant Drag Coeff

plt.figure(1)
plt.plot(V,fD,'-g')
plt.xlim([0.9,6.1])
plt.ylim([0,4.2])
plt.xlabel('Velocity of the Bicycle')
plt.ylabel('Drag Force')
plt.title('"Drag Force vs Velocity" for a Constant Drag Coeff (0.47)')
plt.savefig('CD_const.png')
plt.show()



# (2) For "Drag Force vs Drag Coeff" for a constant Velocity #

# Drag coefficients for Half-Spherical,Spherical,Conical,Angled Cubical,Long-Cylindrical and Cubical shapes respectively
CD = [.42,.47,.50,.80,.82,1.05]

# Constant Velocity
v_const = 5

Fd = []

for cd in CD:

    Fd.append(0.5*density*area*v_const*v_const*cd)     # Drag force(N) wrt Drag Coeff

print(Fd)

# Plotting "Drag Force vs Drag Coeff" for constant Velocity

plt.figure(2)
plt.plot(CD,Fd,'-r')
plt.xlim([0.4,1.06])
plt.ylim([2.42,6.4])
plt.xlabel('Drag Coefficient')
plt.ylabel('Drag Force')
plt.title('"Drag Force vs Drag Coeff" for a Constant Velocity (5m/sec)')
plt.savefig('V_const.png')
plt.show()

Obtained Drag Forces:

Drag Forces wrt different Velocities:

[0.11279999999999998, 0.45119999999999993, 1.0152, 1.8047999999999997, 2.82, 4.0608]

Drag Forces wrt different Drag Coeffs:

[2.52, 2.82, 3.0, 4.800000000000001, 4.92, 6.300000000000001]

Obtained Plots:

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.