Reactor with PID Controller Problem Statement: The following elementary reversible reaction occurs in a reactor at 298 K and 1 atm. CH 3COOH + CH 3OH CH 3COOCH3 + H 2 O (Methyl Acetate Synthesis) The reactor initially contains 100 moles of methanol at 298K and 1 atm. Acetic acid is fed to the reactor at 100 mol/hr at the same temperature and pressure for 30 min, and then at 30 min, a +20% step change is given to the acetic acid flow rate. The reaction rate is given as follows: rA = k1C A C B − k 2 CC C D where A : CH 3COOH B : CH 3OH C : CH 3COOCH3 D : H 2O The rate constants as a function of temperature are given as follows: 44.3 k1 = (1.29 10 4 ) exp − RT 50.03 k 2 = (8.82 10 3 ) exp − RT The frequency factor has the units L/mol.s and the activation energy has the units kJ/mol. Objectives: 1. Simulate the dynamic reactor for 2 hrs assuming that a total of 0.1 mol/hr liquid product is drawn from the reactor. Plot the reactor volume with time. 2. Design a PID controller using Ziegler-Nichols tuning method to maintain the liquid reactor volume at 5 L by manipulating the product flow rate. NOTE: Use UNIFAC method for K-values and Latent Heat method for enthalpy. Objective 1: Step 1: Create the flow sheet The following icons are needed to complete the flow sheet: 1. Feed (1) 2. Ramp controllers (1) 3. Batch Reactor (1) 4. Product (1) Select and click all the above icons on the workspace. Connect them using the stream. Click once on the S/G icon on the menu bar to switch the simulation mode from Edit Simulation to Run Simulation. Completed flow sheet should be as shown below: Step 2: Enter the components and format engineering units Go to the Thermophysical on the menu bar and click on Components List. Find ethanol and n-propanol and add them to the component list. Go to the Format menu and click on Engineering Units and select the desired units for such properties as temperature, pressure etc. Use SI option to convert all units at the same time. Click OK to continue. Step 3: Entering the feed stream composition Double click on the feed stream and enter the feed information (temperature, pressure, total flow rate and component mole fractions) given in the problem statement. Click once on Flash to get the feed stream enthalpy and vapor fraction in feed at the feed conditions. Step 4: Enter RAMP CONTROLLER specs To specify the stream that needs to be ramped, select the radio button for stream under Type and enter the stream number corresponding to acetic acid feed stream for ID number. Select option 5, Total mole rate as the variable to be ramped. Also select option 1, Mole/Mass, for Variable Units. Now, we need to specify the time versus total mole flow rate data in the space provided. One can use the table just the same way as a spreadsheet to enter the data. The RAMP CONTROLLER will simply interpolate between two consecutive entries to determine the value of the parameter at for increments in time. The completed dialogue box for the ramp controller of acetic acid stream would look as follows: Step 5: Batch Reactor Specs Double click on the batch reactor icon. The following window appears. Initial Charge: The following window appears when Initial charge is clicked. Enter the temperature (298 K), pressure (1 atm) and the moles of methanol (100 mol) initially present in the reactor. Click once on Flash. Click on OK to continue. General Information: There are three tabs in this window. General: As the given reaction is reversible, there are essentially two reactions occuring in the reactor. Enter ‘2’ for Number of reactions. The Specify reactor phase option can be left at default value since the reaction proceeds in liquid phase. Since the activation energy and frequency factor for each reaction are provided, we go for standard option for Kinetic rate expression. The reaction is isothermal at 298 K: appropriate radio button is selected and the Reactor temperature is entered. The constant pressure of 1 atm is entered for Specify constant pressure option. The completed General tab is as shown below: Semi-Batch: In this tab, we specify the streams that act as feed and product to the batch reactor. The feed to the reactor is the outlet stream from ramp controller (Stream 3 for this example). The Flowrate option across from Feed1 option indicates that the flowrate specified in the feed stream is the instantaneous flow rate. The cumulative option indicates that the specified flowrate multiplied by one time unit is the total flow from the feed stream. Example: For a 4hr run, the stream has 4lbmol/hr total flow specified. Using the flowrate option, 16lbmol will be added to the reactor. Using the cumulative mode, 4 lbmol (4lbmol/hr * 1hr) will be added. In this problem, the objective is to send at the rate of 100 moles/hr of acetic acid up to 30 min and 120 moles/hr there after. Hence cumulative option is chosen. The completed Semi-Batch tab is as shown below: Convergence: Can be left to default settings. Rate equation units: In this window, we choose the units for rate expression parameters as given in the problem statement. The completed window is as shown below: Reaction Kinetics: The activation energy, frequency factor and stoichiometric coefficients for each reaction are entered in the two screens that show under Reaction Kinetics. The completed screens are shown below: T/Q Profile: Not applicable for this example. Reactor Specifications: Not applicable for this example. External Feed Schedule: The feed to the reactor has already been scheduled by the ramp controller. Hence the feed scheduling option is not applicable for this example. Product Draw Schedule: The product from the reactor flows at 1 mol/hr according to the problem statement. This information is entered in the window. The data entry is similar to that in ramp controller. The completed frame would look as follows: Set Screen Information: Batch reactor unit operation may be set to plot the moles of all the four components in the reactor and the total liquid volume of the reactor during the simulation. The completed screen information window is as shown: Click on Exit after completing the reactor specifications. Step 6: Enter dynamic simulation specifications Step 6.1: Change convergence to dynamic mode Go to Run menu and click on Convergence. Change Steady State/Dynamics option to Dynamics. Click on OK to continue. Step 6.2: Specify run time Go to Run menu and click on Dynamics. The following window appears: Now, Click on Set run time. The following window appears: Under General tab, leave the Number of operation steps at its default value. This field will be most useful when the stop criterion for the dynamic simulation is a parameter other than time. For instance, one can run a distillation column in two operation steps, the first of which may be performed under total reflux conditions for a finite amount of time and the second operation step may be performed until the concentration of a certain component in the distillate stream reaches a pre-defined value. In the second step of the example just mentioned, the simulation time is not pre-determined. As the problem considered in this module has a finite simulation time (120 min), one can simulate the system within just one operating step. Click on Step1 tab and enter 120 min as the Run time. One can choose any value between 0 and the specified run time as the Step size. The value chosen for step size represents the increments of time after which CHEMCAD calculates and prints the results for various parameters. The lower this step size, the more accurate the results and the longer the simulation would take to converge. The step size chosen for this problem is 2 min. The rest of the dialogue box need not be filled as it corresponds to the case when the stop criterion is a parameter other than time. Click on OK to continue. Step 6.3: Record Streams One has to record streams in order to plot the properties of the corresponding streams. This can be done by entering the stream numbers and checking the Run Time Plot option in the Record Streams window as follows. After clicking OK button in the above window, the Dynamic Stream Plot Options window comes up for each of the stream for which the Run Time Plot option is checked. One can select the property of the stream to be plotted in this window as follows: The Dynamic Stream Plot Options window can be completed similarly for the product stream as well. Step 6.4: Record unit operations Parameters pertaining to unit operations can be recorded similar to the streams as described in the previous section. The completed windows would look as follows: Step 6.5: Record Process In addition to recording the stream and unit-operation information, the total process parameters can be recorded at any desired time by clicking on Record Process. Step 7: Running the dynamic simulation After all the information in entered as mentioned in previous steps, the dynamic simulation can be run by clicking on Run from initial state. The simulation runs for 120 min and plots for the chosen streams and unit operations are produced during the run time. The status of the dynamic simulation can be found by looking at DTime on the bottom of CHEMCAD screen. When the dynamic simulation is complete, DTime on the bottom indicates the final time (120 min). Also the following message appears. Step 8: Viewing the plots The results of the dynamic simulation are plotted during the simulation. The results obtained for this example are as follows: Objective-2 In order to meet the requirements given in the problem statement for objective-2, we need to modify the flowsheet by adding a control valve and flow controller to the product stream. First restore the dynamic simulation to initial conditions. Then go to graphics mode and modify the flowsheet as follows: Control Valve: The control valve first needs to be sized for the valve time constant. Refer to previous modules on control valve for the valve sizing procedure. The control valve for this example has a valve coefficient of 36, assuming a downstream pressure of 0.95 atm. The completed control valve page is as shown below: PID Controller: The set point according to the problem statement is 5 L liquid volume inside the reactor. This is entered across Set point in the dialogue box. From the uncontrolled simulation, it can be seen that the volume of the reactor varied from 4 to 10 L for this example. So we can safely choose 1 and 15 L as the minimum and maximum values for this variable. The PID controller routine in CHEMCAD scales these minimum (1 L) and maximum (15 L) according to the control input minimum (4 milli amps) and control input maximum (20 milli amps). Hence the set point of 5 L corresponds to 8.57 milli amps of controller output. This number is entered for Steady state output (PO). A nominal proportional band of 1000 is used as the starting value (this is usually obtained by trial and error). The control valve ID (3) is entered in the appropriate location. The measured object is chosen as variable 46 Calc liquid volume corresponding to Equipment number 1. The variable unit is chosen as Volume (option 20). The completed PID controller dialogue box is as shown below. Now the simulation is again run for 120 minutes and the characteristic of liquid level profile is noted. The simulation is performed for various values of proportional band. It can be seen that for a proportional band of 2500, the liquid volume inside the reactor oscillates consistently. Above this value, the oscillations begin to diminish, below this value, the oscillations continue to be sustained. Hence this value of 2500 can be treated as the proportional band corresponding to ultimate gain, Ku. Note that the gain is defined as the ratio of 100 and the proportional band. Hence the ultimate gain, Ku=100/2500=0.04. The liquid volume corresponding to the ultimate gain is as shown below: From this graph, the period of oscillation, called the ultimate period, Pu can be determined to be 0.3325. Now, one can use the expressions for Ziegler-Nichols tunings and determine the Kc, i and d using the ultimate gain and period. The following values are obtained for the tuning parameters using Z-N tuning expressions: Type of Controller P PI PID i PB 5000 5555 4167 d 16.6 10.0 2.4 The liquid volume obtained by using the three different controllers is plotted as shown below: