1 / 28

Aspen Simulation INTERface (Aspen Sinter)

Aspen Simulation INTERface (Aspen Sinter). John Eslick Andrew Lee David Miller Computational Science Division Office of Research and Development. Outline. Aspen Plus Overview Aspen Custom Modeler (ACM) Overview Aspen Sinter Overview Installing Aspen Sinter

edana
Télécharger la présentation

Aspen Simulation INTERface (Aspen Sinter)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aspen Simulation INTERface (Aspen Sinter) John Eslick Andrew Lee David Miller Computational Science Division Office of Research and Development

  2. Outline • Aspen Plus Overview • Aspen Custom Modeler (ACM) Overview • Aspen Sinter Overview • Installing Aspen Sinter • Aspen Sinter Configuration Files • Excel Interface • Aspen Sinter Usage • To do

  3. Aspen Plus Overview • Concepts • Steady state simulator • Dynamics are handled in Aspen Dynamics • Simulator is flowsheet-based • Calculations • Material and energy balances • Sequential-Modular Calculation Method • Equation-oriented also supported • Key Advantages • Built-in process models • Extensive thermophysical property database

  4. Aspen Custom Modeler Overview • Models for process systems based on fundamental equations and correlations representing the behaviour of the system • Can interface with Aspen Plus, Aspen Dynamics and Aspen Properties • ACM is an Equation Oriented (EO) equation solver • algebraic • differential and • partial differential equations • Steady-state and dynamic modes • Parameter estimation and optimization

  5. Sinter Overview • Sinter is a software library written in Visual Basic • Has both COM and .Net interfaces • Standard Interface with Aspen software • Aspen Plus • ACM • Can be called from • Excel • Matlab • R • Any COM or .NET language

  6. Optimization Framework (sinter) Aspen+ or ACM # Sinter Config File | mea.bpk title | MEA sim author | John Aspen Sinter Interface Excel, Web Server, etc.

  7. Sinter Usage Example

  8. Installing sinter from Binary • Obtain the sinter files • Make a directory where you would like to install sinter • Copy the files from <path to sinter file>\ClassLibrary1\bin\Release to <sinter install path> • Open the command prompt type, replace <sinter install path> by the install directory: > C: > cd\Windows\Microsoft.NET\Framework\v4* > regasm c:\<sinter install path>\sinter.dll /codebase > regasm c:\<sinter install path>\Interop.Happ.dll /codebase

  9. sinter Configuration File • Corresponds to a certain, named, simulation file • Provides simulation meta-data • Defines Input/Output variables with: • Name • Type • Description (human readable) • Aspen Path • Optional Min, Max, Default

  10. Setup File, Basic Information • # ‘|’ is used as a separator • # Comment line • Meta-data: file | sim.bkp title | An example simulation author | John date | Jan. 1, 2021 description | Something to use as example

  11. Setup File, Variable Definitions • name | mode | type | description | string • name – name of a variable • ‘.’ used as path separator: absorber.gas.stream.mass • mode • input • output • type • double • Integer • double(n,m) • double(n) • table • description – human readable comment. Often units • string – Aspen Path (Fully qualified name in sim)

  12. Identifying Variables in Aspen Plus • Aspen Plus Variable Explorer

  13. Identifying Variables in ACM Tabular Form of Selected Variables List of all visible variables in model List of all Forms in model (square icons) Graphical Forms

  14. Setup File, Table Setup • Related variables can be organized into a table • Labels are for human reading • Strings are replaced in the path to make each var in the table • Table strings include a %r and %c • %r and %c subsituted with rString and cString steams | output| table| stream table | \Data\Streams\%r\Output\STR_MAIN\%c rLables | streams | stream 1 | steam 2 rStrings| streams | S-01 | S-02 cLables | T (F) | P (psia) cStrings| TEMP\MIXED | PRES\MIXED • Example of first resulting string: • \Data\Streams\streams\Output\STR_MAIN\TEMP\MIXED

  15. Setup File, Table Setup • Automatic Tables steams | output| table| stream table | \Data\Streams\%r\Output\STR_MAIN\%c rstrings_ForEach| streams | MATERIAL cLables | T (F) | P (psia) cStrings| TEMP\MIXED | PRES\MIXED

  16. Setup File: Defaults and Limits (for UQ) • Scalars default | S1 | 200 max | S1 | 400 min | S1 | 100 • Tables • (Example is a 2x3 table) default | tbl | 200 | 243 | 82 | 982 | 145 | 790 max …

  17. Setup File: Defaults and Limits (for UQ) • Vectors default | vec| 200 | 982 max …

  18. Sinter Structure • .NET library written in Visual Basic • Generic Classes • sinter_Sim • sinter_IOObject • sinter_setupFile • Aspen Plus Classes • sinter_SimAspen • sinter_AspenIO • ACM Classes • sinter_SimACM • sinter_ACMIO

  19. sinter_SimAspen methods and properties • Open Aspen • string workingDir • Property, the directory where simulation files and output files are stored • readSetup(string sfile) • sfile is the full path to the sinter configuration file • Reads config file and opens Aspen • Closing Aspen • stest.closeSim() • Closes the simulation program • Making Aspen Visible or Invisible • Boolean vis • Property, show or hide Aspen Plus GUI

  20. Using Sinter with Aspen Plus and VBA • Running a simulation stest.runName = “run-0001” stest.runSim • Getting Simulation Information Dim author as string = stest.author Dim description as string = stest.description Dim date as string = stest.revDate Dim title as string = stest.title

  21. sinter_SimAspen methods and properties • Input/Output • Integer countIO • Read only property • number of input and output variables • restoreInputDefaults() • Sets all inputs to there defaults • sendSim() • Send variable values stored in sinter to Aspen • recvSim() • Get Output Variable values from Aspen • sinter_IOObjectgetIOByIndex(integer i) • sinter_IOObjectgetIOByName(string name)

  22. sinter_IOAspenmethods and properties • IO Object Query Functions • boolisScalar • boolisMat • boolisVec • boolisTable • boolisInput • boolisOutput • string name • string description • sinter_IOModemode • sinter_IOType type

  23. sinter_IOAspen methods and properties • IO Types Public Enumsinter_IOType 'data types si_INTEGER si_DOUBLE si_INTEGER_VEC 'Vector si_DOUBLE_VEC si_INTEGER_MAT 'Matix si_DOUBLE_MAT si_STRING 'string variable si_TABLE 'table End Enum • IO Modes Public Enumsinter_IOMode si_IN si_OUT End Enum

  24. sinter_IOAspen methods and properties • IO Scalar Objects • object value • current value of a variable • object maximum • maximum allowable value • object minimum • minimum allowable value • object default • default value

  25. sinter_IOAspen methods and properties • IO Vector Objects • intVSize • property, the number of elements in a vector • object VElement(i) • property, value of a matrix or table element • object VElementMax(i,j) • property, maximum vale of a matrix or • object VElementMin(i,j) • object VElementDefault(i) • Vector indexes start at 0

  26. sinter_IOAspen methods and properties • IO Table and Matrix Objects • intMNRows • property, highest row index • intMNCols • property, highest col index • object Melement(i,j) • property, value of a matrix or table element • object MelementMax(i,j) • property, maximum vale of a matrix or • object MelementMin(i,j) • object MelementDefault(i,j) • Matrix indexes start at 0

  27. Using Sinter with ACM and VBA • Using ACM is mostly the same • Additional homotopy option stest.homotopy = true stest.homopopy = false

  28. Sinter Future Work • Add support for dynamic simulations • ACM has dynamic simulation capabilities that are not currently supported • Aspen Dynamics • Add Aspen Plus equation oriented support • Add error trapping and type checking • Add support for interface to spreadsheet software • Update Configuration File Format • Rewrite in C#

More Related