Developers handbook

advertisement
CHEMCAD DEVELOPERS HANDBOOK
INTRODUCTION
The CHEMCAD Developers Handbook is designed to help users create custom elements within
CHEMCAD. Using CHEMCAD and this guide, users can create new dialog screens, user unit
operations, user specified rate expressions, Excel unit operations, Excel automation, and modify costing
algorithms. Before we get into the details though, lets take a brief look at all the pieces covered in this
manual, and how they fit together.
There are 5 main categories of custom elements in CHEMCAD. Custom Unit Operations are user
defined elements that fit within a flowsheet . User specified rate expressions are used in kinetic and
batch reactors. Excel automation describes an Excel spreadsheet which has the ability to control
CHEMCAD: Send information into a simulation, run it and retrieve results. Custom costing algorithms
give you the flexibility to modify the cost estimation methods in CHEMCAD for your own purposes.
Specification sheets allow you to create customized, vendor ready equipment specification reports using
data from you CHEMCAD simulation.
Creating Unit Operations: Three methods, one goal
The goal of creating a user unit operation is to have a customized unit where you can enter your own
equations to calculate the heat and mass balances. In the past users have created membrane
separation units, fuel cells, specialized solids handling units, and crystallizers for the separation of
xylenes.
There are three different methods to achieve this goal of a custom unit operation. Parser unit
operations, Excel Unit operation, and C++ User Added Module. Parser unit operations are defined by a
programming language called “Parser”. Excel unit operations are defined by spreadsheets in Excel and
Visual Basic functions defined within an Excel Workbook. C++ User Added Modules are developed
using Microsoft’s Visual C++ development tool, the same tools that were used in the creation of our unit
operations.
Which method you pick is an important first step towards creating a unit operation, but the choice is
almost entirely up to you. Parser unitops can be quick and easy to set up, but they can’t do everything
the other two methods can. The Excel/Visual Basic approach is very powerful and uses the familiar
Visual Basic language for development. A drawback to this method is sometimes calculation can be slow
due to the use of Microsoft Excel to do the calculations. The most powerful and fastest calculating
method is the C++ User added Module method, however if you are new to C++ developing it may be
difficult for you to use.
Whichever method you use to program the calculations of your unit operation, you will likely need a user
interface, commonly called a dialog screen. A dialog screen allows users to send information into your
unit operation, for example the number of stages for a distillation unitop. No matter what method you
use to program your unit operation, you will be using the Screen Builder program to create your user
interface.
CHEMCAD Version 5.1
Screen Builder
User defined rate expressions
When working with kinetic or batch reactors, sometimes the reaction rate you’re given just doesn’t fit the
arrhenius equation. Good examples of this are reactions involving transition states, the Monod kinetics
of biological systems, and some catalytic reactions. Using an interface to Excel’s visual basic, you now
can enter the rate expression in whatever form you have it.
These user defined rate expressions may be used in both Steady-state kinetic reactors (KREA) and
Dynamic reactors (BREA).
A basic working knowledge of Visual Basic may be required depending on the complexity of your rate
expression.
Excel automation
When working in a plant, it is sometimes useful to transfer plant data directly into CHEMCAD, rather than
entering it by hand. This is possible through the use of Excel. The section of Excel Automation walks
you through the creation of a spreadsheet which is able to start CHEMCAD, transfer information into a
particular simulation, run that simulation, and extract useful information out of CHEMCAD. This can be
used to determine heat exchanger fouling factors, column performance, or to assist in the setting of
control setpoints.
Customized Costing calculations
CHEMCAD includes some very basic costing routines to help determine the capital cost of equipment.
Using a simplified form of C known as the parser language, you may modify these routines to better suit
your needs.
Specification Sheets
Again using our interface with Microsoft Excel, CHEMCAD allows you to output simulation data in an
Excel spreadsheet resembling a vendor specification sheet. By customizing these sheets, CHEMCAD
can become quite a timesaver by outputting data in the format required by your company or vendor.
This leaves you, the engineer more time to get the engineering right, and you spend less time formatting
documents and copying data.
HOW TO USE THIS MANUAL
This manual is divided into sections describing the different tools (Parser Language, C++ UAM, screen
Builder, etc.) and then examples on using each tool. I do not suggest that you try to read this manual
cover to cover. First read the introduction section on the Screen Builder (How Unit Operations Work).
Getting familiar with the architecture of a unit operation is the key to successfully customizing
CHEMCAD. Then decide which tools you are likely to use and read about them.
2
Download