Computer Project Hardy Cross Spring 2021

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

ChE 3315 FLUID MECHANICS, SPRING 2021: Computer Project (Due May 04)

A pipe network consisting of one inlet, three outlets and four flow loops is shown in the diagram below.
The table below shows the friction factor, length, diameter and initial flow distribution of all pipe
sections. Your tasks are as follows:

Write a MatLab (Python, or other language) code to implement the Hardy Cross method in order
to find the correct distribution of flow rates in all the pipes and thus the correct direction of
flows along each pipe section in the network.
PIPE SECTION f L (m) D (mm) Initial guess, Qi (L/s)
A-B 0.0223 150 225 200 (from A à B)
B-E 0.0175 125 200 100 (from B à E)
E-I 0.0223 125 225 0

I-H 0.0218 150 300 200 (from H à I)


H-A 0.0218 250 300 200 (from H à A)
B-C 0.0233 75 225 100 (from B à C)

C-F 0.0175 125 200 0


F-E 0.0188 75 150 0
C-D 0.0233 75 225 100 (from C à D)
D-G 0.0175 125 200 0
G-F 0.0188 75 150 200 (from G à F)
G-J 0.0233 125 225 200 (from Jà G)

J-I 0.0218 150 300 200 (from I à J)

GENERAL GUIDELINES:

Your code should be commented (using the % sign) as much as possible, so it is clear what you have
done at each line in your code.

Make sure that your final solution satisfies mass conservation at each junction and the inlet/outlets.

You should make your code as efficient as possible, using a “while” loop instead of a “for” loop.

In the while loop, start by first calculating head loss in loop 1, then the flow rate correction based on
Hardy Cross, then apply to loop 2, calculate the flow rate correction, then apply to loop 3, etc. Make
sure your code updates the values of flow rate which are common to multiple loops.

Use threshold values of hL = 0.01 m and ΔQ* = 0.001 m3/s to determine convergence of your solution.
Record how many iterations it takes to converge?

Record how long it takes to run your code, using the commands “tic” and “toc”.
REPORT STRUCTURE / GRADING CRITERION:

• Projects will be graded out of 20 (10 pts for writing a code that finds the correct solution and 10
pts for your write-up and presentation).

• You must email your code to me (wei.li@ttu.edu, and zhenya.ding@ttu.edu) by 5pm, May 04.
Failure to do this will result in a 5 point deduction. Your code must run on my PC without me
having to modify your code or enter any information. If it does not, there will be a 5 point
deduction.

• Any hand-written work or poor English and grammar will result in a 5 point deduction.

• Failure to include the final solution/table will result in a 5 point deduction.

Your report must include the following items:

• Cover page with project title and your names. [1pt]

• Problem statement (and diagram) with the initial guess, showing that it satisfies mass
conservation (perform a mass balance at each node). [1pt]

• Statement of the Hardy Cross method that you will implement in your code and the equations.
[2pt]

• Your MatLab (or other) code as an appendix, including time to run the code on your PC and the
total number of iterations. [2pt]

• Your final solution in tabular form, showing the flow rates in each pipe and the number of
iterations required for convergence. [2pt]

• A schematic of the final solution with arrows clearly indicating the direction of the flow in each
pipe. [2pt]

You might also like