© 2024 Jasper van Baten, AmsterCHEM

Saving and loading models

Once your unit operation definition is complete, you can save your model by clicking Save Model in the unit operation's dialog. You will be prompted for the name of a Matlab Unit Operation Model file (*.mum).

You can reload your model at any time by clicking the Load Model button in the unit operation's dialog. Loading a model will discard all information in the current model.

To re-use a unit operation in a different simulation environment, save the model. Open the other simulation environment, insert a new Matlab CAPE-OPEN Unit Operation. Edit the new unit operation and load your model.

The Matlab Unit-Operation Model files (*.mum) are zip files containing "unit.xml" (defining the unit operation's options, such as ports, parameters, reports, ...), "calc.m" (defining the unit definition script), and any additional files.

Examples

A number of examples are available in the default installation. The examples are available from the "Example models" sub-folder of the Matlab CAPE-OPEN Unit Operation installation folder (by default: AmsterCHEM sub-folder of the Program Files folder).

Adiabatic Mixer Example

The Adiabatic mixer example (Adiabatic_mixer.mum) by default has two feed ports, but will work for any (non-zero) number of feed ports. It mixes the feed flows adiabatically and uses a PH flash for the product (with a special case for zero-flow conditions).

Adiabatic Flash Example

The adiabatic flash example (Adiabatic_flash.mum) implements an adiabatic flash separator unit operation. It has a parameter for heat duty and pressure drop. If both are zero, the feed equilibrium is used, otherwise the equilibrium is recalculated after applying heat duty and pressure drop. Three special cases are distinguished: the flash result is vapor-only, the flash result does not contain vapor, or the flash result is multi-phase including a vapor phase. In the latter case, the liquid product is calculated from the difference of the feed and the vapor product. The resulting vapor phase fraction is exposed as an output parameter. This example shows how to work with phases and equilibrium calculations.

Co-current Heat Exchanger

The co-current heat exchanger (CoCurrent_HTX.mum) calculates the limiting heat transfer by solving for the temperature at which the heat transfer from the cold flow matches the heat transfer to the hot flow. An efficiency parameter can be set, that determines the fraction of heat actually transferred with respect to the limiting heat transfer. The products are set using PH flashes, with special cases for zero-flow conditions. A report is exposed showing the actual amount of heat transferred. This is a simple example showing how to apply a function solver.

Adiabatic CSTR for ethane production

This example (Adiabatic_CSTR_ethane_production.mum) performs a vapor phase reaction Ethylene + Hydrogen -> Ethane in an adiabatic CSTR reactor. This is another example where an equation solver is applied. This example shows how to identify compounds and how to deal with heat of reaction. The example will only run in a system that contains the three compounds that take part in the reaction, and enthalpyF as well as volume must be exposed by the underlying thermo system. An example COFE document that is configured to run this example is available here.

INDEX
Acknowledgements
Additional files
Boolean parameters
Calculation
compNames
Dimensionality
Disclaimer
DOs and DONTs
Error trapping
Example
Feeds
Files
Formulas
Function reference
getAggregationState
getAggregationStateName
getCompoundConstant
getEquilibrium
getEquilibriumProperty
getFeedEquilibrium
getFeedProp
getNumberOfFeeds
getNumberOfProducts
getParameter
getPDependentProperty
getPropertyUnitOfMeasure
getSinglePhaseProperty
getTDependentProperty
getTwoPhaseProperty
getUnitOperationName
Global variables
Integer parameters
License
Loading models
logMessage
M files
Model files
nComp
nPhase
Parameters
phaseAggregationStates
phaseNames
Products
Real parameters
Reports
Requirements
Saving models
setParameter
setProduct
setReport
String parameters
SUM files
Welcome
CONTENT
 Welcome
 Feed and product ports
 Parameters
 Reports
 Matlab Calculation Script
 Additional files
 Global variables
 Function reference
 Saving and loading models
 Persistence in AspenPlus
 License and disclaimer