Use Matlab to solve the following question In fluid dynamics
Use Matlab to solve the following question:
In fluid dynamics, the Reynolds number Re is a dimensionless number used to determine the nature of a fluid flow. The formula for a fluid in a circular pipe is Re = vD/V , where V = 1 * 106 (m2/s) is the dynamic viscosity of water at 20o . Write a user-defined function that receives velocity V (m/s) and diameter D (m) as input, calculates the Reynolds number, categorizes it in one of the three regions shown below, and prints out the region the flow is in. Test your function with one set of (v, D) of your choice.
Re <= 2300 Laminar Region
2300 < Re < 4000 Transition Region
Re > 4000 Turbulent Region
Solution
I have written a simple matlab code for the same. The user as to enter the 3 values in the function and the reynolds number will be calculated.
Based on the value of the number we will print the region in which the flow is happening.
matlab code:
function R = reynold_calculator(v,D,V)
R=(v*D/V)
if (R <= 2300)
disp(\'Laminar Region\')
else if (R <= 4000)
disp (\'Transition Region\')
else
disp (\'Turbulent region\')
