Problem 45413. Characterize fluid flow in a pipe as to laminar or turbulent
In fluid mechanics, characterizing the flow in a pipe is essential to predicting its behavior. The flow pattern can either be laminar (smooth/sheetlike), turbulent (rough/chaotic), or transitioning from laminar to turbulent. Intuitively, flow velocity is a dominant factor in determining the flow pattern: A slowmoving fluid is laminar, while a fastmoving one is turbulent. However, the flow pattern can also be influenced by pipe geometry, fluid viscosity, and fluid density.
Hence, instead of just flow velocity, engineers are using a number that better indicates the flow pattern called the Reynolds Number, Re. For a fluid flowing inside a circular pipe, Re is computed as follows:
Re = D x v x rho / mu where: D = inside diameter of the pipe [m] v = mean flow velocity [m/s] rho = fluid density [kg/m^3] mu = fluid viscosity [Pa.s] or [kg/m/s]
Note: Although it is not customary to use SI units for these quantities, this problem deals with SI units for ease.
We can then adopt the following rule: If Re < 2300, the flow is laminar; if Re > 2900, the flow is turbulent; otherwise, the flow is in transition.
Write a function that accepts a MATLAB variable, x, which is always a 4element row vector containing the values (in SI) of D, v, rho, and mu in that order. Output the appropriate string among 'LAMINAR', 'TRANSITION', or 'TURBULENT', according to the rule above.
See sample test cases:
>> flow_pattern([0.02 0.1 1000 8.9e4]) ans = 'LAMINAR' >> flow_pattern([0.02 0.5 1000 8.9e4]) ans = 'TURBULENT' >> flow_pattern([0.02 0.1 1200 8.9e4]) ans = 'TRANSITION'
Solution Stats
Problem Comments

1 Comment
I gotta say, it's very nice to see a problem with an extensive test suite!
Solution Comments
Show commentsProblem Recent Solvers126
Suggested Problems

Increment a number, given its digits
647 Solvers

21299 Solvers

Project Euler: Problem 8, Find largest product in a large string of numbers
1093 Solvers

Determine Whether an array is empty
773 Solvers

Matlab Basics  Convert a row vector to a column vector
625 Solvers
More from this Author19
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!