Project

Flow over Bicycle

AIM:

To write a Python program to calculate drag force against a cyclist.

The factors involved are Velocity, Drag coefficient, Frontal Area, Density of air.

  1. Write a program to plot Velocity vs Drag force.
  2. Write a program to plot Drag Co-efficient vs Drag force.

Theory:

A drag force (Fd) is the resistance force caused by the motion of a body through a fluid, such as water or air.

The aerodynamic coefficient (Cd)is a measure of the effectiveness of a streamline aerodynamic body shape in reducing the air resistance to the forward motion of a vehicle.

In this case the bicyclist is riding the cycle, cycle and bicyclist is experiencing the air resistance to move forward. This is given by the following equation:

Fd=1/2⋅Cd⋅V2⋅ρ⋅A

where,

Fd = Drag force (in Newton)

Cd = Coefficient of Drag

V = Velocity (in m/s)

A = Frontal Area (in m^2)

ρ= Density of air (in kg/m^3)

Assumption:

ρ = 1.225 kg/m^3

Problem 1:

To plot Velocity vs Drag

Solution:

In this case we assume that the Velocities are [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] m/s.

The frontal area(A) and the C_d values are assumed for different positions of the cyclist, of which the table is attached below.

Coding:

#importing the matplotlib module to plot the graph
import matplotlib.pyplot as plt 
#importing pandas module to read the dataframe 
import pandas as pd
import numpy as np
#Input values:
#Reading the values of the table 
data= pd.read_csv('cycle.csv')

data.head()
#Displying the first 5 elements of the table 
print (data.head())
#Drag_Coefficient
#Making the array from  the Cd column
c_da= np.array(data['Cd']) 
print(c_da)
#Diffent Areas of the cross section(Area of the Body) on which the air exerts force
#Storing the areas in an array
A=np.array(data['A'])#m^2
print(A)
#Density of the fluid(air)
rho=1.225#kg/m^3

#Intializing the array of multiple velocities
velocities=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
print(velocities)

#calculating the drag forces for each given velocity
drag_forces=[] #creating an empty array 

#Using for loop to append the values of the input data and calculate the drag force for given velocity
def drag(A,c_da,velocities):
	for velocity in velocities:
	
		drag_forces.append((0.5*rho*A*c_da*velocity*velocity))
				

drag(A,c_da,velocities)
print(drag_forces)
#Plotting the graph 
plt.plot(velocities,drag_forces)
plt.xlabel('velocity')
plt.ylabel('Drag force')
plt.show()

Graph for Different positions of the cyclist:

OUTPUT:

Problem 2:

To write a program to plot Drag Co-efficient vs Drag force

Solution:

Table containing the drag coefficients for different shapes:

Shape

Drag Coefficient

Sphere

0.47

Hemisphere

0.42

Cone

0.50

Cube

1.05

Angled Cube

0.80

Long Cylinder

0.82

Short Cylinder

1.15

Streamlined Body

0.04

Sreamlined Half Body

0.09

Velocity of air = 15 m/s

Density of air = 1.225 kg/m^3

Frontal area = 0.2 m^2

Coding:

#importing the matplotlib module to plot the graph
import matplotlib.pyplot as plt 
#importing pandas module to read the dataframe 
import pandas as pd
import numpy as np
#Input values:
#Reading the values of the table 
data= pd.read_csv('cycle.csv')

data.head()
#Displying the first 5 elements of the table 
print (data.head())
#Drag_Coefficient
#Array of coefficient of drag for different shapes
c_da= [0.47,0.42,0.50,1.05,0.80,0.82,1.15,0.04,0.09]
print(c_da)

#For a constant area 
A=0.20#m^2
print(A)
#Density of the fluid(air)
rho=1.225#kg/m^3

#For a constant velocity of 15 m/s
velocity=15#m/s
print(velocity)

#calculating the drag forces for each given velocity
drag_forces=[]#creating an empty array 

#Using for loop to append the values of the input data and calculate the drag force for given velocity
def drag(A,c_da,velocity):
	for cd in c_da:
		drag_forces.append((0.5*rho*A*cd*velocity*velocity))
				

drag(A,c_da,velocity)
print(drag_forces)
#Plotting the graph 
plt.plot(c_da,drag_forces)
plt.xlabel('c_da')
plt.ylabel('drag_forces')
plt.show()

	
	

GRAPH:

OUTPUT:

Conclusion:

Thus, the drag force increases with the coefficient of drag linearly provided all the other factors remain same.

References:

https://www.sciencedirect.com/science/article/pii/S0167610518305762

https://images.app.goo.gl/PACHBmvqQW7c1eMG6

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.