Annotated rathore.in example
     1	# $Id: rathore-annotated.html 2 2004-04-17 20:20:23Z ucecesf $
     2	# 
     3	# rathore.in
     4	#
     5	# Simple separation sequence synthesis example based on the problem
     6	# described by Rathore et al, AIChE J, May 1974.
     7	#
     8	# Copyright (c) 2000-2001, Eric S Fraga, UCL, All rights reserved.
     9	#
    10	#
    11	# --------------------------------------------
    12	#
    13	# Give the synthesis problem a name and a description. These are used
    14	# for report generation. All output will appear in a subdirectory
    15	# named after the project name.
    16	#
    17	project Rathore
    18	title "Separation sequence synthesis [Rathore et al., 1974]"
    19	#
    20	# tell the system where to find the classes referenced below. The
    21	# second of these is particularly important as it enables us to use
    22	# single line definitions of unit variables.
    23	#
    24	use esf.fish.ps		# for base stream and component classes
    25	use esf.fish.units	# for the unit models and unit variables
    26	#
    27	# Define the constants used by the rest of the input file, specifically
    28	# for definining the component discretizations.
    29	#
    30	variables
    31		constant Base 10 "Percentage component flow discretization"
    32		# define the flows of the components in the feed
    33		constant Fpropane  " 45.36 *kmol/hr"
    34		constant Fibutane  "136.08 *kmol/hr"
    35		constant Fnbutane  "226.8  *kmol/hr"
    36		constant Fipentane "181.44 *kmol/hr"
    37		constant Fnpentane  "317.52 *kmol/hr"
    38		constant FeedFlow "Fpropane+Fibutane+Fnbutane+Fipentane+Fnpentane"
    39	end
    40	#
    41	# The feed stream consists of five hydrocarbon components. The base
    42	# flow for each component is 10% of the total initial flow for that
    43	# component. In other words, component flows will map to the nearest
    44	# 10% of the initial flow. This is sufficient for the level of detail
    45	# desired for this type of problem.  The main effect it has is on the
    46	# purity specification of the final product streams.
    47	#
    48	KistaComponent propane
    49		base "Fpropane/Base"
    50		bp 230.8
    51		cpv -4.224 3.062e-1 -1.586e-4 3.214e-8
    52		lhtc "0.583 *kW/m^2/K"
    53		vhtc "5.0 *kW/m^2/K"
    54	end
    55	KistaComponent ibutane
    56		base "Fibutane/Base"
    57		bp 263.0
    58		cpv -1.390 3.847e-1 -1.846e-4 2.895e-8
    59		lhtc "0.583 *kW/m^2/K"
    60		vhtc "5.0 *kW/m^2/K"
    61	end
    62	KistaComponent nbutane
    63		base "Fnbutane/Base"
    64		bp 272.4
    65		cpv 9.487 3.313e-1 -1.108e-4 -2.821e-9
    66		lhtc "0.583 *kW/m^2/K"
    67		vhtc "5.0 *kW/m^2/K"
    68	end
    69	KistaComponent ipentane
    70		base "Fipentane/Base"
    71		bp 301.0
    72		cpv -9.525 5.066e-1 -2.729e-4 5.723e-8
    73		lhtc "0.583 *kW/m^2/K"
    74		vhtc "5.0 *kW/m^2/K"
    75	end
    76	KistaComponent npentane
    77		base "Fnpentane/Base"
    78		bp 309.3
    79		cpv -3.626 4.873e-1 -2.580e-4 5.304e-8
    80		lhtc "0.583 *kW/m^2/K"
    81		vhtc "5.0 *kW/m^2/K"
    82	end
    83	# 
    84	# The feed consists of a single liquid phase made up of the components
    85	# listed above.
    86	#
    87	Phase feedphase
    88		comps propane ibutane nbutane ipentane npentane
    89		x 0.05 0.15 0.25 0.2 0.35
    90		flow "FeedFlow"
    91		phase liquid
    92	end
    93	#
    94	# Define the actual feed stream. There is only one pressure level
    95	# defined.
    96	#
    97	PStream feed
    98		# the stream has one phase
    99		add feedphase
   100		# define the valid pressure range and number of values in that
   101		# range 
   102		prange "6.8 *atm" "6.8 *atm"
   103		nstates 1
   104		# and set the actual pressure
   105		P "6.8 *atm"
   106		# map to discrete space. this is not strictly necessary but is
   107		# useful to ensure that the feed definition starts at a point
   108		# in discrete space
   109		map	
   110	end
   111	#
   112	# Discrete utilities are available for both heating and cooling. The
   113	# format of each line is:
   114	# 
   115	# type  description  Tin  Tout  TransferCoefficient  Cost in $/J
   116	#
   117	# we define four hot utilities (stream at a variety of pressures) and
   118	# four cold utilities (cold water and ammonia at different
   119	# temperatures). Note that the cost of cooling water is significantly
   120	# lower than any of the other cold utilities and it is therefore
   121	# unlikely that Ammonia will ever be used. However, the option is
   122	# there and it is up to the optimization procedures to choose the
   123	# correct utilities in order to minimize the objective function
   124	# criteria specified (see below)
   125	#
   126	DiscreteUtilities utils
   127	    hot  "Steam @ 28.23 atm"	503.5 503.5 "5000 *W/m^2/K" "1.0246 / GJ"
   128	    hot  "Steam@11.22atm"	457.6 457.6 "5000 *W/m^2/K" "0.773824 / GJ"
   129	    hot  "Steam@4.08atm"	417.0 417.0 "5000 *W/m^2/K" "0.573203 / GJ"
   130	    hot  "Steam@1.70atm"	388.2 388.2 "5000 *W/m^2/K" "0.41796 / GJ"
   131	    cold  "CooldWater@32.2degC" 305.2 305.2 "500 *W/m^2/K" "0.0668737 / GJ"
   132	    cold  "Ammonia@1degC"	274.00 274.00 "500 *W/m^2/K" "1.65035 / GJ"
   133	    cold  "Ammonia@-17.68degC" 	255.32 255.32 "500 *W/m^2/K" "2.96871 / GJ"
   134	    cold  "Ammonia@-21.67degC"	251.33 251.33 "500 *W/m^2/K" "3.96226 / GJ"
   135	end
   136	#
   137	# the only processing technology is a distillation unit for which we
   138	# specify a single pressure level which happens to match the the same
   139	# pressure range specified for the feed stream, and hence all other
   140	# streams created by Jacaranda. It is advisable that the pressure
   141	# ranges and number of discrete values used by units (such as
   142	# Distillation) be consistent with the pressure levels that can be
   143	# represented in the stream objects.
   144	#
   145	Distillation dist
   146	  Real P "6.8 *atm"
   147	end
   148	#
   149	# and we define a product tank which accepts any stream which has one
   150	# component with greater than 90% purity.
   151	#
   152	ProductTank pure
   153	  # The specification for the product streams is uses the variable 'x'
   154	  # which is a vector made up of the mole fractions of the components
   155	  # in the feed to this unit. The expression 'x>0.90' creates a vector
   156	  # of the same size with values 1 or 0 depending on whether the
   157	  # individual mole fraction is greater than 0.90 or not (1=true,
   158	  # 0=false). The '$' operator takes the sum of the values in the
   159	  # vector so this full expression will return a value of 1 if one
   160	  # component matches the spefication and 0 otherwise.  Note that it
   161	  # is impossible for more than one component to match the
   162	  # specification within any given stream as the mole fractions must
   163	  # add up to 1.
   164	  Expression spec "$(x>0.90)"
   165	  # The unit must be marked as interesting to indicate that any
   166	  # path in the search graph which terminates at one of these
   167	  # nodes is an interesting path, i.e. one that leads to a
   168	  # desired product. this is used by the synthesis procedure to enable
   169	  # us to generate different solutions when the user wishes to have
   170	  # more than one solution generated. the variable 'nbest' in the
   171	  # synthesis problem class (defined below) can be set to request any
   172	  # number of solutions.
   173	  interesting		# interesting leaf node for n-best diversity
   174	end
   175	#
   176	# we also need at least one feed tank for the raw material. the feed
   177	# stream defined above is associated with this feed tank.
   178	#
   179	FeedTank feedTank
   180	  Stream feed feed
   181	end
   182	#
   183	# we will ask for solutions to be ranked in three separate lists, the
   184	# first according to capital cost, the second according to operating
   185	# cost, and the third a combination of the two yielding a form of
   186	# annualized cost. Each criterion is given a name, the type of
   187	# operation required to combine criteria values from different sources
   188	# (options are sum or max), and the actual expression for evaluating
   189	# the criterion. The variables "opercost" and "capcost" are used for
   190	# operating and capital costs respectively by all the standard unit
   191	# models (and heat exchangers) in the FiSH distribution.
   192	#
   193	Criteria criteria
   194	  # 
   195	  # We define each criterion separately. The last three arguments in
   196	  # each criterion expression are optional and describe the units for
   197	  # the values generated, the lower bound on the particular criterion,
   198	  # and the format to use for output.
   199	  #
   200	  criterion Capital sum capcost "$" 0.0 "#,##0"
   201	  criterion Operating sum opercost "$/yr" 0.0 "#,##0"
   202	  criterion Annualized sum "capcost/2.0 + opercost" "$/yr" 0.0 "#,##0"
   203	end
   204	#
   205	# before attempting a synthesis problem, we tell the system the
   206	# objects to use for all the global settings which affect the
   207	# synthesis procedures. these consist of the set of utilities, the
   208	# objective function criteria, and the unit models that are available
   209	# for building up process flowsheets.
   210	#
   211	Data
   212	  utils utils		# which utilities object to use
   213	  criteria criteria	# the ranking criteria
   214	  # we now specify the list of units which are allowed for
   215	  # processing
   216	  unit dist		# distillation
   217	  unit pure		# and pure product tanks
   218	  unit feedTank		# and the feed tank
   219	  print			# output all global settings
   220	end
   221	#
   222	# now we actually define the synthesis problem based on the stream and
   223	# units defined above. The number of best solutions to generate can be
   224	# specified in the command line. For example,
   225	#
   226	#   java esf.Main -n 3 rathore.in
   227	#
   228	# would ask for the best three solutions to be generated for each
   229	# criterion specified above. Alternatively, the input file can have
   230	# this value specified directly by adding the line
   231	#
   232	#    nbest 3
   233	#
   234	# within the PS_Problem object definition below.
   235	#
   236	PS_Problem rathore
   237	  representation units	# include unit info in n-best diversity
   238	  # solve the problem ...
   239	  solve
   240	  print			# and show the best solutions found
   241	  print short		# showing the basic structure as well
   242	  stats			# display some statistics about the search
   243	  export		# generate the flowsheets
   244	end
   245	# and that's all!  if one wants to save all objects created by
   246	# Jacaranda in this input file, the option "-s" can be given:
   247	#
   248	#   java esf.Main -s rathore.in
   249	#
   250	# In this case, objects will be saved in the user's esfobjects
   251	# sub-directory off the user's home directory, if it
   252	# exists. Otherwise, the objects will be saved in the current
   253	# directory. If objects have been saved, one can browse them using the
   254	# command:
   255	#
   256	#   java esf.ui.Manager
   257	#
   258