Aspen Custom Modeler Examples Guide

Posted on  by  admin
Aspen Custom Modeler Examples Guide Average ratng: 3,9/5 8750 votes
  1. Aspen Custom Modeler Examples Guide

Implementing MOSAICmodeling Models into Aspen Plus by Alberto Penteado This description can also be obtained as a PDF. Introduction This is a step-by-step guide on how to export self-implemented models from MOSAICmodeling to Aspen Custom Modeler (ACM) and Aspen Plus in order to take advantage of Aspen’s property functions and integrate customized unit operation models into a flowsheet. Knowledge of modeling in MOSAICmodeling and the use of functions, connectors, and ports are pre-requisites. No knowledge of ACM’s language is required, but some knowledge on setting up a simulation in Aspen Plus is expected. Modeling Worfklow Creating a MOSAICmodeling Model The first step is to create a MOSAICmodeling model. In this example, an adiabatic two liquid stream mixer is to be simulated based on a MESHI equation system as described below:.

Home Search; AspenTech Building Custom Simulation Models using Aspen. Hands-on workshops that apply learned concepts; Example problems; Detailed. Learn how to develop open equation models using Aspen Custom Modeler. This is a step-by-step guide on how to export self-implemented models from. In this example, an adiabatic two liquid stream mixer is to be simulated based on a MESHI. Aspen Custom Modeler has many built-in functions (procedures),.

Creating Interfaces Interfaces are necessary to embed external function calls and to connect ports to external elements. The interfaces contain the required variables for the connectivity.

An interface is needed for the enthalpy function, which is calculated by the ACM procedure named Calculate Molar Liquid Enthalpy. Another interface is needed for the external ports to be able to connect with ACM streams. In the Interface / Pattern Assistance tab load the public notation and then select the box that says Other. Select ACM Calculate Molar Liquid Enthalpy in the combo box.

The required fields will appear below under Fields of Specific Interface. Interface Pattern Assistance for ACM Calculate Molar Liquid Enthalpy (click once to enlarge figure) These fields need to be introduced in the Interface Fields tab as shown below. Besides the variable naming, it necessary to give a Name (description), a Dim (scalar or vector), Engineering Unit and information flow (in or out or in/out). For the ACM Molar Liquid Enthalpy function, the enthalpy is an output variable, while pressure, temperature and composition are input variables.

Once these fields have been introduced it is possible to click on Test Pattern Compliance to verify if all the required fields are met. Interface Fields for Molar Liquid Enthalpy Interface (click once to enlarge figure) Save the interface for the ACM molar liquid enthalpy and click on New to create an interface for ACM stream data.

Load the public notation again and select ACM Stream Data on the pattern assistance. Interface Pattern Assitance for ACM Stream Data (click once to enlarge figure) In the Interface Fields tab, enter the required fields as specified in the pattern assistance and as shown below.

As this interface will be used for both inlet and outlet streams, the information flow of every field is selected as In/Out. Save the interface for ACM Stream Data. Interface Fields for ACM Stream Data (click once to enlarge figure) Introducing Embeded Functions Aspen Custom Modeler has many built-in functions (procedures), for enthalpy, density, viscosity, fugacity, activity coefficient and etc. These functions can be embeded in a MOSAICmodeling model. These are generic function calls, which are independent of the selected property package. The calculations will be performed according to the selected property package (NRTL, SRK, PENG-ROB, etc.) for every simulation.

This allows easy model reutilization. In this example, the enthalpy of the liquid streams is going to be calculated by an Aspen Custom Modeler procedure. As the enthalpy is a function of pressure, composition and temperature, the procedure has the following structure: h( ) = ACM Calculate Molar Liquid Enthalpy Where is the liquid molar enthalpy in GJ/kmol, p is the pressure in bar, is the molar fraction of component and is the temperature in °C. Note that these units matter, since ACM cannot know which units are being used in the MOSAICmodeling model.

Additional equations for unit conversion may be necessary. In the Functions tab, click on the combo box under Interface settings and change from the default (Free interface) to Load interface. Load the previously created interface for the liquid enthalpy.

