Project

Flow over Bicycle using Python

AIM

  • Write a Python program to calculate drag force against a cyclist.
  • Write a program to plot Velocity vs Drag force.(25 points)
  • Write a program to plot Drag Co-efficient vs Drag force.(25 points)

THEORY

A drag force is the resistance force caused by the motion of a body through a fluid, such as water or air. A drag force acts opposite to the direction of the oncoming flow velocity. This is the relative velocity between the body and the fluid.

Any object moving through a fluid experiences drag - the net force in the direction of flow due to pressure and shear stress forces on the surface of the object.

The drag force can be expressed as:

Fd = cd 1/2 ρ v2 A

Where,

Fd = drag force (N)

Cd = drag coefficient

ρ = density of fluid (1.2 kg/m3 for air at NTP)

v = flow velocity (m/s)

A = characteristic frontal area of the body (m2)

The drag coefficient is a function of several parameters like shape of the body, Reynolds Number for the flow, Froude number, Mach number and Roughness of the Surface.

The characteristic frontal area - A - depends on the body.

Objects drag coefficients are mostly results of experiments. The drag coefficients for some common bodies are indicated below:

Type of Object

Drag Coefficient
- cd -

Frontal Area

Laminar flat plate (Re=106)

0.001

Dolphin

0.0036

wetted area

Turbulent flat plate (Re=106)

0.005

Subsonic Transport Aircraft

0.012

Supersonic Fighter,M=2.5

0.016

Streamlined body

0.04

π / 4 d2

Airplane wing, normal position

0.05

Sreamlined half-body

0.09

Long stream-lined body

0.1

Airplane wing, stalled

0.15

Modern car like a Tesla model 3 or model Y

0.23

Toyota Prius, Tesla model S

0.24

frontal area

Tesla model X

Sports car, sloping rear

0.2 - 0.3

frontal area

Common car like Opel Vectra (class C)

0.29

frontal area

Hollow semi-sphere facing stream

0.38

Bird

0.4

frontal area

Solid Hemisphere

0.42

π / 4 d2

Sphere

0.5

Saloon Car, stepped rear

0.4 - 0.5

frontal area

Convertible, open top

0.6 - 0.7

frontal area

Bus

0.6 - 0.8

frontal area

Old Car like a T-ford

0.7 - 0.9

frontal area

Cube

0.8

s2

Bike racing

0.88

3.9

Bicycle

0.9

Tractor Trailed Truck

0.96

frontal area

Truck

0.8 - 1.0

frontal area

Person standing

1.0 – 1.3

Bicycle Upright Commuter

1.1

5.5

Thin Disk

1.1

π / 4 d2

Solid Hemisphere flow normal to flat side

1.17

π / 4 d2

Squared flat plate at 90 deg

1.17

Wires and cables

1.0 - 1.3

Person (upright position)

1.0 - 1.3

Hollow semi-cylinder opposite stream

1.2

Ski jumper

1.2 - 1.3

Hollow semi-sphere opposite stream

1.42

Passenger Train

1.8

frontal area

Motorcycle and rider

1.8

frontal area

Long flat plate at 90 deg

1.98

Rectangular box

2.1

PROCEDURE

  • Initially we are going to ‘import the matplotlib.pyplot’ library to get the plots, we name it as plt.
  • After that we just give the input values are velocity, density of air, drag co-efficient and frontal area.
  • Then we are going to calculate the drag force for different velocity values.
  • And then calculate the drag force for drag co-efficient values.
  • Append command is used to add the values and for drag force value we can use ‘print’ command to get the answer.
  • Then using plt.plot(), plt.title and plt.xlable commands to get the graph, title and lables.

PROGRAM

#program to calculate the Drag force
#by sallavoddin

import matplotlib.pyplot as plt

#inputs

#drag co-efficient
c_d=0.8
c_ds=[0.1,0.15,0.23,0.24,0.2,0.29,0.38,0.4,0.42,0.5,0.45,0.6,0.7,0.8,0.88,0.9,0.96,0.8,1.1,1.1,1.17,1.3,1.2,1.42]
drag_forces_cd=[]

#Frontal area m2
A=0.1

#Density (kg/m3)
rho=1.2
#bicycle velocity
velocities=[1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]
drag_forces=[]

for velocity in velocities:
	drag_forces.append(0.5*c_d*rho*A*velocity*velocity)

print(drag_forces)

plt.plot(velocities,drag_forces)
plt.title('Velocity vs Drag force')
plt.xlabel('Velocity [m/sec]')
plt.ylabel('Drag force [N]')
plt.show()

for c_d in c_ds:
	drag_forces_cd.append(0.5*c_d*rho*A*velocity*velocity)

print(drag_forces_cd)
plt.plot(c_ds,drag_forces_cd)
plt.title('Darg co-efficient vs Drag force')
plt.xlabel('Drag co-efficient')
plt.ylabel('drag force [N]')
plt.show()

RESULTS

for different velocities

[0.048, 0.192, 0.43200000000000005, 0.768, 1.2, 1.7280000000000002, 3.072, 3.888, 4.8, 5.808, 6.912000000000001, 8.112, 9.408000000000001, 10.799999999999999, 12.288, 13.872000000000002, 15.552, 17.328, 19.2, 21.168, 23.232, 25.392000000000003, 27.648000000000003, 30.0]

for different Drag co-efficients

[3.75, 5.624999999999999, 8.625, 9.0, 7.5, 10.874999999999998, 14.250000000000002, 15.0, 15.75, 18.75, 16.875, 22.499999999999996, 26.25, 30.0, 33.0, 33.75, 36.0, 30.0, 41.25, 41.25, 43.875, 48.75000000000001, 44.99999999999999, 53.25]

PLOTS

Drag force vs Velocity

Drag force vs Drag co-efficient

CONCLUSION

  • We can see that in figure1 velocity vs drag force, drag force is increases non-linearly with velocity.
  • In the figure2 we can see that drag force is directly proportional to drag co-efficient. if we change the value of drag co-efficient then also there is no variation in straight line.

REFFERENCES

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.