Python Project 1 : Flow over Bicycle
Objective : To calculate drag force against a cyclist.
Problem Statement:- Write a PYTHON program to calculate drag force against a cyclist.
Problem should include: 1. A plot of Velocity v/s Drag force.
2. A plot of Drag Coefficient v/s Drag force.
Factors Involved :- Velocity, Drag Coefficient, Frontal Area, Density of air.
Definition of Drag force:- According to Merriam-Webster drag force is a "retarding force acting on a body moving through a fluid (such as air) in parallel and opposite direction to the direction of motion. It is retardation due to friction."
Formula Used :-
`D=frac{1}{2} rho v^{2}C_{D}A`
where D = Drag Force (Newton)
ρ = Density of Air `({kg}/m^{3})`
v = Velocity (m/s)
`C_D` = Drag Coefficient (Dimensionless)
A= Frontal Area (`m^2`)
"""Project Title:- Flow over bicycle"""
# Importing matplot function for plotting
import matplotlib.pyplot as plt
# Input Data
# Density of Air (rho) in kg/m^3
rho = 1.225
# Frontal Area(A) in m^2
A= 0.1
# For plot between velocity and Drag force(Drag coefficient constant and
# velocity is varying.)
# Drag coefficient(c_d contain drag coefficient 0.8 for bicycle)
c_d = 0.8
#Velocity range (velocity taken from 1 to 35 m/s)
velocities = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]
# Calculation of Drag force of varying velocity
# Using formula of Drag force
drag_force_velocity1 = []
for velocity in velocities:
drag_force_velocity1.append((0.5*rho*A*c_d*velocity*velocity))
# plot of velocity vs drag force
plt.plot(velocities,drag_force_velocity1)
plt.xlabel('Velocity in m/s')
plt.ylabel('Drag force in Newton')
plt.title('Velocity v/s Drag force')
plt.show()
# Input for plot Dag coefficient v/s drag force where velocity is constant
# and drag coefficient has multiple values
# Drag coefficient range
c_d = [0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7]
# Velocity in m/s
v = 25
# Drag force for varying drag coefficient
drag_force_coefficientrange=[]
for c_d_range in c_d:
drag_force_coefficientrange.append(0.5*rho*A*v*v*c_d_range)
# plot of Drag coefficient vs drag force.
plt.plot(c_d,drag_force_coefficientrange)
plt.xlabel('Drag coefficient')
plt.ylabel('Drag force in Newton')
plt.title('Drag coefficient v/s Drag force')
plt.show()
#end of the program
Result and Conclusion :- After the execution of the program following figure window is display.
This plots gives the results that how velocity and drag coefficients are related to each other.
From this the conclusion is that with increase of velocity or increase of Drag coefficient, the drag force will also get increase.
from the figure 1 we can see that when the velocity increase the drag force increase as an polynomial.
from figure 2 we can see that with increase of drag coefficient the change in drag force is linearly. which is show that according to formula drag force proportional to drag coefficient.
END