Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh...

17
2012 AIChE Meeting Pittsburgh PA 2012 AIChE Meeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order Models Jinliang Ma 1, 4 , Christopher Montgomery 1, 4 , Khushbu Agarwal 2 , Poorva Sharma 2 , Yidong Lang 5 , David Huckaby 1 , Stephen Zitney 1 , Ian Gorton 2 , Deb Agawal 3 , David Miller 1 1 US DOE/National Energy Technology Laboratory Morgantown WV 26507 U.S. DOE/National Energy Technology Laboratory, Morgantown, WV 26507 2 U.S. DOE/Pacific Northwest National Laboratory, Richland, WA 99352 3 U.S. DOE/Lawrence Berkeley National Laboratory, Berkeley, CA 94720 4 URS Corporation, Morgantown, WV 26505 5 Carnegie Mellon University Pittsburgh PA 15213 5 Carnegie Mellon University, Pittsburgh, PA 15213 This technical effort was performed in support of DOE’s Carbon Capture Simulation Initiative (CCSI) project under the RES contract RES0004000.2.600.232.001

Transcript of Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh...

Page 1: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

2012 AIChE Meeting Pittsburgh PA2012 AIChE Meeting, Pittsburgh, PA

Enforcing Elemental Mass and Energy Balances for Reduced Order Models

Jinliang Ma 1, 4, Christopher Montgomery 1, 4, Khushbu Agarwal 2, g , p g y , g ,Poorva Sharma 2, Yidong Lang 5, David Huckaby1 ,

Stephen Zitney 1, Ian Gorton 2, Deb Agawal 3, David Miller 1

1U S DOE/National Energy Technology Laboratory Morgantown WV 26507U.S. DOE/National Energy Technology Laboratory, Morgantown, WV 265072U.S. DOE/Pacific Northwest National Laboratory, Richland, WA 993523U.S. DOE/Lawrence Berkeley National Laboratory, Berkeley, CA 947204URS Corporation, Morgantown, WV 265055Carnegie Mellon University Pittsburgh PA 152135Carnegie Mellon University, Pittsburgh, PA 15213

This technical effort was performed in support of DOE’s Carbon Capture Simulation Initiative(CCSI) project under the RES contract RES0004000.2.600.232.001

Page 2: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

IntroductionMulti-Scale Models in Carbon Capture Simulation Initiative (CCSI)Multi-Scale Models in Carbon Capture Simulation Initiative (CCSI)

https:www.acceleratecarboncapture.orgPlant Scale

• Process (Aspen Plus, gPROMS)

Device Scale

( p g )

Device Scale• 1-D Reactor• Computational Fluid Dynamics

Scal

e

Single Particle Scale• Diffusion (Film, Pore)• Surface Adsorption/Reactions

S

Power Plant Process Model

Molecule Scale• Molecular Dynamics

C t ti l Ch i t

ROM

2

• Computational ChemistryCO2 AdsorberModel (CFD)

Page 3: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

High-Fidelity Model Versus ROM Hi h Fid lit M d l High-Fidelity Model

• e.g. CFD, Ideal Reactors (Equilibrium, Plug Flow, CSTR)• Based on first principles• Usually conserves mass/energy• Usually conserves mass/energy

If converged tightly• Slow (CPU Intensive)

Reduced Order Model (ROM)( )• Based on mathematical regression/interpolation

Kriging Artificial Neural Network (ANN) Others

• Not necessarily conserves mass/energy• Possible unrealistic predictions (negative species mass flow rates)• Fast• Fast

ROM as a Bridge Between Multiple Scales• Needs tight mass/energy balances

Important for recycles

3

Important for recycles

Page 4: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

REVEAL: CCSI’s ROM Generation SoftwareIn a form of unit operation model for PME (e g Aspen Plus ACM gPROMS)In a form of unit operation model for PME (e.g. Aspen Plus, ACM, gPROMS)

REVEAL

4

Page 5: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Enforcing Mass Balance

iN1

tN1

inm

in

in

N

NN

,2

,1

outn

out

out

N

NN

,2

,1

Species molar flow rate

FeedStreams

ProductStreams

inm, outn,

For each mole of species i, there are Ai,j moles of element j (j=1,2,…,l)e.g., for CH4, A1,1 =4, A1,2 =1, A1,3 =0, A1,4 =0

m

n

For element j:

Mass balance:

i

jiiniinj ANL1

,,,

i

jioutioutj ANL1

,,,

nm

ANAN (j 1 2 l)

5

Mass balance:

i

jioutii

jiini ANAN1

,,1

,, (j=1,2,…,l)

Page 6: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Correction Factors For Product Species

For product species i, Define:

Corrected Prediction

ROM Prediction

1,

,

,

,,

ROMouti

outiROMouti

ROMoutiouti

i NN

NNN

f

Corrected molar flow of species i: ROMoutiiouti NfN ,, 1

n

ROMm

Eqn. for solving fi:

Let

i

jiROMoutii

ijiini ANfAN

1,,

1,, 1

m

i

n

iji

ROMoutijiinij ANANL

1 1,,,,

(Mass imbalance)

Number of equations: l (one for each element)

(Based on element j)Then

i i1 1

01

,,

j

n

iji

ROMoutii LANf

Number of equations: l (one for each element)Number of unknowns: n (one for each product species)Notes: 1.Total mass will be balanced if individual elements are balanced.

2. if , set it to a small positive number. Use 0, ROMoutiN ROM

outiN ,01.0

6

Page 7: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Solving Correction FactorsScenario 1: n>lScenario 1: n>l

Approach: Find most reasonable correction factors by minimizingwhile enforcing mass balance for each element

n

iif

1

2

Algorithm: Lagrangian multiplier method (mass balance equations as constraints)

Lagrangian Function G:Lagrangian Function G:

Partial Derivatives of G:

l

j

n

ijji

ROMoutiij

n

iiln LANfffffG

1 1,,

1

22121 ,,,,,,,

Partial Derivatives of G: 

l

jjji

ROMoutii

i

ANffG

1,, 02 ni ,,2,1

Total number of equations: n+l

 

n

ijiji

ROMouti

j

LfANG1

,, 0

lj ,,2,1

7

Total number of unknowns: n+l

Page 8: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Solving Correction FactorsScenario 2: n<lScenario 2: n<l

A h Fi d b t fit f ti f t b l t l ti

Example: CO2 and H2O as products (2 species, 3 elements)

Approach: Find best fit for correction factors by least square solution

ljLfAN j

n

iiji

ROMouti ,,2,1

1,,

bfM

(Matrix is )nl M

Algorithm: Minimize quadratic

i 1

Solve: (Product matrix is )

2bfM

bMfMM TT

nn MM T

(Linear Least Square Method)

Total number of equations: nTotal number of unknowns: n

Solve: ( ) bMfMM

Note: Applicable to non-reacting devices

8

Page 9: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Enforcing Energy BalanceW

inin

inin

ThmThm,,,,

2,2,2

1,1,1

outout

outout

ThmThm,,,,

222

1,1,1

StSt

Port 1Port 2

Port 1Port 2

outW

pinpinp Thm ,, ,,

,,

qoutqoutq

outout

Thm ,,

,,

,,

2,2,2

Stream enthalpy

Stream mass flow rate

Port p Port q

FeedStreams

ProductStreams

s To TdTChyThStream Enthalpy: (If ideal gas mixture)

lossQ

kT kpkfkmix TdTChyTh

1,,

0Stream Enthalpy: (If ideal gas mixture)

Enthalpy Rate In: p

iiniiniin hmH

1,,

qp

QWhh E B l

Enthalpy Rate Out:i 1

q

ioutioutiout hmH

1,,

9

lossouti

outioutii

iniini QWhmhm 1

,,1

,,Energy Balance:

Page 10: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Enforcing Energy BalanceO ti 1 Adj ti h t lOption 1: Adjusting heat loss

ROMq

i

ROMouti

p

iiniiniloss outouti

WhmhmQ 1

,1

,, ,

Option 2: Adjusting product stream enthalpy/temperature

ROMloss

ROMoutinout QWHH Total Enthalpy Rate

of Products:

Total Enthalpy Rate Correction:

ROMout

ROMloss

ROMoutin

ROMoutoutout HQWHHHH

tim

E th l C ti P

outq

joutj

outiouti H

m

mH

1

,

,,Enthalpy Rate

Correction for Port i:

HEnthalpy Correction Per Unit Mass for Port i :

q

joutj

outouti

m

Hh

1,

,

Solve Temperature Ti iT

10

Solve Temperature Tifor Port i : TdTCh i

ROMi

T

T ipouti ,, (for product port i)

Page 11: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Implementations

CAPE-OPEN Unit Operation Model• Aspen Plus, gPROMS, COFE

Generation of Vendor Specific Source Code (Custom Model) Generation of Vendor Specific Source Code (Custom Model)• Aspen Custom Modeler (Equation-Oriented)• gPROMS (Equation-Based)

A Pl th h CAPE OPEN C C

11

Aspen Plus through CAPE-OPEN ACM through Custom Model