Input and output variables should be filled automatically. Enter a description and save the function.

Embeded ACM Function for Molar Liquid Enthalpy (click once to enlarge figure) This function can be added to the equation system with the following 3 applications, for each one of the streams. ACM Enthalpy Function Applications Generic Naming Application I Application II Application II h p Introducing Ports Ports are necessary to allow the model to be connected to streams.

They consist of an Interface, containing the required variables for connectivity, and a Connector, which translates the variable names between the model and the interface. Two inlet ports and one outlet port are necessary. The interface for ACM Stream Data was already created, but connectors need to be created following the nomenclature matching as following. It is not necessary to translate variables for molar volume as these variables are not included in the mixer model. Variable matching for each connector Super Naming Sub Naming I Sub Naming II Sub Naming II F h p v -– Create and save the three connectors in the Connectors editor. Now the ports can be added to the equation system in the tab Equation System / External Ports. An Id is automatically assigned (numbering all ports). User has to define the direction of the external port (in/out) and a name.

Adding External Ports (click once to enlarge figure) Enter a description and save the equation system containing the 4 equations, the molar liquid enthalpy function with 3 applications, and the 3 external ports. Code Generation Open the newly created equation system in the Simulation editor. Select the value for the index i (number of components) as 2 and confirm. In the Specifications / Namespaces tab, it is possible to give user-defined names for the namespaces. This is very important if many ports are used. Since ACM stream interface is selected as the super notation, the namespaces are the only way to differentiate the variables. In the Specifications / Variables tab, select the design variables.

The enthalpies of the three streams should appear in the calculated variables table. Give proper starting values for the flow, composition, temperature and pressure of the outlet stream. An example of problem specification is given below.

Iteration Variables Variable Initial Value Lower Bound Upper Bound Units 25 -273.15 1.0E09 °C 2 0 1.0E09 kmol/h 1.02 0 1.0E09 bar 0.5 0 1 kmol/kmol 0.5 0 1 kmol/kmol In the Evaluation / Generation tab select ACM NLE Functions as Equations in the language specification and press generate code. The code is now ready to be copied and compiled in Aspen Custom Modeler. Solution in Aspen Custom Modeler Configuring the Component List Open the ACM user interface. For this example we are using version 8.4. Before creating the model, it is necessary to configure a component list and a property package. In the Model Explorer select Component List and then double click on Default.

Select the use Aspen property system option and click on Edit using Aspen Properties. Configuring the Default Component List in ACM (click once to enlarge figure) This will open the Aspen Properties user interface. Here the component list and property methods can be specified normally as when starting an Aspen Plus simulation.

In order to verify the non-ideal enthalpy calculations, a binary mixture of water and methanol will be used. Add water and methanol to the component list. Component List in Aspen Properties (click once to enlarge figure) Click Next to go to the Methods tab and select NRTL as the main property method. Method Selection in Aspen Properties Click Next one more time to retrieve the binary interaction parameters and again to run the property analysis. Once this is completed successfully, close the Aspen Property window and save the file when asked. Back to the ACM window, it should state that the Component List setup was completed. Click on OK and add the available components to the ACM component list.

Creating a New Model Now it is necessary to create a new model that will receive the code generated in MOSAICmodeling. Again on the Model Explorer palette, select Custom Modeling Models and then Add Model as highlighted below. Adding a New Model in ACM (click once to enlarge figure) Name the model and paste the ACM code exported from MOSAICmodeling in the code window. By default, the MOSAICmodeling code generation will:. Name the model as mosaicmodel. Name the component list as prop. Name components as COMP1, COMP2, etc.

Name inlet ports as Feed1, Feed2, etc. Name outlet ports as Prod3, Prod4, etc.

The model name appearing on the code window must be the same as the name previously given, so change the fist line from mosaicmodel to your given name. Comment by adding // or erase the line with the component list declaration to make ACM use the default component list as desired.

It is essential to keep consistency in the component names, therefore the Component ID for water should be WATER and for methanol it should be METHANOL as previously defined. By using the tools search for and replace, it is possible to replace COMP1 and COMP2 by WATER and METHANOL. One might also want to rename the ports to make it clear to the user where to connect the streams. In a distillation column, for example, it’s advisable to rename the outlet ports as Distillate and Bottom Product, rather than Prod2 and Prod3. This is not important for the mixer. The default icon for all models generated in ACM is the flash vessel. It is possible to change this icon and design customized icons that reassemble the real equipment.

Under the Contents of your model, there’s an option to Add Icon. Coding Window in ACM (click once to enlarge figure) Once these minor modifications are done, right-click on the coding window and click on compile (sh. Compilation should be completed without any errors. Close the window containing the code. In the Model Explorer palette, click on the mixer model and drag it to the Process Flowsheet Window to add a mixer unit to the flowsheet. A light-green square on the lower right part of the ACM window indicates that the degree of freedom is zero and the simulation is ready to be executed. It would show a red arrow pointing upwards if the model is overspecified and pointing downwards if it is underspecified.

Run the model by clicking on the run button in the upper part of the screen. Check the results. Flowsheet Simulation and Results (click once to enlarge figure) Exporting an ACM Model to Aspen Plus Now the model is to be exported to Aspen Plus. For this example we are using Aspen Plus version 8.6. When simulating a unit in an Aspen Plus flowsheet, the inlet ports will be connected to streams.

Streams in Aspen Plus already have a built-in function to calculate the enthalpy once pressure, composition, and temperature are specified. This means that there is no need to calculate the enthalpy of the inlet stream using a function anymore.

Therefore, these lines must be commented by adding // or deleted from the ACM code. This can be done in the Model Palette/Models then selecting the highlighted icon under contents. Opening the code window for a model (click once to enlarge figure). ADD: HOW TO OPEN AND EDIT THE CODE.

FEED info can be retained as initials Depending on the installed version of Aspen, it may be necessary to have a proper version of Microsoft Visual Studio installed in order to export the model. It is possible to export to DLL, in order to generate a.dll file which can be read by Aspen Plus as a unit operation. It is also possible to export to MSI, which will generate an.msi file that can later be used to install the.dll file. In the Model Explorer right click on the model name and select EXPORT TO MSI.

When asked “ Do you want to install the model now?” click yes and follow the installation steps. Keep the default location for the file.

Once the file has been installed correctly, start a new Aspen Plus simulation file, select WATER and METHANOL as components and NRTL as property package. Run a property analysis and then enter the simulation environment. To enable the ACM models to be shown in the Model Palette, select the tab Customize and then Manage Libraries and then activate the ACM Models. Enabling ACM Models in the Model Palette (click once to enlarge figure) Add the customized mixer model to the flowsheet and repeat the simulation done in ACM. The results should be the same.

Simulating the Mixer (click once to enlarge figure). MOSAICmodeling is a free, web-based modeling, simulation, and optimization environment. Based on a LaTeX-style entry method for algebraic and differential equations, equation systems can be built and subsequently used for simulation and optimization. Based on a steadily growing library of existing models of chemical engineering applications large-scale flowsheets, optimization problems, etc. Can be built.

MOSAICmodeling provides an automatic code generation for numerous simulation and optimization environments, such as AMPL, Aspen Custom Modeler, GAMS, gPROMS, MATLAB, Modelica, and for solvers interfaced via C, FORTRAN, Python, etc. Request your free account today and get started with MOSAICmodeling.

Course Id: EAP2311 Duration: 3.00 day(s) CEUs Awarded: 2.1 Level: Intermediate Course Objective Learn how to develop open equation models using Aspen Custom Modeler. Gain the practical skills to build and run custom models. Use automation to pass information to and from Microsoft?

Excel and control the simulation. Course Overview Learn how to develop open equation models using Aspen Custom Modeler language and graphical user interface. Benefits.

Gain the practical skills and knowledge to specify a complete problem description. Build a flowsheet and run simulations. Tabulate and plot simulation results. Use automation to pass information to and from Microsoft® Excel and control the simulation Audience Engineers with little or no prior experience of Aspen Custom Modeler who need basic training to get started. Approach. Instruction on basic topics. Demonstrations of general features.

Instructor-guided exercises. Hands-on workshops that apply learned concepts. Example problems. Detailed course notes Prerequisites The course assumes little or no familiarity with the use of Aspen Custom Modeler Familiarity with process modeling and modeling techniques is expected.

Subsequent Courses EAP101 Aspen Plus: Process Modeling EAP2411 Aspen Plus Dynamics. Graphical User Interface.

Aspen Custom Modeler Examples Guide

Describe navigation through ACM graphical user interface. Provides a quick tour of Aspen Custom Modeler with a simple example.

Learn how to create a flowsheet. Workshop: Build a simple flowsheet and run the simulation. Review of Equation Oriented Concepts.

Explain; Equation Oriented modeling, Principle of system resolution, Steady state modes, Initialization and dynamic modes Overview of the Modeling Language. Explain Aspen Custom Modeler language syntax for: Model, Variable Types, Port Types. Workshop: Illustrate Variable Type, Port Type and Model. Parameters. Identify and explain the parameter types used by Aspen Custom Modeler Conditions. Explain Structural and Run Time conditions.

Workshop: Extend a tank model to add an overflow port Stream Types. Identify and explain stream types used by Aspen Custom Modeler. Workshop: Create a stream type to convert from volume flowrate to mass flowrate.

Language Details. Present less important details on modeling language and graphical user interface Non Isothermal CSTR. Workshop: Build a model for a non-isothermal CSTR reactor, cooled with a jacket Sets and Arrays. Explain how to declare sets (group of elements). Show how to use sets.

Multiports. Identify and explain multiports. Workshop: Illustrate the use of sets, arrays and multiports.

Forms (Tables and Plots). Show how to display data in Aspen Custom Modeler graphical user interface using Forms. Explain different types of forms; Table, Plots, History Table. Workshop: Create model forms. Submodels and Hierarchy Blocks. Explain submodels and Hierarchy blocks. Workshop: Build a model using submodels.

Structures. Identify and explain structure types. Workshop: Use the structure type to store saturation pressure parameters. Workshop: Use the structure type to store reaction data.

Handling Components and Physical Properties. Show how to set up properties to be used by Aspen Custom Modeler. Explain how to create Component lists. Show how to handle physical property calculation with procedures and submodels.

Workshop: Use Aspen Properties for the physical property calculations in ACM Snapshots and Results. Identify the purpose of snapshots and results. Explain usage of snapshot management tool. Show where snapshots and results are located.

Examples

Rewind and Restart operations. Copy Values and Advanced Copy Values. Workshop: Illustrate the use of Rewind and Snapshots. Tasks.

Aspen Custom Modeler Examples Guide

Identify the purpose of tasks. Explain syntax of task instructions. Workshop: Use the task feature to model a lifting valve and a step change on a variable. Solutions Methods.

Identify and explain group decomposition, variable equivalencing and non-linear system resolution. Discuss modeling advice recommendations. Review convergence troubleshooting options. Workshop: Use some of tools and settings available in Aspen Custom Modeler to troubleshooting convergence problems. Integration Methods.

Review integrator options. Present concept of index. Provide advice for troubleshooting Scripts and Automation. Show Simulation scripts.

Show how to run ACM from Excel (Automation). Workshop: Complete the workshop to illustrate use of scripts in Aspen Custom Modeler. Complete the workshop to illustrate use of automation of Aspen Custom Modeler with Excel. Optional Topics. Create procedures to interface ACM to FORTRAN/C/C calculations. Model partial differential equations.

Introduction to Estimation. Review of optimization capabilities. Export ACM models to Aspen Plus (or Aspen HYSYS®). Demonstrate Aspen Model Runner.

Each lecture is typically followed by a workshop.

Coments are closed