Question: ASAP! POST USING VBA CODE!!! The head loss in a pipe is given by the formula: H l o s s = f L V

ASAP! POST USING VBA CODE!!!
The head loss in a pipe is given by the formula:
Hloss=fLV22gD,
Where L is the length of the pipe, V is the velocity in the pipe, g is the acceleration of gravity
(32fts2),D is the diameter and f is the friction factor. The friction factor for laminar flow (Re
2300) is given by:
f=64Re
The friction factor for turbulent flow (Re>4000) is given by the following explicit
approximation (Haaland equation):
1f2=-1.8log10[6.9Re+(D3.7)1.11]
Where Re is the Reynolds number, is the roughness and D is the diameter of the pipe. Develop
a visual basic program, using a FUNCTION (do not use Subroutines), to calculate the
friction factor and total head loss for two pipes. The parameters for the two pipes are given
below.
a) Pipe 1:Re=45,000,D=0.055,D=1.2ft,V=3.6fts;L=1200ft.
b) Pipe 2: Re=1,500,D=0.0,D=0.65ft,V=0.35fts,L=11000ft
Set up your spreadsheet as follows:
Hint 1: In VBA, "log()" will compute natural log. Refer to the following formula as you
develop your code that utilizes log10 :
log10(x)=0.43429ln(x)= Application. WorksheetFunction. Log100
Hint 2: Since the friction factor (f) calculation is simple if Re2300(f=64Re, you don't
need to make a function for it. Therefore, you are only required to create a function to calculate
fif Re>4000.
Hint 3: To calculate both columns with one button, insert the calculations and printing codes
inside a for loop (that starts after variables declarations). You can use the following code as
a guideline.
 ASAP! POST USING VBA CODE!!! The head loss in a pipe

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!