Está en la página 1de 5

Microsoft Excel Part 2

The first part of the Excel tutorial showed you how enter data into spreadsheets, edit them,
process them using equations and plot them on a graph.

1. Orifice flow exercise

1.1 Start with a blank spreadsheet. You can do this by clicking on the New icon at the left
of the first row of icon buttons. Enter your name in cell A1.

Consider the following engineering formulas which are used to determine the flow rate
in a pipeline where the flow passes through a concentric orifice:

2 P
Q = Ao Co

3
where Q : flow rate in m /s
3
Ao : area of orifice, m
Co : orifice coefficient, dimensionless
2
P : pressure drop across orifice, Pascals (N/ m )
3
: fluid density, kg/ m

The orifice coefficient, Co , can be calculated from:


Co = 0.6106 0.1319 + 0.3604 2
where : ratio of orifice diameter to pipe diameter

Now, you will create a spreadsheet which computes the flow rate based on the
various parameter values. Let's consider water flowing in a 6-inch pipeline with a 2-
inch-diameter orifice and a pressure drop of 100 inches of H2O.

Enter the basic data first:


1) in cell B2, enter 2, the orifice diameter in inches
2) in cell B3, enter 6.065, the actual inside diameter in inches of standard 6-inch
pipe
3) in cell B4, enter 100, the orifice pressure drop in inches of H2O
4) in cell B5, enter 1000, the density of water in kg/m3
5) enter the title Basic Data in cell B1

Add labels for units in column C and labels for variable names in column A:
1) in cells C2 and C3, enter the label inches
[You can copy one down to the other with the fill handle if you want.]
2) in cell C4, enter the label inH2O
3
3) in cell C5, enter the label kg/m
4) in cell A2, enter the label Do
5) in cell A3, enter the label Dp
6) in cell A4, enter the label deltaP
7) in cell A5, enter the label rho
8) right align the labels in cells A2:A4

Now, the first three values are converted to SI units (metric) to be consistent for the
rest of the calculations.
1) in cell D2 and D3, enter a formula to convert the inches in cell B2 and B3 to
meters by multiplying by 2.54 (cm/inch) and dividing by 100 (cm/m) [You can copy
one down to the other with the fill handle, if you want.]
2
2) in cell D4, enter a formula to convert the inH2O in cell B4 to Pascals (N/m ) by
dividing by 27.7 (in H2O/psi), dividing by 14.696 (psi/atm), and multiplying by 101325
(Pa/atm)

And, add the following labels to column E:


1) in cells E2 and E3, enter the label meters
2) in cell E4, enter the label Pascals

Now, create names for the following cells as shown in the table below using the
procedure described below the table:

Cell Name
D2 Do
D3 Dp
D4 deltaP
B5 rho

Select cell D2. In the entry line above the spreadsheet, just to the right of the D2
indicator, there is a downward arrow. Click on that; it opens the Name Box. Type in
the name Do and press the Enter key. Now, when the D2 cell is selected, the name
Do will appear in that window to the left of the downward arrow. Repeat this
procedure for cells D3, D4, and B5, and create the names shown in the table above.

This is a typical set-up for an engineering calculation: enter the basic data along with
explanatory labels, make necessary units conversions with labels.

1.2 Create the auxiliary formulas which lead up to the final equation. The first two
formulas are for the cross-sectional area of the orifice and the ratio. The third is the
equation shown above for the orifice coefficient, Co .
1) in cell B7, enter a formula which squares Do, multiplies by pi, and divides by 4
[Note: enter PI() in the formula for the value of pi.]
2) in cell B8, create a formula for by dividing Do by Dp
3) in cell B9, enter a formula to compute Co from according to the equation above
4) in cells A7, A8, and A9, enter the labels Ao, beta, and Co, and transfer those
labels as names to cells B7, B8, and B9, using in the following way: First, select
the block of cells to include A7,A8,A9 and B7,B8,B9, that is, block A7:B9. Next, use
the menu to choose Insert, Name, Create. You should see a Create Names dialog
box. Make sure that only Left Column is checked, the click on OK. This is a
convenient way to create a set of names at once.
5) Place a label of m2 in cell C7. It is also possible to display the 2 in this label as
a superscript. To do that, edit the C7 cell by pressing F2 or by just double-clicking
on the cell. Either use the mouse to highlight the 2 or use the arrow keys in the
following way: move the cursor with the arrow keys just to the left of the 2, hold
down the Shift key, and press the right arrow key once. With the 2 highlighted,
select the Format menu and the Cells option. Click on the Superscript box and then
the OK button. Your label should now read m2.

1.3 Now enter the final formula for flow rate in cell B11 as follows, using the names you
have defined directly in the formula:

=Ao*Co*SQRT(2*deltaP/rho)

The value you obtain is in m3/s ; so enter a label these units in cell C11. Enter the
label Q in cell A11.

In cell D11, create a formula which converts B11 from m3 to gallons-per-minute, by


multiplying by 1000 (liters/ m3), dividing by 28.316 (liter/ ft3), multiplying by 7.48
(gallons/ft 3), and multiplying by 60 (seconds/minute). Label the units in cell E11 as
gpm.

1.4 This should all result in a neatly arranged spreadsheet with a resulting flow rate of
about 137 gpm. If you do not get this result, go back through your cells and check
your formulas.

Try a few different values of the parameters according to the table below

Do (inches) P (inH2O) (kg/m3) Q (gpm)

3 100 1000

2 200 1000

2 100 700
Save your spreadsheet as file H:\Orifice.xls using the Save icon button. Close the
spreadsheet with the menu commands File and Close.

2. Curve fitting exercise

Engineers and hydrologists recurrently fit curves to data. In many cases, this involves tabular,
x-y data. There are two ways to do this: regression and interpolation.

y (a) y (b)

x x

(a) Regression and (b) interpolation

Regression (a) involves fitting a line or curve through data points which are uncertain. Such
data is often obtained by measuring inherently uncertain data or because the measurement
instrument has uncertainty associated with it. In such cases, the points are not connected.
Rather, a "best fit" curve is used to fit the data in a general sense. The best fit is often judged
as being the line that minimizes the sum of the squares of the vertical residuals between the
points and the curve.

Interpolation (b) involves fitting a line to points that are certain. These are often tabulated
measures of physical properties that have been measured with great precision. In such
cases, the strategy is to fit a curve through the points, and then use the equation for the curve
to estimate intermediate values.

YOUR PROBLEM: WEIR DATA

The relationship between height and flow rates for a weir can often be expressed in the
following form

Q = C w LH a

3
where Q = flow rate [m /s], Cw = the weir coefficient, L is the crest length [m] and H is the
height of the water above the crest [m]. Suppose that you are studying a sharp-crested
rectangular weir on the Thames with a length L = 60 m, and you collect the following data
Table 1
H, m 0.1 0.13 0.28 0.35 0.6
Q, m3/s 3.5 5 16 23 50

Use Excel to determine Cw and a by

(a) by trial and error


(b) adding a power trend line

You need to start by plotting Q (from Table 1) and Q (from the equation), both against H on
the same graph.

Linear regression can be used to calculate Cw and a based on the following trick. The
logarithm of the equation yields

log Q = log(C w L) + a log H

Therefore a plot of logQ versus logH should yield a straight line with a y-axis intercept of
log(CwL) and a slope of a. To get Cw, recall that

d = 10 log d

Therefore,

10 log Cw L
Cw =
L

3. Other Excel functions which you will find useful

Use the help facility to look at

IF, AND, OR operators


sorting data
searching
copying and moving spreadsheets to other workbooks
copying charts to Word and PowerPoint

También podría gustarte