0% found this document useful (0 votes)
3 views2 pages

L05 Code Drag Objects

Lab 5 focuses on calculating the drag coefficients for various objects using input data from an Excel sheet. The lab involves processing data to determine average static and stagnation pressures, velocities, Reynolds numbers, and drag coefficients, followed by plotting the results against Reynolds numbers. The plot visually represents the relationship between drag coefficients and Reynolds numbers for different drag models, with critical Reynolds numbers indicated on the graph.

Uploaded by

sarradaboub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

L05 Code Drag Objects

Lab 5 focuses on calculating the drag coefficients for various objects using input data from an Excel sheet. The lab involves processing data to determine average static and stagnation pressures, velocities, Reynolds numbers, and drag coefficients, followed by plotting the results against Reynolds numbers. The plot visually represents the relationship between drag coefficients and Reynolds numbers for different drag models, with critical Reynolds numbers indicated on the graph.

Uploaded by

sarradaboub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab 5 - Drag Objects

NAME: SARAH DABOUB

LAB TITLE: Drag Objects

DATE: 02/28/2025

clc; % this will clear the fx >> command window


clear; % this clears local variables so there is no conflicts
close all; % close plots so each plot windows is new and correct
format short; % only show 5 significant digits for clear outputs

Input Data and Define Constants


% Calculation of Area of each drag models

diameter = [3,2.967,2.973,2.974,1.98,4]*0.0254;
area = pi/4*(diameter.^2);
density = 1;
mu = 0.0000185;

max = 0;
for i=1:1:6

data = xlsread('L05_Data Sheet_Drag Objects 1.xlsx',i);


j = length(data(:,1)); % This is to find the number of rows of data
% maximum data size
if j>max
size(i) = j;
end
speed_percent(i,1:j) = data(:,1);

ave_static(i,1:j) = (data(:,2)+data(:,3)+data(:,4))./3;

ave_stagnation(i,1:j) = (data(:,5)+data(:,6)+data(:,7))./3;

ave_force(i,1:j) = (data(:,8)+data(:,9)+data(:,10))./3;

dy_pressure(i,1:j) = (ave_static(i,1:j)-ave_stagnation(i,1:j))*248.84;

velocity(i,1:j) = sqrt(2.*dy_pressure(i,1:j)/density);

re_num(i,1:j) = density.*velocity(i,1:j).*diameter(i)/mu;

drag_coeff(i,1:j) = ave_force(i,1:j)./(dy_pressure(i,1:j)*area(i));

end

Generate Plot
% Define approximate critical Reynolds numbers

1
critical_re = [3e5, 5e5, 5e5, 3e5, 1e5, 3e5];

figure;
hold on;

plot_handles = gobjects(1,6);

for i = 1:6
% Plot curves and store handles for legend
plot_handles(i) = plot(re_num(i,1:size(i)), drag_coeff(i,1:size(i)));

% Find closest index to critical Re


[~, idx] = min(abs(re_num(i,:) - critical_re(i)));

plot(re_num(i,idx), drag_coeff(i,idx), 'ro', 'MarkerFaceColor', 'r',


'HandleVisibility', 'off');
end

title('Drag Coefficient vs. Reynolds Number');


xlabel('Reynolds Number');
ylabel('Drag Coefficient');

% Only include actual curves in legend


legend(plot_handles, {'Small Sphere', 'Circular Plate', 'Plunger', 'Mushroom',
...
'Streamlined', 'Big Sphere'}, 'Location', 'Best');

hold off;

You might also like