Aspen Simulation INTERface (Aspen Sinter)

architectgroundhogInternet και Εφαρμογές Web

4 Δεκ 2013 (πριν από 3 χρόνια και 7 μήνες)

96 εμφανίσεις

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


Aspen Sinter Configuration Files


Excel Interface


Aspen Sinter Usage


To do



‹#›

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

3

‹#›

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


‹#›

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




‹#›

Optimization Framework (sinter)

# Sinter
Config

File | mea.bpk

title | MEA
sim

author | John


Aspen Sinter Interface


Aspen+ or ACM

Excel, Web Server, etc.

‹#›

Sinter Usage Example


Simulation Workflow
Excel
Solve Efficiency
Cost Estimate
Compressor
Simulation
Aspen Plus
Input
Output
Optimization Scheduler
(
NSGA
-
II
)
sinter
Excel
Cost Estimate
Stripper
Simulation
Aspen Plus
sinter
Excel
Cost Estimates
Absorber
Simulation
Aspen Plus
sinter
Initial Input
modeFRONTIER
Power Plant Correlations
Cooling Tower Correlations
‹#›

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

‹#›

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




‹#›

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


‹#›

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
)

‹#›

Identifying Variables in Aspen Plus


Aspen Plus Variable Explorer

‹#›

Identifying Variables in ACM

List of all visible
variables in model

Graphical Forms

Tabular Form of
Selected Variables

List of all Forms in
model (square icons)

‹#›

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


‹#›

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

‹#›

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 …


‹#›

Setup File: Defaults and Limits (for UQ)



Vectors

default |
vec

| 200


| 982

max …


‹#›

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

‹#›

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


‹#›

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

‹#›

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_IOObject

getIOByIndex
(integer
i
)


sinter_IOObject

getIOByName
(string name)




‹#›

sinter_IOAspen

methods and properties


IO Object Query Functions


bool

isScalar


bool

isMat


bool

isVec


bool

isTable


bool

isInput


bool

isOutput



string name


string description


sinter_IOMode

mode


sinter_IOType

type


‹#›

sinter_IOAspen

methods and properties


IO Types

Public
Enum

sinter_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
Enum

sinter_IOMode


si_IN



si_OUT


End
Enum




‹#›

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



‹#›

sinter_IOAspen

methods and properties


IO Vector Objects


int

VSize


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

‹#›

sinter_IOAspen

methods and properties


IO Table and Matrix Objects


int

MNRows


property, highest row index


int

MNCols


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

‹#›

Using Sinter with ACM and VBA


Using ACM is mostly the same


Additional
homotopy

option

stest.homotopy

= true

stest.homopopy

= false



‹#›

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#