# reaction-with-purge.in # # Conceptual level design for a reaction/separation problem with a # purge unit. The problem includes the simple reaction A+B -> 2C and # distillation units to perform the separation steps. The initial feed # consists of three components, A, B and an inert D. The desired # product is C. The reaction is not complete and hence recycling is # necessary. Additionally, there is a purge unit which may or may not # be used (the synthesis procedure decides this). # # Copyright (c) 2000, Eric S Fraga, All rights reserved. # # --------------------------------------------------------------------- # # Give the synthesis problem a name and a description. These are used # for report generation. All output will appear in a subdirectory # named after the project name. # project ReactionWithPurge title "Reaction with purge example" # # tell the system where to find the classes referenced below use jacaranda.design.ps # for base stream and component classes use jacaranda.design.units # for the unit models and unit variables # # The first step is to define the feed. We use the PseudoComponent # class to define the 4 components in the system. This class # implements very simple physical property estimation methods: # essentially, all physical properties are constant. The only physical # property actually required for this problem is the vapour pressure # from which all VLE calculations required by the distillation unit # can be derived. The components are ranked from C1 to C4 in terms of # relative volatility, C1 being the lightest and C4 the heaviest. # # Note, although it may be tempting to use the letters A through D to # name the components, this is not a good idea because some of the # units use these as variables for some of the computed results. For # instance, the distillation column defines B and D to be the bottoms # and distillate flow rates respectively. # PseudoComponent C1 base 1 vapourpressure 8 end PseudoComponent C2 base 1 vapourpressure 4 end PseudoComponent C3 base 1 vapourpressure 2 end PseudoComponent C4 base 1 vapourpressure 1 end Phase phase add C1 10 add C2 10 add C4 10 phase liquid end PStream feedstream add phase T 300 P 1 end # # The feed is associated with a feed tank # FeedTank feed Stream feed feedstream end # # The reaction is embodied in a Reaction class. We describe the rate # (which is used to calculate the design information for the reactor) # and the stoichiometry for the reaction. # Reaction reaction comps C1 C2 C3 stoich -1 -1 2 rate 10 end # # The reactor uses the reaction defined above and we specify the # desired reaction conversion. We could of course define a range of # conversions. The length to diameter ratio is also specified; the # volume of the reaction is determined from the conversion rate. # # We also specify that the use of the reactor unit is limited. This # means that the synthesis procedure can only use this unit a pre-set # number of times in any given flowsheet. The number of times it can # be used is specified in the synthesis problem class itself. # # Note the difference in input for conversion and ldratio: the former # is a design specification which can, in synthesis mode, be varied to # determine the optimum choice whereas the latter is an input # specification which remains constant for the run. Therefore, the # former must be specified with min and max values and number of # discrete alternatives even when only one value is to be considered. # Reactor reactor limit reaction reaction Real conversion 0.7 0.7 1 Real ldratio 2 end # # Distillation unit which operates is purely conceptual design # mode. This means that most physical property calculations are not # required. Only the ability to estimate relative volatilities is # required. No estimates of heating or cooling requirements are made. # Distillation dist Boolean conceptual true Real P "1 *atm" "1 *atm" 1 Real rrf 1.2 1.2 1 end # # We need a mixer unit to handle recycle streams. This unit has no # real design information. # Mixer mixer Boolean conceptual true end # # A product tank which accepts the desired product C3 and gives it a # value based on the flow (F), the number of hours in a year (hpy) and # the number of seconds in an hour (hr). Essentially, therefore, # the value is 1 unit per kmol produced in a year. # ProductTank pureC3 Expression spec "(x[C3]>0.90)" Expression valuefn "F*hpy*hr" interesting end # # Another valid output of the process will be the C4 component. This # component must come out relatively pure (>90%) but has no value. # ProductTank pureC4 Expression spec "x[C4]>0.90" interesting end # # We also need a purge unit. Like the mixer, this unit has no # specifications given. # Purge purge end # # The ranking criteria for processes in this problem is the "value" # variable which the product tanks generate. As the optimizer # minimizes the criteria given, we need to use the negative of this # value as we want to maximize the value overall. # Criteria criterion criterion Value sum "-value" end # # define all the global data for the system prior to attempting the # synthesis run. these data include the ranking criteria (only one in # this case) and the list of units which are available for the # synthesis procedure to use. # Data criteria criterion unit feed unit dist unit reactor unit mixer unit pureC3 unit pureC4 unit purge end # # The iterative dynamic programming problem class is based on the use # of hierarchies to rank partial solutions. These partial solutions # (described by Fraga, Chem Eng Res Des, 1998 [see # http://www.ucl.ac.uk/~ucecesf/ for a list of publications]) are # necessary when tackling problems with recycle streams. We change the # default hierarchy to encourage the production of valid products. The # default value of this is 0; the smaller the value, the greater the # attractiveness of the particular feature. # Hierarchy hier product -10 end # # Finally, define the synthesis problem which, because we will require # recycle streams, must be based on the IDP class (iterative dynamic # programming). This is similar to the Qualified problem class except # that it will iterative to converge tear streams (recycle streams) # identified by the procedure itself. # IDP problem hierarchy hier maxdepth 2 # when to consider iterating maxiter 1 # how many iterations to allow limit reactor # only one instance of the reactor # # An interesting facet of the type of problem we are tackling # here is that we can not use the branch and bounding strategy # that is available by default. The reason for this is that we # have product values (negative costs) and negative valued # hierarchy entries. Negative values in either aspect mean # that the bounding procedure will produce the wrong results. # bounding false sud true # save unit designs show solve # solve the problem print # output results print short # *** NOTE: exporting solutions with recycle streams is currently # *** not working (2001.08.15). This will hopefully be fixed # *** soon # although we can create a flowsheet object for this problem, # it should be noted that the flowsheet evaluation method # currently does not support flowsheets with recycle # streams... # export # generate flowsheets end