Week 1 Flow over bicycle on python
AIM: To Calculate Drag Force against a cyclist using Python Program.
OBJECTIVES OF THE PROJECT:
- To calculate Drag Force on a bicycle moving through air
- To plot Velocity vs Drag force and to plot Drag Co-efficient vs Drag force.
THEORY:
The force on an object that resists its motion through a fluid is called ‘drag’. When the fluid is a gas like air, it is called aerodynamic drag or air resistance. A drag force acts in opposition to the direction of motion and therefore has a negative effect on the velocity. A cyclist, for example, will constantly try to minimise drag so that they can increase their velocity.
GOVERNING EQUATIONS: The equation that represents the drag force, experienced by a body due to its movement through the fluid is given by,
`implies` `F_(D )= 0.5*ρ*A*v^2*C_d`
`F_D` = Drag Force experienced by a body (`N`),
`rho` = Density of the fluid through which the body is moving (`kg⁄m^3` ),
`A` = Projected frontal area of the body which is perpendicular to fluid flow direction (),
`v` = Velocity of the body relative to the fluid around them (`m/s`),
`C_d`= Drag coefficient, a dimensionless quantity.
PROCEDURE:
- First, we will assume the density of air to be 1.2041 `(kg) /m^3`, which is at and 101.325 kPa and drag coefficient to be 0.80.
- Frontal area is assumed 0.5 `m^2` and drag force is calculated with different values of velocity stored in the array to understand the variation of velocity with drag force in Python.
- At first drag_forces array is kept null and for loop is executed for different values of velocity array and drag force is calculated using the given formula and stored in drag_forces array using 'append' command.
- All the values of drag_forces calculated are dispalyed using print command and plotted using 'plt.plot' and dispalyed using 'plt.show' command.
- For same frontal area, the coefficient of drag varies for different shapes, so we will take different values of drag coefficient and observe variation of drag coefficient with drag force keeping all other parameters to be constant. Same process will be applied for c_d array as that of velocity_array.
BODY OF THE CONTENT :
(i) Python Code for calculating drag force and to plot variation between velocity and drag force -
# A program to calculate drag forces over a bicycle and to plot variation between velocity and drag force
import matplotlib.pyplot as plt
# Inputs
# Drag coefficient of air
c_d = 0.8
# Frontal area(m^2)
A = 0.5
# Density of air (kg/m^3)
rho = 1.2041
# Velocity (m/s)
velocity_1 = [10,20,30,40,50,60,70,80,90]
drag_forces = []
for velocity in velocity_1:
drag_forces.append((0.5*rho*A*velocity*velocity*c_d))
print(drag_forces)
plt.plot(velocity_1,drag_forces)
plt.xlabel('Velocity (m/s)')
plt.ylabel('Drag forces (N)')
plt.title('Variation between Velocity and Drag_forces')
plt.show()
(ii) Python Code for calculating drag force and to plot variation between drag coefficient and drag force for the same frontal area-
# A program to calculate drag forces over a bicycle and to plot variation between drag coefficient and drag force
import matplotlib.pyplot as plt
# Inputs
# Drag coefficient
'''drag coefficient for different shapes having same frontal area
Sphere = 0.50
Solid Hemisphere = 0.42
Cube = 0.8
Thin disk = 1.12
Squared flat plate = 1.17'''
c_d_1 = [0.42,0.5,0.8,1.12,1.17]
# Frontal area(m^2)
A = 0.5
# Density (kg/m^3)
rho = 1.2041
# Velocity (m/s)
velocity = 20
drag_forces = []
for C_d in c_d_1:
drag_forces.append((0.5*rho*A*velocity*velocity*C_d))
print(drag_forces)
plt.plot(c_d_1,drag_forces)
plt.xlabel('C_d ')
plt.ylabel('Drag forces (N)')
plt.title('Variation between Drag coefficient and Drag_forces')
plt.show()
OUTPUT :
- The following output is for program (i) and drag forces are calculated and displayed here.
The data obtained are entered into excel sheet and from there the plot obtained is as -
- The following output is for program (ii) and drag forces are calculated and displayed here.
CONCLUSION :
- The greater the velocity of a body through a fluid, the greater the drag force,i.e., drag force becomes four times as velocity doubles and it is clearly observed from figure 1 as,
`F prop V^2`
- As the value of `C_d` increases, correspondingly drag force also increases. Hence such shapes are chosen for designing whose `C_d` is less as,
`F prop C_d`
- Furthermore, drag force is directly proportional to the density of the air, `rho`, which decreases with altitude, thus one way to experience less drag is to move from the sea level to the mountains.
`F prop rho`