Anda di halaman 1dari 97

An Introduction to HYSYS The purpose of this and the following pages is to introduce you to the primary tool that

you will be using in the design classes, HYSYS. Now HYSYS comes with a number of excellent reference and tutorial manuals. The Design Lab should be equipped with two complete sets of the manuals. Each set contains the following books: Getting Started, Quick Reference, Tutorials, Applications, Reference Volume 1, and Reference Volume 2. PLEASE do not remove these from the room. The same six volumes may be accessed electronically in Adobe Acrobat format either from the start menu as shown below or via the World Wide Web.

Getting Started and Tutorials are available at http://www.hyprotech.ab.ca/support/dox.htm. The Applications book is available at http://www.hyprotech.ab.ca/support/examples/hysysappexamp.htm. It is far easier to look at the actual books than to worry through the Acrobat Reader, so, again, please don't take them from the room. Note that all referals to manuals are in yellow and if the manual in question is on the HYSYS web page, like the Tutorials Book, then the reference will also be a link. Because I don't believe in duplication of effort (especially my own), this web page is intended to be complimentary to those manuals. Here on the web page, I hope to fill in the blanks left by the books, serve as a quick reference for some items, and give pointers and links as to the places in the manuals to look immediately for the answers to your questions. Most importantly, however, these pages will provide you with the tips you will need to get your specific tasks done on the specific computer system you will be working with and with this specific version of HYSYS. These tips will include information for both CENG403, where you learn to design individual units, and CENG404, where you will design an entire plant (in fact, this is the only place that you will find many tips for 404, so don't forget to come back and read them again when you start needing them). HYSYS is not the best program for group work (Aspen isn't any better believe me), therefore an entire section has been devoted towards teaching you the best way to work in groups. By the way, NT will allow two different users to edit the same file at the same time. This is bad. If you do this, only one person's work will get saved. A Little About HYSYS The goal of programs like HYSYS and Aspen is, of course, to provide you with the capability to design an entire process as completely and accurately as possible. Most (though not all) of the differences between the two lie in their user interfaces. Having gone through the design class with Aspen, I am of the personal opinion that HYSYS has a much better and intuitive interface than Aspen. You have the option of using either simulation package, but I recommend using HYSYS unless you run against something that only Aspen will do. I will try to warn you of all the limitations of HYSYS that you might encounter in advance. Unlike Aspen, HYSYS does not wait until you've entered everything before beginning calculations. It always calculates as much as it can at all times and results are always available, even during calculations. Any changes that you make to the data are automatically propagated throughout the program to anywhere that entry appears and all necessary recalculations are instantly carried out. It tends to be a lot easier to catch errors this way as you build your simulation. However, there are times when you will not want HYSYS

calculating the entire flowsheet over again every time you make a small change. Hence, the existence of the environments. While you are in one environment, calculations in the other environments are placed on hold. Every case (as HYSYS calls each individual simulation file) has two or more environments. The one that contains all the items you expect to see, the streams, unit operations such as reactors, separators, columns, mixers, etc., and various utilities, is the simulation environment. At the top of that environmental hierarchy (and the only one required) is the Case environment and the Main flowsheet. (Aside: both the name "Case" and the tag "Main" are defaults and can be changed in the "Main Properties" view under the Simulation menu). Though the entire simulation may be placed in the Main flowsheet, columns and templates are automatically brought in as Sub-flowsheets. Sub-flowsheets can be thought of as modular programs. You can have as many as you like, nested as deep as you like (though you tend to not need to put additional sub-flowsheets under a column flowsheet). The other environment, and the one you actually have to deal with first when you start a case, is the basis environment. The basis environment is the place that you define the thermodynamic package you wish to use (Peng-Robinson, Margules, etc.), the components that will be used in your simulation and any reactions that may occur. If dealing with a Petrochemical application, there is also an oil environment that may be reached only from the basis environment. There are two files that HYSYS reads whenever you start HYSYS. One of these is the Preferences File, the other is the workbook format file. The preferences file tells HYSYS many important things like which units you want to use, where to look first for your stored files etc. You can have multiple preference files saved (or you can just build up various unit sets, etc., in one file you alter upon need), but the one that is loaded upon startup is the file named hysys.prf in the directory from which HYSYS is started. If you launch HYSYS from your start menu, your user's profile has been configured with Y:\Hysys as the start directory (note that if you are not in a design class group, you won't have a Y drive, because the purpose of theY drive is to save group work). If you look at the contents of that directory you will see, in addition to some other stuff, that I have placed a hysys.prf file in there for you. That is the file that must be overwritten if you want to make changes to your default preferences (though changes are automatically saved to the preference file when you save your simulation, so overwriting should not often be necessary). You may have noticed the other file I put there, hysys.wrk. That file is responsible for the appearance of your workbook. The workbook shows you the contents of every stream in your process and the connections of every unit (if you really wanted to you could make your entire simulation using the Workbook and never even look at the PFD). Without the hysys.wrk file, unless the file has undergone changes to its workbook which got saved with that particular case, the default is for the workbook to only show two pages: Streams and Unit Ops. Now, if you've done any reading of the manuals or working of the tutorials you were propably expecting four pages: Material Sreams, Compositions, Energy Streams, and Unit Ops. The Workbook is much harder to work with without the extra info these pages provide. The file I provided restores these other pages, but again it is only automatically loaded if the Start Menu was used to launch HYSYS. Why am I telling you all this? Because there are a number of cases where you will not be able to use the start menu to do what you want. If you start a file by double clicking it (your simulations should all be stored under Y:\Hysys\Cases), without a hysys.prf file present, HYSYS will use the default file located on the NTserver called Hartsook. It is not configured for you and you cannot save changes to it. HYSYS will also fall back on that file if you do not have a Y drive. Moreover, any time you want to run one of HYSYS' or my example files, because of a failure of HYSYS to handle links or networks well, the only way you'll be able to see Hartsook (where all the sample files are located), is to double-click on one of your own files (causing HYSYS to "start in" a directory on Hartsook), then turn right around and close that file. Then, you may Open the example file. Note that HYSYS' examples are located in \\Hartsook\Hysys\SAMPLES, not in CASES as the manuals say, and that my examples are located in \\Hartsook\Hysys\SAMP403. What ever you are trying to do, if you used one of the above methods, HYSYS will not open with the correct Preference File. The first thing you should do once HYSYS opens is open Preferences under the Tools Menu. Then press Load Preference Set... . Load Y:\Hysys\Hysys.prf. At that point you may or may not need to import your workbook format. Push the Workbook button , on the toolbar to find out. If you do need to, then choose Import under the Workbook Menu and import the file hysys.wrk under

Y:\Hysys. Note: Should you somehow create a Hysys.prf file under your cases directory, DELETE or move it, as you will not be able to get to the example files on Hartsook with it there. An automatic way of telling if your preference file is based on the one I started you with or if it is HYSYS' default is the color of the background. HYSYS' preference file makes the background the same brown color as your desktop. My preference file uses a deep purple as the background color.

Reactions in HYSYS There are currently five different types of reaction that may be simulated in HYSYS and a number of reactor types that they may be used with (and one special reactor that does not require any equations). Reactions may also be used in Columns and Separators (though there are some limitations on the phases that may be used by the reactions in those cases). The five reaction types are as follows: Conversion This reaction type does not require any thermodynamic knowledge. You must input the stoichiometry and the conversion of the basis reactant. The specified conversion cannot exceed 100%. The reaction will proceed until either the specified conversion has been reached or a limiting reagent has been exhausted. Conversion reactions may not be grouped with any other form of reaction in a reaction set. However, they may be grouped with other conversion reactions and ranked to operate either sequentially or simultaneously. Lowest ranking occurs first (may start with either 0 or 1). Just as with single reactions, simultaneous reactions cannot total over 100% conversion of the same basis. Conversion reactions cannot be used with Plug Flow Reactors or CSTRs. In general, they should only be used in Conversion Reactors. Equilibrium Equilibrium reactions require that you know some sort of relation between the reaction's equilibrium constant, Keq, and temperature. You may specify Keq in a number of ways:

As a constant. Enter either Keq or Ln(Keq) As a function of Temperature. You specify A-D in the equation below Ln(Keq) = A + B/T + C*Ln(T) + D*T IMPORTANT: No matter what the units in your preferences, the T's used for this equation are in Kelvin and thus your coefficients A-D must be adjusted accordingly if the T's for the information you have are not also in Kelvin. If it becomes complicated to do so, you might choose to generate a table of K vs. T and enter that as tabular data. As tabular data of Keq vs. T (as suggested in the note above and from which HYSYS fits the above equation) Have HYSYS determine Keq from the Ideal Gas Gibbs Free Energy Coefficients. This is similar to, but not exactly like what you get by attaching any equilibrium reaction to a Gibbs Reactor (which just takes the stoichiometry). The difference depends on the property package because the Gibbs reactor will take into account any non-ideal behavior predicted by a thermo package such as PengRobinson. An essentially ideal thermo package like Antoine would give almost exactly the same results for the two different methods. You may also search for the reaction among the pre-defined reactions in the HYSYS library (reached from the Library Page of the Equilibrium Reaction window)
o

Supposedly, like Conversion reactions, equilibrium reactions may be calculated either sequentially or simultaneously. I actually did not see any means by which reactions might be designated sequential and suspect an error in the reference manuals in stating that it could be so. Equilibrium reactions also cannot be used with Plug Flow Reactors or CSTRs. In general, they should only be used in Equilibrium Reactors or General Reactors. They can, however, also be used in the special Gibbs Reactor. When a reaction set is attached to a Gibbs reactor, the stoichiometry involved in the reactions is used in its calculations. Kinetic

All three of the remaining reaction types can be considered kinetic, in that they deal with an expression for the rate of the reaction. Differentiating between the three becomes simply a matter of formulation. In this first and simplest form, the rate equation is the one to the left (this picture is taken from the Parameters Page of the Kinetics Reaction window). The first term on the right hand side refers to the forward reaction, the second term to the optional backward reaction. The k's are the reaction constants for which you must enter on the Parameters Page the activation energies, E and E', and the pre-exponential factors, A and A' (which are basically all of the constants lumped out front). The basis functions are not just functions of the Base Component (which you set on the Basis Page -- see Chapter 11 of RV1 for an explanation of the Base Component or anything else having to do with reactions), but are the products of the concentrations (or partial pressures, etc.) of any of the reactants or products to whatever power (negative numbers and decimals are fine). For example, it just so happens that for the reaction CO + Cl2 --> COCl2 the rate law might be rCO = k[CO][Cl2]3/2 You actually enter the form of the basis functions on the first page, Stoichiometry, of the reaction window. In the columns to the right of the one in which you enter the stoichiometric coefficients, you must enter the forward and reverse order. The HYSYS default is to assume an elementary reaction the stoichiometry parallels the order. Therefore for this reaction you would leave the forward order of CO at 1 and enter 1.5 for the forward order of Cl2. Though it is assumed there is no reverse reaction, you might, if you chose, leave a 1 for the reverse order of the COCl2. As long as you did not enter a value for the reverse E and A, no reverse reaction would take place. The Chemicals Tutorial in the Tutorials Book will take you through an example of the use of a Kinetics reaction in a CSTR. Kinetic (Rev Eqm) This form of the rate equation is fairly similar to the standard kinetic form. The difference is that instead of getting information about the reverse rate constant, we use the relation: Keq = kforward/kreverse or, as is actually substituted into the standard form, kreverse = kforward/Keq Of course, in doing so we have implicitly assumed an elementary reaction as that is inherent in the definition of Keq. Therefore there is no place to enter reaction orders. Keq is determined by HYSYS in the same it was done for the equilibrium reaction above, except that this time you are forced to enter the data in the Ln(K') format (again, if that's not what you have, don't despair. Try creating an equilibrium reaction, defining it how you are able and then copy over the constants that HYSYS generates). For an example of the use of this type of reaction, see my Plug Flow Example. Langmuir-Hinshelwood This is the most complicated of all the reaction forms and is therefore the one that is not even mentioned in any of the manuals (either on-line or off). Therefore it falls to me to explain it. I go through all of this in detail in the Plug Flow Example, so if you decide you do need to use this form, I recommend you work through that. Langmuir-Hinshelwood is mainly used to model heterogeneous catalysis. The rate of reaction is slowed when you have a finite number of active sites on the catalyst, some of which may become blocked to

reaction by the products being formed. Hence, to the standard rate equation is added a denominator (this is almost exactly like the form for enzyme catalysis for those of you who have had Biochemistry).

General Information on Reactions If you are looking for a step by step instruction on every stage of the creation of a reaction and the use of reaction sets, you won't find it here. You will find explanations of that stuff in any of my reactor examples (Plug Flow Example, Gibbs and Equilibrium Reactors, Conversion Reactor), or you may look in Chapter 11 of Reference Volume 1 (does an excellent job with this kind of stuff), or work through the Chemicals Tutorial in the Tutorials Book. What I am going to list here are the little pearls of wisdom I picked up while working through the reactions myself and that may or may not be mentioned in the manuals. 1. You do not need to go back to the basis environment every time you want to edit reactions. You can create or change reactions in the simulation environment using the Reactions Package under the Flowsheet menu. You cannot, however, import or export reactions except from the basis environment. 2. Modifications can be made to reactions on a specific reactor's property view pages that are local only and do not apply globally. Local changes always take precedence over the global settings. (Not an option in PFR). See Section 13.13 of RV2. 3. The components you have in a reaction need not have been previously included in the fluid packages' component list. When you finally associate a reaction set with the fluid package, whichever of its reaction's components are not already there will be added then to the fluid package. 4. There are places (such as when entering the kinetics parameters) where you shall find that no matter how many significant digits you enter in, only 2 sig. figs will be displayed. This is a short coming of HYSYS and will be fixed in future versions. The extra unseen digits are used in the calculations, but the only way to see them is to export them to a Spreadsheet (using the secondary mouse button, simply drag the number from the reaction window to a cell of the Spreadsheet Page of the Spreadsheet). 5. Under the Stoichiometric Page of a reaction window, the item called "Reaction Heat" is not the Heat of Reaction as we know it. In fact, they have opposite signs (an exothermic reaction has a positive Reaction Heat). 6. Remember whenever defining an Equilibrium constant using Ln(Keq) = A + B/T + C*Ln(T) + D*T, that T is in Kelvin. 7. HYSYS does not show you the units of the Activation Energy it displays. If you would like to display it in the same units you entered, you must go into your preferences set and set the units of Molar Enthalpy to the units you would like Activation Energy displayed in, as Activation Energy does not have its own category. Reaction rate does have its own category. The Pre-exponential factor has the same units as Reaction rate (the units set on the basis page, NOT necessarily the units set in the preferences which seem to only be for reporting purposes) divided by the Basis Units.

