Flow over bicycle
| Flow over bicycle using Python |
1. AIM : To calculate Drag Force against a cyclist using Python program.
2. OBJECTIVE :
- To calculate Drag Force on a bicycle moving through the air.
- To plot Velocity vs Drag force and to plot Drag Co-efficient vs Drag force.
3. THEORY :
3.1 Drag: - 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 minimize drag so that they can increase their velocity.
fig.1: Drag force acting on a moving bicycle
Governing equations: - As the bicyclist is riding the cycle, cycle and bicyclist is expressing the air resistance to move forward. This is given by the following equation,
| `"FD "= 1/2 ".Cd." "v" ^2.ρ."A"` |
Where, FD = Drag force (Newton)
Cd = Coefficient of Drag (dimensionless)
v = Velocity (m/s)
`ρ` = Density of air (kg/m3)
4. PROCEDURE :
- First, we will assume the density of air to be 1.2041 kgm3, which is at and 101.325 kPa, and the drag coefficient to be 0.80.
- The frontal area is assumed 0.5 m2 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 displayed using the print command and plotted using 'plt.plot' and displayed using 'plt.show' command.
- For the same frontal area, the coefficient of drag varies for different shapes, so we will take different values of drag coefficient and observe the variation of drag coefficient with drag force keeping all other parameters to be constant. The same process will be applied for c_d array as that of velocity_array.
5. BODY OF 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()
6. OUTPUTS :
Output for program (i) and drag forces are calculated as below -
Output for program (ii) and drag forces are calculated as below -
7. CONCLUSIONS :
- We can see from the graph-1, that the drag force increases with velocity in quadratically provided all the other factors remain same.
- Also from graph-2, the drag force increases with the coefficient of drag linearly provided all the other factors remain same.