Problem (3): The pressure drop Ap in Pascal (Pa) for a fluid flowing in a pipe w
ID: 3872064 • Letter: P
Question
Problem (3): The pressure drop Ap in Pascal (Pa) for a fluid flowing in a pipe with a sudden increase in diameter is given by: 7 where is the density of fluid, v, the velocity of the flow, and d and D are defined in the figure above. Write a program in a script file that calculates the pressure drop Ap. When the script is calculated, it requests the user to input the density in kg/m3, the velocity in m/s, and values of the non-dimensional ratio dID as a vector. The program displays the inputted values of and v followed by a table with values of dID in the first column and the corresponding values of Apin the second column. Execute the program assuming flow of gasoline (-737 kg/m3) at v = 5 m/s and the following ratios of dimensionless diD-0.9, 0.8, 0.7, 0.6, 0.5, 0.4,0.3Explanation / Answer
Script chegg.m
rho= input('Enter the density in kg/m^3:'); % Accept density
v = input('Enter velocity in m/s:'); %Accept Velocity
dD = input('Enter a vector of d/D:'); % Accept d/D ratio as vector
delp=0.5*(1-dD.^2).^2*rho*v.^2; % Calculate delta P
X=['Density is ',rho]; % Forming a string with message to print the density
disp(X);
X=['Velocity is ',v]; % Forming a string with message to print the density
disp(X);
for i=1:numel(delp)
X=[ num2str(dD(i)),' ',num2str(delp(i))]; % Printing a table of dD with corresponding delp value
disp(X);
end
Output==>
Enter the density in kg/m^3:737
Enter velocity in m/s:5
Enter a vector of d/D:[0.9 0.8 0.7 0.6 0.5 0.4 0.3]
Density is 737
Velocity is 5
0.9 332.5712
0.8 1193.94
0.7 2396.1712
0.6 3773.44
0.5 5182.0313
0.4 6500.34
0.3 7628.8713
>> disp(rho)
737
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.