Reactors Though I plan to tell you about all of the reactors, pay special attention to the info on the Plug Flow and Gibbs Reactors, as they are the ones you will likely use the most. With the exception of the Plug Flow Reactor, the property views of the various reactors are essentially the same. You must specify a liquid and/or vapour product stream for all reactors (again, except for plug flow which has one and only one product stream). All reactors are assumed adiabatic until an energy stream is attached (at which point some further specification such as outlet temp or energy input is required).With the exception of the Plug Flow Reactor and the Gibbs Reactor, all of the reactors also have a number of pages in their property views related to the reactions in them. There you may make changes to the reactions that only take effect in that particular reactor. Local changes always take priority over global changes (so make sure you are aware of whether the change you are making is local or global). Appearance in PFD / Object Palette Button Description The Plug Flow Reactor can be used with Kinetics, Kinetics (Rev. Eqm.), or Langmuir-Hinshelwood reactions (any number and combination of the three types can be used in the reaction set). An excellent description of each of the PFR's inputs can be found in Section 13.10 of RV 2. You can also get a good idea of the way to go about setting up a PFR in your simulation by working through my Plug Flow Example. Quirks of the PFR: HYSYS "integrates" over the length of the reactor by dividing it into a number of sub-volumes (like a series of CSTRS). The default is 20 sub-volumes. The most noticeble effect of this to the user is in the reactor profiles. The various characteristics are given as values vs reactor length. The lengths listed are the midpoimts of the subvolumes. For example, a 10 m length reactor with 20 subdivisions would give profiles starting at .25 m and incrementing by .5 m (the size of a subdivision), finishing with 9.75 m. Not realizing this at first I was irritated that the profiles were not showing me the entering and exiting values (0 and 10 m). Not to worry, the .25 and 9.75 m values are, in fact, the same as 0 and 10 m. Everything within a subvolume is the same (like a CSTR). Another quirk of PFR is that on very rare occasions (see the note in the gibbs reactor example). The integration mechanism gets confused. To fix the problem, try looking at the Reactions page of the reactor property view. Under "Initialize segment reactions from:" make sure the re-init radio button is chosen. Normally, you would not pick this option as it takes the longest time to run. For details on how HYSYS handles the three options see Section 13.10 of RV2 (p. 464).

The CSTR can be used with Kinetics, Kinetics (Rev. Eqm.), or Langmuir-Hinshelwood reactions (any number and combination of the three types can be used in the reaction set). An excellent description of each of the CSTR's inputs can be found in Section 13.13.3 of RV 2. You can also get a good idea of the way to go about setting up a CSTR in your simulation by working through the Chemicals Tutorial in the Tutorials Book. In addition you might want to take a look at my Case Studies Example, where I build on the tutorial by adding a case study. I use the Spreadsheet feature to access the actual conversion % of the CSTR in the tutorial. Quirks of the CSTR: CSTR is primarily for liquid reactions, of course, but HYSYS will conduct the gaseous reactions as well. The less the "liquid" volume, the more of the total volume available for the vapour phase reactions (i.e. HYSYS uses the total volume minus the volume you set for the liquid to calculate the volume of the gas, whether or not any liquid is actually present in the stream). The Gibbs Reactor (like the one in Aspen) is unique among the reactors in that you are not required to enter a reaction set for it to work. The Gibbs reactor works by finding the equilibrium state with the lowest Gibbs Free Energy. It appears to be akin to finding all the possible equilibrium reactions and allowing them all to equilibrate. It's nice because you do not need to know anything about the individual equilibrium constants. On the Composition page you can set the production of components or set any of them to be inert. You may also set, on the Reactions page, the Gibbs reactor to behave like an equilibrium reactor (you must then attach an equilibrium reaction set, also see quirks below), or like a separator (no reaction). See the example which will teach you about the Gibbs reactor, the Equilibrium Reactor, and my "switch" technique. The "switch" is also mentioned on my tools and tricks page. Quirks of the Gibbs Reactor: There is something very important to note when attaching equilibrium reactions to the Gibbs reactor. The Gibbs reactor takes only the stoichiometry of the attached reactions and applies its own free energy minimization technique to it. Only components listed as reacting in the reaction set undergo any reaction. Note that HYSYS will not allow you to attach a reaction set which would include all of the possible independent reactions as that would simply duplicate the effect of setting the reactor to full Gibbs reactions. The part of this that is important to you in the design classes is that the results of the Gibbs calculations come extremely close to the values obtained in the equilibrium reactor using correct data, while not making use of any data on Keq. Thus if you need to simulate a reactor in which you want certain reactions equilibrated, but not others (for instance, because a certain catalyst is employed allowing

opens

then,

those particular reactions to equilibrate quickly, but not aiding any other reaction) and yet have no or untrustworthy data on the equilibrium constants, you are better off using the Gibbs reactor set on "Specify Equilibrium Reaction" than using the Equilibrium Reactor. Two postscripts on this: 1) If you use the above technique, it doesn't matter what you set the equilibrium constant, a fixed constant of 1 is fine, because you only need the stoichiometry. 2) Before using the above technique, check the equilibrium reaction library. The one you need may already be there, in the temperature range you desire (even then, however, the Gibbs way may still be better). One last note, there appears to be a minor bug in HYSYS, in that, when operating the Gibbs Reactor in Equilibrium Reactor mode, a button appears that would show you the % conversion, reaction extent, etc. Unfortunately, even when the Gibbs Reactor had completed its calculations, the matrix remained blank. If you would like to experiment with the similarities and differences between the Gibbs reactor and the Equilibrium Reactor yourself, see the example for a good way to go about it.

The Equilibrium Reactor uses reaction sets with only, surprise, equilibrium reactions in it. You can read more about it in Section 13.13.4 of RV 2. You can also see the example in which I compare it to a Gibbs Reactor. In general, I recommend making use of the Gibbs Reactor over the Equilibrium Reactor. opens

then, The Conversion Reactor deals with, yep, you guessed it, conversion reactions. You use it when you know how much of the reactants will be converted into products. As mentioned in the section on conversion reactions, it can handle multiple reactions which may be ranked to occur simultaneously or sequentially. Reactions with the same ranking are simultaneous and the total conversion of the same reactant can not exceed 100% (all subject to limiting reagents, of course). The product of one reaction can be the reactant of

another reaction. Quirks of the Conversion Reactor: Though the specified conversion cannot exceed 100%, the actual conversion can. This is because the actual conversion is the percentage conversion over the original amount of base component present. However, if that base component is the product of a lower ranked (meaning reacts first) reaction, there may be more available than was originally there. This allows the actual conversion to exceed the specified conversion (it's still behaving correctly, so don't panic). The conversion could thus be much greater than 100%. You can see this in my conversion example. If none of the base component was initially present, the actual conversion field will remain blank. Conversely, if the base component of a reaction is a reactant in an earlier occuring reaction, or if there are limiting reagents, the actual conversion will be less than the specified conversion. If the reaction producing the base component of another reaction is ranked equally with it, the second reaction would not convert any of the component produced by the first reaction, but would only convert the specified percentage of the original amount present. Ranking cannot be changed locally in the reactor. It may only be altered in the reaction set on the global level.

opens

then,

The General Reactor is like a combination of the CSTR and the Equilibrium Reactor. If you put in all kinetic style reactions, it acts like a CSTR. If you put in all equilibrium reactions, it acts like an Equilibrium Reactor. The General Reactor, unlike any other type of reactor available to you, will also allow you to mix equation types. You can combine kinetic and equilibrium reactions into one reaction set (you still cannot combine conversion reactions with any other type, though you can attach a conversion reaction set to the general reactor as well). That set will then be a mixed type and can be attached to the general reactor. Unfortunately, verifying the accuracy and method is somewhat involved (though not necessarily difficult). I leave it to you to investigate this. Rather than create an example for you. This time I simply added the General Reactor to my file comparing all the other reactors. That way, you may use all the reactions and reaction Not Accessible from the Object Palette. sets that were created for the other examples as a way of Can only be reached via the Unit Ops exploring the results that the General Reactor gives you. The View (obtainable by pressing <F12>, "Add name of the file is AllReactors.hsc and it is located under an Operation" under the Flowsheet Menu, \\Hartsook\Hysys\SAMP403. or from the Unit Ops Page of the Workbook. Quirks of the General Reactor: A strange problem, somehow tied into the number of product streams attached, results if you try to attach an equilibrium set immediately after a conversion set. It fails to find a solution even if it had done so before. If something like this happens to you click off then back on again the Act as a Separator when cannot solve button and it should solve.

The same quirks of the CSTR apply when using any kinetic reactions in your reaction set.

Plug Flow Reactor Example

This example will take you through the entire process of setting up multiple reactions and creating a plug flow reactor in HYSYS (as shown in the picture above). The same example problem has been worked in Aspen and Matlab. A completed case has been pre-built and is located in the file PlugFlowEx.hsc in the \\Hartsook\Hysys\SAMP403 directory, though I recommend you work through the example yourself so that you do not miss anything. The reactions that we are going to model are those encountered in the early stages of the production of such chemicals as ammonia and methanol, both of which may start with a Natural Gas feed. Here are the two reactions that we shall consider: CH4 + H2O --> 3H2 + CO CO + H2O <--> H2 + CO2 The first reaction is the reforming reaction in which the natural gas (here modeled entirely as methane) is reacted with steam to form hydrogen and carbon monoxide. The second reaction is the Water Gas Shift Reaction in which yet more hydrogen is produced and the CO changed to CO2 (this is especially important in ammonia sysnthesis as both CO and CO2 will poison the catalyst used to make ammonia from hydrogen and nitrogen, and the CO is harder to remove than CO2). Note that the Water Gas Shift is an equilibrium reaction and is modeled as a reversible reaction. The reactor that we will model is like one of the Water Gas Shift Reactors in the ammonia process (occurs after the reforming reactors), and at the considerably lower temperature at which we shall be operating, we should expect to see mostly the second reaction and little of the first. In fact, we won't see any, but if we were modeling this whole process, we would need to account for the possible effects of both reactions in the shift reactors as well as the reforming reactors. Here, the purpose is to demonstrate another kinetic form in HYSYS. To start, open a new case in HYSYS and add a new fluid package. Choose Antoine for the Property Package. The example calls for an ideal system (we'd like to be able to compare to Matlab and Aspen which we cannot do if differing thermodynamics are used). Unfortunately, HYSYS does not have a package labeled ideal. However, according to Chapter 8 of RV1 (link only good from AL-C126), the vapour pressure models (such as Antoine) are for essentially ideal systems. Alternatively, you might try comparing those results to the results of an activity coefficient model like Margules with its vapour model set to ideal and all of its binary coefficients (both Aij's and Bij's) set to zero. Switch to the Components Page and install the following components into the fliud package:

Return to the Simulation Basis Manager window and switch to the Reactions page. The first thing that must be done is tell HYSYS which components are to be available for reaction, so push the button marked Add Comps... . A window should open that looks like this.

Press Add This Group of Components and then close the window. Note that if you had not already created the fluid package, you could simply have switched to the Library radio button in the add components group and added the components as you had added them to the fluid package. In fact, when the reaction is later associated with a specific fluid package, if the reaction components were not already listed among the package's components, they would be added then. Now on the Reactions page of the Simulation Basis Manager, press the Add Rxn... button. This is the window that comes up. There are five forms of reaction that you can enter in HYSYS. To know which ones to use you must know the form of the kinetic data you have. In this example we will be looking at the last two forms of reaction. For a description of all of the different reaction types, see Chapter 11 of RV1 (link only good from AL-C126). Reaction 1 is the reforming reaction and is in the form that may be modeled easily by Langmuir-Hinshelwood. The LangmuirHinshelwood equation you may (or may not) remember from CENG 390 is the form used for heterogeneous catalysis when you must worry about products or inerts using up active sites on the solid catalyst. Reaction 2, the Water Gas Shift reaction, uses the standard Kinetic (Rev Eqm) form, in which you know the forward reaction constant and use the equilibrium constant to get the reverse

nature of the reactions.

Variable Bed Density

r1 = DBED*km*e(-Ea1/(R*T))*P*ym/(1+Kh*P*yh) r2 = DBED*A*e(-Ea2/(R*T))*(yc*yw - yd*yh/Keq2) Abbreviation Value Units DBED km R P Kh ym yh yc yw yd A Keq2 1200 5.517e6 1.849e8 8.314 30.0 4.053 Varies Varies Varies Varies Varies 4.95e8 1.163e5 e
-4.946 + 4897/T

kg/m3 mol/kg/s/atm J/mol J/mol/K atm atm-1 Unitless Unitless Unitless Unitless Unitless mol/kg/s J/mol Unitless (T in K)

Pre-exponential Rate Constant Gas Constant Pressure Absorption Parameter Mole fraction of CH4 Mole fraction of H2 Mole fraction of CO Mole fraction of H2O Mole fraction of CO2 Pre-exponential Rate Constant Equilibrium Constant
1

Activation Energy of Reaction 1 Ea1

Activation Energy of Reaction 2 Ea2

As mentioned above, the first reaction is Langmuir-Hinshelwood, so highlight that in the Reactions window and press Add Reaction. Fill out the form that appears with components and coefficients so that it looks like the picture below then press the Basis tab to move to that page.

