Question: I need to create an If/Then structure in VBA. I was able to get the calculation for function Re, but I can't figure out how

 I need to create an If/Then structure in VBA. I was

I need to create an If/Then structure in VBA. I was able to get the calculation for function Re, but I can't figure out how to make the If/If else structure to work.

For Problem 3 - the Following values for diameter, Average velocity, density and viscosity result in a Re of 4022

D = 0.0508 m

Vavg = 0.1 m/s

density = 950 kg/m3

Viscosity = 0.0012 Pa sec

Create a function for Reynolds number. Use it to determine the type of flow for the following values.

(Optional - The Spreadsheet should contain the variable values for D, Vavg, density and viscosity and receive the Reynolds number. )

Pass the variables to the function Re(D,V,d,m).

Print out a MsgBox with the type of flow from the function

ACTOR , FOR A PARTICULAR FLOW e mechanical energy balance a an equation that a conmoelyaed by engineers for working oat the pump power required to move a fluld throogh a piplng estem One of the terms in the equation accousts for the change in kinetdic energy of the Buid and Inclodes a linetic energy correction factor, ar. The alue of a is 2 for fully developed laninar flow, In order to learn whether the Bow is laminar or tarbalent, ve must calculate the Reyholds number, deflned a but approaimately 1.05 for fully developed turbulent flow where Dis the inside diameter of the pipe, Is the average fuld velodty, p is the denslty cf the fluld, and p is the absolute viscoalty of the fluld at the system temperabare IE the value of the Reymolds mumber ls 2100 or les, then we will have lamioar low Ir it is at least 6000, we will have tarbulent fow. IE the Reyoolds number is between 2100 and 6000, the Bow is in a tramition region and the value of cannot be forecaut precisely We can write a shoet VBA function to first calculate the Reynolds number nd then use to if statements to set the value of according to the value of the Reysolda number. The SetAlpha function is charted is Figure 1424 and listed below Figure 14.24 Flowchat of SetAlpha lncdion. START YES NO Re 2100 NO Return a END

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!