1. Pressure drop calculation (Chemical Engineering Application) (10 points) The
ID: 1839066 • Letter: 1
Question
1. Pressure drop calculation (Chemical Engineering Application) (10 points) The pressure drop in an incompressible and Newtonian fluid in laminar flow flowing through a long cylindrical pipe of constant cross section is calculated using Hagen-Poiseuille law as shown below tr Where: &P; is the pressure loss, Pa L is the length of a pipe, m ? is the dynamic viscosity, Kg/ s mQ is the volumetric flow rate, m/sris the radius, m Draw a Flowchart and write a VBA Sub Program to calculate the pressure drop for a given value of ? Q and r Round the pressure drop to two decimal places a. b. 2. Kinetic Energy (Mechanical Engineering Application) (10 points) a. Write a VBA Sub Program to calculate the kinetic energy by calling a function (written in the previous assignment #41) Use Inputbox to get the values of mass and velocity from the user, and output the calculated kinetic energy to the Excel sheet using msgbox Change the interior of the output cell to blue and font color (to any color). b. c.Explanation / Answer
Sub Pressuredifference()
'
' Pressuredifference Macro
'
'
ActiveCell.FormulaR1C1 = "L"
Range("A2").Select
ActiveCell.FormulaR1C1 = "µ"
Range("A3").Select
ActiveCell.FormulaR1C1 = "Q"
Range("A4").Select
ActiveCell.FormulaR1C1 = "r"
Range("A6").Select
ActiveCell.FormulaR1C1 = "?P"
Range("C1").Select
ActiveCell.FormulaR1C1 = "m"
Range("C2").Select
ActiveCell.FormulaR1C1 = "Kg/ms"
Range("C3").Select
ActiveCell.FormulaR1C1 = "M3/s"
Range("C4").Select
ActiveCell.FormulaR1C1 = "m"
Range("C3").Select
Range("C3").Select
ActiveCell.FormulaR1C1 = "M3/s"
With ActiveCell.Characters(Start:=1, Length:=1).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
With ActiveCell.Characters(Start:=2, Length:=1).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Strikethrough = False
.Superscript = True
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
With ActiveCell.Characters(Start:=3, Length:=2).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
Range("B6").Select
ActiveCell.FormulaR1C1 = "=8*R[-4]C*R[-5]C*R[-3]C/(3.14*R[-2]C^4)"
Range("B1").Select
ActiveCell.FormulaR1C1 = "1"
Range("B2").Select
ActiveCell.FormulaR1C1 = "1"
Range("B3").Select
ActiveCell.FormulaR1C1 = "1"
Range("B4").Select
ActiveCell.FormulaR1C1 = "1"
Range("B6").Select
Selection.NumberFormat = "0.00"
End Sub
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.