finding root using open method
ME 291: Engineering Analysis Spring 2021
Project #3: Finding Roots Using an Open Method Due Wednesday, April 28 at 5:00 pm Late submission for 20% penalty is by Wednesday, April 28 at 11:59 pm. No projects will be accepted after the late deadline. The pressure drop in a section of pipe can be calculated as
∆𝑃𝑃 = 𝑓𝑓 𝐿𝐿 𝐷𝐷 𝑉𝑉2
2 𝜌𝜌
where ∆𝑃𝑃 = the pressure drop (Pa), f = the friction factor, L = the length of pipe [m], ρ = density (kg/m3), V = velocity (m/s), and D = diameter (m). For turbulent flow, the Colebrook equation provides a means to calculate the friction factor,
1 �𝑓𝑓
= −2.0 log � 𝜀𝜀
3.7𝐷𝐷 +
2.51 Re �𝑓𝑓
�
where ε = the roughness (m), and Re = the Reynolds number,
Re = 𝜌𝜌𝑉𝑉𝐷𝐷 𝜇𝜇
where μ = dynamic viscosity (Ns/m2). Step 1 (Set-up): Choose from the Newton-Raphson, Secant or Modified Secant methods to solve the Colebrook equation for the friction factor, f. If you chose the Newton-Raphson method, clearly show the analytical derivative. Draw a flowchart of your chosen method. Step 2 (Program): Write a MATLAB function for solving the Colebrook equation using your chosen method for finding roots. Your flowchart from Step 1 should be for the method your team chooses to use. The function should be written such that the input variables (ɛ, D, Re, and others as needed) are passed to the function when it is called and the output variable (f) is returned. This will allow you to easily re-run your function for different pipes and flow conditions. Do NOT hard-code values for these input variables in your function and do NOT have it ask the user to input data during execution. To execute your function, either (a) write a main script to call the function (the input variables may be hard-coded in the main script, but not in the function) or (b) execute the function by calling it directly at the prompt in the command window. Use proper comments in your function to explain its purpose, define input and output variables and explain various calculation steps.
Step 3 (Analysis): Complete the following cases: - Determine ∆𝑃𝑃 for a 0.2-m-long horizontal stretch of smooth drawn tubing given 𝜌𝜌 =
1.23 𝑘𝑘𝑘𝑘/𝑚𝑚3,𝜇𝜇 = 1.79 × 10 − 5 𝑁𝑁 · 𝑠𝑠/𝑚𝑚2, 𝐷𝐷 = 0.005 𝑚𝑚, 𝑉𝑉 = 40 𝑚𝑚/𝑠𝑠, and 𝜀𝜀 = 0.0015 𝑚𝑚𝑚𝑚. Use a numerical method to determine the friction factor.
- Repeat the computation but for a rougher commercial steel pipe (ε = 0.045 mm). Logistics: This is an individual project that you will work by yourself. Submit:
• Electronic copy of your code tun printscreens (upload to Project 3 Dropbox on D2L):
o MATLAB function file from Step 2.
If you choose to execute the function by calling it from a main script, then also upload your main script.
Hint: Suggested reasonable intervals for the variables are provided below: Reynolds number: 2 × 103 ≤ Re ≤ 2 × 106 Pipe diameter 0.5 𝑖𝑖𝑖𝑖 ≤ 𝐷𝐷 ≤ 24 𝑖𝑖𝑖𝑖 Roughness height, ε 0 ≤ 𝜀𝜀 ≤ 0.01 𝑓𝑓𝑓𝑓