Page 12: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Example: Equilibrium Flow Reactor

CH4+Air→Products• Const p Adiabatic

kg/s1

K300

4

4

CH

CH

m

T

)8,1(for??

imT

i

exhaust

atm1p Model Predictions

Const p, Adiabatic• Reactants: CH4, O2, N2 (m=3)• Products: CH4, O2, N2, H2, H2O,

CO, CO2, NO (n=8) kg/s8.20,9.13

K420,280

i

air

mT

19.3

20.0

20.8

g/s)

, 2, ( )• Elements: C, H, O, N (l=4)• High-Fidelity Model: Aspen Plus

Latin Hypercube Sampling (LHS)

kg/s8.20,9.13airm

109

8

16.2

17.0

17.7

18.5

Flow

 Rate (kgyp p g ( )

• 10 samples• Two input variables

Air Temperature airT

airm

76

54

13.9

14.6

15.4

280 296 311 327 342 358 373 389 404 420

Air p

Air Mass Flow Regression Method

• Kriging

32

1

12

Air Temperature (K)• ANN

Page 13: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Example: Equilibrium Flow ReactorResponse Surface (Kriging)Response Surface (Kriging)

K280airT

0 6

0.7

0.8

0.9

st (kg/s)

0.3

0.4

0.5

0.6

e of O

2in Exhau ROM (Uncorrected)

ROM (Corrected)

Aspen Plus

‐0.1

0

0.1

0.2

Flow

 Rate

Flow rate of O2 in exhaust versus air temperature and air flow rate

Flow rate of O2 in exhaust versus air flow rate (280 K air temperature)

13 15 17 19 21

Air Flow Rate (kg/s)

13

air temperature and air flow rate air flow rate (280 K air temperature)

Page 14: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Example: Equilibrium Flow ReactorResponse Surface (Kriging)Response Surface (Kriging)

K280airT

0 6

0.7

0.8

0.9

ust (kg/s)

0.3

0.4

0.5

0.6

e of CO in

 Exhau

ROM (Uncorrected)

ROM (Corrected)

Aspen Plus

‐0.1

0

0.1

0.2

Flow

 Rat

Flow rate of CO in exhaust versus air temperature and air flow rate

Flow rate of CO in exhaust versus air flow rate (280 K air temperature)

13 15 17 19 21

Air Flow Rate (kg/s)

14

air temperature and air flow rate air flow rate (280 K air temperature)

Page 15: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Example: Equilibrium Flow ReactorResponse Surface (Kriging)Response Surface (Kriging)

K280airT

2200

2250

e (K)

2100

2150

ust Tem

peratur

ROM (Uncorrected)

ROM (Corrected)

2000

2050Exha

u

Aspen Plus

13 15 17 19 21

Air Flow Rate (kg/s)

Exhaust temperature versus air temperature and air flow rate

Exhaust temperature versus air flow rate (280 K air temperature)

15

temperature and air flow rate flow rate (280 K air temperature)

Page 16: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Conclusions

Enforcing elemental mass balance for ROM• Enforcing positive species flow rate

L i M lti li M th d (# f d t i # f l t )• Lagrangian Multiplier Method (# of product species > # of elements)• Least Square Method (otherwise)

Enforcing energy balance• Adjust heat loss• Adjust product enthalpy/temperature

Implementations Implementations• CAPE-OPEN unit operation model• Custom model in ACM and gPROMS languages

Corrected ROM predictions are usually closer to Corrected ROM predictions are usually closer to high-fidelity model predictions• Especially in regions with negative product flows predicted by ROM

16

Page 17: Enforcing Elemental Mass and Energy Balances for Reduced ... · 2012 AIChE Meeting Pittsburgh PAMeeting, Pittsburgh, PA Enforcing Elemental Mass and Energy Balances for Reduced Order

Disclaimer

This presentation was prepared as an account of worksponsored by an agency of the United States Government.N ith th U it d St t G t th fNeither the United States Government nor any agency thereof,nor any of their employees, makes any warranty, express orimplied, or assumes any legal liability or responsibility for theaccuracy completeness or usefulness of any informationaccuracy, completeness, or usefulness of any information,apparatus, product, or process disclosed, or represents that itsuse would not infringe privately owned rights. Reference hereinto any specific commercial product process or service byto any specific commercial product, process, or service bytrade name, trademark, manufacturer, or otherwise does notnecessarily constitute or imply its endorsement,recommendation, or favoring by the United States Government, g yor any agency thereof. The views and opinions of authorsexpressed herein do not necessarily state or reflect those ofthe United States Government or any agency thereof.

17