Project

Drag Force Calculation for Flow Over Bicycle Using MATLAB

Overview

This project aims to create code for calculating drag force over a cyclist.

Drag Force is the resistance force caused by the motion of a body moving through a fluid,such as water or air.

Drag Force is given by `Fd = Cd cdot frac{1}{2} cdot rho cdot A cdot V^2`

where `Cd`= Drag Coefficient

`rho`= density of fluid(here its air)

A = frontal area

V = velocity of the fluid

Objective

To calculate the drag force and evaluate the effects of various parameters on it.

1. Calculation of drag force and to plot drag force vs velocity graph

Code

% To compute drag force on a body
clear all
close all
clc

% Inputs

% Drag Coefficient
c_d = 0.5;

% Area in m^2
A = 0.1;

% Density of air in kg/m^3 at STP conditions
rho = 1.225;

% Velocity in m/s
V = linspace(1,20,5);

% Drag Force 
Fd = rho*A*V.^2*c_d*0.5;

% Plot of drag force v/s velocity
plot(V,Fd)
xlabel('Velocity(m/s)');
ylabel('Drag Force(N)');
grid on

Concise Explanation of the code

The code first initializes the values for parameters like drag coefficient,frontal area,density of the fluid and velocity.

Velocity of the air is varied at values of equal intervals from 1 to 20 m/s with interval spacing of 5 m/s.

Fd is the drag force in N.

Plot command plots the drag force vs velocity graph.

Results

The drag force vs velocity graph is plotted.

The drag force increases quadratically for the velocity when the rest of the parameters are maintaned constant.

2. To plot graph of drag force vs drag coefficient

Considering constant frontal area, values of drag coefficients for various shapes are shown below.

Code

% Plotting variation of Drag force w.r.t different values of drag
% coefficients keeping other parameters constant

clear all
close all
clc

% Inputs 
% Drag coefficients of various shapes shown in the first figure
c_d = [0.045 0.07 0.295 1.14 1.28];

% Frontal area in m^2
A = 1; %(assuming)

% Density of air in kg/m^3
rho = 1.225;

% Velocity of fluid in m/s
V = 25; %(keeping constant)

% Drag Force
Fd = c_d.*0.5*rho*A*V^2

plot(c_d,Fd)
xlabel('Drag Coefficient');
ylabel('Drag Force(N)');
grid on

Concise Explanation of the code

The code first initializes a coefficient matrix with values displayed on the first figure.

The frontal area is taken as 1 m^2.

Density = 1.225 kg/m^3.

Velocity = 25 m/s.

The drag force Fd is calculated for each value of the drag coefficient.

The plot command plots the drag force vs drag coefficient.

Results

The drag force vs drag coefficient graph is plotted.

It can be noted that the drag force varies linearly with the coefficent provided the rest of the parameters are kept constant.

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.