19
Integration of APECS and Aspen Dynamics Integration of APECS and Aspen Dynamics 1 © 2009 ANSYS, Inc. Proprietary - All rights reserved. © 2009 ANSYS, Inc. All rights reserved. 1 ANSYS, Inc. Proprietary NETL 2009 Workshop on Advanced Process Engineering Co-Simulation October 20-21, 2009 NETL 2009 Workshop on Advanced Process Engineering Co-Simulation October 20-21, 2009

Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Embed Size (px)

Citation preview

Page 1: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Integration of APECS and Aspen DynamicsIntegration of APECS and Aspen Dynamics

1 © 2009 ANSYS, Inc. Proprietary - All rights reserved.© 2009 ANSYS, Inc. All rights reserved. 1 ANSYS, Inc. Proprietary

NETL 2009 Workshop on Advanced Process Engineering Co-SimulationOctober 20-21, 2009

NETL 2009 Workshop on Advanced Process Engineering Co-SimulationOctober 20-21, 2009

Page 2: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Objective

• Develop a prototype APECS controller for transient co-simulation

• Demonstrate coupling between FLUENT and Aspen Dynamics

2 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

Page 3: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Technical Issues

• Aspen Dynamics does not have a CAPE-OPEN block like Aspen Plus

• To date, transient simulations have not been considered within the framework of CAPE-OPEN

• Unsteady CFD simulations are considerably more

3 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

• Unsteady CFD simulations are considerably more time-consuming than steady simulations

• Using unsteady CFD simulations within a co-simulation environment poses additional technical difficulties (e.g., “remembering” the initial state)– Assume quasi-steady– τCFD << τPlant

Page 4: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Available Capabilities

• Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported – Permits customization at the “block” level– Custom blocks can be used in Aspen Dynamics– Custom blocks can call external functions

4 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

• Simulation Access eXtension (SAX) capability– Operates at the “flowsheet” level– Can call functions at beginning/end of timestep

• ACM “Events”– Event triggers: OnDeletedBlock, OnNewBlock, etc.

• ACM Custom Forms– Customized GUI

Page 5: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Capabilities Used for Prototype

• Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported – Permits customization at the “block” level– Custom blocks can be used in Aspen Plus Dynamics– Custom blocks can call external functions

5 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

• Simulation Access eXtension (SAX) capability– Operates at the “flowsheet” level– Can call functions at beginning/end of timestep

• ACM “Events”– Event triggers: OnDeletedBlock, OnNewBlock, etc.

• ACM Custom Forms– Customized GUI

Page 6: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Aspen Dynamics Wrapper

• Custom block created in Aspen Custom Modeler

Custom Block

6 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

Available Inlet Ports Available Outlet Ports

Page 7: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Aspen Dynamics Wrapper (cont.)

Custom Block

• Custom block created in Aspen Custom Modeler

7 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

Connected Inlet Ports

Unit Conversion

Page 8: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Aspen Dynamics Wrapper (cont.)

Custom Block

• Custom block created in Aspen Custom Modeler

8 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

Connection to APECS Controller

Page 9: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Aspen Dynamics Wrapper (cont.)

Custom Block

• Custom block created in Aspen Custom Modeler

9 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

Connection to APECS Controller

Unit Conversion

Page 10: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Aspen Dynamics Wrapper (cont.)

Custom Block

• Custom block created in Aspen Custom Modeler

10 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

Connection to APECS Controller

Calculate enthalpy and molar volume

Page 11: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Aspen Dynamics Wrapper (cont.)

Custom Block

• Custom block created in Aspen Custom Modeler

11 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

Connection to APECS Controller

Connected Outlet Ports

Page 12: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Architecture for Dynamic Co-Simulation

APECS

Aspen Dynamics

ROM Builder

EKM

COUnitManagerAD

Wrapper

EKMWrapper

12 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

FLUENT

Other Solvers

APECS ControllerFLUENTWrapper

CORBAWrapper

Regression ROM

CAPE-OPENCOM Solvers

Page 13: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Aspen Dynamics Wrapper Functions

PRECALL

FINAL APPROACH

Create COUnitManagerStart FLUENTLoad Case/Data files

INITIAL APPROACH

Create COUnitManagerStart FLUENTLoad Case/Data files

13 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

OUTPUTS

POSTCALL

Set boundary conditionsConverge FLUENT modelReturn outputs

Exit FLUENTClean up

Load Case/Data filesSet boundary conditionsConverge FLUENT modelReturn outputsExit FLUENTClean up

PRECALL POSTCALLOUTPUTS OUTPUTS OUTPUTS…

Page 14: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Test 1 – Verify Correct Outputs

• 2D FLUENT “Dual Pipe” model– 2 inlets / 2 outlets, no mixing

14 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

Page 15: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Test 2 – Benchmark Run Times

• Case 1– Pipe Model ROM Template– Fastest APECS block– Steady and Dynamic Co-Simulation

• Case 2

15 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

• Case 2– 2D FLUENT “Triple Pipe” model– 1200 quad cells– 3 inlets / 3 outlets, no mixing– Steady and Dynamic Co-Simulation

Page 16: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Case 1 – Data Transferred

******************************* INPUTS *******************************

Block Name: PIPE_MODELNumber of Inlet Ports: 10Number of Outlet Ports: 10Number of CONNECTED Inlet Ports: 1Number of CONNECTED Outlet Ports: 1

Number of Species: 3Specie 0 is ETOHSpecie 1 is H2O

******************************** OUTPUTS *****************************

OUTPUTS was called 60 timesRetrieving the COUnitManager pointer. Block Name: PIPE_MODELSetting values of persistence strings in OUTPUTS no w.

Persistence String 0 is now InstanceKey_47Persistence String 1 is now UnusedPersistenceString _1Persistence String 2 is now UnusedPersistenceString _2

16 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

Specie 1 is H2OSpecie 2 is MEOH

Inlet Port Name = inlet_portInlet Flow Rate = 0.02 kg/sInlet Temperature = 313.15 KInlet Pressure = 100000.00 PaInlet Mass Fraction [0] = 0.2876Inlet Mass Fraction [1] = 0.1124Inlet Mass Fraction [2] = 0.6000

Outlet Port Name = outlet_port

Persistence String 0 is InstanceKey_47Persistence String 1 is UnusedPersistenceString_1Persistence String 2 is UnusedPersistenceString_2

Outlet flow rate for outlet_port is 0.02 kg/s

Outlet temperature for outlet_port is 313.15 K

Outlet Pressure for outlet_port is 99000.00 Pa

Outlet Mass Fractions for outlet_port are:Species [0]: 0.28755 (ETOH)Species [1]: 0.11246 (H2O)Species [2]: 0.59999 (MEOH)

************************************************************************

Page 17: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Case 2 – Dynamic Co-Simulation

17 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

Page 18: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Benchmark Results

Model Mode Inputs Simulation Time, s

Real Time, s “Output”Calls

Pipe Model ROM Template

Steady 407* 60

Pipe Model ROM Template

Unsteady Steady 5 7200 1080

18 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

ROM Template

2D FLUENT Model

Steady 1096 60

2D FLUENT Model

Unsteady Ramped (5 seconds)

10 22098 1380

*for comparison, this model takes ~1 second in Aspen Plus

Page 19: Integration of APECS and Aspen Dynamics - netl.doe.gov · PDF fileCapabilities Used for Prototype • Aspen Custom Modeler (ACM) permits user-defined blocks to be created and exported

Summary

• The feasibility of dynamic co-simulation was investigated

• A prototype Aspen Dynamics Wrapper was created to demonstrate dynamic co-simulation

• Run times were significantly longer for dynamic co -

19 © 2009 ANSYS, Inc. Proprietary - All rights reserved.

• Run times were significantly longer for dynamic co -simulation than for steady co-simulation

• Promising future research: use ROMs capable of computing derivatives (e.g., Regression ROM) and return Jacobian to Aspen Dynamics– Expected to significantly reduce the number of

“Output” calls required