Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

24
Start Presentation September 21, 2009 Modeling Chemical Reactions in Modelica By Use of Chemo-bonds Prof. Dr. François E. Cellier Department of Computer Science ETH Zurich Switzerland Dr. Jürgen Greifeneder Corporate Research Center ABB Germany

description

Modeling Chemical Reactions in Modelica By Use of Chemo-bonds. Prof. Dr. Fran çois E. Cellier Department of Computer Science ETH Zurich Switzerland. Dr. J ürgen Greifeneder Corporate Research Center ABB Germany. - PowerPoint PPT Presentation

Transcript of Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Page 1: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Modeling Chemical Reactions in ModelicaBy Use of Chemo-bonds

Prof. Dr. François E. CellierDepartment of Computer Science

ETH ZurichSwitzerland

Dr. Jürgen GreifenederCorporate Research Center

ABBGermany

Page 2: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Chemical Reactions and Convective Flows

• Most researchers model chemical reactions using (molar) mass flow equations only, not taking into account energy flows at all.

• This is possible for isothermal and isobaric reactions, but in general doesn’t work, because the reaction rate constants depend on temperature and in the case of gaseous reactions also on pressure.

• A better approach to modeling chemical reaction systems is by means of bond graphs. This shall be demonstrated here.

Page 3: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Hydrogen-Bromine Reaction I

• Given the following balance reaction:

• Its individual step reactions are known and well understood:

H2 + Br2 2HBr⇌

Page 4: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Hydrogen-Bromine Reaction II• The mass flow equations can be written as follows:

• where:

Br2 = –k1

+ k2 – k5

Br· = 2k1 – 2k2

– k3 + k4

+ k5

H2 = –k3

+ k4

H· = k3 – k4

– k5

HBr = k3 – k4

+ k5

k1 = k1 · nBr2

k2 = k2 · (nBr·)2 /V k3

= k3 · nH2 · nBr· /V

k4 = k4 · nHBr · nH· /V k5

= k5 · nH· · nBr2 /V

Page 5: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Chemical Energy Flow• Each mass flow is accompanied by a chemical energy

flow:

• such that:

molar flow rate

chemical potential

J/mol]

mol/sec]

g [J/kg]

m [kg/sec].TF

mass flow rate

Gibbs potential

Page 6: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Hydrogen-Bromine Reaction III• The step reactions can be interpreted as a bond graph:

Br2 = –k1

+ k2 – k5

reaction rate equations

k1 = 2Br

– Br2

energy flow equations

Page 7: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Hydrogen-Bromine Reaction IV• Programmed in BondLib:

Page 8: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Hydrogen-Bromine Reaction V• Simulation results:

Page 9: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009December 4, 2008

Hydrogen-Bromine Reaction VI• The reaction rate equations can be rewritten in a matrix-

vector form:

• or:

Br2 –1

+1

0 0 1 k1

Br· +2 –2 –1

+1

+1 k2

H2 = 0 0 –1

+1

0 · k3

H· 0 0 +1

–1

–1 k4

HBr 0 0 +1

–1

+1 k5

mix = N · reac

Page 10: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009December 4, 2008

Hydrogen-Bromine Reaction VII• The energy flow equations can also be written down in a

matrix-vector form:

• or:

k1 –1

+2

0 0 0 Br2

k2 +1

–2 0

0

0 Br·

k3 = 0 –1

–1

+1

+1 · H2

k4 0 +1 +1

–1

–1 H·

k5 1 +1 0

–1

+1 HBr

reac = NT · mix

Page 11: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009December 4, 2008

• Thus, the bond graph describing the chemical reaction network can be reinterpreted as a multiport transformer:

• where:

The Chemical Reaction Network I

mix = N · reac

reac = NT · mix

mix

mixMTF

N

reac

reac

Page 12: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009December 4, 2008

The Chemical Reaction Bond Graph

• We can now plug everything together:

mix

mixMTF

N

reac

reacCF RF

Capacitive storage of all reactants in the mixture.

Transformation of the reactants into each other in the chemical reaction.

Page 13: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Hydrogen-Bromine Reaction VIII• Programmed in MultiBondLib:

Page 14: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Hydrogen-Bromine Reaction IX

Page 15: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Chemical Reactions and Convective Flows

• The chemical reaction bond graph, as shown until now, still doesn’t reflect the physics of chemical reactions in all their complexity.

• The problem is that a substance that undergoes a transformation does not only carry its mass along, but also its volume and its heat.

• Hence we should describe each step reactions by three parallel bonds, one describing mass flow, a second describing volumetric flow, and a third describing heat flow.

• Thus, we should really use thermo-bonds.

Page 16: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Thermo-bonds

• A (red) thermo-bond represents a parallel connection of three (black) regular bonds.

Page 17: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Thermo-bonds and Chemo-bonds• The (green) chemo-bonds and the (red) thermo-bonds are

essentially the same thing. However, the thermo-bonds have been designed for convective flows, and therefore, operate on regular mass flows (measured in kg/sec), whereas the chemo-bonds were designed for chemical reactions, and therefore, operate on molar mass flows (measured in mol/sec).

Page 18: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Hydrogen-Bromine Reaction X• This version of the chemical

reaction network contains more information than the original one. Yet it is simpler, because the thermal and pneumatic ports don’t need to be carried separately any longer. They are now integrated into the chemical reaction network. Each mass flow carries its own volumetric and heat flows along.

Page 19: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009December 4, 2008

• Also the thermo-bond graph describing the chemical reaction network together with its volumetric and heat flows can be reinterpreted as a multiport transformer:

• This transformer is now of cardinality 15, as there are 5 step reactions, each represented by a thermo-bond of cardinality 3.

The Chemical Reaction Network II

Page 20: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009December 4, 2008

Hydrogen-Bromine Reaction XI

Page 21: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009December 4, 2008

Hydrogen-Bromine Reaction XII

Page 22: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Efficiency Considerations

• The simulations are so fast that there is very little difference between all four of these models.

Page 23: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Conclusions I• Chemical reactions are quite tricky. To model chemical

reactions down to their physical and, in particular, thermodynamic properties quickly leads to models that are rather bulky.

• The bond graph methodology offers us a unified framework to deal with this complexity in an orderly and organized fashion.

• To this end, we used all three of our bond graph libraries; BondLib, featuring (black) regular bonds, MultiBondLib, featuring (blue) vector bonds, and ThermoBondLib, featuring (red) special vector bonds for the description of convective flows.

Page 24: Modeling Chemical Reactions in Modelica By Use of Chemo-bonds

Start PresentationSeptember 21, 2009

Conclusions II• To deal with chemical reactions more conveniently, we

introduced even a fourth bond graph library: ChemBondLib, featuring (green) special vector bonds for the description of chemical reaction flow rates.

• The chemo-bonds are identical to the thermo-bonds, except that they describe their internal mass flows with molar flow rates and chemical potentials, rather than with regular mass flow rates and Gibbs potentials (the specific Gibbs energy).