Note that unlike the second reaction (which has an equal number of moles on both sides and therefore shouldn't), the first reaction contains pressure terms. You will note, however, that in each instance it is a singular mole fraction multiplied by the overall pressure. This is equivalent to the partial pressure of the species. Therefore you should change your basis to Partial Pres. You may leave the base component as Methane (note the base component of a reaction must always be a reactant for that reaction, though it may

The reaction phase, as you might guess, tells HYSYS in which phase the reaction is to take place. Your options for this are:

Overall -- reaction occurs in all Phases Vapour Phase -- reaction only occurs in the Vapour Phase. Liquid Phase -- reaction only occurs in the Light Liquid Phase. Aqueous Phase -- reaction only occurs in the Heavy Liquid Phase. Combined Liquid -- reaction ocurs in all Liquid Phases.

Since we anticipate that these reactions will only take place at temperatures where the entire process stream is gaseous, a reaction phase of either Vapour Phase or Overall is fine. Now we want to enter the units for the rate and the basis. These units do not have to have anything in common with the units you have set in your preferences. Instead they should correspond to the units used in the kinetic equations you are provided with. If you look back above to the table of variables, you will see that for everything to work out correctly, Pressure, and therefore Partial Pressure, must be in atm and the rate of reaction must be in mole/m3/s (gotten by multiplying the units of DBED, km, and P; the exponential term, the y term, and the denominator all being unitless). It is no problem to enter atm for the Basis Units. The closest we can get for the Rate Units, however, is kgmole/m3-s. Thus we will have to adjust the rate constant later to match. When you are all finished the Basis Page should look like this:

On the Numerator Page, you shall begin filling in the information that will tell HYSYS the actual form of the rate equation. If you have not already done so, I suggest that you push Kinetics Help, which will call up the following window:

The various basis functions in the reaction I have colored yellow and the parts that become the A's are in red. r1 = DBED*km*e(-Ea1/(R*T))*P*ym/(1+Kh*P*yh) You can see that in this numerator there is no reverse reaction and that the forward reaction is first order in methane and zero order in steam (the latter is a trifle suspect and indicates that some assumptions were probably made about the ratio of steam to carbon and that the steam partial pressure was probably incorporated into the rate constant). Therefore, in the components matrix, you should change it so that all orders for both forward and reverse reactions are zero, except for the forward order of Methane which should remain 1. The Activation Energy, Ea1 = 1.849e8 J/mol, of the reaction may be entered as E of the forward reaction. There are a couple of things to note at this point. The first is that HYSYS does not show you the units of the Activation Energy it displays. If you would like to display it in the same units you entered (in this case, J/mol), you must go into your preferences set and set the units of Molar Enthalpy to the units you would like Activation Energy displayed in. The second item is that despite the fact that you entered 4 significant digits, HYSYS only displays 2. Calculations are based on 4 digits, but you cannot see them unless you export the number to a Spreadsheet (using the secondary mouse button, just drag the number from the reaction window to a cell of the Spreadsheet Page of the Spreadsheet). Per my request, HYSYS has added the ability to adjust this formatting to their wishlist for future versions. The same problem will result when you enter in the Pre-exponential Factor. The number you enter into A for the forward reaction, must be the product of DBED and km divided by 1000 (remember the units need to be in kgmole/m3/s, not gmole/m3/s), which is equal to 6620400. You may leave all the reverse reaction info blank (we don't hae one so you don't need it). Your window should look something like this:

Note that the status has changed to Ready. Do not believe it! Though HYSYS does not require it, we still need to input the Denominator (and it would be kind of silly to use the Langmuir-Hinshelwood form if you didn't have a Denominator). Moving to the denominator page, the form of input changes slightly. It is now in matrix form, because you have the ability to put in as many terms as you want into the denominator, each with differing A's, E's, and bases to go with them. Enter Kh = 4.053 into A, set E equal to 0, and put a 1 under Hydrogen.

You are done entering the data for the first reaction. You may close this window. Go back to the little Reactions window and add a Kinetics (Rev Eqm) reaction. If you closed the Reactions window you may get it back by going to the Simulation Basis Manager and pushing Add Rxn on the Reactions Page. Add the components and the stoiciometric coefficients like we did for the first reaction, then move to the Basis Page.

On the Basis Page, set the basis to Mole Fraction, the reaction phase to Overall or Vapour Phase, and the reaction units to kgmole/m3-s.

Moving on to the Parameters Page, we see that this time the Kinetics Help is already on the page. Below I have copied the second reaction rate equation. This time, as with the first reaction, the preexponential factor is in red and the bases are in yellow. r2 = DBED*A*e(-Ea2/(R*T))*(yc*yw - yd*yh/Keq2) Note that this time, however, you are not asked for information on the orders of the components in the forward and backward reaction. That is because this formulation of rate equation can only be used with elementary reactions (remember those are reactions where the orders are equal to the coefficients). The reason being that that is how Keq's are defined. Enter A = 5.94e8 (DBED*A/1000, the thousand is for the units to come out) and E = 1.163e5 J/mol. For the rest we need to use the expression in the chart for Keq2: Keq2 = e-4.946 + 4897/T. Note that the natural log of this is what we want to enter into HYSYS. Therefore, A' = -4.946 and B' = 4897. IMPORTANT: the T used in their expression is always in Kelvin, no matter what your unit preferences are in. Luckily, this was the form we were provided with.

You are now finished entering the second and final reaction. You may close this window and return to the Reactions Page of the Simulation Basis Manager.

Now that you are done creating your reactions, you must add them to a reaction set. Reaction Sets are groups of one or more reactions. They may be exported and imported. They must be attached to fluid packages to be used in the flowsheets to which those fluid packages are associated. You can attach as many as you like to a fluid package, and thus use different sets on different units within the flowsheets. Reaction Sets may be used with reactors, columns, and separators. Conversion reactions cannot be placed in the same set as other types of reaction. For more information on Reaction Sets see Section 11.4 in RV1 (link only good from AL-C126). To start, press the Add Set button in the Reaction Sets Group, add both of your newly created reactions to the Active List. Note that the Global Rxn Set already contains the two reactions created, but practice is good for you and this way you get to see the Reaction Set window.

Close the above window and look back at the Simulation Basis Manager, which should now look like this:

Make sure your reaction set is highlighted and press Add to FP. A window will pop up listing all the available fluid packages (in this case, there should be only one). Select it and press Add Set to Fluid Package. Your fluid package should now appear under Assoc. Fluid Pkgs when your reaction set is selected. You have now completed everything you need to do in the basis environment. You may now enter the Simulation Enironment.

Begin by creating two material streams on the PFD. Name one Feed and the other Product. On Feed's property view, set the temperature to 350o C, the pressure to 30 atm, and the total flowrate to 2110 moles/s (7596 kgmoles/hr). Fill out the compositions as shown below.

Now, from either the Oblect Palette or the Unit Ops Page of the Workbook, add a Plug Flow Reactor to the flowsheet and connect the Feed and Product streams (remember a shortcut for toggling into and out of the connecting mode is to hold down <Ctrl>). Your PFD should look like the one below.

Open the property view of the reactor. If you have already connected the streams to the reactor then the Connections Page will be completed (note that unless you connect a heat stream, the reactor is assumed to be adiabatic by HYSYS). You may move to the Parameters Page. The only thing you need to do there is set the Pressure Drop to 0. Move two tabs over to the Dimensions Page. Fill in the settings as they are below.

These are the same dimensions as those used in the Aspen example (with the same correction in the diameter for porosity that you can read about there). The next page over is the Reactions Page. All you need to do there is enter your reaction set and HYSYS will begin to integrate your reactor. It may take a little while, but when it's done, your window will look like mine below and your PFD will look like the picture at the beginning of the example (all blue and happy like).

To see some of the results of your reactor, click on the Profiles button at the bottom of its Property View.

Above is one of the reactor profiles you can choose. It is important that you note -- it's easier to see in table mode than graph mode -- that the data points at the ends say they are for .25 m and .95 m, not 0 m and 10 m like you might expect. You have to remember that HYSYS integrates over the length of the reactor by dividing it into 20 sub-volumes (that was the default on the Reactions Page of the Property View and we left it at that). Ten meters divided into twenty groups means .5 m per division. The point that HYSYS records is thus halfway between the divisions, but is valid in HYSYS for the whole sub-volume. Thus the temperature, composition, etc. of the product stream contains the same values as 9.75 m down the reactor. In other words, don't worry that HYSYS is leaving off its charts the first and last values. The first point corresponds to the reactor inlet and the last point to the reactor outlet. Below are the results you should have gotten for your Product stream.

Compare these to the results we found in the Aspen simulation. Agreement is good in both the mole fractions and the final temperature (off by about a degree). These results correspond to a thermodynamic package of Antoine. If you were to go back and change this to Margules, set the vapour model to ideal, and delete all the binary parameters, you would find that the results hardly change at all (the final temperature changes by 0.2 degrees Celcius). Thus, it is likely that the difference between the HYSYS and Aspen models are the result of column integration differences versus property package differences.

Gibbs vs. Equilibrium Reactor

In order to save time and make it possible for you to campare the results of the various reactors, this example will begin by using the same components and reactions that were employed in the Plug Flow Reactor Example. It is recommended, but not necessary, that you work through that example first (or at least glance at the component list and reactions). If you do not have a version of your own of that example from which to start this example, I have made available a completed version of that example entitled PlugFlowEx.hsc located in the \\Hartsook\Hysys\SAMP403 directory. There is also a file containing this and all other completed reactor examples called AllReactors.hsc in the same directory. The Gibbs Reactor We will begin by installing the Gibbs Reactor. Set up your Process Flow Diagram (PFD) like you see below (remember the <Ctrl> button is great for quick connecting as it toggles you in and out of Connect Mode). The Gibbs Reactor is available from the Unit Ops menu or from the Object Palette by pressing the General Reactors button

which opens this menu

. Press

for the Gibbs Reactor.

Note that it is not necessary to attach a liquid product stream to the reactor. All of the reactors may be run with only one product stream (vapour or liquid). Should both phases be present in the product and only one or the other product stream available, HYSYS will tell you it needs another product stream. At that point, you must add another stream, but do not be dismayed. Remember, you can always mix them back together again. Also note that you may add an energy stream to the reactor. That we have not indicates that we intend the reactor to be adiabatic. Since we desire the Gibbs Feed stream to be the same as the Plug Flow Feed stream, the easiest method is to double-click on the Gibbs Feed, opening the property view, and switch to the Utilities Page. There, press the button marked "Copy Stream Specs From ..." and choose the Plug Flow Feed stream.

You'll find that this is all that is required for the Gibbs reactor to work. If you so wished, you could now open the reactor's property view and add a pressure drop on the Parameters Page. You can also switch to the Reactions Page where you will see a couple more options. Currently selected should be Gibbs Reactions Only. This is the choice that gives total equilibrium of all components (excluding those labeled

the option that allows you to attach an equilibrium reaction set. We shall return to this option later in the example. The last option is to have No Reaction occur at all. The reactor then would simply act as a separator (provided both vapour and liquid product streams were connected). Changing nothing, however, we find our product stream looks like this

Note these are extremely different results than we obtained in the Plug Flow Example. The main difference is that where in the PFR the reforming reaction was not occuring, here it is occuring in great quantity, backwards. At this temperature, the equilibrium is to the left (something we did not even allow for in the kinetic equations we defined for the reforming reaction), and methane is formed in what is called the Sabatier reaction (same reaction, two names, go figure. We are ready to start putting in the Equilibrium Reactor. The Equilibrium Reactor We cannot install a working equilibrium reactor without first creating the reactions it will use. Therefore the first thing you must do is enter the basis environment. On the Simulation Basis Manager, switch to the Reactions Page (close any other windows that might have been left open there). Before continuing any further, if they are not already, I suggest that you change the names of the existing two reactions to ReformingLH and WGSkin for consistency with my examples and to prevent confusion later (you will begin to collect many very similar reactions). You should also probably change the name of the reaction set containing those reactions to Kinetic. That completed, your window should look something like this

Now, in the Reactions Sub-Group, press the Add Rxn ... button. Choose Equilibrium Reaction and name the reaction that appears ReformormingEq. Since this is a very common reaction of interest, before beginning to fill out coefficients we will check the Library Page to see if it is already stored in HYSYS. Luckily for us, it is, as no one was kind enough to provide us with any equilibrium data on this reaction. As you can see it is second on the list and the Water Gas Shift reaction that we will be adding next is first.

Highlight the reforming reaction and press the Add Library Reaction button. You will find the reaction is now completely defined. HYSYS inputed for you a table of Keq vs. Temp values (from which it also fitted the equation it uses to interpolate and extrapolate -- speaking of which, be aware of the temperature range of the table from which HYSYS will draw its information). To learn more about ways of inputing your own data into the form read the section on Equilibrium Reactions back on my Reactions page or Section 11.3.3 of RV1. Now that we are done with the reforming reaction, close this window and add a new equilibrium reaction called WGSeq. Again, go to the Library Page and choose this time the first reaction on the list. Close the window of the completed second equilibrium reaction.

Our next job is to create a reaction set for our two new reactions. Though, HYSYS will allow you to put kinetic and equilibrium equations in the same reaction set (see the General Reactor), you could not put these in the same reaction set with the others because they refer to the same two reactions (evaluated in different ways). Create a new reaction set from the reactions page of the Simulation Basis Manager and call it Equilibrium. Add the two reactions you just created to the active list. It should now look like this:

Close the window. Back again on the Simulation Basis Manager, highlight the reaction set you just created and push the Add to FP button as we must associate the reaction with our fluid package before it can be used in the flowsheet. There should be only on fluid package listed (if there is more than one, pick the one that is used on your main flowsheet). Select it, then push Add Set to Fluid Package. The completed Reactions Page of the Simulation Basis Manager should look like this:

Note the Assoc. Fluid Package box only shows those Fluid Packages associated with the highlighted reaction set. You may now return to the simulation environment as we are ready to install the equilibrium reactor.

The Process "Switch" Rather than simply create another feed stream for the Equilibrium Reactor copied from the PFR or Gibbs Reactor, let us assume that you wish to compare the results of the two different reactors on the rest of an involved process. You could simply use Save As to make a copy of the file and substitute one reactor for the other, but that makes comparison of results difficult and cumbersome. You could also use the Logical Operation Balance to dynamically copy the feed to one reactor to another stream which would then become the feed to the other reactor. That way you can have the upstream of the plant duplicated to both reactors on the same flowsheet. Unfortunately, to get the downstream part of the plant, you would have to copy every stream and unit, a difficult prospect in itself, which would clutter your PFD, and then you would have to make every future adjustment to the downstream section twice, a tedious business at best and heaven help you if you have a downstream stream affecting an upstream stream. Basically, this option is out for any but the simplest of flowsheets or unless you only care about the immediate output after the divergence. Your last, and I think best option (though there are times when a Save As might well be the most expedient solution), is a technique which I find HYSYS well suited to take advantage of, but which I found curiously missing from the manuals. I call it the Process "Switch". It takes advantage of a lesser used option in the preferences allowing you to make multiple connections to the same stream and the ability of HYSYS to "ignore" unit operations without you deleting them. Therefore to start, open the Preferences from under the Tools menu. On the first page, marked Simulation, check the box marked Multiple Stream Connections. You may then close the Preferences window.

Since there is no point tempting fate by upsetting HYSYS and to make things clearer to you, we will go ahead and make HYSYS ignore the Gibbs Reactor. Open that reactor's property view and switch to the Parameters Page. Check the box that says Ignore This Unit Op During Calculations. The reactor should now turn yellow and the product stream to a pale blue, indicating it is not solved. It is time to place the Equilibrium Reactor on the PFD. Either do so from the Unit Ops Menu or as follows from the Object Palette.

Push

which opens this menu

. Press

for the Equilibrium Reactor.

Your PFD should look something like this:

Now from the Equilibrium Reactor's Property View, go to the Connections Page and for the Feed stream, go to the drop down menu and choose FeedG or whatever you called the feed to the Gibbs Reactor (if you had not already changed the multiple streams option in the preferences, that feed stream would not be a listed option). Now if you were to go right to the Vapour Outlet and attempt to connect ProductG, you would get this error:

I believe this is due to the similarity of the two units you are trying to "switch" out. When I tried this first with a Gibbs Reactor and a PFR, I did not get the error. There is an easy way around it, however. Simply

attach a valve with zero pressure drop (don't forget this) to the Equilibrium's Vapour Outlet, then in the valve's property view, set the outlet to be ProductG or whatever you called the Gibbs Outlet. Note: When I was experimenting with the "switch" and the PFR, the PFR began having trouble doing its integration and I was forced to set the segment initialization to Re-initialize for it to work. When you are finished connecting, your reactors should look like this:

Now all that remains is to specify the Equilibrium Reactor. All you need to do is open the Equilibrium Reactor Property View, move to the Reactions page and attach the Equilibrium Reaction Set. HYSYS will do the rest.

You may now switch back and forth between the two reactors. I recommend that you try to have one of the two "ignored" at all times (though in this simple case nothing crazy happens and you should observe what happens if you break this "rule"), thus you would start a "switch" by going to the Parameters Page of the Equilibrium Reactorand setting it to be ignored. Then go to the Gibbs Reactor and remove the command to ignore. If you examine the product stream as you are switching back and forth, you will see that the results of the two reactors, as they are currently configured, are almost identical. This kind of confirmation is good to see as the reactors go about this calculation in completely different ways. You can see this for yourself by going into the reaction manager and changing one of the equilibrium reactions (or a copy) to have a fixed K of, say, 1. (I leave it to you to remember how to do it). You will then find that while the results for the Equilibrium Reactor change drastically, the Gibbs Reactor continues to give the same "correct" values. This same technique can be used later to show that when an equilibrium reaction set is attached to the Gibbs Reactor, that it is truly only taking the stoichiometry info. Another important thing to note about the similar results is that the thermodynamic property set we are using is Antoine. This is one of the thermodynamic packages that has essentially ideal vapour and liquid phases. You'll find that if you change your thermo package to one of the non-ideal ones, like PengRobinson, that the results of the Gibbs Reactor begin to diverge from those of the Equilibrium Reactor (remember the equalibrium reactions set Keq as a function of T only). More so in other examples than this one. (You may also have noticed that for whatever reason, the PFR takes a lot longer to re-calculate in Antoine than in PR). To see a case where the difference caused by the thermo package is more severe see the file called methpuz.hsc in \\Hartsook\Hysys\SAMP403.

Now we are ready to experiment with attaching reactions to the Gibbs Reactor. Open its property view and go to the Reactions Page. Switch the Reactor Type to Specify Equilibrium Reactions. Try attaching one of the reaction sets to the reactor. You probably were not suprised to see that you could not select the Kinetic set, but you might have been suprised to discover that you also could not attach the Equilibrium set! Located down at the bottom, in the Trace Window, is this explanation: "There is no need to specify reactions if all of them are equilibrium type. Gibbs Reactor will take care of attaining equilibrium by itself" Remember that in the standard setting on the Gibbs Reactor, the reactor will solve for the equilibrium of all possible reactions (element balance is maintained). As it turns out, with the limited number of components in this example, the two reactions we are exploring compose the entirety of possible independent reactions. HYSYS will not allow you to attach a set containing both reactions as it could accomplish the same thing better by simply forcing you to choose Gibbs Reactions Only. Frequently, however, you do not want all possible reactions to go to equilibrium. Suppose instead you wish to model a system that normally does not go to equilibrium quickly (there is a large activation energy). You, however, know that there is a catalyst which will lower the activation energy for the reaction you want and only the reaction that you want. You know that eventually a PFR will be used, but for whatever reason, you do not wish to model one yet. It is sufficient to assume that the Plug Flow would sufficiently near equilibrium that you may model the reactor as if it went all the way to equilibrium. In a case such as this, you would want to use an Equilibrium or Gibbs Reactor with only the one reaction attached. This is the time to use the Specify Equilibrium Reactions option in the Gibbs Reactor. For this example, we must first de-activate one of the reactions in the Equilibrium Set before we may use it. Let us assume that we wish to focus on the Water Gas Shift reaction and expect to see little or no Reforming (at the temperatures we are operating at, a not unreasonable assumption). Under the Flowsheet menu, select Reaction Package. This will open a window showing the available reactions and reaction sets.

Double-click on Equilibrium and its window will open. Highlight ReformingEq and push the Make Inactive -> button.

Note that in my file AllReactors.hsc, instead of de-activating the reaction from Equilibrium, I made a new reaction set called GibbsEquil, which I set up with the one equation active and the other equation inactive. Now, attach the modified reaction set to the Gibbs Reactor. It should work without a hitch. (Note that if you attempt to use the Composition Page now, the reactor will automatically revert back to Gibbs Reactions Only). Compare the results you get now with the results from the Equilibrium Reactor using the same reaction set. Yet again they are almost exactly the same. Two final notes: 1. Unless you are given specific Equilibrium data to use, your results are more likely to be accurate using the Gibbs Reactor than with the Equilibrium Reactor. 2. When defining Equilibrium Reactions realize that you may choose to have HYSYS determine Keq from the Ideal Gas Gibbs Free Energy Coefficients. This is nearly the same as what it does with equilibrium reactions in the Gibbs Reactor. The difference is that Gibbs will take in non-ideal effects from the thermodynamic package whereas the equilibrium reaction so defined will remain for the ideal case.

Logicals

There are four logical unit ops that are used primarily in steady-state mode. These are SET, ADJUST, BALANCE, RECYCLE, and the Spreadsheet. The rest of the logical unit operations are used primarily in Dynamic Mode and will not be discussed here. The Chapeter in the Reference Volumes which covers all of logical ops is Chapter 14 in RV2. Much of what is said here may also be found there, as well as a more thorough explanation of each option available.

The SET Operation SET is used to set the value of a specific process variable (PV in the manuals) in relation to another PV. The relation must be of the form Y = mX + b and the process variables must be of the same type. For example, you could use the SET to set one material streams temperature to always be 20 degrees hotter than another material stream's temperature. SET may work both ways (i.e. if the target is known and not the source, the target will "set" the source). You can see an example on SET's use that includes an example of the Spreadsheet in my Set Example. You may also read more about it in Section 14.7 in RV2. As a small aside. You can use the Spreadsheet to set the multiplier, m, or increment, b, of the SET operation (similar to what I mention with the ADJUST below). But I don't see much point, since, if you're going to invoke the Spreadsheet anyway, you might as well just import the source variable, do your necessary calculations, and export the result directly to the target without ever bothering with SET.

The ADJUST Operation Use the ADJUST operation when you want HYSYS to adjust one variable until a target variable reaches a user specified value or matches a specification. That source of that specification can be yet a third variable (of the same type as the target and offset by a constant if you so wish). The Gas Processing Example in the Tutorials Book uses an ADJUST to vary one stream's temperature until another stream's dew point equals a specified value. One irritating little feature is that if you are using another object as the source of the target value, the menu of objects will include objects that you cannot actually use that way. I tried to connect the results of a spreadsheet that way, but it did not work. You can use the results of Spreadsheets, however (which is good, since it greatly increses the power and flexibility of ADJUST). It must be done by exporting the variables from the Spreadsheet itself to the ADJUST. You can export to the target value or to the offset used whenthe target value is another object. If you export to the target value, the number will appear in the user specified box (the radio button must therefore be set to that). Before installing the ADJUST module, it is often a good practice to inialtize the independent variable, allow the flowsheet to solve, and note the value on the dependent variable.Then self-adjust the independent variable and make sure that the dependent variable is actually affected by it. This should also give you an idea of the step size you will require. The step size is set on the Parameters Page and is the initial step size employed until the solution is bracketed. Note that too small a step size and you may not bracket the solution before exceeding the maximum number of iterations (you may change that number as well though).For a description of the rest of the items on the Parameters Page, another example, and a discussion on the use of multiple ADJUSTs simultaneously (involves a change in the Solving Method), see Section.14.1 of RV2.

The BALANCE Operation This is one of the most interesting and deceptively useful of the logical units. Remember way back when you took CENG 301. You had to do Mass and Energy Balances over sections of or entire plants to solve for unknowns in composition, flow, energy, or whatever. Well, that is what this operation will do for you. You tell it what streams of material and/or heat are crossing the imaginary boundary into your system of interest and what streams are exiting. You know that HYSYS shares information both forward and backward throughout the PFD at all times. However that is not always enough for HYSYS to know when the situation is entirely specified but in a more unorthodox manner. The Mole and Heat Balance example in Section 14.2 of RV2 shows a single stream passed through two coolers in series. Though you know the composition and the temperature of the stream both before the first cooler and after the second cooler, you do not know the flowrate or the temperature in between. You do, however, know the duties of the two coolers, which gives us enough information to figure out the unknowns. The balance is set up so that the two coolers are the system, which thus has one material inlet stream, one material outlet stream, and two outlet heat streams. (Note: when setting up balances, even when the flow is negative -- something you are more likely to see with energy than with material streams -- choose which streams are inlet and which streams are outlet from the direction of the arrows, into or out of the system, on the PDF. HYSYS will handle the signs correctly then.) There are a total of 5 different types of Balance available to you, they are:

Mole and Heat Balance - I mentioned this one already. It is the most commonly used and is good for calculating ONE unknown based on the total material balance and ONE unknown based on a total energy balance. It should not be used in conjunction with a reactor as the balance is on a molar basis. The material balance is conducted first and will complete even if the energy balance is under(or worse, over-) specified. Though it does not conduct individual component balances like the General Balance, you may leave the composition of one stream empty and HYSYS will know how to fill it. Actually, I am not absolutely sure about this type's limitations. It seems to be able to handle more than the manuals say it should (I suspect that it really does do some sort of individual component balance). It was able to handle the example I made up for the General Balance below, but it couldn't handle the example for the General Balance contained in the Reference Manuals. Mole Balance - There is another way to use the Balance Operation. The "system" for which you have inlets and outlets need not be part of the process at all. You can use the balance to create new streams with characteristics of streams in your process. In the HYSYS' Gas Processing Tutorial, they use the Mole Balance to create a stream with the same composition and flow as a process stream, but then they give the new stream a different pressure and a vapor fraction of 1 to see what the stream's dew point would be (remember, when you specify vapor fraction of 1 or 0, HYSYS assumes you want saturated vapor or liquid and solves for the corresponding temperature or pressure). Mass Balance - The Reference Manual says that this is good for non-stoichiometric reactors like alkylation units and hydrotreaters. The compositions of all streams must be specified and all but one flowrate. Be aware that the only thing this balance passes is a Mass Flowrate. Note that there is no sort of elemental balance. You could have five streams of pure nitrogen as inlets and one stream of CO2 as the outlet, and HYSYS will gleefully pass the sum of the mass flowrates of the nitrogen to the CO2. So, be careful with this one. Heat Balance - You know, I'll be honest. I cannot think of a good use for this one, but hey, I can't do all your thinking for you. General Balance - This is the really good one. In addition to conducting individual component balances, and thus being able to solve a greater variety of problems that way, you can specify ratios between components within a stream (unfortunately not between streams). It could even handle inputing flowrates for some of the components but leaving the rest of the composition <empty>, this

was a little tricky though. Take a look at my neat, little example and you'll see what I mean. As with the Mole and Heat Balance, the material balance is conducted independently of the energy balance and will complete even if the energy balance is under- (or worse, over-) specified. A warning, though. Either balance may surprise you by making the other balance overspecified, if you are not watching for that possibility when inputting data. For all Balances, the balance will not start to calculate until the Auto Calculation box is checked, but don't check it until all is ready.

The RECYCLE Operation Use this operation every time you need to recycle a stream. The logical block connects the two streams around the tear (remember the tear does not have to be the official "recycle" stream itself, but instead should be the best place in the loop to make the break for convergence purposes). Before you can install the RECYCLE the flowsheet must have completed. That means there need to be values for both the assumed stream and the calculated stream. Once the Recycle is attached and running, HYSYS compares the two values, adjusts the assumed stream, and runs the flowsheet again. HYSYS repeats this process until the two streams match within specified tolerances. Those tolerances are set on the Parameters Page. There are tolerances for Vapour Fraction, Temperature, Pressure, Flow, Enthalpy, and Composition. The tolerances you enter are not absolute. They are actually multipliers for HYSYS' internal convergence tolerances. For example, the internal value for Temperature is .01 degrees (note that is in Kelvin, because HYSYS does all of its calculations in an internal unit set), so a multiplier of ten means the two streams must be within a tenth of a degree of each other. On the Numerical Page, among other things, you may set the RECYCLE to either Nested (the Op is called whenever it is encountered in the flowsheet) or Simultaneous (all of the RECYCLEs are invoked at the same time -- use with multiple inter-connected recycles). There is far more to this Operation. I cannot really do it justice. See Section 14.5 in RV2 for much more information on the options available to you as well as two excellent examples which include strategies on reducing the number of recycles and convergence time.

The Spreadsheet You must have noticed me raving about this operation on occaision. This is by far one of the most powerful and flexible of the tools available to you. You may import almost any variable to the Spreadsheet, do a variety of calculations there (including boolean logical operations like if ... then statements), and then export results to any specifiable field in your simulation. It serves the same basic Function as the FORTRAN blocks do in Aspen, but again, no surprise, it's a heck of a lot more user friendly an interface. Besides reading about in Section 14.8 in RV2 and looking at their example which shows how you may use the Spreadsheet to calculate the pressure drop across a heat exchanger (at least they calculate the Reynolds Number), I have made two different examples showing further uses for the Spreadsheet. One example was mentioned earlier in this page, SetEx. The other example shows how the Spreadsheet may be used to calculate reaction conversion for use with a Case Study. In the first example, I import and export via the Connections Page. In the second example, I do it by directly dragging the variables into and out of the spreadsheet.

Set and Worksheet Example

In this example, I am going to show you two different ways to solve the same dilemma. Let me start by defining the problem. You need to mix a stream of natural gas with steam before sending them to the natural gas reformer where they will react to form CO and CO2. You cannot just mix them in any proportion, however. Though stoichiometry might suggest you could use nearly a 1:1 ratio, you must avoid a possible side reaction whereby solid carbon (coke) is formed, choking the reactor. To avoid this reaction you are told to maintain at least a 3:1 Steam to Carbon Ratio (i.e. for every carbon atom entering the reactor, there should be 3 molecules of water). This wouldn't mean much if you always had the same starting flow of natural gas, but chances are high you are going to have to make many, many adjustments to the feed flow. You do not want to have to recalculate the flow of steam and enter a new value, every time you do so. Don't panic! There are a couple of easy ways to get HYSYS to maintain that steam to carbon ratio automatically. But before we get to that, let's go ahead and set up our property package. Start a new case and push the Add button on the Fluid Pkgs Page of the Simulation Basis Manager to create a new fluid package. In the window that opens up, pick PR for the thermodynamic package (it doesn't really matter what you pick, as we shouldn't be doing anything that requires thermo information, but there are a few packages that limit what components you may use and I'd rather avoid them). Move to the Components Page and add as your first component: H2O. Then add Methane, Ethane, Propane, i-Butane, and n-Butane. Finally add Nitrogen to the list, then close the fluid package window and enter the simulation environment. Add a material stream to your PFD, name it Methane. As the name probably suggested to you, we are going to start by assuming that the natural gas stream is entirely made of methane. Set the Stream as shown below (actually the Temp and Pressure don't matter much either to this example, do set the molar flow to 1 in whatever units you're in as that will making viewing the results easier):

Now make a stream called Steam. Set the temperature and pressure as you wish (as long as it stays steam). Set the molar flow to 3 for now. For the composition, you guessed it, 100% H2O.

The Logical Unit SET Place the Set Unit on your PFD between your two streams (if you take it from the Object Palette, it's the one that looks like a grey diamond with a green S in it -- you're surprised, aren't you. Go ahead, admit it. You would never have guessed which one it was). Sarcasm out of my system, go ahead and hold down the <Ctrl> button to toggle into Connect Mode and place your cursor over the two connection points on the Set diamond. One should say "Target Object" and the other should say "Source Object". Since we are using information from the Methane stream to set properties of the Steam stream, Methane must be the Source and Steam the Target. Go ahead and connect each point on the Set box to a green box on its respective stream (this is a logical Op so we use green connections rather than blue for material streams or red for energy). When you connect the target to the Set, a window will appear like the one below. For this example, choose Molar Flow.

You should have gotten a Consistency Error from this. This is because you actually inputed a value for the flow and then told Set to input a different value (you haven't finished with Set yet, so it is still using a multiplier of one and tried to set the flow to 1). HYSYS isn't sure which one to believe. Go ahead and open Steam's property view and delete the flow you entered before. Then, do not forget to go up to the toolbar and push GO to start the calculations up again, with the consistency error resolved. Your PFD probably looks something like this now

To fix the streams to look better, you can either select the Set with the right mouse button and choose transform and Rotate by 90, or you can select it (with the usual left mouse button) and push the number 3 which has the same effect. To move the SET-1 out of the way, push <L> (with the SET box still selected). This switches the selection to the label of the unit only.

Open the Set's Property View. Connections are all finished so switch to the Parameters Page. You can set the target to be any first order function of the source (basic Y = mX + b format).We want three times as much steam as methane, so set the multiplier to 3. We do not need an offset, so leave it as 0. Voila! We're done. If you open Steam now you will see a Molar Flow of 3 which is what we wanted. If you change the flow of Methane to 2, then Steam will automatically change to 6.

So much for the easy case, now let's move on to something more complicated. Create a stream called Steam2 and define it exactly the way you did Steam, though this time leave the Molar Flow field empty. Also create the following stream:

This is at least a little more representative of a Natural Gas stream (I still made up the numbers to be a little rounder). For this we need the flow of water to equal the flow of methane plus 2 times the flow of ethane plus 3 times the flow of propane, etc. Now to be honest, if we knew that the composition of the natural gas stream would be relatively fixed (with only the overall flowrate subject to adjustment), then we could still use the Set Op with a multiplier equal to 3*(.5 + 2*.3 + 3*.05 + 4*.025 + 04*.025) = 4.35 However, we are going to assume that either the composition may be subject to change or that I am trying to teach you something for your own good to use when an even more complicated situation arises. Therefore, we are going to solve the problem this time by using ...

The Spreadsheet Begin by starting a new spreadsheet (for once, it doesn't matter where you place it on the PFD). If you

are using the Object Palette, the button for the Spreadsheet is . Open the Property view, if it isn't already. We begin on the Connections Page by importing the variables we wish to work with. Start by pressing Add Import and making the selections in the window that appears as shown:

Press OK.. Then, import the rest of the Natural Gas component flow rates. When you have finished that go back and change each cell from A to B. Be careful with this part. HYSYS can be irritatingly unforgiving about this, so, in the future, you'll want to think carefully before deciding which cell you want each variable in as well.

Now, switch over to the Spreadsheet Page and add the text shown below.

The next step is to start entering formulas. You know that in MS Excel you start all formulas with an = . Here we start all formaulas with a + . In cells C2 through C6 enter the following cells respectively: +B2, +2*B3, +3*B4, +4*B5, +4*B6. Then, in cell B8, write "Total Carbon Flow" and in B9 "Required Steam Flow". In C8, enter +C2+C3+C4+C5+C6. In C9, enter +3*C8. When finished the spreadsheet should look like this:

Return now to the Connections Page (glance at the other two pages on the way). Press Add Export. Select Steam2 and then Molar Flow. After you have done so, change the cell to C9, to match the one we actually wish to Export. Again, POOF, we're done. Steam2 now has a flowrate of 4.35 as we expected.

You can develop much more complex expressions in the Spreadsheet. To get an idea of your options, take a look at the window that opens when you press Function Help ...

My Case Studies Example also demonstrates another use of the Spreadsheet.

Case Studies Example

This example will build on the simulation you made for the Chemicals Tutorial Case from Chapter 4 of the Tutorials Manual. You did complete that example, didn't you? Hint, hint, wink, wink, nudge, nudge. Well just in case you didn't, the example consisted of using a CSTR to react Propylene Oxide with Water to make Propylene Glycol, then separating that out as a product. Now we would like to explore that reaction a little more, from a plant design stand point. Utility costs, and other issues, are directly tied to the temperatures we use for various operations. In this case, the temperature we set for our reactor determines how much coolant is required and has a direct effect on how well the column runs, and of course, it has a critical effect on the reaction itself. Another big issue is Capital Costs. Since the general rule goes, the bigger the piece of equipment, the more expensive it is, we'd like to see how sensitive the reaction is to the size of the reactor. Now we could plug about 200 different combinations of temperature and size in by hand, but what would be the point when HYSYS has so thoughtfully provided us with a tool to do just that. It's called a Case Study (very similar to Sensitivity Runs in Aspen) and is available as part of the DataBook. Start by opening up the file you made from the Tutorial. If you do not have such a file you may start from my version entitled ChemicalsEx.hsc in my sample directory or use TUTORIAL3.hsc from HYSYS' sample directory located on the server HARTSOOK. When you begin, your PFD should look approximately like this

The first thing we should do is refresh ourselves on the current conditions, so open the Reactor's Property View. On the Worksheet Page, you can see that currently the entire contents of the reactor are exiting via Reactor Prods (Reactor Vent has zero flow) at 140 o F. Note that I am using the same Units Set that was used in the Tutorial (essentialy Field, with Liquid Volume Flow set to USGPM, but any Field based set should be fine for this example). On the Reactions Page, you can see that the current Liquid

reaction occurs in the liquid phase). Since we will be varying the liquid volume by changing the Liquid Level percentage and we like even numbers, go ahead and change the Vessel Volume to 300 ft3. Note that the Liquid Volume didn't change because HYSYS adjusted the liquid level to keep it constant. In general it is a good idea to be aware of your settings before running a case study as the Case Study will not return you to your original state afterwards. Perhaps, you might want to develop the habit of always making a record in the Data Recorder (also part of the DataBook) right before running your Case Studies. Go ahead and open up the DataBook now (under the Tools menu). On the Variables Page, you should see three variables already defined. One of these, Reactor Temp, we will actually use ourselves. We will need two more variables: the liquid level and the reaction conversion (conversion is a much better measure of the efficiency of a reactor than just looking at the flow or concentration of product in the product stream). Press Insert ... . The Variables Navigator will appear. Select Reactor from the Object List.

Perhaps, you've noticed our first problem. Yep, Conversion is nowhere to be found on that list of Variables. All right, we'll worry about that in a second. Let's go ahead and get the Liquid Percent while we are here. What's this! There are two variables called Liquid Percent: Liquid Percent SP and Liquid Percent Level. Well, the SP probably means "Set Point" which sounds like a Dynamics thing, not a Steady-State variable, plus the title of the variable we want to affect on the Reactions Page of the CSTR's Property View, called it "Liquid Level", so let's choose Liquid Percent Level (I'll show you later why this is the wrong choice). Blissfully, unaware that we just made a mistake, let us now proceed to doing something about the Conversion. See HYSYS just gave us that conversion as a little helpful bonus. It doesn't actually consider it a variable and heaven forbid you should actually want to use it for something. Therefore we must make our own Conversion calculation. And where do we get to make our own calculations? That's right girls and boys, the Spreadsheet (and your profs complain you don't pay attention -- Well, actually they complain that you don't come to class, but that is neither here nor there).

Begin by adding a Spreadsheet to the simulation ( on the Object Palette). We are going to do things a little differently from the way we did things in the SET example with the Spreadsheet. Instead of importing variables on the Connections Page, we are going to do it directly (sometimes it may take just as long though, because of all the windows you'll have to wade through to display the number you want). First we need the Molar Flowrate of Propylene Oxide entering the reactor. For that, double-click on the Mixer Out stream and switch to the Compositions Page. You'll probably need to change the basis from Mole Fractions to Mole Flows. Now make sure the Spreadsheet Property View is on the Spreadsheet Page

(yes, you'll need to push the little "pin" on the stream's window to switch out of Modal View). Now position your cursor over the 12C3Oxide's Molar Flow and using the secondary mouse button, drag the number to cell B2 of the Spreadsheet. You should see a Bull's Eye when you are over a place you may "drop" it. Oh, and make sure the Spreadsheet is also not in Modal View (push the little "pin"). 150.0000 lbm/hr in black should appear in the cell of the spreadsheet. Now repeat this process with the Molar Flowrate of Propylene Oxide of Reactor Prods and Reactor Vent into cells B3 and B4, respectively. Even though the vent is nominally empty, we need to include it on the off chance that some of the reactor contents do become vapourized. With the addition of the appropriate text, your Spreadsheet should now look like this (note, if you place an import incorrectly you must delete it from the Connections Page or using the secondary mouse button menu):

Now, in cell B6, enter the following equation: +100*(B2-B3-B4)/B2. All equations in HYSYS' Spreadsheet must begin either with + or, for certain functions it may begin with, @. For more information on the special functions and logical expressions you may use, press Function Help... or read Section 14.8 of RV2. The 100 multiplier is because we wish to express the conversion as a percentage. Speaking of which, go ahead and add for that cell the Variable Type: Percentage, and the Variable Name: Conversion. That's all we have to do for the Spreadsheet. When you are finished, the page should look like it does below (Note that the conversion, in red because it is a spreadsheet calculated value, is the same as we saw it on the Reactor's Property View). Go ahead and look at the other pages before you close the Spreadsheet window.

Return to the Variables Page of the DataBook and press Insert... .Pick the Spreadsheet as the Object and B6: Conversion as the variable (go ahead and change the Variable Description at the bottom to just Conversion). Switch to the Case Studies Page. Push Add to create a new Case Study. Remember our goal is to vary the reactor temperature and reactor size (done here by varying what percentage of 300 cubic feet need actually be filled with liquid) and observe the effect on the reactor's efficiency (i.e. the conversion). Now immediately, you should see we have a problem executing this plan. The Liquid Percent Level is not offered as an independent variable! This is the reason that that is not the variable we really wanted to use. If we had actually looked at the Dynamics Page of the Reactor, we would have seen that the same variable called Liquid Level on the Reactions Page, was called Liquid Level SP there. Since it is the same variable, despite the slightly different nomenclature, HYSYS will change one when it changes the other. Therefore, that is the variable we truly wanted. Go back to the Variables Page, highlight the Liquid Percent Level Variable, and press Edit... . Change the variable to Liquid Percent SP and select OK. Now we are finally, finally ready to set up the Case Study (normally it is not at all this much of an ordeal). Go back to the Case Studies Page (actually you might first want to make a recording on the Data Recorder Page, as that is a good habit to get into. Remember that HYSYS does not return you to your original settings after completing the Case Study). Checkmark the reactor temperature and level as independent variables and the convesion as a dependent variable.

Push View... to open the newly created Case Study's Property View. Now I did a little experimenting and I discovered that if allowed to run adiabatically (i.e. no coolant added), the reactor heats to 235o F. However, you the boiling point of the mixture is around 228o F. This means that if you went so far as to run with no coolant, you would lose product out the vent (never a good thing). Therefore we want our maximum temperature to be less than 228o F. As you shall see 200o F is more than sufficient for an upper bound. For a lower bound on temperature, let us take the first temperature we were given to try in the example, 75o F. Choose a step size of 5o for a nice continuous curve. For the liquid level, varying from 20% to 100% by 10% steps should be more than sufficient.

Before pushing start (and you could at this point), there is one thing I would point out to you. If you've worked with Aspen, you've probably done Sensitivity Runs. Where the sensitivity runs only solve as much of the flowsheet as they need to to get all the dependent variables, Case Studies in HYSYS apparently solve the entire flowsheet every time. In this case that would mean running an unnecessary column 234 times (from the Number of States in the upper right corner). To shorten your simultation time enormously, open the column's Property View. On the Parameters Page, checkmark the box that says Ignore column during calculations. The column should turn yellow, and you may close its window. Now press Start on the Case Study.

Push the Results... button, and make sure it is set to Graph instead of Table. You should see a nice, pretty 3 dimensional graph of Conversion vs. temperature and size.

You may see one, as in my graph, or even two anamalous points. Don't ask me why, but occaisionally HYSYS screws up somewhat on these Case Studies. When I went back and entered by hand of 200o F and 20% SP, HYSYS still gave me zero, until I walked the SP down from thirty in steps. At that point, HYSYS finally gave me the value 98.10, which it should have been giving me all along. Again, I don't know why, I'm just reporting what I saw and warning you to be aware that the data you get may possibly be buggy. I have always been able to get HYSYS to give the correct answer after a little fiddling, though. Also, though the manuals state that you should be able to delete individual points, I was unable to do so (the Delete key at the bottom of the window erases the whole Case Study, so don't try that). We're done with the example. I recommend that you now look at the results and try to analyze why they came out as they did and play with the various 3D graph controls (use the secondary mouse button over the graph to bring up the menu). A bit of advice, occasionally I have seen HYSYS crash when I tried to get a cross-section (plane cutting) of either XZ or YZ planes. Later, I would come back and it would work just fine from then on, but I recommend saving your work before ever trying that, just in case. You may also want to try a two dimensional case study, Coolant Duty vs. Reactor Temp. It's easy, because the variables are already defined, and it's informative. I have included this second Case Study in my file containing this completed example, CaseEx.hsc in my SAMP403 directory under \\Hartsook\Hysys.

General Balance Example

This is an example of an interesting use of the General type Balance Operation. Start by making a new file in HYSYS (you can also see my completed file called GenBalEx.hsc, but you really should make your own). Choose PR for your property package and choose for your components the first five on the list (Methane through n-Butane). Then enter the Simulation Environment. We are going to create three streams to play with. Therefore, go ahead and place three streams on the

PFD and a Balance Operation (from on the Object palette). Connect streams 1 and 2 as inlets and stream 3 as an outlet (remember holding <Ctrl> toggles into Connect Mode). We will let stream 1 be completely defined. Give it a temperature of 200 F and a pressure of 1 atm (doesn't matter too much, I just want to avoid regions of strange behavior). Set the Molar Flowrates of the first three components to 1 and the rest to 0. For stream 2, set the temperature and pressure to be the same as in 1, but this time set the Mole Fraction of the last two components to .5 each. Leave the Molar Flowrate of the stream <empty>. For stream 3, set the pressure to 1 atm but leave the temperature blank. Even though we know it should be 200 F, it is good to leave HYSYS a dumping ground for the energy balance in case things screw up. For the Composition, set the Molar Flowrate of the last two components to 1 each but leave the other cells <empty>. See below.

Unfortunately, this action had more of an effect than we desired. Switch back to the Conditions Page of stream 3 and notice that the Molar Flowrate of the stream has been set to 2. This is bad because we expect that when the balance is done, the first three components enteringthe system through stream 1 must exit again through stream 3 (so the flowrate had better not be set to only 2). This kind of potential overspecification will always occur when you use individual component flowrates for stream specification without specifying the whole composition, so always remember to go back to the Conditions Page and delete the Molar Flowrate. Like so

Now open the Balance Property View and choose General for the Type. The block should turn yellow. All that is left is for you to check the Auto Calculation button. You got a Consistency error, right? Sometimes when your pushing the boundaries of what HYSYS can handle, you'll get these even when you are really alright. I think this has to do with the order things are calculated in.

Just close it and push Go on the toolbar up top. Everything's fine and you'll see that HYSYS calculated everything correctly. The flow of stream 2 is 2 and the flow of stream 3 is 5. You'll notice, though, that the 5 is in blue, normally reserved for user inputed numbers, not solved for numbers (just another sign that we are giving HYSYS headaches).

Note that the temperature is in black and that it's just a tad off 200. HYSYS actually would have let us define the stream ourselves as 200, this small a difference is not enough to call up a consistency error. The Composition of stream 3 is also interesting in that if you look at in Molar Flows, it still only shows the two 1's that we inputed and leaves the other cells <empty>. However, if you look at the Mole Fractions, it shows all 5 as .2 which is what we expect of course.

Conversion Reactor Example In order to save time and make it possible for you to campare the results of the various reactors, this example will begin by using the same components and reactions that were employed in the Plug Flow Reactor Example. It is recommended, but not necessary, that you work through that example first (or at least glance at the component list and reactions). If you do not have a version of your own of that example from which to start this example, I have made available a completed version of that example entitled PlugFlowEx.hsc located in the \\Hartsook\Hysys\SAMP403 directory. There is also a file containing this and all other completed reactor examples called AllReactors.hsc in the same directory. To begin we must first define our conversion reactions. Go to the Simulation Basis Environment. On the Reactions Page of the Simulation Basis Manager, push the button marked Copy Rxn ... (why bother entering stoichiometry again when we've already set it up for the Plug Flow). In the window that appears, highlight ReformingLH or whatever you called your reforming reaction and change the reaction type to Conversion and press Copy Reaction. When the new reaction appears, change the name to something more descriptive like ReformingConv.

Now move to the Basis Page and set the conversion to 100%. This is of course totally unreasonable for this reaction, but we are more concerned with learning how the conversion reactions and reactor work.

Copy the Water Gas Shift reaction now (or enter it from scratch) as a conversion reactor. Name it WGSconv and give it a conversion of 100% as well for now. Close the reaction windows and return to the Basis Manager. Push the Add Set button and fill the set out as shown.

You may have noticed a button that was never there before when we looked at reaction sets. Go ahead and push the Ranking button now.

Set like this the two reactions will be evaluated simultaneously. Had we wanted one reaction to come first, we would set the other reaction's ranking to 1. Go ahead and leave it as is and choose cancel or accept (not reset, I'll tell you why later, but when you do your own projects I recommend pushing reset first). You may also close the reaction set window. Back again on the Simulation Basis Manager, highlight the reaction set you just created and push Add to FP as we must associate the reaction with our fluid package before it can be used in the flowsheet. There should be only on fluid package listed (if there is more than one, pick the one that is used on your main flowsheet). Select it, then push Add Set to Fluid Package. The completed Reactions Page of the Simulation Basis Manager should look like this:

You may now return to the Simulation Environment.

To set up the conversion reactor (the only one capable of handling conversion reactions, by strange and mystical coincidence), we need to first place it on the Process Flow Diagram (PFD). This may be done from the Unit Ops Menu or from the Object Palette as shown below

opens

then,

Add a couple material streams and connect them as shown (remember the <Ctrl> button is great for quick connecting as it toggles you in and out of Connect Mode).

Since we simply want a copy of the feed stream to the Plug Flow, go to the Utilities Page of the FeedC Property View. Press Copy Stream Specs From ... and choose Feed. Now, all that is left is to specify the reactor. Open its Property View. Remember, by not attaching a heat stream, it is assumed adiabatic (to make it isothermal, you would need to attach a heat stream and set the Temperature on the the product stream the same as the inlet). On the Parameters Page you could set a pressure drop across the reactor, but for this example, leave it at zero. Switch to the Reactions Page and attach the Conversion Reactor Set.

See that HYSYS requires you to attach another product stream. That is because for these reactions to go to the specified conversions adiabatically, the product must exit at -7 deg Celcius and all the water is liquid (told you it was unrealistic -- also note that the thermo package is unable to predict the formation of ice, I doubt any of them could). Go ahead and attach a liquid product stream and call it LiquidC. Looking back at the Conversion Reactor Property View, you should see a couple things on the Reactions Page that strike you as decidedly odd. Most strange is the ranking. Though we left them both as zero, here we see a zero and one. Looking under Reaction Rank in Section 11.4.2 of RV1, we see that HYSYS will assign default ranks to multiple reactions based on reactants and products. Because CO is a product of the Reforming reaction and a reactant in the Water Gas Shift reaction, the Reforming reaction is set by default to go first. The problem, of course, is that HYSYS did not show us this as the default when we opened the ranking window from the basis environment. This is another BUG in HYSYS. The workaround is of course to push the Reset button in the ranking window first to see what HYSYS is really going to give you (I told you not to push it before because I wanted you to see the error). Whether or not you plan on changing what you see when you first bring up that window I suggest you go ahead and Reset. For this example, since we've already run it sequential, we might as well analyze this ranking arrangement first. The other thing that might have struck you as odd is that, though both reactions have a specified conversion of 100%, only the reforming reaction has an actual conversion of 100%, the WGS reaction has an actual conversion of 202%! This is because the specified conversion tells HYSYS how much to react of what is present when the reaction begins. The actual conversion, on the other hand tells you what percentage of the original amount present is converted. In our example, all the methane is reformed, making CO and H2. Then, the reforming reaction starts. It is told to convert 100% of the CO present, which turns out to be a little over twice what was there before the reforming reaction and thus that is how much is converted. Had the ranking order been reversed or the same (as we had originally assumed it would be), both actual conversions would have been 100% and all the CO generated in the reforming reaction would pass through to the product stream. There are other conditions that can cause a difference between specified and actual. If the base component is the product of an earlier reaction and there was not any initially present, the actual conversion field will remain blank. Conversely, if the base component of a reaction is a reactant in an earlier occuring

reaction, or if there are limiting reagents, the actual conversion will be less than the specified conversion. We did not run into the limiting reagant problem because there was enough water present initially to totally convert both reactions. You can adjust the ranking and experiment for yourself by opening the Reaction Package under the Flowsheet Menu. I don't know about you, but I don't feel comfortable leaving the temperature in negative degrees Celcius. Let's go ahead and switch the reactor from adiabatic to isothermal. To do that you must first attach a heat stream to the reactor.

Of course, the reactor becomes unspecified again. Go ahead and open the Property View of ProductC and set the temperature to 350 deg C. The temperature of LiquidC is constrained to equal the temp of ProductC, so it will automatically follow suit. The reactor is again specified. Note that, of course, the total molar flow of each component out of the reactor has not changed, though the liquid stream has dried up and shows zero flow. Note that you did not actually set the reactor to an "isothermal" setting. If you want the product to always exit at the same temperature at which it entered, you will probably need to use the logical operator Set.

Gibbs vs. Equilibrium Reactor

In order to save time and make it possible for you to campare the results of the various reactors, this example will begin by using the same components and reactions that were employed in the Plug Flow Reactor Example. It is recommended, but not necessary, that you work through that example first (or at least glance at the component list and reactions). If you do not have a version of your own of that example from which to start this example, I have made available a completed version of that example entitled PlugFlowEx.hsc located in the \\Hartsook\Hysys\SAMP403 directory. There is also a file containing this and all other completed reactor examples called AllReactors.hsc in the same directory. The Gibbs Reactor We will begin by installing the Gibbs Reactor. Set up your Process Flow Diagram (PFD) like you see below (remember the <Ctrl> button is great for quick connecting as it toggles you in and out of Connect Mode). The Gibbs Reactor is available from the Unit Ops menu or from the Object Palette by pressing the General Reactors button

which opens this menu

. Press

for the Gibbs Reactor.

Note that it is not necessary to attach a liquid product stream to the reactor. All of the reactors may be run with only one product stream (vapour or liquid). Should both phases be present in the product and only one or the other product stream available, HYSYS will tell you it needs another product stream. At that point, you must add another stream, but do not be dismayed. Remember, you can always mix them back together again. Also note that you may add an energy stream to the reactor. That we have not indicates that we intend the reactor to be adiabatic. Since we desire the Gibbs Feed stream to be the same as the Plug Flow Feed stream, the easiest method is to double-click on the Gibbs Feed, opening the property view, and switch to the Utilities Page. There, press the button marked "Copy Stream Specs From ..." and choose the Plug Flow Feed stream.

You'll find that this is all that is required for the Gibbs reactor to work. If you so wished, you could now open the reactor's property view and add a pressure drop on the Parameters Page. You can also switch to the Reactions Page where you will see a couple more options. Currently selected should be Gibbs Reactions Only. This is the choice that gives total equilibrium of all components (excluding those labeled

the option that allows you to attach an equilibrium reaction set. We shall return to this option later in the example. The last option is to have No Reaction occur at all. The reactor then would simply act as a separator (provided both vapour and liquid product streams were connected). Changing nothing, however, we find our product stream looks like this

Note these are extremely different results than we obtained in the Plug Flow Example. The main difference is that where in the PFR the reforming reaction was not occuring, here it is occuring in great quantity, backwards. At this temperature, the equilibrium is to the left (something we did not even allow for in the kinetic equations we defined for the reforming reaction), and methane is formed in what is called the Sabatier reaction (same reaction, two names, go figure. We are ready to start putting in the Equilibrium Reactor. The Equilibrium Reactor We cannot install a working equilibrium reactor without first creating the reactions it will use. Therefore the first thing you must do is enter the basis environment. On the Simulation Basis Manager, switch to the Reactions Page (close any other windows that might have been left open there). Before continuing any further, if they are not already, I suggest that you change the names of the existing two reactions to ReformingLH and WGSkin for consistency with my examples and to prevent confusion later (you will begin to collect many very similar reactions). You should also probably change the name of the reaction set containing those reactions to Kinetic. That completed, your window should look something like this

Now, in the Reactions Sub-Group, press the Add Rxn ... button. Choose Equilibrium Reaction and name the reaction that appears ReformormingEq. Since this is a very common reaction of interest, before beginning to fill out coefficients we will check the Library Page to see if it is already stored in HYSYS. Luckily for us, it is, as no one was kind enough to provide us with any equilibrium data on this reaction. As you can see it is second on the list and the Water Gas Shift reaction that we will be adding next is first.

Highlight the reforming reaction and press the Add Library Reaction button. You will find the reaction is now completely defined. HYSYS inputed for you a table of Keq vs. Temp values (from which it also fitted the equation it uses to interpolate and extrapolate -- speaking of which, be aware of the temperature range of the table from which HYSYS will draw its information). To learn more about ways of inputing your own data into the form read the section on Equilibrium Reactions back on my Reactions page or Section 11.3.3 of RV1. Now that we are done with the reforming reaction, close this window and add a new equilibrium reaction called WGSeq. Again, go to the Library Page and choose this time the first reaction on the list. Close the window of the completed second equilibrium reaction.

Our next job is to create a reaction set for our two new reactions. Though, HYSYS will allow you to put kinetic and equilibrium equations in the same reaction set (see the General Reactor), you could not put these in the same reaction set with the others because they refer to the same two reactions (evaluated in different ways). Create a new reaction set from the reactions page of the Simulation Basis Manager and call it Equilibrium. Add the two reactions you just created to the active list. It should now look like this:

Close the window. Back again on the Simulation Basis Manager, highlight the reaction set you just created and push the Add to FP button as we must associate the reaction with our fluid package before it can be used in the flowsheet. There should be only on fluid package listed (if there is more than one, pick the one that is used on your main flowsheet). Select it, then push Add Set to Fluid Package. The completed Reactions Page of the Simulation Basis Manager should look like this:

Note the Assoc. Fluid Package box only shows those Fluid Packages associated with the highlighted reaction set. You may now return to the simulation environment as we are ready to install the equilibrium reactor.

The Process "Switch" Rather than simply create another feed stream for the Equilibrium Reactor copied from the PFR or Gibbs Reactor, let us assume that you wish to compare the results of the two different reactors on the rest of an involved process. You could simply use Save As to make a copy of the file and substitute one reactor for the other, but that makes comparison of results difficult and cumbersome. You could also use the Logical Operation Balance to dynamically copy the feed to one reactor to another stream which would then become the feed to the other reactor. That way you can have the upstream of the plant duplicated to both reactors on the same flowsheet. Unfortunately, to get the downstream part of the plant, you would have to copy every stream and unit, a difficult prospect in itself, which would clutter your PFD, and then you would have to make every future adjustment to the downstream section twice, a tedious business at best and heaven help you if you have a downstream stream affecting an upstream stream. Basically, this option is out for any but the simplest of flowsheets or unless you only care about the immediate output after the divergence. Your last, and I think best option (though there are times when a Save As might well be the most expedient solution), is a technique which I find HYSYS well suited to take advantage of, but which I found curiously missing from the manuals. I call it the Process "Switch". It takes advantage of a lesser used option in the preferences allowing you to make multiple connections to the same stream and the ability of HYSYS to "ignore" unit operations without you deleting them. Therefore to start, open the Preferences from under the Tools menu. On the first page, marked Simulation, check the box marked Multiple Stream Connections. You may then close the Preferences window.

Since there is no point tempting fate by upsetting HYSYS and to make things clearer to you, we will go ahead and make HYSYS ignore the Gibbs Reactor. Open that reactor's property view and switch to the Parameters Page. Check the box that says Ignore This Unit Op During Calculations. The reactor should now turn yellow and the product stream to a pale blue, indicating it is not solved. It is time to place the Equilibrium Reactor on the PFD. Either do so from the Unit Ops Menu or as follows from the Object Palette.

Push

which opens this menu

. Press

for the Equilibrium Reactor.

Your PFD should look something like this:

Now from the Equilibrium Reactor's Property View, go to the Connections Page and for the Feed stream, go to the drop down menu and choose FeedG or whatever you called the feed to the Gibbs Reactor (if you had not already changed the multiple streams option in the preferences, that feed stream would not be a listed option). Now if you were to go right to the Vapour Outlet and attempt to connect ProductG, you would get this error:

I believe this is due to the similarity of the two units you are trying to "switch" out. When I tried this first with a Gibbs Reactor and a PFR, I did not get the error. There is an easy way around it, however. Simply

attach a valve with zero pressure drop (don't forget this) to the Equilibrium's Vapour Outlet, then in the valve's property view, set the outlet to be ProductG or whatever you called the Gibbs Outlet. Note: When I was experimenting with the "switch" and the PFR, the PFR began having trouble doing its integration and I was forced to set the segment initialization to Re-initialize for it to work. When you are finished connecting, your reactors should look like this:

Now all that remains is to specify the Equilibrium Reactor. All you need to do is open the Equilibrium Reactor Property View, move to the Reactions page and attach the Equilibrium Reaction Set. HYSYS will do the rest.

You may now switch back and forth between the two reactors. I recommend that you try to have one of the two "ignored" at all times (though in this simple case nothing crazy happens and you should observe what happens if you break this "rule"), thus you would start a "switch" by going to the Parameters Page of the Equilibrium Reactorand setting it to be ignored. Then go to the Gibbs Reactor and remove the command to ignore. If you examine the product stream as you are switching back and forth, you will see that the results of the two reactors, as they are currently configured, are almost identical. This kind of confirmation is good to see as the reactors go about this calculation in completely different ways. You can see this for yourself by going into the reaction manager and changing one of the equilibrium reactions (or a copy) to have a fixed K of, say, 1. (I leave it to you to remember how to do it). You will then find that while the results for the Equilibrium Reactor change drastically, the Gibbs Reactor continues to give the same "correct" values. This same technique can be used later to show that when an equilibrium reaction set is attached to the Gibbs Reactor, that it is truly only taking the stoichiometry info. Another important thing to note about the similar results is that the thermodynamic property set we are using is Antoine. This is one of the thermodynamic packages that has essentially ideal vapour and liquid phases. You'll find that if you change your thermo package to one of the non-ideal ones, like PengRobinson, that the results of the Gibbs Reactor begin to diverge from those of the Equilibrium Reactor (remember the equalibrium reactions set Keq as a function of T only). More so in other examples than this one. (You may also have noticed that for whatever reason, the PFR takes a lot longer to re-calculate in Antoine than in PR). To see a case where the difference caused by the thermo package is more severe see the file called methpuz.hsc in \\Hartsook\Hysys\SAMP403.

Now we are ready to experiment with attaching reactions to the Gibbs Reactor. Open its property view and go to the Reactions Page. Switch the Reactor Type to Specify Equilibrium Reactions. Try attaching one of the reaction sets to the reactor. You probably were not suprised to see that you could not select the Kinetic set, but you might have been suprised to discover that you also could not attach the Equilibrium set! Located down at the bottom, in the Trace Window, is this explanation:

"There is no need to specify reactions if all of them are equilibrium type. Gibbs Reactor will take care of attaining equilibrium by itself" Remember that in the standard setting on the Gibbs Reactor, the reactor will solve for the equilibrium of all possible reactions (element balance is maintained). As it turns out, with the limited number of components in this example, the two reactions we are exploring compose the entirety of possible independent reactions. HYSYS will not allow you to attach a set containing both reactions as it could accomplish the same thing better by simply forcing you to choose Gibbs Reactions Only. Frequently, however, you do not want all possible reactions to go to equilibrium. Suppose instead you wish to model a system that normally does not go to equilibrium quickly (there is a large activation energy). You, however, know that there is a catalyst which will lower the activation energy for the reaction you want and only the reaction that you want. You know that eventually a PFR will be used, but for whatever reason, you do not wish to model one yet. It is sufficient to assume that the Plug Flow would sufficiently near equilibrium that you may model the reactor as if it went all the way to equilibrium. In a case such as this, you would want to use an Equilibrium or Gibbs Reactor with only the one reaction attached. This is the time to use the Specify Equilibrium Reactions option in the Gibbs Reactor. For this example, we must first de-activate one of the reactions in the Equilibrium Set before we may use it. Let us assume that we wish to focus on the Water Gas Shift reaction and expect to see little or no Reforming (at the temperatures we are operating at, a not unreasonable assumption). Under the Flowsheet menu, select Reaction Package. This will open a window showing the available reactions and reaction sets. Double-click on Equilibrium and its window will open. Highlight ReformingEq and push the Make Inactive -> button.

Note that in my file AllReactors.hsc, instead of de-activating the reaction from Equilibrium, I made a new reaction set called GibbsEquil, which I set up with the one equation active and the other equation inactive. Now, attach the modified reaction set to the Gibbs Reactor. It should work without a hitch. (Note that if you attempt to use the Composition Page now, the reactor will automatically revert back to Gibbs Reactions Only). Compare the results you get now with the results from the Equilibrium Reactor using the same reaction set. Yet again they are almost exactly the same.

Two final notes: 1. Unless you are given specific Equilibrium data to use, your results are more likely to be accurate using the Gibbs Reactor than with the Equilibrium Reactor. 2. When defining Equilibrium Reactions realize that you may choose to have HYSYS determine Keq from the Ideal Gas Gibbs Free Energy Coefficients. This is nearly the same as what it does with equilibrium reactions in the Gibbs Reactor. The difference is that Gibbs will take in non-ideal effects from the thermodynamic package whereas the equilibrium reaction so defined will remain for the ideal case.

Tools and Tricks On this page I will introduce you to the various tools and tricks that exist to help you make important decisions about your plant and to help you work as a team. This Page will cover the DataBook, the use of template subflowsheets, and my process "switch".

The DataBook The DataBook is a tool that lets you record and explore the effects of changing parameters in your flowsheet. It is especially useful for fine tuning individual units and for optimizing your entire plant. The DataBook has 5 pages, the first of which is the Variables Page, where you will define the variables to make available to the other pages. There is another page, called Strip Charts, that you will not need unless you enter dynamic mode (which you won't need for 403 or 404), and therefore will not be discussed here. That leaves three pages, three tools. These are the Process Data Tables, the Data Recorder, and, I think the most important one, the Case Studies. The Variables Page Before you can use any of the tools in the DataBook, you must first establish here which process variables you intend to observe or vary.

Use Insert... to add a new variable to the list (the new variable will be added above the selected variable), Edit... to, well, edit the selected variable's name or the very choice of process variable itself, and Delete should be obvious. You can choose any process variable to add to the list (see my Case Study Example to see one of the few exceptions I have found). Pressing Edit or Insert, will cause the Variable Naviagator to appear. Choose the process variable you want from there. The Process Data Tables If the process variables in your simulation are like all the various goods in a grocery store, than the Process Data Tables are like your grocery basket in which you pile only those variables from around the store that you wish to monitor. Essentially, you just tell the DataBook which of the Variables defined on the Variable Page you wish to show in the Tables and the Process Data Tables will always show the current values of those variables. It's a good way of assembling information from all over the flowsheet into one, easy to

view, place. All of the tutorials in the Tutorials Book show examples of its use. Important: At the time of this writing, the version of HYSYS we are using (ver. 1.2.11) has a bug in the Process Data Tables. No matter what units it says it is displaying, HYSYS is actually displaying the variables in its internal units. Thus, at the moment the Tables are not really of much use, but it should be fixed in the next upgrade. The Data Recorder Like with the Process Data Tables, the Data Recorder make work with any of the Variables that have been defined on the Variables Page. The purpose of the Data Recorder is to provide you with a way to keep a record of your values even after you have changed your simulation, much like taking a snapshot. It is good for making a benchmark and watching your progress, as well as giving you a record of which combination of parameter values gave which results.

If you wish to delete an individual entry, delete its title. If you press the Delete button at the bottom, it will delete the whole Scenario and there is no way of getting it back without repeating the whole chart all over again. You will find examples of its use in any of the tutorials in the Tutorials Book. Case Studies I think the most useful of the DataBook tools, the Case Study allows you to quickly vary key process variables across a range and observe the effect on other key process variables. While you may choose any number of independent and dependent variables for the Case Study, HYSYS will only plot a maximum of three variables at a time. One independent variable and one or two dependent variables make a 2D graph and two independent and one dependent variable make a 3D graph. Should more dependent variables be included than the one or two allowed for plotting, HYSYS will use for the graph the first one or two dependent variables that are checkmarked Active on the Display Properties Page of the Case Studies Setup. Check out my example where I show you in greater depth the uses and limitations of the Case Study.

Templates and Sub-Flowsheets Templates and their use as Sub-flowsheets are going to be the key to your group working as a team on design. This will be especially true when you get to CENG 404 where you will be designing an entire plant. You will find, especially in 403 that it is far too easy too let one or two people in the group do all the simulation work. Don't be tempted, because when you get to 404, it is far too much work for any one or two people to do. You will be glad if everyone in your group got good practice simulating reactors, columns, and heat exchangers (as well as all the other ops you will use) back in 403. Now, since it is so easy for one person to claim a flowsheet, because he or she did so much work on it that he or she is the only one who knows enough about what is going on to work on it, you must find ways of either sharing the work or splitting up the flowsheet. Of course, you could just agree to only work on the flowsheet when everyone is present and hover over one computer (which might actually work well for 403 if your schedules match well enough). However, you don't get any division of labor that way. If two people do want to work on the simulation at the same time, you have to use Save As to make a copy and then there is no way to recombine the work, so one person's changes must all be scrapped or laboriously transferred over to the other file at the end. There is another option, but it requires a little forethought. You've seen how when you open the Property View of a Column, you have the option of entering its Column Environment. Therein you see the column has its own PFD with streams and units that may be hidden from the main flowsheet. There are two other kinds of sub-flowheet besides that of the Column. They are the templates that you import in and the subflowsheets that you create in-situ. Once they are installed there is absolutely no difference between them (unlike with the column, which does have a slightly different form of environment). A template is created just like any other case (in fact, any simulation can be converted to a template to be used in another simulation). The only difference is that a little more information is needed to guide HYSYS in transfering info between the main simulation and the "black box" that is the Sub-flowsheet. It is a very modular way of doing things. Even if you don't need to reuse a section of plant or use it another simulation, the templates are a great way of breaking a complicated flowsheet down into more manageable chunks. The best part, of course, is that templates are separate files and thus solve your problem of working as a group. One scenario could be to assign a section of plant to each person or a pair of people and then set someone to coordinate them and put together the main flowsheet (this means a lot of deleting old templates and then reloading and reconnecting the updated templates, but it is still the easiest way of putting people's work together).

The above PFD is only an illustration to give you an idea of how you might split up a plant. A real, working PFD would doubtless have other units on the main flowsheet and at least a few few more and possibly many more energy streams connecting sub-regions. Not as many as you might think, however. One of the biggest demands for cross-regional interaction is for heat exchangers and HYSYS already has taken care of that. HYSYS allows you to place the tube side of a heat exchanger in one sub-flowsheet and the shell side in another. Thus, there could in fact many streams exchanging energy with each other between flowsheets and it does not clutter the main flowsheet up (but you might consider making adding text beside each such heat exchagner to remind you what the other half is without having to open a property view everytime). I have made a quick demonstration of splitting a heatexchanger between to sub-flowsheets. There is also an excellent example showing how it can be done between the main flowsheet and a subflowsheet with a refrigeration loop in Section 15.3.4 of RV2.

There are some other issues that must be dealt with when using sub-flowsheets. One of the best features that the separate environments have is the ability for you to use different fluid packages in each subflowsheet or column flowsheet from the one used for the main flowsheet. For instance you might want to use an EOS for a Natural Gas Reforming Section and a thermodynamic package more suited for VLE or LLE in the Separations Section or Columns. Just removing components from a fluid package in areas they are not needed will reduce HYSYS' convergence time. Of course, with the ability to use different property packages in different sections of the plant, the problem of passing information from one region pops up. You know that any two of Vapour Fraction, Temperature, Pressure, and Enthalpy, plus the Composition of the Stream is enough information for HYSYS to flash the stream and find the rest of the information. You should expect that the same two parameters in Peng-Robinson will give different results for the rest of the variables then if the thermo package were Antoine (an essentially ideal package). So if you need to pass a stream from a flowsheet using PR to one using Antoine or vice versa, it becomes important to decide which pair of parameters should be used to flash the stream on the other side. That's what the Transfer Basis is for. On the Transfer Basis Page of the sub-flowsheet Property View, next to each stream, you may pick one of the following choices for a transfer basis:

P-H Flash - Pressure and Enthalpy Passed (Not Recommended)

T-P Flash - Temperature and Pressure Passed VF-T Flash - Vapour Fraction and Temperature Passed VF-P Flash - Vapour Fraction and Pressure Passes None Required - Nothing passed. Normally used for energy streams, though if used for material streams, will still pass composition (though suprisingly not flow) User Specs - User Specified (to the best of my knowledge, essentially the None Req'd when actually intended for use with material streams)

I have prepared an example demonstrating the importance of choosing the correct Transfer Basis.

You've probably noted that I have yet to discuss or include in my examples, the means by which you should actually go about making a template. In my examples, I had you create blank sub-flowsheets to build on within your cases. When you actually are working on your projects, this is NOT the way you want to do things. If you start with a blank sub-flowsheet there is no simple way to turn it into a template (there is a work-around which I will discuss later but it is not pleasant either to do or work with later). If, on the other hand, you were smart and divided your plant up into pieces early on, you could build the pieces separately as templates or as separate cases (which may be converted into templates) right from the beginning. Even if you started by placing everything in the main flowsheet, you are still good because you can save the file under a new name then delete everything but what you want to put into a sub-flowsheet and then convert the case to a template. To show you how this may be done, I am putting a short example right here.

TEMPLATE EXAMPLE Start with ChemicalsEx.hsc in my sample directory or TUTOR3.hsc in HYSYS' sample directory (they are the same thing). It was the one that looked like this

The first thing you must do is save the file under a new name (you shouldn't be able to write to either directory anyway). Now, let us pretend that this flowsheet represents not an entire process, but merely a section of the plant we wish to model. We'd like to convert this case into a template. To do that, go to the Simulation Menu and choose Main Properties. Here you can change the name of the case or its tag, or, on the Notes Page, you can write the description that appears next to the file name in the Open dialog window. However, we are here for the button at the bottom.

Press Convert to Template. After HYSYS asks for confirmation and you approve it, HYSYS will close the case you were working on (it will ask if you want to save it first) and leave open the newly created template. The template, of course, looks the same as the case except that the file name at the top shows the extension .tpl instead of .hsc and some new pages have been added to the Main Properties window we have been working with.

On the Exported Connections Page, you have a number of options for the default values connected with the template when you import it as a sub-flowsheet. At the top you may choose the tag it will receive in the new flowsheet and whether the default property package should be that of the template or that of the simulation it is imported to. You can, of course, change the property package of any sub-flowsheet after it has been imported from the simulation basis manager. You can also affect the name of the streams as they will appear on the sub-flowsheet's Property View to be connected with streams on the main flowsheet and the transfer basis of each stream. Let us put to use the concepts I taught in my transfer basis example and pick the transfer bases for these streams. The None Req'd type is fine for our energy streams, but you'll remember that P-H Flash is definitely not good for the material streams. The two material feed streams were defined by specifying their temperature and pressure, so they should probably be set to T-P Flash. The three streams exiting the column are all from the condenser or reboiler and are saturated vapours or liquids. Therefore, they should be set to VF-P Flash. In general, all direct product streams from a column should be set to either VF-P or VF-T Flash. The last product stream, the vent from the reactor is also the result of a flash separation. Moreover, it had its temperature set directly (via the stream Reactor Prods) and so should be set to VF-T Flash. Note that the choice of T or P is much less important than the choice of Vapour Fraction as the other passed parameter in these cases.

You are now ready to install the template as a sub-flowsheet in another simulation case. I hope the information I have imparted to you makes it easier to turn your projects into real team efforts. Oh, one last thing on this. If it should happen that you created a subflowsheet from scratch that you really want to turn into a template, the work around is to save the file under a new name, eliminate everything from the flowsheet except the sub-flowsheet and the streams directly connected to it. Then, turn

this into a template. This process adds another level of depth (and irritation) between the areas you want to work with, but it does work.

The Process "Switch"

This is one trick that is not mentioned anywhere in the HYSYS manuals, but it works regardless. If you've gone through my Gibbs/Equilibrium Reactor Example than you've already seen what it can do. Essentially there is a way in HYSYS to choose one or another "path" for a flow. Somewhat like a switch in a railroad track that sends the train to another destination, you can send a stream to more than one unit operation or section of the plant to evaluate how they compare to each other and then merge the "tracks" on the other side to see the effect downstream in the plant of using the one over the other.

This is the picture from the example I mention above. You see how the stream appears to diverge then reconnect. The stream is not actually splitting and mixing. It must go one way or another. In the picture the Equilibrium reactor is active and the Gibbs reactor is Ignored, but it can be switched easily. To see the process of setting up a switch, see my example.

Heat Exchangers and Sub-Flowsheets

This Example is exactly like the Heat Exchanger Example in Section 13.7.2 of RV2 with the addition that it will now take place across flowsheets. Start a new case. Choose ASME Steam for the property method and H2O as the only component, then enter the main simulation environment.

On the PFD add two blank Sub-flowsheets ( on the Object Palette). Make sure you choose the Start With a Blank Flowsheet... Option. On the Property View of the first Sub-Flowsheet, press SubFlowsheet Environment... . Now that we are in the Sub-Flowsheet environment, we will begin by placing the tube side of the heat exchanger. Place two material streams on the new PFD. Label one Tube In and the other Tube Out. Tube In should be defined as shown below. The Mole Fraction of H2O should, of course, be 1.

Now add a Heat Exchanger ( on the Object Palette), and connect the two streams as I have shown below. If you want the same icon I have used, Object Inspect the heat exchanger using the secondary mouse button and pick Change Icon from the menu. Otherwise, just make sure you connect the streams to the Tube side.

Press the up button in the toolbar to return to the Parent Environment. Now enter the Sub-Flowsheet Environment of the second sub-flowsheet, FLOW-2. Create two material streams: Shell In and Shell Out. Shell In should be at 90o F, 100 psia, 4000 lbmol/hr of water. Now we could go back to the other subflowsheet to connect these to the heat exchanger there, but just to show you that HYSYS is very userfriendly when it comes to allowing you to pull information from other flowsheets into the one you are in, we will do it from here. Right click anywhere on the background (of the workspace, not the PFD) to pull up the Object Navigator. Choose the Flow-1 flowsheet and the E-100 unit op, then push View.

Now, on the Connections page, switch the Shellside Flowsheet to FLOW-2 (TPL2). Then Connect Shell In and Shell Out to the Shell Side inlet and outlet, respectively.

Now we need to set the pressure drops in the heat exchanger so for that switch to the Parameters Page. Oh oh. HYSYS will not let us change the settings. We've run into a side effect of placing our heat exchanger in two sub-flowsheets not along the same branch of the heirarchy. Remember, when you enter an environment, only those below it in the heirarchy are still active. Those above and on other branches are left in hold mode to reduce unnecessary calculations. Had we been doing this from the Main Flowsheet, it wouldn't have been a problem, as both sub-flowsheets are below it and active. We need to switch to the other flowsheet. You may either push the up arrow to return to the Parent Environment and the enter FLOW-1 from its property view, OR you may bring up the Object Navigator again and choose FLOW-1, then press Build. Double-click on the Heat Exchanger to open its property view and go to the Parameters Page. Enter 5 psi for both the Tube Side Delta P and the Shell Side Delta P. At this point there is only one degree of freedom left (you may glance at the Specs page to see this), and defining one exit temperature would be enough to finish it. However, this example is also going to include Heat Loss (loss of the hot side duty to leakage) and Heat Leak (loss of the cold side duty to leakage). To do that you must first change the Heat Exchagner Model on the Parameters Page to Weighted and select the Extremes radio button in the Heat Loss/Leak group. This brings our degree of freedom up to 3. On the Specs Page, enter 2.50e6 BTU/F-hr for UA. Then add the following two constraints:

For more information about all of these parameters, read Section 13.7 on Heat Exchangers in RV2. Now, in the example in the reference volume, the exchanger would be solved by now. Instead, we get this:

Don't panic (because I already did for you when I first saw this)! It's just the problem of the other half of the exchanger being on hold still, again. This time getting HYSYS to do what we want is a little more interesting (but not impossible).Go up to the Main Flowsheet, then back to this one. You'll note it still says Insensitive. Just switch to the Parameters Page and flick the Ignore checkbox on, then off and it should complete. If you switch to the Work Sheet Page, however, you'll see that the numbers haven't all been filled in yet. So, one more time, go up to the Main Flowsheet, close the consistency error and push go, then go back down to FLOW-1. This time, the final results may be seen easily from the Work Sheet Page.

Note that a lot of the convolutions we went through only occured because of the order in which we supplied information or where we were when we did so. Other times you might only have to go back once to the parent environment and that will be sufficient. But if you do ever have trouble getting HYSYS to do what it should be able to do with no problem, I hope this provides you with good ideas on how to kick start it. :-)

Setting the Transfer Basis

In this example, we shall explore the dangers of setting the transfer basis incorrectly (only slightly less dangerous than drug or alcohol abuse). Start a new case. Create a fluid package with PR as the thermo package and H2O as the sole component. Now create a copy of the fluid package and change the thermo package to Antoine. If you recall, Peng-Robinson is an Equation of State model for non-ideal vapor phase (ideal liquid phase). Antoine has both ideal vapour and ideal liquid phases. Enter the Main Simulation Environment. Add a new material stream to the flowsheet. Set the VF to .5, the pressure to 1 atm and the molar flow to 1000 of whatever units you like. The Composition, of course, must be pure water. Next, install a Separator as shown above. We did this to quickly create two streams of Saturated Vapour and Saturated Liquid (we could obtain the same result by creating two streams and defining the VF's as 1 and 0, respectively.

To install the Sub-flowsheet, you can press on the Object Palette. Choose Start With a Blank Flowsheet from the pop-up menu. Open the sub-flowsheet's property view. Add streams 2 and 3 to the Feed list in the External Stream column. (If you want or need to switch the attachments of the streams to the sub-flowsheet, object inspect either stream and choose Swap Attachments, then click on the other stream). This has the additional effect of creating streams 2 and 3 inside the sub-flowsheet. You'll note that the Parameter and Variables Pages are currently empty. We will make use of them shortly, but, first, turn to the Transfer Basis Page. Note that HYSYS chooses P-H Flash as the default Transfer Basis for all material streams (for energy streams it is None Req'd, of course). This is a poor and rather strange choice for HYSYS to make as I will show you. Switch, now, back to the Simulation Basis Environment. On the Fluid Pkgs page of the Simulation Basis Manager, in the Flowsheet - Fluid Pkg Associations group, change the fluid package of your sub-flowsheet to the one using Antoine, so that now the thermo package changes as you go from main to sub flowsheet.

Press the Return to Simulation Environment button. You get the following warning:

We could change the basis here, but to show you the actual effects, we will leave it like this for the moment. Again, press Return to Simulation Environment. Choose not to be left in holding mode. To make our analysis of results easier, we are going to add a couple variables to the parameters page of the sub-flowsheet. This goes along with the concept of the sub-flowsheet as the "black box" that you shouldn't have to always open to get what you need out. Turn to the Variables Page and press Add... . Choose as shown in the window that pops-up and then repeat the process for the internal stream 3.

Now if you turn to the Parameters Page, you will see the values of those variables we defined

If you look at streams 1, 2, or 3 in the main case, you'll see that the temperature is supposed to be 211.9o F. Now the liquid stream gets passed just fine (remember, that we are only at one atmosphere and both thermo packages have essentially ideal liquids anyway), but the vapour is way off the boiling point. Change the transfer basis for both streams to VF-P Flash. The new results are

becomes 591.8o F. The two streams inside the flowsheet should now both show 593.51o F which is not bad at all. Now suppose you weren't thinking too carefully, and had instead set the transfer basis of the two streams to T-P flash. After all that's a good way to do gases. It's not, however, always a good way to do streams near a phase transition. Consider that, in this case, both streams would be passed at 591.8o F and 100 atm. That would turn the vapour stream into a liquid, since the boiling point to Antoine should be 593.51o F!

Moral of the story: Think before you set your Transfer Basis (don't forget to set them in the first place) and check the results afterwards.

Conversion Reactor Example In order to save time and make it possible for you to campare the results of the various reactors, this example will begin by using the same components and reactions that were employed in the Plug Flow Reactor Example. It is recommended, but not necessary, that you work through that example first (or at least glance at the component list and reactions). If you do not have a version of your own of that example from which to start this example, I have made available a completed version of that example entitled PlugFlowEx.hsc located in the \\Hartsook\Hysys\SAMP403 directory. There is also a file containing this and all other completed reactor examples called AllReactors.hsc in the same directory. To begin we must first define our conversion reactions. Go to the Simulation Basis Environment. On the Reactions Page of the Simulation Basis Manager, push the button marked Copy Rxn ... (why bother entering stoichiometry again when we've already set it up for the Plug Flow). In the window that appears, highlight ReformingLH or whatever you called your reforming reaction and change the reaction type to Conversion and press Copy Reaction. When the new reaction appears, change the name to something more descriptive like ReformingConv.

Now move to the Basis Page and set the conversion to 100%. This is of course totally unreasonable for this reaction, but we are more concerned with learning how the conversion reactions and reactor work.

Copy the Water Gas Shift reaction now (or enter it from scratch) as a conversion reactor. Name it WGSconv and give it a conversion of 100% as well for now. Close the reaction windows and return to the Basis Manager. Push the Add Set button and fill the set out as shown.

You may have noticed a button that was never there before when we looked at reaction sets. Go ahead and push the Ranking button now.

Set like this the two reactions will be evaluated simultaneously. Had we wanted one reaction to come first, we would set the other reaction's ranking to 1. Go ahead and leave it as is and choose cancel or accept (not reset, I'll tell you why later, but when you do your own projects I recommend pushing reset first). You may also close the reaction set window. Back again on the Simulation Basis Manager, highlight the reaction set you just created and push Add to FP as we must associate the reaction with our fluid package before it can be used in the flowsheet. There should be only on fluid package listed (if there is more than one, pick the one that is used on your main flowsheet). Select it, then push Add Set to Fluid Package. The completed Reactions Page of the Simulation Basis Manager should look like this:

You may now return to the Simulation Environment.

To set up the conversion reactor (the only one capable of handling conversion reactions, by strange and mystical coincidence), we need to first place it on the Process Flow Diagram (PFD). This may be done from the Unit Ops Menu or from the Object Palette as shown below

opens

then,

Add a couple material streams and connect them as shown (remember the <Ctrl> button is great for quick connecting as it toggles you in and out of Connect Mode).

Since we simply want a copy of the feed stream to the Plug Flow, go to the Utilities Page of the FeedC Property View. Press Copy Stream Specs From ... and choose Feed. Now, all that is left is to specify the reactor. Open its Property View. Remember, by not attaching a heat stream, it is assumed adiabatic (to make it isothermal, you would need to attach a heat stream and set the Temperature on the the product stream the same as the inlet). On the Parameters Page you could set a pressure drop across the reactor, but for this example, leave it at zero. Switch to the Reactions Page and attach the Conversion Reactor Set.

See that HYSYS requires you to attach another product stream. That is because for these reactions to go to the specified conversions adiabatically, the product must exit at -7 deg Celcius and all the water is liquid (told you it was unrealistic -- also note that the thermo package is unable to predict the formation of ice, I doubt any of them could). Go ahead and attach a liquid product stream and call it LiquidC. Looking back at the Conversion Reactor Property View, you should see a couple things on the Reactions Page that strike you as decidedly odd. Most strange is the ranking. Though we left them both as zero, here we see a zero and one. Looking under Reaction Rank in Section 11.4.2 of RV1, we see that HYSYS will assign default ranks to multiple reactions based on reactants and products. Because CO is a product of the Reforming reaction and a reactant in the Water Gas Shift reaction, the Reforming reaction is set by default to go first. The problem, of course, is that HYSYS did not show us this as the default when we opened the ranking window from the basis environment. This is another BUG in HYSYS. The workaround is of course to push the Reset button in the ranking window first to see what HYSYS is really going to give you (I told you not to push it before because I wanted you to see the error). Whether or not you plan on changing what you see when you first bring up that window I suggest you go ahead and Reset. For this example, since we've already run it sequential, we might as well analyze this ranking arrangement first. The other thing that might have struck you as odd is that, though both reactions have a specified conversion of 100%, only the reforming reaction has an actual conversion of 100%, the WGS reaction has an actual conversion of 202%! This is because the specified conversion tells HYSYS how much to react of what is present when the reaction begins. The actual conversion, on the other hand tells you what percentage of the original amount present is converted. In our example, all the methane is reformed, making CO and H2. Then, the reforming reaction starts. It is told to convert 100% of the CO present, which turns out to be a little over twice what was there before the reforming reaction and thus that is how much is converted. Had the ranking order been reversed or the same (as we had originally assumed it would be), both actual conversions would have been 100% and all the CO generated in the reforming reaction would pass through to the product stream. There are other conditions that can cause a difference between specified and actual. If the base component is the product of an earlier reaction and there was not any initially present, the actual conversion field will remain blank. Conversely, if the base component of a reaction is a reactant in an earlier occuring

reaction, or if there are limiting reagents, the actual conversion will be less than the specified conversion. We did not run into the limiting reagant problem because there was enough water present initially to totally convert both reactions. You can adjust the ranking and experiment for yourself by opening the Reaction Package under the Flowsheet Menu. I don't know about you, but I don't feel comfortable leaving the temperature in negative degrees Celcius. Let's go ahead and switch the reactor from adiabatic to isothermal. To do that you must first attach a heat stream to the reactor.

Of course, the reactor becomes unspecified again. Go ahead and open the Property View of ProductC and set the temperature to 350 deg C. The temperature of LiquidC is constrained to equal the temp of ProductC, so it will automatically follow suit. The reactor is again specified. Note that, of course, the total molar flow of each component out of the reactor has not changed, though the liquid stream has dried up and shows zero flow. Note that you did not actually set the reactor to an "isothermal" setting. If you want the product to always exit at the same temperature at which it entered, you will probably need to use the logical operator Set.

Assorted Tips

As I was learning Hysys myself, I made a number of notes along the way. As I incorporated what I learned into the web pages, I would remove that item from the list (unless it was something particularly usefull but short). Below are the remaining items that I didn't find a good home for in the pages I had time to write. Some of them mention things I wanted to explore and questions I had left that I did not get the time to deal with. Perhaps, if you find the answers, you can add to the web pages.

General Notes 1. Note that two different users CAN open the same file on two different computers at the same time. Only saved changes from the first opened appear in the second when it is opened and only the changes made to the last one saved remain (the other changes are lost). SOLUTION: Don't work on the same file at the same time! 2. When editing your workbook format, you cannot reorder the tabs in workbook, so better put them in the right order to start. 3. UNIT OPS on workbook cannot be deleted, changed, or duplicated. 4. Holding down the <Ctrl> button automatically places one temporarily in Attach Mode. 5. If you want to move just a label, click on the label then either press <L> or choose "move label" from the menu appearing with the right mouse button. 6. Can Duplicate Streams Within a flowsheet by going to the property view of the stream to which you want the properties copied. Go to the Utility tab and choose "Copy Stream Specs From ". 7. When setting compositions by flows instead of fractions, the normalize button simply sets empty cells to zero. 8. One way of creating images (perhaps there is a better way) is to print the screen to the clipboard (press <SHIFT+Print Screen>), then paste it in a blank slide in PowerPoint. Crop it down to the image you want then save it as a jpeg or GIF (change the file type it is to save to). 9. To move things on a 2D graph, must double click once to outline the entire graph then single click on the item to be moved and drag (a double click will call up the graph controls). If part of the text or numbers on the graph are cut off, this will also fix the problem. 10. To change fonts on the 3D graph must change fonts for all graphs in the preference file. Unfortunately cannot move text around on the display, though. 11. You may add a copy of your PFD to your workspace, giving you the chance to rearrange the view. Note, however, that removing an object from any PFD removes it globally, not just on that view.

Fluid Package Notes

1. You can choose thermo packages to be both an activity coefficient model for the liquid and EOS for the vapor. Must choose the activity model first, and then choose from the drop down menu the preferred "vapour model". Look in Chapter 8 and Appendix A of the Reference Volume 1 for more information on the choosing of the thermo package. 2. By exporting, then importing, you may transfer fluid packages between files. (Alternatively, if you used the Save As command to start the second file it will automatically have the same fluid packages of course). To have slightly different fluid packages within the same file (say you want the same compounds but a different thermo package) the Copy button may be employed to copy an existing package under a new name for editing. This is useful if you want to use, for example, an EOS model in the main flowsheet containing a reactor but an activity coefficient model in a column sub-flowsheet. 3. Seems as if the only way to get a totally ideal property package is to use either a vapour pressure model like Antoine or an activity model like Margules with the vapour model set to Ideal and all the binary coefficients deleted (make sure to get both Aij's and Bij's). 4. Binary Coefficients are library values unless instructed to calculate new ones by the user. The only way to get the original library values back is to change then re-select the property package. 5. In the tabular, Note that for all properties except K factors, the tabular must be used for all components in the case.

Oil Notes (for petrochemical work)

1. When experimenting with the Refining Tutorial components in the fluid package were changed without my knowledge or approval. Hypotheticals acted weird. The file gave even more different results from the tutorial than the file with the correct fluid package. Might have been the result of changing the property package and then changing it back since hypotheticals are tied into the property package. 2. If you want to use an oil in more than one file, etc. Save the assay, not the fluid package, otherwise you cannot introduce the oil as a stream. 3. See p.275 of Reference Volume 1 for a good explanation of assay %. 4. In refining example Standard Density NOT requested as API

Reaction Section Notes

1. Under "Reaction Heat" a positive # indicates an exothermic reaction (it is not the delta H of reaction). Find out if they are the same apart from the sign. 2. HYSYS requires for equilibrium reactions that you either provide info about the constant or provide a table of T vs. K values. What does Aspen do for equilibrium reactors? 3. Note that the Absorption Parameter in Seth's Example of Plug Flow seems to have the wrong units. Change in all pertinent locations (not just HYSYS). 4. Find out if Aspen "integrates" the same way and if so, how to affect the number of its divisions.

Databook Notes Data Recorder does not allow some variable changes between recordings. Figure out which changes are acceptable.

Column Notes

1. On page 131 of tutorial, it talks about being unable to do a 3-phase condenser in the column while claiming total reflux. This is no longer the case, it can be done now. 2. When reporting the total number of theoretical stages one needs to include all the main column trays as well as all side stripper trays and all condensers and reboilers (i.e. those for side strippers too). Example: The refining example in the tutorial has 40 total stages in four total tray sections. 3. Be Careful when looking at graphs of results for columns (check out the table as well to make sure that the entries and order are what you think they are). 4. On column condensers and reboilers, can apparently only use energy streams for the heating or cooling, not material streams. So will have to include some sort of temperature cross check.

Unsorted Notes

1. HYSYS does not have the capability to do multistage compressors (i.e. no equivalent to Aspen's MCOMPR). 2. Interesting note about the use of PUMP vs. COMPRESSOR on p.424 of RV2. In general, Compressors are for gases and pumps are for liquids (the liquids are assumed incompressible). But, if you actually want realistic compression of liquids (say near their critical point), go ahead and use the compressor. 3. How does the sign work on energy streams? If you set up a cooler but make the temperature of the stream rise, what happens? Get negative energy streams (can also get negative material streams if work at it)