Excel Recycle and Iteration Calculation

August 17, 2017 | Author: Samson Mase | Category: Microsoft Excel, Chemical Reactor, Chemistry, Mathematics, Computing And Information Technology
Share Embed Donate


Short Description

Using microsoft excel to do chemical engineering stream recycling...

Description

1

Microsoft Excel for Chemical Engineers Course β€œFundamentals of Chemical Engineering”

Material balance with Chemical Reaction General mole balance Equation:

𝑛

𝑁𝑖 π‘œπ‘’π‘‘ = 𝑁𝑖 𝑖𝑛 + οΏ½ πœŽπ‘–π‘— Γ— π‘Ÿπ‘— 𝑗=1

Where;

𝑁𝑖 : π‘€π‘œπ‘™π‘Žπ‘Ÿ π‘“π‘™π‘œπ‘€ π‘Ÿπ‘Žπ‘‘π‘’ π‘œπ‘“ π‘π‘œπ‘šπ‘π‘œπ‘›π‘’π‘›π‘‘

πœŽπ‘–π‘— : π‘†π‘‘π‘œπ‘–π‘β„Žπ‘œπ‘šπ‘’π‘‘π‘Ÿπ‘–π‘ π‘Žπ‘šπ‘œπ‘’π‘›π‘‘ π‘œπ‘“ π‘π‘œπ‘šπ‘π‘œπ‘›π‘’π‘›π‘‘ 𝑖 𝑖𝑛 π‘Ÿπ‘’π‘Žπ‘π‘‘π‘–π‘œπ‘› 𝑗

π‘Ÿπ‘— : π‘€π‘œπ‘™π‘Žπ‘Ÿ π‘Ÿπ‘Žπ‘‘π‘’ π‘œπ‘“ π‘Ÿπ‘’π‘Žπ‘π‘‘π‘–π‘œπ‘› 𝑗, calculated according to the following equation:

π‘Ÿπ‘— = [(𝑁𝑖𝑛 Γ— πΆπ‘œπ‘›π‘£π‘’π‘Ÿπ‘ π‘–π‘œπ‘› Γ— 𝑆𝑒𝑙𝑒𝑐𝑑𝑖𝑣𝑖𝑑𝑦)/(βˆ’πœŽ)]π‘™π‘–π‘šπ‘–π‘‘π‘–π‘›π‘” π‘Ÿπ‘’π‘Žπ‘π‘‘π‘Žπ‘›π‘‘

Reaction with Recycle

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:

𝐢𝑂 + 2𝐻2 ↔ 𝐢𝐻3 𝑂𝐻

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 unreacted components, it was reported that the bottom product contains 3% of CO, 2% of H2, 4% of CH4 and 96% of methanol reactor effluent. With this low conversion, 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.

2

Microsoft Excel for Chemical Engineers Course β€œFundamentals of Chemical Engineering”

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

Reactor

Flash

Splitter

Process

Overall

11

9

12

12

28

12

4

4

4

4

16

4

No. of Givens

3

1

0

0

4

3

No. of Additional Relations

0

0

4

4

8

0

DOF

4

4

4

4

0

5

No. of Variables No. of Equations

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 not 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.

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:

Note: We'll assume the purge stream (6) to be 10% of the Flash top product stream (4). This assumption can be refined later after solution based on the allowable amount of the inert (methane) in the process streams. 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).

3

Microsoft Excel for Chemical Engineers Course β€œFundamentals of Chemical Engineering”

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 formulae will be inserted in the same way as the previous example; the table will be as follows:

These formulae will result in the following flow rates:

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, and the sum of the squares will be calculated below, then the table will be in the form shown:

4

Microsoft Excel for Chemical Engineers Course β€œFundamentals of Chemical Engineering”

Then we’ll finally have the following table:

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.

If you clicked on the Options button, you might edit the solver convergence in the options to reach a high convergence:

5

Microsoft Excel for Chemical Engineers Course β€œFundamentals of Chemical Engineering”

Finally, the solver solution will yield the following results:

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. All flow rates now are available in the table. Note: How to make the square (Diff) Total Cell (J6) turn automatically green upon finding a solution as in the figure above? This is called condition formatting. You can tell the Excel to put a certain formatting (Font color, Background color…ETC) based on the cell value. Normally, we had this cell is a red color (to show that we have not reached a solution. Next we select the cell and under the Home Tab; Choose: Conditional Formatting > Highlight Cells Rules > Between

The following window will appear.

6

Microsoft Excel for Chemical Engineers Course β€œFundamentals of Chemical Engineering”

Choose the cell to have a β€œGreen Fill with Dark Green Text” when its value is between (-0.0001 and 0.0001) οƒ  i.e. when the value is almost zero. Click OK! Excel Automatic Iterations: We can allow Excel to do us the iterations automatically instead of having to use the solver. This will be better in case we do any changes to the data, Excel will then automatically do the iterations without having to Rerun the solver. To do this, you must let Excel understand that stream 2 (that we initially assumed) is actually calculated by adding streams 1 and 7. Go to 2 (assumed) and change the formula of cell C2 to be B2+H2, Excel will then warn you that you have a β€œCircular Reference” meaning that stream 7 in dependent on stream 2 and now you want to make 2 dependent on 7 (this is a closed loop). Ignore the warning for now because that’s what we want. Do this by clicking cancel in the error message (Cancelling means that you want a circular reference to happen).

Now drag and drop the formula to cells C3, C4, and C5. It will look like the image below.

To allow Excel to do the iterations Click the Excel Logo button (Top left of the window) and choose Excel Options.

7

Microsoft Excel for Chemical Engineers Course β€œFundamentals of Chemical Engineering”

In the formulas window, click on the check box β€œEnable Iterative Calculations”. You can increase the β€œmaximum iterations” to allow more iterations to reach the solution (let’s make it 200). You can also reduce the β€œmaximum change” to reach a larger convergence. Make it 0.00001.

Finally, click β€œOk” to save. Excel will now do the iterations automatically (there is no need now for the 2 (Calc) and Square (Diff) columns, and we don’t need to use the solver. Try to change the feed flow rate to 1500 and see how excel does the iterations automatically.

Note: When doing a flowsheet with several recycle operations (Several iteration problems) it is not advisable to make the Excel do the iteration automatically because it will try to make them all simultaneously and might fail to adjust them all together. It is better to do each by yourself and keep moving between them till they are adjusted.

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF