Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Domain Transfer Learning With 3q Data Processing

Authors: Ahmed Atif Hussain

1st Edition

B0CQS1NSHF, 979-8869061805

More Books

Students also viewed these Databases questions

Question

Describe reviewing applications and rsums.

Answered: 1 week ago

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago