microsoft excel for chemical engineers notes (by moataz and mohammed)

85
CAIRO UNIVERSITY FACULTY OF ENGINEERING CHEMICAL ENGINEERING DEPARTMENT July 2009 INTRODUCTION TO MICROSOFT EXCEL WITH APPLICATIONS IN CHEMICAL ENGINEERING Eng. Moataz Bellah Mahmoud Mousa Eng. Mohammed Gamal Abdel Nasser

Upload: madhusudhan-reddy-pallaka

Post on 27-Oct-2014

1.508 views

Category:

Documents


43 download

TRANSCRIPT

Page 1: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

CAIRO UNIVERSITY FACULTY OF ENGINEERING CHEMICAL ENGINEERING DEPARTMENT

July 2009

INTRODUCTION TO MICROSOFT EXCEL

WITH APPLICATIONS IN CHEMICAL ENGINEERING

Eng. Moataz Bellah Mahmoud Mousa Eng. Mohammed Gamal Abdel Nasser

Page 2: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Table of Contents

Microsoft Excel 2007 Basics .................................................................................................................... 1

Inserting Charts ...................................................................................................................................................... 1

Data fitting using least square method ......................................................................................................... 5

Array calculations .................................................................................................................................................. 9

Matrices ................................................................................................................................................................... 10

Thermodynamics ..................................................................................................................................... 14

Equations of state ................................................................................................................................................ 14

Solving equations of state using excel ........................................................................................................ 16

Vapor Pressure Data Representation Using Equations ........................................................................ 17

Chemical Reaction Engineering........................................................................................................... 21

Batch reactor yield optimization ................................................................................................................... 21

Chemical reaction equilibrium ....................................................................................................................... 23

Example Using Excel ........................................................................................................................................... 24

Regressing rate constants in rate equation from experimental data .............................................. 26

Multiple regression using Excel.................................................................................................................... 26

Non linear regression ....................................................................................................................................... 30

Nonlinear Regression Using Excel .............................................................................................................. 30

Fundamentals of Chemical Engineering ........................................................................................... 33

Material Balance................................................................................................................................................... 33

Material balance for non-reactive system .................................................................................................. 35

Material balance for a reactive system without recycle ......................................................................... 37

Material balance for a reactive system with recycle ............................................................................... 39

Energy Balance ..................................................................................................................................................... 43

Energy balance on a non-reactive system .................................................................................................. 50

Energy balance on a reactive system ........................................................................................................... 53

Fluid Mechanics ........................................................................................................................................ 59

Terminal Velocity of Falling Particles .......................................................................................................... 59

Emptying Tank...................................................................................................................................................... 62

Runge-Kutta method .......................................................................................................................................... 62

Pipeline optimization ......................................................................................................................................... 64

Page 3: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

PHASE EQUILIBRIA AND MASS TRANSFER .................................................................................. 68

Introduction ........................................................................................................................................................... 68

Bubble point Calculations................................................................................................................................. 70

Dew point Calculations ...................................................................................................................................... 71

Flash Calculations ................................................................................................................................................ 71

Performing flash calculations using Microsoft Excel ......................................................................... 72

Page 4: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Microsoft Excel 2007 Basics

Inserting Charts

Microsoft Office Excel 2007 supports many types of charts to help you display data in ways that are

meaningful to you. There are many types of charts available in Microsoft excel, and here we will try to

show the most commonly used ones in the engineering applications:

Line charts

Data that is arranged in columns or rows on a worksheet can be plotted in a line chart. Line charts can

display continuous data over time, set against a common scale, and are therefore ideal for showing

trends in data at equal intervals. In a line chart, category data is distributed evenly along the horizontal

axis, and all value data is distributed evenly along the vertical axis.

Pie charts

Data that is arranged in one column or row only on a worksheet can be plotted in a pie chart. Pie charts

show the size of items in one data series, proportional to the sum of the items. The data points in a pie

chart are displayed as a percentage of the whole pie.

Consider using a pie chart when:

You only have one data series that you want to plot.

None of the values that you want to plot are negative.

Exercise: Search the Microsoft Excel help to find out more information about bar charts and how to

use it to draw a Gantt chart

Page 5: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

XY (scatter) charts (most used in chemical engineering applications)

Data that is arranged in columns and rows on a worksheet can be plotted in an xy (scatter) chart. Scatter

charts show the relationships among the numeric values in several data series, or plots two groups of

numbers as one series of xy coordinates.

A scatter chart has two value axes, showing one set of numeric data along the horizontal axis (x-axis)

and another along the vertical axis (y-axis). Scatter charts are typically used for displaying and

comparing numeric values, such as scientific, statistical, and engineering data.

Consider using a scatter chart when:

You want to change the scale of the horizontal axis.

You want to make that axis a logarithmic scale.

There are many data points on the horizontal axis.

You want to effectively display worksheet data that includes pairs or grouped sets of values and

adjust the independent scales of a scatter chart to reveal more information about the grouped

values.

You want to show similarities between large sets of data instead of differences between data

points.

You want to compare many data points.

Some of Microsoft Excel charts (unstacked, 2-D, area, bar, column, line, stock, xy (scatter), or bubble

chart) provide an easy means of fitting data and getting the equation that fits the data plotted on the

graph using a method called Regression.

Fitting data is performed by an option called “Add Trendline”

Page 6: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Choosing the right trendline type for your data

When you want to add a trendline to a chart in Microsoft Office Excel, you can choose any one of these

six different trend or regression types:

linear trendlines power trendlines

logarithmic trendlines exponential trendlines

polynomial trendlines moving average trendlines

Linear trendlines

A linear trendline is a best-fit straight line that is used with simple linear data sets. Your data is linear if

the pattern in its data points resembles a line. A linear trendline usually shows that something is

increasing or decreasing at a steady rate.

Logarithmic trendlines

A logarithmic trendline is a best-fit curved line that is used when the rate of change in the data

increases or decreases quickly and then levels out. A logarithmic trendline can use both negative and

positive values.

Polynomial trendlines

A polynomial trendline is a curved line that is used when data fluctuates. The order of the polynomial

can be determined by the number of fluctuations in the data or by how many bends (hills and valleys)

appear in the curve. An Order 2 polynomial trendline generally has only one hill or valley. Order 3

generally has one or two hills or valleys. Order 4 generally has up to three hills or valleys.

Power trendlines

A power trendline is a curved line that is used with data sets that compare measurements that increase

at a specific rate. You cannot create a power trendline if your data contains zero or negative values.

Exponential trendlines

An exponential trendline is a curved line that is used when data values rise or fall at constantly

increasing rates. You cannot create an exponential trendline if your data contains zero or negative

values.

Moving average trendlines

A moving average trendline smoothes out fluctuations in data to show a pattern or trend more clearly.

A moving average uses a specific number of data points (set by the Period option), averages them, and

uses the average value as a point in the line. For example, if Period is set to 2, the average of the first

two data points is used as the first point in the moving average trendline. The average of the second and

third data points is used as the second point in the trendline, etc..

Page 7: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

NOTE: Choosing the type of trendline in many cases depends on the case whose data is being fitted,

i.e. you may know that your data must fit linear or logarithmic or whatever trendline before

they are plotted.

A trendline is most accurate when its R-squared value is at or near 1. When you fit a trendline to your

data, Excel automatically calculates its R-squared value. If you want to, you can display this value on

your chart.

The table below summarizes the types of trendlines and the final forms of equations:

Use this type To create

Linear A linear trendline by using the following equation to calculate the least squares

fit for a line:

where m is the slope and b is the intercept.

Logarithmic A logarithmic trendline by using the following equation to calculate the

least squares fit through points:

where c and b are constants, and ln is the natural logarithm function.

Polynomial A polynomial or curvilinear trendline by using the following equation to

calculate the least squares fit through points:

where b and are constants.

Power A power trendline by using the following equation to calculate the least

squares fit through points:

where c and b are constants.

This option is not available when your data includes negative or zero values.

Exponential An exponential trendline by using the following equation to calculate the least

squares fit through points:

where c and b are constants, and e is the base of the natural logarithm.

This option is not available when your data includes negative or zero values.

Moving

average

A moving average trendline by using the following equation:

Page 8: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Data fitting using least square method

Microsoft Excel proved to be very effective in curve fitting, but it does so for five forms of equations

which were mentioned previously. If the equation that you need to fit your data to is not one of these

five forms then Microsoft Excel will not be able to fit your data automatically using the Trendline

option.

In these cases the user must be able to fit his data to the form he needs by himself. There are many

methods to do so, the most common and easy to use is what so called “Least square method”.

To understand this method let‟s see the next example:

Consider the following experimental data relating any two variables (say x and y)

X 3.4 7.1 16.1 20.0 23.1 34.4 40.0 44.7 65.9 78.9 96.8 115.4 120.0

Y 9.59 5.29 3.63 3.42 3.46 3.06 3.25 3.31 3.50 3.86 4.24 4.62 4.67

And that from your knowledge about your experiment you know that the relation must take the form:

Y=aX+b/X+c

And you now need to fit these data to that equation to get the values of a, b and c, also to calculate the

R-squared.

This method is based on a simple idea, which is assuming values for the variables a, b and c, then

calculating values of Y‟s based on the assumed values, then comparing the calculated and the real

values of Y‟s, and finally changing the values of assumed a, b and c till the difference between the real

and calculated vales of Y‟s is minimum.

This is simply done by building a simple table, two columns for the experimental data available (X‟s

and Y‟s ), another column for the calculated values of Y‟s ( based on the values of X ).

Page 9: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Remember to add the dollar signs on typing the names of cells containing assumed vales of a, b and c

before dragging. After dragging the table will be in the form shown below:

Now it‟s now required to minimize the difference between the calculated and the real values. So a new

column is introduced to calculate the difference between the calculated and the real values.

Now it‟s required to minimize all the values in the last column by varying the values of the variables a,

b and c. Microsoft Excel has a tool that performs this form of iterations which is “Solver”. It‟s available

under the Data toolbar in the analysis tab.

Page 10: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

On clicking the solver tab a window will appear having the shape:

This tool can change the value of multiple cells to set the value of ONLY ONE cell to a maximum,

minimum or a specific value.

And we need now to change the value of the three cells (a, b and c) to set the values of 13 cells to zero,

which is not available using this tool.

A trick can be done to avoid this problem. If the sum of the differences is calculated and then is set to

the value of zero then consequently the values of all the 13 cells will be minimized, so a cell for the

sum values in the last column is set and calculated. And is now the cell that will be set to zero.

But remains a small problem, you may notice that some of the values in the last column are positive

and some are negative, so the summation may be zero but the entire cells in the column may not be

zeros. So a new column is added where the SQUARES of the values of the difference column are

calculated, so all the values will be positive and this problem is no more present. And that‟s why this

method is called Least Square Method.

Finally the table will have the form:

Now we are now ready to use the solver.

Page 11: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

By clicking solve the final results appear:

It‟s now clear that the values in columns D and E are minimized. Now to ensure the accuracy of this

fitting the R-squared value must be calculated.

R-squared value is calculated from the following relation:

Then finally the shape of the table will be as follows:

And the R-squared value is found to be 0.9967 which is a very good fit.

Page 12: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Array calculations

An array formula is a formula that can perform multiple calculations on one or more of the items in an

array. Array formulas can return either multiple results or a single result. For example, you can place an

array formula in a range of cells and use the array formula to calculate a column or row of subtotals.

You can also place an array formula in a single cell and then calculate a single amount.

To understand the concept on arrays well, let‟s consider the least square method example discussed

previously.

On calculating the value of the sum of square of the differences between the calculated and the real

values we had to add a column to calculate the differences then another column to calculate the square

of the differences, and finally a cell to calculate the summation of the squares.

Array calculations provide a quicker means to do these 3 or 4 steps in only one step.

In any cell type the following formula “=SUM(C2:C14-B2:B14)” then press Ctrl+Shift+Enter and

compare it with the value in cell D17, you will find that they both have the same value, this means that

this formula calculated the difference between the values in two columns and got the sum of these

values.

On typing the following formula: “=SUM((C2:C14-B2:B14)^2)” you will be able to calculate directly

the sum of squares of the differences.

Page 13: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Matrices

Matrix calculation is a special type of array calculations, as Microsoft Excel deals with matrices as

arrays. Microsoft Excel can perform many matrices operations such as adding, subtracting, multiplying

matrices, also getting the inverse of a matrix and the value of its determinant.

Before discussing how these operations are performed using Microsoft Excel, it‟s recommended to

revise quickly the matrix operations and calculations.

Consider a system of linear equations like :

a1X+b1Y+c1Z=L

a2X+b2Y+c2Z=M

a3X+b3Y+c3Z=N

where X,Y and Z are variables

a1,b1,……., b3,c3 are their coefficients ( constants )

L,M and N are constants

And it‟s required to solve these equations to get the values of X,Y and Z.

One of the methods of solving this system of equations is using Matrices.

This can be simply performed by putting the system of equations in the form of matrix as follows

a1 b1 c1 X L

a2 b2 c2 × Y = M

a3 b3 c3 Z N

Which takes the general form: AX=B

Before solving such a system, we must check first if it‟s solvable or not, which can be verified by

calculating the value of the determinant of the matrix “A”. If its value ≠ 0 then it‟s solvable, if its

value=0 then it‟s not solvable.

After performing this check the system has to be solved. This was done by performing the following

steps:

AX=B

A-1

AX=A-1

B

X=A-1

B

So getting the final solution requires first getting the inverse of the matrix “A”, then multiplying it by

matrix “B” to get the final solution.

NOTE: on multiplying two matrices, the number of columns of the first matrix has to be equal to the

number of rows of the second one.

Page 14: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Now, consider a set of linear equations that we have to solve using Microsoft Excel, like:

X-Y-Z+3 L=1

2X+4 Y+3 Z+L=2

2.25 X+Y+2 Z+2 L=3

X+1.5 Y+Z+2 L=4

This will take the matrix form as follows:

1 -1 -1 3 X 1

2 4 3 1 ×

Y =

2

2.25 1 2 2 Z 3

1 1.5 1 2 L 4

This is introduced to Microsoft Excel as an array:

Then we have to check if the determinant “A” equals zero or not, Microsoft Excel can calculate the

value of the determinant of a matrix using the function “MDETERM”

Entering the following formula MDETERM(array region) then –as in any array calculation- pressing

Ctrl+Alt+Enter calculates the value of the determinant.

Now it‟s verified that the system of equations is solvable. Now we need to get the inverse of the matrix

“A”, this is calculated using the function “MINVERSE”

Entering the following formula MINVERSE(array region) –after highlighting the array of the inverse

matrix–then pressing Ctrl+Alt+Enter, calculates and shows the inverse of the matrix.

Page 15: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Finally to get the solution we have to multiply A-1

by B

To do this use the function MMULT, Entering the following formula MMULT(array1,array2)

– after highlighting the array of the product – then pressing Ctrl+Alt+Enter, calculates and shows the

matrix X, which is the solution.

Page 16: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Other matrix operations can be easily performed using excel such as addition subtraction of matrices,

multiplying matrix by a constant, ... etc.

Page 17: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Thermodynamics

This chapter introduces the ideal gas equation of state, then describes how computer programs such

as Excel, use modified equations of state to easily and accurately solve problems involving gaseous

mixtures.

Also in this chapter the vapor pressure data representation is discussed, then the use of Excel to

determine constants of different equations, relating vapor pressure to temperature, is illustrated for

optimum representation to the experimental data.

Equations of state

Solving equations of state allows us to find the specific volume of a gaseous mixture of chemicals

at a specified temperature and pressure. Without using equations of state, it would be virtually

impossible to design a chemical plant. By knowing this specific volume, you can determine the size

– and thus cost – of the plant, including the diameter of pipes, the horsepower of compressors and

pumps, and the diameter of distillation towers and chemical reactors.

The ideal gas equation of state, which relates the pressure, temperature, and specific volume, is a

familiar equation:

The term p is the absolute pressure, V is the volume, n is the number of moles, R is the gas

constant, and T is the absolute temperature. The units of R have to be appropriate for the units

chosen for the other variables. This equation is quite adequate when the pressure is low (such as one

atmosphere). However, many chemical processes take place at very high pressure. For example,

ammonia is made at pressures of 220 atmospheres or more. Under these conditions, the ideal gas

equation of state may not be a valid representation of reality. Other equations of states have been

developed, usually in conjunction with process simulators, to address chemical processes at high

pressure.

There are two key features:

(1) the equation can represent the real p–V–T behavior; and

(2) the parameters must be easily found, including for mixtures. This last criterion is no small

requirement. There are more than 25 million chemicals, leading to an infinite number of different

mixtures.

Obviously, you cannot look up the properties of all those mixtures on the Web.

The first generalization of the ideal gas law was the van der Waals equation of state:

Page 18: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

15 INTRODUCTION TO MICROSOFT EXCELermodynamics

In this equation, the b accounts for the excluded volume (a second molecule cannot use the same

space already used by the first molecule), and the a accounts for the interaction force between two

molecules. This extension is just a first step, however, because it will not be a good approximation

at extremely high pressures.

The Redlich–Kwong equation of state is a modification of van der Waal‟s equation of state:

Where,

In these equations, Tc is the critical temperature (in absolute terms), Pc is the critical pressure.

The Redlich–Kwong equation of state was modified further by Soave to give the Redlich–Kwong–

Soave equation of state, which is a common one in process simulators:

Now the parameter a is given by a different formula,

The is the „acentric‟ factor, which is a tabulated quantity for many substances. Thus, the value of

can be computed for each chemical and reduced temperature.

The Peng–Robinson equaton is another variation:

All these equations can be rearranged into a cubic function of specific volume. The form of the

Redlich–Kwong and Redlich–Kwong–Soave equation of state is

When given the temperature and pressure of a gaseous mixture, and the parameters a and b, then to

find the specific volume you would have to solve the cubic equation of state for specific

volume . This represents one algebraic equation in one unknown, the specific volume.

For a pure component, the parameters a and b are determined from the critical temperature and

critical pressure, and possibly the acentric factor. These are all tabulated quantities, and there are

even correlations for them in terms of vapor pressure and normal boiling point, for example. For

mixtures it is necessary to combine the values of a and b for each component according to the

Page 19: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

16 INTRODUCTION TO MICROSOFT EXCELermodynamics

composition of the gaseous mixture. Common mixing rules are shown in next equations, in which

the ys are the mole fraction of each chemical in the vapor phase:

where

for Redlich-Kwong

or

for Redlich-Kwong-Soave

Thus, the only difference between the problem for a pure component and that for a mixture is in the

evaluation of the parameters a and b.

Here is the mathematical problem need to be solved:

Given a set of chemicals, temperature and pressure, find the specific volume of the mixture. To do

this, you must find the critical temperature and pressure of each chemical. Once you have the

parameters, you must solve the cubic equation, which is a nonlinear equation in one variable.

Excel allows us to easily solve for the specific volumes. However, one advantage of process

simulators is that the physical properties of many components are saved in a database that users can

access. The next section illustrates how to use Excel to solve equations of state.

Solving equations of state using excel

Problem

Calculate the molar volume and compressibility factor for gaseous ammonia at a pressure P = 40

atm and a temperature T = 400 K using the van der Waals and Redleich-Kwong equations of state.

Step 1 You must first find the critical temperature and pressure; Perry‟s Chemical Engineers‟

Handbook gives Tc = 405.4 K and Pc = 111.3 atm for ammonia

Step 2 Calculate values of a and b for Redlich-Kwong using the following equations:

Van der Waals parameters are

a= 0.4233 J.m3/mol

2, b= 3.737E-5 m

3/mol

Page 20: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

17 INTRODUCTION TO MICROSOFT EXCELermodynamics

Step 3 Prepare the spreadsheet shown in next figure. The title, name, and data will be useful when

you come back to the problem at a future date

Step 4 You enter the parameters in the parameter box. The cells containing the critical parameters

and the temperature and pressure can be named Tc, Pc, T, and P, respectively.

That way, the equation for f (v) will be easier to understand

Step 5 The lower box gives the equations actually used as well as the results. Use the Goal Seek

command to make f (v) (cell B15) equal to zero by changing (cell B16)

Step 6 For reference, the result for an ideal gas is also shown

Exercise

a) Repeat the calculations for the following reduced pressures: Pr = 1, 2, 4, 10, and 20.

Vapor Pressure Data Representation Using Equations

Vapor pressure is the pressure of a vapor in equilibrium with its non-vapor phases. All liquids have

a tendency to evaporate to a gaseous form, and all gases have a tendency to condense back into their

original form. At any given temperature, for a particular substance, there is a pressure at which the

gas of that substance is in dynamic equilibrium with its liquid form. This is the vapor pressure of

that substance at that temperature. The equilibrium vapor pressure is an indication of a liquid's

evaporation rate. It relates to the tendency of molecules and atoms to escape from a liquid or a

solid. A substance with a high vapor pressure at normal temperatures is often referred to as volatile.

The atmospheric pressure boiling point of a liquid is the temperature where the vapor pressure

equals the ambient atmospheric pressure. The higher the vapor pressure of a liquid at a given

temperature, the lower the normal boiling point (i.e., the boiling point at atmospheric pressure) of

the liquid.

Page 21: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

18 INTRODUCTION TO MICROSOFT EXCELermodynamics

The vapor pressure of any substance increases non-linearly with temperature and is independent of

the applied pressure. Also it differs from one substance to another thus it can be a considered a

characteristic physical property for substances.

There is a large number of saturation vapor pressure equations used to calculate the pressure of

water vapor over a surface of liquid water. The two most commonly used equations are

1) Clausius-Clapeyron

where P is the vapor pressure in mmHg and T is the temperature in °C. Note that the

denominator is just the absolute temperature in K. Both A and B are the parameters of the

equation which are typically determined from experimental data.

2) Antoine equation

where typically P is the vapor pressure in mmHg and T is the temperature in °C. Note that

this equation has parameters A, B, and C which must be determined by experimental data.

Also a simple polynomial can be used to relate vapor pressure with temperature. This can be

written in general form for this problem as

Where a0... an are the parameters (coefficients) to be determined by regression and n is the

degree of the polynomial. Typically the degree of the polynomial is selected which gives the

best data representation when using a least-squares objective function.

So the main task to be done here is to find a good values for the equation constants

(whatever it was Antoine, clausius-clapeyron or a simple polynomial equation) from a set of

experimental results. After determining the constants you have to compare the equation

results with the experimental data to assess the equation reliability.

Page 22: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

19 INTRODUCTION TO MICROSOFT EXCELermodynamics

Problem

Next table presents data of vapor pressure versus temperature for benzene. Some design

calculations require these data to be accurately correlated by various algebraic expressions which

provide P in mmHg as a function of T in °C.

Vapor Pressure of Benzene

Temperature, T, (0C) Pressure, P, (mm.Hg)

-36.7 1

-19.6 5

-11.5 10

-2.6 20

7.6 40

15.4 60

26.1 100

42.2 200

60.6 400

80.1 760

(a) Determine the constants for best fit of the experimental data using a polynomial equation. Also

Determine the degree of polynomial which best represents the data.

(b) Determine the constants for best fit of the data using Clausius-Clapeyron equation.

(c) Determine the constants for best fit of the data using Antoine equation.

Step 1 The spreadsheet was set up with the data for temperature and pressure entered in the

indicated columns

Step 2 Columns for temperature in K and Log P were developed

Step 3 Columns were then added for each of the curve fits that were to be carried out along with

the parameters that would be manipulated to generate the calculated curves. These are shown above

the calculated columns as parameters.

Step 4 A row of sum of squares cells were added along the bottom. The contents were set up as

array formulas and entered with Crtl+Shift+Enter. For example for the calculated Clasius-

Clapeyron column: in the sum of squares cell the following was entered:

SUM ((E16:E25-D16:D25) ^2) followed by Crtl+Shift+Enter. The function will be written

between brackets { }

Step 5 The Solver program was then utilized for each of the curve fits. For example for the

Clausius-Clapeyron fit E5 and E6 (A and B) were manipulated until E27 (the sum of squares) was

minimized.

Page 23: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

20 INTRODUCTION TO MICROSOFT EXCELermodynamics

Exercise

The vapor pressure of a pure liquid as a function of the absolute temperature can be expressed as:

log (P0) =

)

The total vapor pressure of a three component mixture is given by:

P= x1P0

1+x2P0

2+x3P0

3

Where xi is the mole fraction of component i. Set up a worksheet to use with solver to find the

normal boiling point (the temperature at which P= 760mm.Hg) of a three component mixture. Use

the following data

a b x

Benzene 7.8413 1750 0.5

Toluene 8.0884 1985 0.3

Ethyl benzene 8.114 2129 0.2

Page 24: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Chemical Reaction Engineering

Batch reactor yield optimization

A chemical plant uses the following process in its production:

A volume “V” m3 of solution of compound “A” having a concentration of a0 gmoles/m

3 is allowed

to react for tr hours; the reactor is then emptied, cleaned and recharged for another cycle. The

reaction occurring is a first order reaction with rate constant of 1.

It is required to find the optimum reacting time tr for maximum reactor product at different

combinations of solution volume, concentration and cleaning time as shown in the next table.

(1) (2) (3) (4)

V (m3) 5 5 10 10

a0 (gmol/m3) 0.1 0.2 0.1 0.1

tc (hrs) 0.5 0.5 0.5 1

Step1 You must first develop an equation for the reaction yield to be optimized.

In general for first order reaction,

But,

and the amount of product formed is the difference between initial and final moles of “A”

For optimization purposes it is better to optimize the product yield per unit process time, thus

Page 25: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

22 Chemical Reaction Engineering

Step 2 Enter the values in the table as shown in the next figure

Step 3 In yield row the yield equation need to be optimized must be written. The equation entered

in cell B8 is shown in row 9 as appears in the next figure.

The presence of dollar sign on the left of cell numbers is to allow dragging of the function to other

cells in the same row without changing the cells numbers in the functions.

Step 4 Now, initial guesses for “tr” must be entered in other cells then solver is used to find the

optimum values. For example in the first case, Solver will try to find optimum value for cell B8 by

changing B10. The final sheet form is shown in the next figure.

Page 26: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

23 Chemical Reaction Engineering

Chemical reaction equilibrium

aA+bB ↔ cC+dD

This is a reversible reaction. When the forward reaction happens at the same rate as the backward

reaction, the reaction progress stops and the reaction reaches equilibrium.

If the reaction is elementary, then the concentration of reactants and products are related to each

other according to:

The number KC is called the equilibrium constant and is a function of temperature. a ,b,c and d are

the stoichiometric coefficients.

There is another useful definition of the equilibrium constant based on pressure rather than

concentration and is used when dealing with gases since the pressure is usually more convenient to

measure than concentration.

Under conditions of low pressure (~10atm.) the gas can be considered to behave ideally and follows

the ideal gas low

PV=nRT

Here P is the total pressure. In the cases of several components, each has a partial pressure, all of

which sum up to the total pressure.

P=PA+PB+PC+PD

For each component, we can write the ideal gas law as follows:

If we plug in the partial pressures in the definition of KC above we get:

Using the realtion pi=yiPT

Page 27: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

24 Chemical Reaction Engineering

Gibbs free energy is related to KP by the relation:

N.B.: Of course, the reaction rate may not be infinitely high, and you may use a catalyst to speed up

the reaction. However, even if the reaction rate is increased, you can never go beyond the

composition determined by chemical reaction equilibrium. Here is how to set up that problem

mathematically.

Example Using Excel

When the carbon monoxide and hydrogen enter the reactor in a 1:2 ratio, use Excel to find

the equilibrium conversion when the pressure is 50 atm and KP=0.0016.

Consider the methanol formation reaction

CO + 2H2 ↔ CH3OH

At equilibrium:

Thermodynamic data give the value of KP=0.0016 atm-4

at reaction conditions and 50atm pressure.

If you start with a stoichiometric mixture of carbon monoxide and hydrogen, what will the

equilibrium composition be?

Step 1: We will start by making a quick material balance by writing 3 component material balance

equations

Step 2: You can solve for the equilibrium using Excel, by putting the equilibrium equation in one

cell, a guess of “r” in another cell, and use the Goal Seek to make the former cell zero by changing

“r”. The final results are shown in next figure.

Page 28: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

25 Chemical Reaction Engineering

Second column is the initial moles of each species. The third column is computed according to the

equations displayed in the column beside it. The equilibrium equation is calculated in C10,

according to the formula displayed in cell D10. Goal seek is used to make cell C10 zero by varying

cell C9.

Now once you have prepared the spreadsheet, it is easy to change the conditions, either the

equilibrium constant or the starting moles of various species.

Exercise

Find the molar flow rates of all species out of an equilibrium reactor used in ammonia production

when the inlet moles ratio of nitrogen, hydrogen and ammonia are 1.1, 3, and 0.2 respectively. The

equilibrium constant is 0.05atm-4 at 589 K. The reactor is operated at 220 atm.

Page 29: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

26 Chemical Reaction Engineering

Regressing rate constants in rate equation from experimental data

Engineers often need to express experimental data in terms of an equation. They must decide on the

equation and then determine the parameters that provide the best fit to the data. The problem is

simplest if the equation is linear. The mission will a little bit harder if the best fit equation is

polynomial one. Although this later case can be considered easy, as long as the equation relates 2

variables only. In this part we will discuss how to fit any set of functions of more than 2 parameters

either appearing linearly (multiple linear regression), or nonlinearly (multiple non-linear

regression).

Multiple regression using Excel

Early in the introduction of the course it was shown how to fit a polynomial to data. The same thing

can be done when the functions are not simple powers, but are more complicated functions.

However, to keep the problem linear, the unknown coefficients must be coefficients of those

functions; that is, the functions are completely specified. Multiple regression simply determines

how much of each one is needed. Thus, the form of the equation is

The goal is to find the best M values of ai, given the M functions fi (x) and data yi = y

(xi), i =1,. . ., N.

In Excel, you put the x values in a column and create additional columns, with each column being a

function, evaluated for the x value in that row. The example used here is to find the constants in a

reaction rate formula. The expected expression is

and the goal is to find the values of k, n, and m that give the best fit of the rate for various partial

pressures of substances A and B. This form is not linear, which is a requirement of multiple

regression, but a transformation can make it linear. Take the logarithm of both sides of the equation.

This equation has the following form:

where the dependence upon two or more variables is clear. The data is entered into the spreadsheet,

and the various terms are transformed as shown in next table. Columns A and B are the

partial pressures of the two chemicals for which the rate is measured, as indicated in column C.

Page 30: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

27 Chemical Reaction Engineering

Step 1 Obtain columns D, E, and F by taking the logarithm of columns A, B, and C, respectively.

Do this in the first cell (D2), copy it across the E and F rows, and copy down the three rows (D2,

E2, and F2).

Step 2 Proceed with parameter estimation by choosing „Data/Data Analysis,‟ and then choosing

„Regression.‟ If „Data Analysis‟ does not appear in your menu under „Data‟ you will have to add it

from Add-Ins. Enter F2:F13 for the y values and D2:E13 for the x values. This tells the computer

that you want the best line representing ln(rate) depending linearly upon ln pa and ln pb.

Page 31: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

28 Chemical Reaction Engineering

Step 3 There are several other options; choose residuals, residual plots, and line fit plots. These are

all useful for evaluating the results. You can place the results on another sheet in the same

Workbook or on the same sheet by specifying a location. Next table shows part of the output. The

best fit is for

The curve fit is then

You might think at this point the correlation is complete. It is not, though, because the data were

transformed to make the parameter estimation problem linear. Thus, the statistics are in terms of the

transformed problem. It is always a good idea to calculate the curve fit using the original variables.

Page 32: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

29 Chemical Reaction Engineering

Page 33: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

30 Chemical Reaction Engineering

Non linear regression

Nonlinear regression is a curve fit in which the unknown parameters enter into the problem in a

nonlinear way. Nonlinear regression is much more difficult (for the computer), so it is best to

always try to manipulate your model into a form that is linear. Sometimes that is not possible, and

then nonlinear regression must be used. You need to be aware, though, that the methods described

here do not always work. Nonlinear regression uses techniques borrowed from the field of

optimization, and it is difficult to construct a method that works every single time for every

problem.

For nonlinear curve fits it is necessary to use functions such as Solver in Excel. This is

demonstrated using the same example given above for multiple regression.

Nonlinear Regression Using Excel

Step 1 Place the data on a new sheet as shown in next figure

Step 2 Enter arbitrary values for the parameters k, n, and m.

Step 3 In column D, calculate the value of rate using the parameters in C16:C18, the data in

columns A and B, and the formula, Eq.

Step 4 Make column E the difference between columns C and D, and then square the result and put

it in column F.

Step 5 Sum Column F, divide by the number entries [COUNT (F2:F13)] to obtain the (sum of

squares)/N, Eq. (E.3).

Page 34: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

31 Chemical Reaction Engineering

Step 6 The goal is to minimize F17 by choosing values C16:C18. To do that, choose

„Tools/Solver.‟ You might have to add it to the Excel program if that was not done when the

program was installed. A screen appears in which you insert F17 as the quantity to be affected, and

choose „Min‟ as the option. Then insert C16:C18 as the cells to be changed, and click „Solve.‟ The

results are shown in next figure.

Page 35: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

32 Chemical Reaction Engineering

The best correlation is

These numbers are slightly different from those obtained using multiple regression. Multiple

regression and nonlinear regression obtained the solution by minimizing two different objective

functions.

Page 36: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Fundamentals of Chemical Engineering

Material Balance

Generally the material balance calculation was simply governed by the equation:

In=out + r

Where In and out are the flow rates of the component in the inlet and outlet streams to the unit around

which material balance in established, is the stoichiometric coefficients (-ve for reactants and

+ve for products ) if there is a chemical reaction involved in the unit .

Generally this equation can be applied to a single unit or group of units.

To be able to know if the available information about the unit are sufficient to solve this unit or there

are some information needed we calculate the degrees of freedom of this unit as follows:

DOF= number of variables- number of equations- number of given variables-number of

additional relations

The system will be solvable if the DOF=Zero, if the DOF is negative then the system is said to be over

specified i.e. more information are given, if the DOF is positive then the system is said to be under

specified i.e. more information are needed to solve this unit.

For a flow sheet where a number of units are operating depending on each other, a DOF table should be

constructed to ensure that the system can be solved using the available data.

Unit I Unit II ---------- Unit N Process Overall

No. of variables

No. of equations

No. of

given variables

No. of

additional relations

DOF

The system will be solvable if the DOF of process equals zero (gray cell) even if the DOF of all units

are not Zeroes.

Note: The degrees of freedom table not only indicates if the system is solvable or not, but also

determines what so called “Strategy of solution” or the way by which the system will be solved

and the sequence of units solved.

Page 37: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

34 Fundamentals of Chemical Engineering

The solution is not usually straight forward, so there are some techniques that are usually used to be

able to solve such a system. The main two of them are tearing and carrying over.

Tearing: a method where a stream is assumed ( components flow rates ) and recalculated again, then

comparing the assumed with the calculated values, and so on till both are equal.

Carrying over: a method where all equations of all units are written and the uncalculated values

remain unknown till the calculations lead to getting their values, sometimes the equations are put in a

matrix form.

The most common way used in simulation programs is the tearing method.

In practical cases material balance and energy balance are both performed simultaneously, and this – of

course- will result in more accurate results, however, more calculations and harder iterations will be

needed.

But in some cases when the effect of pressures and temperatures on material balance is not significant,

or when some equipment lack such information material balance calculations can be performed alone.

Microsoft Excel can be used successfully in solving material balance problems, its main advantage is

that the user builds the program by himself – not like the other simulation programs where the user

only is inputing the data – and this gives a good chance to understand the principals well and know the

source of error in calculations if exists.

Page 38: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

35 Fundamentals of Chemical Engineering

#1

#3

#2

B

D

D1

B1

D2

B2

F

15% Xylene

25% Styrene

40% Toluene

20% Benzene

24% Xylene

65% Styrene

10% Toluene

1% Benzene

15% Xylene

10% Styrene

54% Toluene

21% Benzene

18% Xylene

24% Styrene

42% Toluene

16% Benzene

7% Xylene

4% Styrene

54% Toluene

35% Benzene

Material balance for non-reactive system

Separation Train

Xylene, styrene, toluene and benzene are to

be separated with the array of distillation

columns that is shown below where F, D, B,

D1, B1, D2 and B2 are the molar flow rates in

mol/min.

F is the feed flow rate of 70 mol/min

a- It‟s required to calculate the flow

rates of the top and bottom products

of the second and third distillation

columns.

b- Also it‟s required to calculate the

molar flow rates of the four

components in both streams B and

D.

Part a :

Solution of such a system can be performed by solving a set of algebraic equations simultaneously,

these equations are material balance equations for each component.

Material balance equations on the overall of the three columns will yield:

0.15×70=0.07×D1+0.18×B1+0.15×D2+0.24×B2

0.25×70=0.04×D1+0.24×B1+0.10×D2+0.65×B2

0.40×70=0.54×D1+0.42×B1+0.54×D2+0.10×B2

0.20×70=0.35×D1+0.16×B1+0.21×D2+0.01×B2

This can be shown in the form of a matrix:

AX=B

Its solution is as follows

X=A-1

B

Page 39: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

36 Fundamentals of Chemical Engineering

So the inverse of the matrix A must be calculated, by using Microsoft excel, a function called

“MINVERSE” is used to calculate the inverse of a matrix.

Then the inverse is multiplied by matrix “b” using the function “MMULT”.

The calculated matrix is then the solution to the above system of equations and required flow rates are

calculated.

Part b :

The two streams B and D can be got from material balance equations around both towers

number 2 and 3, For tower 2:

D=D1+B1

For tower 3:

B=D2+B2

Page 40: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

37 Fundamentals of Chemical Engineering

Material balance for a reactive system without recycle

Get started

The following flow diagram represents a part of methanol production process, it‟s produced by the

reaction of synthesis gas ( CO and H2 ) according to the following reaction:

Fresh feed of 1000 Kgmol/hr containing 33% CO, 66.5% H2 and 0.5% CH4 (all in mole %) is

introduced to the reactor, this reaction is catalytic and only 40% conversion of CO is achieved. The

product is then fed to a separator where methanol is separated from the unreactants, it was reported that

the bottom product contains 3% of CO2, 2% of H2, 4% of CH4 and 96% of methanol reactor effluent.

You are now required to solve this system to get the flow rates of all components in all streams in

addition to the rate of the reaction, once by solving a system of equations (using matrix) and once by

unit-to-unit calculations.

For the unit-to-unit calculations method:

It‟s common to arrange the variables in the form of table where the columns represent the streams and

the rows represent the components in each stream as shown:

1 2 3 4

CO

H2

CH4

CH3OH

Total

So each cell represents the flow rate of a component in a stream.

The solution requires filling the cells with the material balance equations of the units involved and the

additional relations (note that the size of matrix equals the number of variables in the process column).

Note that there must be an external cell for the rate of reaction.

Catalytic Reactor

Flash

Separator

21

4

3

CO

H2

CH4

CO

H2

CH4

CH3OHCO

H2

CH4

CH3OH

CO

H2

CH4

CH3OH

Page 41: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

38 Fundamentals of Chemical Engineering

For example consider the table will be in the next form:

Then the inserted formulas will be as follows:

Material balance equation In cell Formula

Feed

CO)1=0.33×Stream (1) B2 =0.33*E8

H)1=0.665×Stream (1) B3 =0.62*E8

CH4)1=0.005×Stream (1) B4 =0.05*E8

Reactor

CO)2=CO)1-r C2 =B2-B8

H)2=H)1-2r C3 =B3-2*B8

CH4)2= CH4)1 C4 =B4

CH3OH)2= CH3OH)1+r C5 =B5+B8

r=0.4× CO)1 B8 =0.4*B2

And so on for the separation unit.

Finally the results appear in all streams. This method has the advantage that you needn‟t build a matrix

of a big size especially for systems containing may units and many components. Also it makes the user

able to know the location of error ( if exists ) and so easiness in correction and modification.

The final results will be:

Page 42: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

39 Fundamentals of Chemical Engineering

Material balance for a reactive system with recycle

For the above example, it‟s clear that nearly half the reactants only reacted and the other half was

introduced to the separator, separated from the product. Practically in such processes the unreacted

reactants are recycled and mixed with the fresh feed to make use of them, also in such systems where

there are some inerts in the feed (like Methane) some of the recycle stream is purged before mixing

with the fresh feed to prevent accumulation of inerts in the system.

On applying such a concept in the above case we will realise that the flow diagram will be as follows:

First, the degrees of freedom table must be constructed, it‟ll be as follows:

Mixer Reactor Flash Splitter Process

No of var 11 9 12 12 28

No of Eq 4 4 4 4 16

No of rel 0 1 4 4 9

No of G.V 3 0 0 0 3

No of DOF 4 4 4 4 0

It‟s clear that the system is solvable as the degrees of freedom of process is zero, so either a matrix is

constructed and a system of equations is solved (28 equations, i.e. square matrix 28×28) and it‟ll be so

time consuming, or the easier method unit-to-unit calculations.

But note that the solution will no be straight forward as there is no unit that has zero degrees of

freedom, so tearing technique can be applied. It should be clear first that a number of variables will be

assumed and recalculated again, the assumed variables will be determined based on the degrees of

freedom table, as the assumed variables must solve a unit and introduce new information to the next

unit and so on till the recycle stream is calculated and the assumed variables are recalculated again.

Catalytic Reactor

Flash

Separator

31 2

67

5

4

CO

H2

CH4

CO

H2

CH4

CH3OH

CO

H2

CH4

CH3OH

CO

H2

CH4

CH3OHCO

H2

CH4

CH3OH

CO

H2

CH4

CH3OH

Page 43: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

40 Fundamentals of Chemical Engineering

So let‟s assume the flow rates of the components in stream 2 (feed to the reactor), then the sequence of

solution will be as follows:

Reactor Separator SplitterMixer

7

1

2

calculated

2

assumed

3 4

5 6

Now, stream 2 can be totally assumed (flow rates of all four components) then four information are

added to the reactor and then can be solved, then stream 3 is specified which will allow the solution of

the separator, which in turn will add four information (stream 7) to the mixer and as a result the mixer

can be solved and stream 2 can be recalculated. Then the calculated values are compared with the

assumed ones, if the difference is in the range of allowable error then it‟s Ok, else the calculated values

are used as the assumed ones till the values of the assumed and the calculated flow rates are equal (or

the difference between them is nearly zero).

To achieve this, a table must be constructed (like that constructed in the previous example) but the only

difference is that there will be two columns for the same stream “2” (assumed one) one will be for the

assumed value and the other for the calculated one. And the aim is to equalize the terms in both

columns. Note that the cells of the assumed flow rates will not contain formulas; it‟ll contain the

assumed values, while the cells of the calculated flow rates will contain the formulas.

The formulas will be inserted in the same way as the previous example; the table will be as follows:

Page 44: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

41 Fundamentals of Chemical Engineering

These formulas will result in the following flow rates:

1 2 assum 3 4 5 6 7 2 Calc

CO 330 600 360 349.2 10.8 34.92 314.28 644.28

H2 620 800 320 313.6 6.4 31.36 282.24 902.24

CH4 50 100 100 96 4 9.6 86.4 136.4

CH3OH 0 10 250 10 240 1 9 9

Total 1000 1510 1030 768.8 261.2 76.88 691.92 1691.92

r 240 Feed 1000 Kgmol/hr

It‟s now clear that the flow rates of column “2 assumed” are not equal to those of column “2 calc” so if

we can change the flow rates of column “2 assumed” (as they contain values not formulas) so that they

are equal to column “2 calc” then these flow rates are the final ones and all the other cells will be

automatically calculated.

To achieve this we can insert another column in which the square the difference between the assumed

and the calculated values is calculated (Why Square Of The Difference???), and the sum of the squares

will be calculated below, then the table will be in the form shown:

This will yield the following values:

1 2 assum 3 4 5 6 7 2 Calc square Diff

CO 330 600 360 349.2 10.8 34.92 314.28 644.28 1960.7184

H2 620 800 320 313.6 6.4 31.36 282.24 902.24 10453.0176

CH4 50 100 100 96 4 9.6 86.4 136.4 1324.96

CH3OH 0 10 250 10 240 1 9 9 1

Total 1000 1510 1030 768.8 261.2 76.88 691.92 1691.92 188779246

r 240 Feed 1000 Kgmol/hr

Now we can say that setting the cell “J6” to the value of zero means that the difference between the

assumed and the calculated values is zero, or they are equal. The final step is to use the solver to

change the assumed values in order to set the cell “J6” to the value of zero.

Page 45: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

42 Fundamentals of Chemical Engineering

Finally, the solver solution will yield the following results:

1 2 assum 3 4 5 6 7 2 Calc square Diff

CO 330 692.985693 415.791416 403.317673 12.4737425 40.3317673 362.985906 692.985906 0.01460138

H2 620 1110.25734 555.868781 544.751406 11.1173756 54.4751406 490.276265 1110.27627 0.13758542

CH4 50 367.668119 367.668119 352.961394 14.7067248 35.2961394 317.665255 367.665255 0.05351814

CH3OH 0 10.3516531 287.54593 11.5018372 276.044093 1.15018372 10.3516535 10.3516535 0.00063926

Total 1000 2181.2628 1626.87425 1312.53231 314.341936 131.253231 1181.27908 2181.27908 0.20634421

r 277.194277 Feed 1000 Kgmol/hr

Now compare the values of the cells in column “2 assum” and column “2 calc”. It‟s clear that assumed

and calculated values are the same.

Now all flow rates are available in the table.

Page 46: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

43 Fundamentals of Chemical Engineering

Energy Balance

The basic Closed-system energy balance equation (for non reactive systems)

Where Hi, Hj are the specific enthalpies of the stream i (outlet stream) and stream j (inlet stream)

[KJ/Kg]

Zi, Zj are the elevations of streams i and j

i, j are the velocities of streams i and j

Q is the heat input to the system

W is the work done by the system

• Magnitude of potential and kinetic energies are relatively small in chemical process applications

• Except pumps, turbines and compressors most chemical process units do not involve work

• If this is the case, the energy balance will reduce to:

Now, it‟s important to know how the enthalpy term is calculated.

Enthalpy:

Specific Enthalpy term represents the energy of the stream, and it‟s calculated from:

It‟s known that calculating enthalpy requires setting a reference temperature, i.e. the value of

enthalpy varies according to the reference temperature.

So, the above equation must be in the following form

For a mixture the specific enthalpy takes the form:

For non-ideal mixtures a term of heat of mixing must be added.

Heat capacities are always function of temperature, the general form of the heat capacity is:

Cp=C1+C2T+C3T2+C4T

3+C5T

4

Page 47: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

44 Fundamentals of Chemical Engineering

So after integration H will have the form (For a single component stream):

The values of constants C1, C2, C3, C4 and C5 vary according to the component, these values are

available in many references, the most popular are:

- Coulson and Richardson, “Chemical Engineering”, Volume 6, Appendix D.

- Robert H. Perry, “Chemical Engineers‟ Handbook”, Chapter 2.

So for a single component stream, say liquid Benzene, to calculate its enthalpy at any temperature

we have to get the values of the constants, which will be :

C1=1.2944E+05

C2=-1.6950E+02

C3=6.4781E-01

C4=0

C5=0

Where T in Kelvin, Cp in J/Kmol.K (these values are got from chapter 2 in Perry).

Then, taking reference temperature 25oC (298

oK), the value of the enthalpy of this stream will be

calculated as follows:

Substituting the temperature by 70oC (343

oK) the solution will be

H=6.3795E6 J/Kmol

Now, let‟s consider such a stream but with two components, say toluene and o-xylene (500 Kmol/hr

each), and we need to calculate the mixture enthalpy at temperature of 80oC taking reference

temperature of 298oK, so first the constants of both must be got and they were found to be:

Toluene Xylene

C1 1.4014E+05 3.36500E+04

C2 -1.5230E+02 1.0175E+03

C3 6.9500E-01 -2.6300E+00

C4 0 3.0200E-03

C5 0 0

Page 48: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

45 Fundamentals of Chemical Engineering

Then the enthalpy of the stream will be the sum of the enthalpies of both components, so each one

will be separately calculated then added to each other.

The specific enthalpy of Toluene will be 7327606.7 J/Kmol

The specific enthalpy of Xylene will be 8508358.9 J/Kmol

And the total enthalpy of the stream =500×7327606.7+500×8508358.9=7.918E+09 J/hr

=7.918E+06 KJ/hr

The same can be applied for three or more components

Note: Try to check the values of the constants from Perry to make sure that you are able to get the

right values.

Calculating Enthalpy of streams using Microsoft Excel:

Consider the first case of pure Benzene stream:

First: the values of the constants must be entered in the worksheet:

Second: Enter the values of the reference temperature and the operating temperature, enter the

values in Celsius and calculate their values in Kelvin.

Page 49: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

46 Fundamentals of Chemical Engineering

Third: Start writing the equation of enthalpy calculation as a function of temperature.

Fourth: If the stream flow rate is 100 Kmol/hr, then the total enthalpy of the stream can be

calculated.

Page 50: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

47 Fundamentals of Chemical Engineering

For a case of a multicomponent stream, say the second example (toluene and o-xylene):

First: Introducing the constants for both components

Second: Entering the values of operating temperature and reference temperature, in oC and

oK.

Third: Entering the formulas of specific enthalpies for both components, you may save time by

entering the formula for the first component and put dollar signs at the cells containing temperature,

then drag this formula to the next component, this will be so useful and time saving if there is a big

number of components.

Page 51: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

48 Fundamentals of Chemical Engineering

Dragging this formula will yield the following results:

Fourth: Entering the flow rates of both streams to calculate the Enthalpy of each component.

Page 52: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

49 Fundamentals of Chemical Engineering

Finally: The total enthalpy is calculated as the sum of both enthalpies of toluene and xylene. The

final result will be 9.836E9 J/hr

Page 53: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

50 Fundamentals of Chemical Engineering

Energy balance on a non-reactive system

In many cases there are many units in which information are available about the flow rates and the

inlet temperatures, and it‟s required to get the outlet temperature, or cases where there is a stream

that has to be at specific conditions of temperature and pressure, so other related streams must be

adjusted to keep that stream at its required conditions.

In such cases the conditions are adjusted by performing energy balance calculations on such a

stream.

Example:

In a process air is required to be heated to a temperature of 100oC. If the available heat source

provides 1.8E+06 KJ/sec. The feed flow rate is 1000 gmol/sec (790 gmol N2/sec and 210 gmol

H2/sec), what will be the temperature of the feed?

T

N2

O2

100oC

N2

O2

On applying the energy balance equation on this system, the equation will be:

Taking Tref=25oC=298

oK, and Tout=100+273=337

oK

Note that the units have to be homogeneous, i.e. the units of LHS must be KJ/sec as that of Q or the

RHS must be J/hr as that of Enthalpies.

It‟s now clear that all the parameters of the above equation are known except the inlet temperature,

and that this temperature must be adjusted so that the LHS=RHS, so a value will be assumed and

then the actual value is got by trial and error (let the assumed value 30oC).

Let‟s see how this is performed using Microsoft Excel.

First each term has to be calculated alone, i.e. Feed Enthalpy is first calculated, then product

Enthalpy.

Feed Enthalpy will be easily calculated as what was done in the previous examples based on any

assumed value (let it 30oC as mentioned above).

Page 54: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

51 Fundamentals of Chemical Engineering

The same step is done for the product stream

Page 55: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

52 Fundamentals of Chemical Engineering

Now only remains to place the Q term in the excel sheet

The calculated value of Q based on the assumed feed temperature of 30oC will be 2.05E+06 J/sec.

This value is required to be 1.8E+06 J/sec by changing the value of the inlet feed temperature.

Using the solver this can be done in only one step.

By clicking solve, the value of the feed temperature will be adjusted so that Q will be 1.8E+08 J/sec

and the feed temperature is now 311.56 oK which is 38.56

oC

Page 56: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

53 Fundamentals of Chemical Engineering

Energy balance on a reactive system

For a reactive system the energy balance equation is the same but only one term is added to the

equation which is the heat of reaction term. The equation takes the form:

Where r is the rate of reaction, Hr is the heat of reaction at the reaction temperature.

Note that Hr is negative for exothermic reactions and positive for endothermic reactions.

The heat of reaction can be calculated from the heat of formation of products and reactants at the

standard temperature (25oC) according to the relation:

Calculate the standard heat of reaction for the oxidation of Pentane:

C5H12 + 8O2 5CO2 + 6H2O

Given: Hf,C5H10o = - 146.54 KJ/mol

Hf,O2 o = 0.0 ( because it‟s an element)

Hf,CO2 o = - 393.77 KJ/mol

Hf, H2O o = - 242 KJ/mol

So Hro = (5×-393.77+6×-242) - ( -146.54+8×0 ) = -3274.31 KJ/mol

Performing such a step using Microsoft Excel is easy as it‟s only adding and subtracting as shown

To get the heat of reaction at any other temperature, some more calculations must be done. These

calculations are based on the next diagram:

Reactants (at Reaction temp.) Trxn Products (at Reaction temp.)

Reactants (at 298oK)

298oK

Products (at 298oK)

Example:

Calculate the heat of reaction of oxidation of Pentane at 100oC

Page 57: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

54 Fundamentals of Chemical Engineering

To do so we will need the constants for the Cp‟s for all components, and Hr at reference

temperature (298oK)

Each term of the last equation will be calculated alone and finally they all will be added.

First the reactants term

:

Page 58: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

55 Fundamentals of Chemical Engineering

The same step is done for the third term in the equation

Finally the three terms are added to get the heat of reaction at 100oC

The heat of reaction at 100oC is -1223.17 KJ/mol

Page 59: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

56 Fundamentals of Chemical Engineering

Example:

Pentane at 100oC and 1 bar is fed to a heater at a flow rate of 100 mol/sec where complete

combustion (reaction with oxygen) occurs according to the reaction:

C5H12+8O2 5CO2 + 6H2O

Air enters so that the oxygen molar flow rate is eight times that of pentane, and Nitrogen is four

times the oxygen. Calculate the temperature of the gases leaving the heater assuming no heat losses

from the heater.

100oC

C5H12

O2

N2

N2

CO2

H2O

To get the temperature of the exit stream the energy balance equation has to be solved.

As the previous example, each term is calculated separately, taking reference temperature 298oK.

Note that the term Q=0 as there is no heat added or removed from the system.

First : Calculate the enthalpy of feed as past examples, note that the flow rate of Pentane is

100Kmol/hr, flow rate of Oxygen is 8×100=800 mol/sec and the flow rate of

Nitrogen=4×800=3200Kmol/hr.

Second : Heat of reaction term needs the rate of reaction and it equals the number of moles of

reactant converted to product per unit time, which –in this case- is the feed flow rate 100 Kmol/hr.

And the heat of reaction was calculated in the previous example.

Page 60: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

57 Fundamentals of Chemical Engineering

Third: Calculate the Enthalpy of product stream based on an assumed temperature (say 120oC)

Note that the product flow rates will be calculated based on MB calculations:

CO2)out=CO2)in+5×r=500 Kmol/hr

H2O)out= H2O)in+6×r=600 Kmol/hr

N2)out= N2)in=3200 Kmol/hr

Both Pentane and Oxygen are totally consumed.

Page 61: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

58 Fundamentals of Chemical Engineering

Fourth: the Energy balance equation is now written

Finally use the solver to change the value of the product temperature to make the Energy balance

equation =0

Page 62: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

Fluid Mechanics

Terminal Velocity of Falling Particles

A simple force balance on a spherical particle reaching terminal velocity in a fluid is given by

Where Vt is the terminal velocity in m/s, g is the acceleration of gravity given by g = 9.80665 m/s2,

is the particles density in kg/m3, r is the fluid density in kg/m3, DP is the diameter of the

spherical particle in m and CD is a dimensionless drag coefficient.

The drag coefficient on a spherical particle at terminal velocity varies with the Reynolds number

(Re) as follows (pp. 5-63, 5-64 in Perry3).

for Re<0.1

for 0.1Re1000

for 1000<Re350000

for 350000< Re

Where

and m is the viscosity in Pa.s or kg/m.s.

It is required to calculate the terminal velocity for particles of coal with and

falling in water at T = 298.15K where and

Step 1 Enter particles and fluid properties at the top of the sheet.

Step 2 Enter equation in cell B9 for calculating Reynold‟s no. since choosing appropriate drag

coefficient equations depends in which range lies this value.

Step 3 Now you have to calculate the drag coefficient based on the calculated value of Reynold‟s

no. To do so we will use the “If” function.

Page 63: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

60 Fluid Mechanics

The next figure shows the form of the sheet after adding the If condition for calculating the drag

coefficient. The used “If” nested loop is shown below the CD cell.

The IF function returns one value if a condition you specify evaluates to TRUE, and

another value if that condition evaluates to FALSE. For example, the formula

=IF(A1>10,"Over 10","10 or less") returns "Over 10" if A1 is greater than 10, and "10

or less" if A1 is less than or equal to 10.

Syntax

IF(logical_test, value_if_true, [value_if_false])

The IF function syntax has the following arguments:

logical_test Required. Any value or expression that can be evaluated to

TRUE or FALSE. For example, A10=100 is a logical expression; if the value

in cell A10 is equal to 100, the expression evaluates to TRUE. Otherwise, the

expression evaluates to FALSE. This argument can use any comparison

calculation operator.

value_if_true Required. The value that you want to be returned if the

logical_test argument evaluates to TRUE. For example, if the value of this

argument is the text string "Passed" and the logical_test argument evaluates

to TRUE, the IF function returns the text "Passed” If logical_test evaluates to

TRUE and the value_if_true argument is omitted (that is, there is only a

comma following the logical_test argument), the IF function returns 0 (zero).

To display the word TRUE, use the logical value TRUE for the value_if_true

argument.

value_if_false Optional. The value that you want to be returned if the

logical_test argument evaluates to FALSE. For example, if the value of this

argument is the text string "Refused" and the logical_test argument evaluates

to FALSE, the IF function returns the text "Refused" If logical_test evaluates

to FALSE and the value_if_false argument is omitted, (that is, there is no

comma following the value_if_true argument), the IF function returns the

logical value FALSE. If logical_test evaluates to FALSE and the value of the

value_if_false argument is omitted (that is, in the IF function, there is no

comma following the value_if_true argument), the IF function returns the

value 0 (zero).

Page 64: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

61 Fluid Mechanics

Step 4 Enter the terminal velocity function and an initial guess for the terminal velocity to get the

accurate terminal velocity using “Goal seek” or “Solver”.

Page 65: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

62 Fluid Mechanics

Emptying Tank

In this Exercise we are going to solve a simple differential equation using the Runge-Kutta

method. A cylindrical tank of diameter D has a short pipe of diameter d at the bottom. The tank is

initially filled with water to a height h. We wish to examine how changing the diameter of the pipe

alters the rate of discharge of the tank. The problem chosen has an analytical solution. You may

wish to find it and compare the results from it with those found using the Runge-Kutta

approximation.

For a short pipe, we may assume the rate of change of his:

Step1 Enter a value of 0.1 for “h” and 0.05 for “R” where R is the ratio between pipe and tank

diameters.

Step 2 In cell A8 enter the value of 5 and 0 in cell B8. This is the initial condition h(0)=5 (the

initial elevation is 5m).

Step 3 Enter a range of values for “t”, from “0” to “15” with an increment of h=0.1.

Step 4 Enter these formulas to compute the k parameters:

C8: =$B$4*(-($B$5^2)*(SQRT(2*9.81*B8)))

D8: =$B$4*(-($B$5^2)*(SQRT(2*9.81*(B8+(C8/2)))))

E8: =$B$4*(-($B$5^2)*(SQRT(2*9.81*(B8+(D8/2)))))

F8: =$B$4*(-($B$5^2)*(SQRT(2*9.81*(B8+E8))))

Step 5 In B9 enter =B8+((1/6)*(C8+2*D8+2*E8+F8)) to compute the first approximation.

Runge-Kutta method

is an algorithm used to solve differential equations. Runge-Kutta method finds an approximation for y

based on the previous value.

The iterative formula for forth order Runge-Kutta method is as follows:-

Page 66: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

63 Fluid Mechanics

Step 6 Copy the cells C8:F8 to C158:F158 then copy B9 to B158. This computes the successive y

approximations.

Step 7 Create a summary table for the results by copying the height values every minute in a

separate table as shown in next figure,

Page 67: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

64 Fluid Mechanics

Pipeline optimization

Problem

We are in the design phase of constructing a new, grass-roots, 200,000 ton/year, dimethyl ether

(DME) plant. This will be part of a larger facility that also produces diethyl ether (DEE).

The PFD (Process Flow Diagram) for the feed and reaction sections is given in next figure. Feed to

the process consisting of liquid methanol, is mixed with recycle liquid methanol.

Stream 1 is liquid methanol at 110kpa, 250C, while stream 10 is recycled methanol saturated at

1200kpa.

There is a pump(s) P-1401 from tank storage to V-201. P-1401 is not shown on the PFD but it will

be near to tanks TK-1401 and TK-1402. For further details about plant layout and P-1401 location

refer to the plot plan in the next figure.

Page 68: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

65 Fluid Mechanics

400m

m 5m

Page 69: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

66 Fluid Mechanics

As you can see, the DME facility is part of a larger facility that also produces DEE. You are to size

the new pump(s), P-1401. You are to determine the optimum pipe size for the piping from tank

storage to V-201. The objective function for the optimization is the Equivalent Annual Operating

Cost (EAOC) of the piping system including the pump (EGP/y). The EAOC is defined as:

CAP includes only the installed cost of pipes and pumps, and operating costs include the electricity

to run the pump.

Place the pumps, P-1401, on the ground at a location you choose. All elbows are 90°, and you

should place these as needed. Pipes from the tanks to the process must follow the indicated pipe

racks. We would like the flexibility for 25% scale-up in the future.

Step 1 Enter flow properties as shown in cells A10:G11 and DME physical properties as shown in

cells A14:B16.

Step 2 Enter pipe line specifications and costs as shown in cells A18:F20. Note that pipe and pump

prices are entered in different uncommon ways. The pipe prices are calculated using equation which

depends on pipe diameter. This equation varies with diameters, thus was the use of “IF” condition.

For pump price, it is function of required power and the correlation is shown in cell G20.

Step 3 Enter a first estimate pipe diameter in cell A5 (2‟‟) then calculate the equivalent SI diameter

in the next cell.

Step 4 Calculate the velocity for this pipe diameter from the flow rate using the following

equation:-

Step 5 Calculate Reynold‟s no. and /D in cells D5 and E5

Step 6 Calculate moody friction factor in cell F5 using Churchill equation as written in Perry‟s

N.B.:- Do not forget to multiply the Churchill equation result by 4 to get moody friction factor.

Step 7 the rest of equations for calculating total losses (minor and major losses), pump head, pump

power and total cost are as shown in the next lines:-

Minor losses equivalent length: =8*((0.81*(C5^2))/(2*9.81)) (for “8” 900 elbows)

Total losses: =(F5*($B$19+G5)*(C5^2))/(2*9.81*B5)

Pump head: =(($E$12-$E$11)/(B15*9.81))+($H$12-$H$11)+H5

Pump power: =(B15*9.81*B13*I5)/1000

Total Cost: =((E19*$B$19)+($E$20*8))+((9.81*$B$12*I5)*8000*0.3)

Page 70: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

67 Fluid Mechanics

Step 8 the target now is to reach the minimum total cost by changing the pipe diameter. This can

be easily done using minimization option of the “solver” tool.

The final sheet form is shown in the next figure:-

Exercise

Specify the liquid level to be maintained in the storage tanks to avoid cavitation of P-1401.

Page 71: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

PHASE EQUILIBRIA AND MASS TRANSFER

Introduction

Phase equilibria is one of the main sciences that have many applications in chemical engineering, especially

in separation techniques. And according to the industrial practice, it rarely happens to find any chemical

plant that don‟t contain systems involving liquid-vapour contact, these equipment are like distillation

columns, absorbers, strippers, flash separators and many others.

That‟s why it‟s so important to understand the vapour liquid equilibria well, and to understand the equations

governing such systems.

From the important fundamental equations for gas liquid systems:

Dalton‟s law: to calculate partial pressure of a component in the gas phase

Where yi is the mole fraction in the gas phase and equals ni/nT

Rault‟s law: to calculate partial pressure of a component on the surface of a liquid phase

Where xi is the mole fraction in the liquid phase and Pio is the vapour pressure of component “i”

Antoin‟s law: Empirical equation to calculate the vapour pressure of a component as a function of

temperature

Where T is temperature in Kelvin, Pio is the vapour pressure in mmHg, A, B and C are

constants for each component ( available in appendix D, Coulson and Richardson‟s Chemical

Engineering, Volume 6)

This part of the course will be considering three points: Determining bubble point, dew point and doing the

flash calculations for a mixture of two or more components in a mixture.

But first of all it‟s important to note that the calculations that will be done are considering IDEAL SYSTEMS,

and that for non-ideal systems these calculations will not be so accurate as there are some thermodynamic

properties must be included such as fugacity, activity coefficients and others. That is why for non ideal

systems it‟s preferred to use simulation programs like Hysys, Aspen, Pro II, …. . But it still important to

understand the scientific background of such systems that are common in a big variety of industries.

Liquid-Vapour Equilibria:

According to mass transfer principals, for any two phases contacting each other there will be mass transfer

for the components of the two phases as well as the system has not reached the Equilibrium composition.

Equilibrium composition means that there is no driving force to permit further mass transfer. Generally,

Page 72: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

69 Phase Equilibria and Mass Transfer

Equilibrium relation is a relation that relates the concentrations of a specific component in two phases in

contact with each other. There are many forms of equilibrium relations for vapour-liquid systems, it‟s just a

relation between x and y.

The most common relation is what‟s called K value relation, it‟s based on the assumption that at equilibrium

the difference between partial pressure of the component in gas phase and the partial pressure of the same

component on the surface of the liquid is zero, or they are equal, then:

This relation is the one that‟s used to get the bubble points, dew points, plotting the phase diagrams for

vapour-liquid systems, and doing the Flash calculations.

Page 73: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

70 Phase Equilibria and Mass Transfer

Bubble point Calculations Bubble point represents the temperature at which the liquid starts

evaporation, i.e. the first bubble of vapour appears, this point is

shown in the phase diagram as the liquidous curve.

To know how to determine the bubble point of a system under

certain pressure we will assume that at this point only very small

amount of the liquid evaporates and that this small amount is in

equilibrium with the liquid that has the same initial concentration

( because the very small amount of vapour didn‟t cause any change

in liquid concentration ), so we want to calculate the temperature at

which the vapour will be in equilibrium with the liquid of

concentration of feed at the operating pressure.

So using the equilibrium relation:

And

Those two equations will be performed for all the components involved in such a system, to know

which temperature will be the bubble point there is a condition that must be fulfilled which is

yi=1, that can‟t be verified directly but by trial and error. A temperature must be assumed and yi

is calculated and another temperature is assumed till yi=1.

Dew point calculations:

Dew point represents the temperature at which the liquid starts condensation, i.e. the first droplet of

liquid appears, this point is shown in the phase diagram as the vapourous curve.

The dew point calculations are so similar to bubble point calculations, we will assume that at this

point only very small amount of the vapour condenses and that this small amount is in equilibrium

with the vapour that has the same initial concentration ( because the very small amount of liquid

didn‟t cause any change in vapour concentration ), so we want to calculate the temperature at which

the liquid will be in equilibrium with the vapour of concentration of feed at the operating pressure.

So using the equilibrium relation:

And Antoine equation, trial and error on temperature will be done to verify that xi=1.

Calculating Bubble and Dew points using Microsoft Excel:

Bubble point

First the Antoine constants for the components involved in the system must be available.

A cell for the temperature is set.

From the Antoine equation, the vapour pressures of all components can be calculated.

Using the feed composition as xi‟s we can now calculate yi‟s.

Summation of yi‟s is calculated, if the summation equals 1 then the assumed temperature is true,

else we will go to the next step.

Using the solver or goal seek, set the cell of y to the value of 1 by changing the cell containing

the assumed temperature.

Then the temperature that‟s finally got is the bubble point.

Composition0% A

100% B

100% A

0% B

Te

mp

era

ture

Bubble

point

Dew

point

Page 74: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

71 Phase Equilibria and Mass Transfer

Dew point Calculations A cell for the temperature is set.

From the Antoine equation, the vapour pressures of all components can be calculated.

Using the feed composition as yi‟s we can now calculate xi‟s.

Summation of xi‟s is calculated, if the summation equals 1 then the assumed temperature is true,

else use the solver or goal seek, set the cell of x to the value of 1 by changing the cell

containing the assumed temperature.

Then the temperature that‟s finally got is the Dew point.

Exercise Try drawing the phase diagram of any binary system using the above calculations, for – say –

Benzene toluene system, calculate bubble and dew points of the system under atmospheric pressure

for different feed compositions (say 10%B, 20%B, 30%B…, 90%B, 100%B) and then you‟ll get

the final data in a table like this

Composition Bubble Point Dew Point

Plot these values of temperature vs composition, you will find it the phase diagram of a binary

system.

Flash Calculations Flash separation is one of the most widely used methods of gas liquid

separation, it‟s very cheap, simple piece of equipment, and performs

separation effectively.

Flash separation is performed by changing the conditions of the system

(either temperature or pressure) so that the system will lie in the wet

region between the liquidous and vapourous curves, accordingly the

system will split into liquid and vapour phases in equilibrium with each

other (from tie line).

So simply the equations governing such a process are simply material

balance equations and equilibrium relations, as will be discussed below.

But note that Flash calculations are performed at certain temperature

and pressure, so to know the region of operation bubble point and dew

point have to be specified first.

let the feed F and the composition of feed , the vapour product V and

its composition yi , liquid product L and its composition xi.

From material balance

F=L+V (1)

(2)

From (1) and (2)

(3)

From equilibrium relation

(4)

From (3) and (4)

Composition0% A

100% B

100% A

0% B

Te

mp

era

ture

xf

y

x

F

xf

V

y

L

x

Page 75: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

72 Phase Equilibria and Mass Transfer

And

Now there are two conditions that have to be fulfilled to know the final concentrations and flow

rates, these are xi=1 and yi=1. Such systems are solved by trial and error, some variables are

known (ki and ) but there are two variables that have to be determined, and it will be difficult to

change two variables to solve such equations. So some mathematical manipulation of the equations

can simplify the solution and make it only changing of a single variable.

Divide numerator and denominator of xi and yi by V, so we get:

And

So instead of changing L and V we will change only L/V.

Performing flash calculations using Microsoft Excel

First, the Antoine constants for the components involved in the system must be available.

A cell for the temperature is set, also a cell of pressure is set.

From the Antoine equation, the vapour pressures of all components can be calculated.

The K values of all components can be now calculated.

Feed compositions are entered to the sheet.

Set a cell for L/V, and assume its value.

Values of xi and yi for each component can be now calculated based on the assumed value of

L/V.

Summations of xi‟s and yi‟s are calculated, if each of them equals 1 then the assumed L/V is true,

else we will go to the next step.

Using the solver or goal seek, set the cell of y (or x) to the value of 1 by changing the cell

containing the assumed L/V.

Make sure that BOTH y and x equal 1, not only one of them.

Then the ratio that‟s finally got is the true one, and the final composition of both the liquid and

vapour phases are calculated.

From material balance

F=L+V

And now L/V is known, say L/V=a

Then L=aV

So F=(1+a)V

Or V=F/(1+a)

Generally, there is no problem with these equations, but generally using this method of performing

the flash calculations may lead to inaccurate results especially in very non ideal mixtures. This

results from the method of calculating the K‟s. The general law of calculating K is:

Page 76: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

73 Phase Equilibria and Mass Transfer

Where i is the activity coefficient, foi is the fugacity of the pure chemical, i is the fugacity

coefficient in the vapour phase, and p is the total pressure. Most of these quantities can be

calculated using thermodynamics. That‟s why in such cases performing such calculations manually

will result in inaccurate results, and it becomes easier to perform such calculations using any

simulation software such as Hysy, Pro II, Aspen, VMG, or any other software.

In some cases, especially in hydrocarbons, where separation occurs under high pressures there are

charts from which the values of K‟s can be got directly without performing the thermodynamic

calculations.

The charts will be provided later.

An exercise about using these charts will be sent through email, try solving it yourself.

Page 77: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

74 Phase Equilibria and Mass Transfer

Page 78: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

75 Phase Equilibria and Mass Transfer

Page 79: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

76 Phase Equilibria and Mass Transfer

Page 80: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

77 Phase Equilibria and Mass Transfer

Page 81: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

78 Phase Equilibria and Mass Transfer

Page 82: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

79 Phase Equilibria and Mass Transfer

Page 83: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

80 Phase Equilibria and Mass Transfer

Page 84: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

81 Phase Equilibria and Mass Transfer

Page 85: Microsoft Excel for Chemical Engineers Notes (by Moataz and Mohammed)

82 Phase Equilibria and Mass Transfer