PROCEEDINGS OF ECOS 2022 - THE 35TH INTERNATIONAL CONFERENCE ON
EFFICIENCY, COST, OPTIMIZATION, SIMULATION AND ENVIRONMENTAL IMPACT OF ENERGY SYSTEMS
3-7 JULY, 2022, COPENHAGEN, DENMARK
Thermal Engineering Systems in Python (TESPy): The
implementation and validation of the chemical exergy
Mathias Hofmanna, Francesco Witteb, Karim Shawkyc, Ilja Tuschyd,
and George Tsatsaronise
aTechnische Universit¨
bGerman Aerospace Center (DLR), Institute of Networked Energy Systems, Oldenburg, Germany,
francesco.witte@dlr.de
cTechnische Universit¨
at Berlin, Berlin, Germany, k.shawky@campus.tu-berlin.de
dFlensburg University of Applied Sciences, Flensburg, Germany, ilja.tusch[email protected]
eTechnische Universit¨
Abstract:
Exergy-based methods enable to reveal thermodynamic inefficiencies and propose appropriate optimization
approaches for energy conversion processes. TESPy, a free and open-source Python library for the analysis
of thermal engineering applications, was expanded to perform generic exergy analyses in previous work. This
contribution presents the implementation of the previously missing chemical exergy, and aims to validate re-
spective simulations with data from literature. For that, the calculation of chemical exergies of pure substances
and mixtures, that usually occur in energy conversion processes, is described. Where available, standard
chemical exergies are compiled for substances listed in the free and open-source library CoolProp. Different
tables for the standard values can be selected or entered by the user. The approach is then applied to pro-
cess simulations involving conversion of substances based on the CGAM process. Thermodynamic property
calculations are successfully validated using different Python-based back-ends. However, it is also shown that
compared to simple and partly inaccurate polynomials, the calculation time increases by a factor of three. The
results of the overall process simulation are compared to respective Ebsilon calculations and show no sub-
stantial differences. Finally, the exergy analysis for the overall process based on state-of-the-art substances
data and TESPy cycle calculations is presented. With the work presented here, engineers may use TESPy
to perform exergy-based analyses for energy conversion processes including chemical reactions, e.g. gas
turbines.
Keywords:
Thermodynamic Analysis, Exergy, Simulation, Python, Energy Conversion Process.
1. Introduction
Energy conversion systems are complex technical installations. With regard to cost efficiency and environmental
impact, the thermodynamic analysis of respective plants is of high interest: Considerable improvements in
design and operation can be achieved by using exergy as an extensive property for all flows of matter and
energy within the system or crossing the system boundary [1]. Even if possible, it is not reasonable to perform
analytical calculations by hand with respect to time efficiency [2]. Consequently, the systematic numerical
analysis of such systems in terms of design, operating parameters or plant optimization, needs the support of
computational hardware and appropriate software.
In the following, we focus on simulation. As already summarized [3], numerous software, proprietary or free
and open-source, is currently available. However, determining exergy values or performing exergy analyses is
not possible without additional effort.
TESPy, a free and open-source Python library [4], provides a generic exergy analysis subsequent to the solution
of the system of equations based on a object-oriented programming approach. A specification of exergy
balances for the components, definition of exergetic efficiencies, etc. is not required. The user only has to
specify the exergy balance of the overall system, which means to assign exergetic fuel
˙
ETOT
F
, the exergetic
product ˙
ETOT
Pand exergy losses ˙
ETOT
Lin (1).
˙
ETOT
F=˙
ETOT
P+˙
ETOT
D+˙
ETOT
L(1)
The analyses can then be performed automatically. But up to now it was only based on physical exergy, which
means that it is limited to processes without material conversion. [3]
Proceedings of ECOS 2022 - The 35th International Conference on
Efficiency, Cost, Optimization, Simulation and Environmental Impact of Energy Systems
July 4-7, 2022, Copenhagen, Denmark
257
As a next step of TESPy development the introduction of the chemical exergy is proposed, as in already available
software a comprehensive calculation of specific chemical exergies is usually not implemented, cf. [3]. This would
first require an internationally accepted standard reference environment for the calculation of standard chemical
exergies. Approaches have been published among others by Baehr and Schmidt [5], Bo
ˇ
snjakovi
´
c [6], Fratzscher
and Gruhn [7], Riekert [8], Gaggioli and Petit [9], Szargut et al. [10
–
14], Ahrents [15,16], Kameyama [17], van
Gool [18], Diederichsen [19], Shieh [20], Stepanov [21,22] etc. A discussion of some of these approaches can
be found in [23]. Particularly with regard to the analysis of energy and chemical engineering processes, theses
models have varying degrees of suitability. Despite numerous proposals and contributions to the discussion,
no standard reference environment for the calculation of standard chemical exergies has yet been established
internationally.
Several tools or routines, which at least partially represent the calculation of chemical exergies are closed-source,
and no longer available, distributed, or further developed, e.g. routines for Aspen Plus [24
–
30], Aspen Hysys [31],
ProSimPlus [32], Sim42 [33], or not assigned to a specific software [34,35]. The first simulation tool with an
integrated exergy analysis for chemical and energy engineering was the computer program THESIS [36].
Implementing the calculation of chemical exergies of pure substances and mixtures in TESPy and validating
respective simulations is the aim of the present work. All validations are carried out using a well known and
fully documented process from the literature. The source code is publicly available, via github as part of the
TESPy project, and can be freely used as well as further developed cooperatively. For the first time a free
and open-source software focusing on energy conversion processes and including the exergy-based analysis
is available. All input data, simulations, and scripts used for validation and their results can be obtained via
zenodo [37].
The article is structured as follows: The chemical exergy methodologies applied here are summarized in the
next section. Afterwards, the implementation is presented. Simulations performed for validation purposes and
the results of the exergy analysis are discussed in Section 4., which is followed by the conclusions.
2. Chemical Exergy
The product of mass flow rate and specific exergy equals the total exergy rate. Assuming that effects associated
with nuclear, magnetic, or electric processes remain unconsidered [1], the specific exergy consists of the values
of physical ePH, chemical eCH, kinetic eKN and potential exergy ePT.
˙
E=˙
mePH +eCH +eKN +ePT(2)
For most applications in energy and chemical engineering, potential and kinetic energies can be neglected
because within the common unit operations changes of these energies are usually negligible. The physical
exergy of a material stream is calculated using its enthalpy and entropy. This calculation is already implemented
in TESPy, cf. [3].
For the calculation of the chemical exergy of pure substances or mixtures, which takes place at
T0
and
p0
, the
chemical exergy at standard conditions of all components and the chemical composition must be known. Based
on the different proposals for the thermodynamic reference environment, values of standard chemical exergy
have already been calculated and listed in data tables.
In case of a pure substance the chemical exergy is identical to the table value. Fluids like air, flue gas or fuels
are usually mixtures of
n
substances (gases or liquids). The composition is given as molar fraction
xi
, or mass
fraction yifor every substance i.
xi=yi/Mi
Pyi/Mi
or yi=xiMi
PxiMi
(3)
As long as all individual substances of a mixture are gaseous at
T0
and
p0
and the mixture can be considered
as an ideal one, the chemical exergy can be calculated based on the individual standard chemical exergies of
the substances involved. The values for eCH
iare taken from the tables mentioned above. [1,38]
eCH =XxiMi−1·XxieCH
i+R T0Xxiln xi(4)
In the case of gas mixtures with constituents that are partially condensable at ambient temperature, e.g. water, it
must be checked whether the partial pressure of the component in the mixture is greater than the corresponding
saturated vapor pressure at ambient conditions.
xH2O·p0>psat
H2O(T0)(5)
ECOS 2022
258
If inequality
(5)
is fulfilled, a part of the water x
H2O(l)
is liquid. The remaining components of the mixture including
water vapor will be in the gas phase, the composition of which must be corrected.
xgas = 1 −xH2O(l) =X
i= H2O
xi+xH2O(g) and x′
i=xi
xgas
(6)
Using the corrected molar fractions x′
i, the chemical exergy of the mixture can be determined.
eCH =XxiMi−1·xgas Xx′
ieCH
i+R T0Xx′
iln x′
i+xH2O(l) eCH
H2O(l) (7)
For other mixtures, e.g. solid fuels, approaches for the calculation of the chemical exergy can be found in [1],
which will not be discussed further here, since these are not yet covered by the first implementation steps in
TESPy described below.
Similar to the physical exergy, which can be divided into its thermal and mechanical parts, it is possible to
examine the chemical exergy as the sum of a reactive and a non-reactive part. The part of chemical exergy
associated with the non-reactive effects usually cannot be used in energy conversion processes and therefore
has no economic relevance. However, in exergoeconomic analyses of certain processes, splitting can be useful.
Examples of this are separation processes, the goal of which is to increase the non-reactive part of the chemical
exergy. [1,39,40]
3. Implementation
The calculation of the chemical exergy is intended to be implemented in the existing simulation environment.
This will be done analogously to the method for the physical exergy, which is described in more detail in [3].
To that end, new functions must be be created and tested, see Figure 1, marked in red. For every con-
nection within the process, the physical and chemical exergies are to be determined. Consequently, a new
function calc chemical exergy() is placed in the fluid properties module of TESPy, which is called by the
get chemical exergy() method of each connection. Furthermore, the balance equations for system components
with chemical conversion processes have to be defined to enable the exergy analysis of the overall process.
For the calculation of the chemical exergy of every connection, the fluid is categorized as a pure substance or
as a mixture in a first step. For mixtures, the flash routine is obligatory. If any condensation takes place, the
molar fraction of the gas phase must be recalculated, see
(6)
. Subsequently, the calculation of the chemical
exergy refers to the provided values of the standard chemical exergies. Values from [11,14, 15] are already
included as separate Python dictionaries. The user may also specify own values.
fluid_properties module
calc_physical_exergy():
calc_chemical_exergy():
pure substance, mixture
class Connection:
get_chemical_exergy():
if condensation:
update molar analysis
class Network:
class Component:
class Bus:
connections
class ExergyAnalysis:
components
busses
results
...
solve()
label
...
get_physical_exergy():
...
dictionary
Chem_Ex = {
str: 'fluid_name': [
str: 'CAS-No.',
float: eCH(s),
float: eCH(l),
float: eCH(g),
int: 1,2,3
],...
}
Figure 1: Simplified structure of the intended implementation of chemical exergy calculation within TESPy
A future step in development is to calculate standard chemical exergy values based on a user defined reference
environment instead of falling back to literature values, since this would allow more flexibility in the analysis and
will assure that all chemical exergy values are consistent with the thermodynamic properties used to calculate
enthalpies and entropies. The respective routine or library would be imported to replace the data shown in
Figure 1.
4. CGAM process: Validation and exergy-based analysis
To compare different methodologies, a simple problem of optimization was defined in 1990. The CGAM
problem [41
–
45], named after the first initials of the participating researchers
1
, was referred multiple times
to introduce, improve, and apply methods of energy engineering analyses, e.g. [46
–
66]. We focus on the
thermodynamic modeling of the process as described in [1], as we use this example for validation of the
simulation and exergy analysis with TESPy. The energy conversion process shown in Fig. 2 is intended to
provide process steam in addition to mechanical output.
1C. Frangopoulos, G. Tsatsaronis, A. Valero, and M. von Spakowsky
ECOS 2022
259
APH
CC
EXPAC
HRSG
EV
ECO
Air
Fuel
Flue gas
Water
Steam
1
2
34
566P
7
8 8P
9
10
7
6P
6
8
8P
9Pinch
HRSG
AC
APH
CC
EXP
EV
ECO
HRSG
Air compressor
Air preheater
Combustion chamber
Expander
Evaporator
Economizer
Heat-recovery steam generator
Figure 2: Flow diagram of the CGAM process
Air at ambient state enters the process via the air compressor (AC). An air preheater (APH) is used to increase
the temperature. The reaction of the supplied fuel with the air takes place in the combustion chamber (CC).
The high physical exergy of the flue gas is converted into work using the expander (EXP). After passing the hot
side of the air preheater the flue gas enters the heat recovery steam generator (HRSG). To provide the process
steam, water is first preheated in an economizer (ECO) and then evaporated (EV).
All parameters and decision variables based on data given in [1]. The values are collected in Table 1. In a
thermodynamic simulation the dependent variables summarized in Table 2 must be determined.
If the HRSG should be simulated in detail as a combination of ECO and EV two additional temperature values
can be calculated, see diagram in Fig. 2. The temperature T
8P
at the outlet of the ECO results from the given
approach point temperature difference T
A
. From the energy balance of EV the flue gas temperature T
6P
can be
calculated. Since T9is constant, the value is affected by T6and the heat capacity flow rate of the flue gas.
4.1. Particularities of TESPy model
In TESPy, component-based pressure losses can be accounted by specifying the ratio r
p
as shown in
(8)
. Since
the data provided by [1] use pressure losses
∆
pas input values instead, the pressure ratio is calculated by
(10)
.
rp=pout
pin
(8)
pout =pin (1−∆p)(9)
rp= 1 −∆p(10)
A new type of combustion component was implemented in TESPy [37], to meet all requirements of the
CGAM process. Using the class DiabaticCombustionChamber heat losses over the component surface to
the environment can be simulated. In addition, pressure losses within the component with respect to the air
pressure according to
(8)
can be taken into account. Also, the fuel is supplied to the component at the same or
higher pressure compared to the air. Therefore a consistency check in terms of fuel pressure is carried out at
the end of every simulation.
Regarding the heat losses, it is assumed that the loss can be calculated as a precentage of the thermal input
˙
mfuel ·
LHV
fuel
. Therefore the thermal efficiency
ηCC
is introduced in the energy balance of the combustion
chamber, see
(11)
. By subtracting the enthalpy of common temperature and pressure, an error due to different
reference point definitions of the involved fluids can be prevented.
0 = ˙
mout ·(hout −hout,ref)−X
i
˙
min,i·(hin −hin,ref)i−˙
mfuel,in ·LHVfuel ·ηcc (11)
4.2. Validation of combustion chamber
The model for the validation of the combustion chamber is depicted in Figure 3. All variables listed there, are
given values. In addition, a model for the thermodynamic properties is required to calculate the enthalpies and
the lower heating value of the fuel.
ECOS 2022
260
Table 1: CGAM process, parameters and decision variables [1]
Parameter, decision variable Symbol Unit Value
Ambient state
Temperature T0K 298.15
Pressure p0bar 1.013
Overall process requirements
Net power output ˙
Wnet MW 30
Mass flow rate of steam ˙
msteam kg/s 14
Pressure of steam psteam bar 20
Quality of steam x– 1
Overall process decision variables
Pressure ratio of compression rp,AC – 10
Isentropic efficency of air compressor ηs,AC – 0.86
Isentropic efficency of expander ηs,EXP – 0.86
Combustion chamber inlet temperature T3K 850
Expander inlet temperature T4K 1520
Remaining flow- and component-based specifications
Air
Molar analysisaxi,air –
0.7748
0.2059
0.0003
0.0190
0.0
Fuel
Temperature T10 K 298.15
Pressure p10 bar 12
Molar analysis xi,fuel –(... , 1.0)
Lower heating value LHVfuel MJ/kg 50.01315
APH
Pressure loss, air side ∆pair,APH – 0.05
Pressure loss, flue gas side ∆pfluegas,APH – 0.03
CC
Thermal efficiency ηCC – 0.98
Pressure loss ∆pCC – 0.05
HRSG (ECO, EVAP, DRUM)
Approach point temperature difference TAK 15
Pressure loss, flue gas side ∆pfluegas,HRSG – 0.05
Pressure loss, water side ∆pwater,HRSG – 0
aAll fluid compositions are given as xi=xN2,xO2,xCO2,xH2O,xCH4T
Table 2: CGAM process, dependant variables
Variable Symbol
Mass flow rates (air, fuel, flue gas) ˙
mi
Molar analysis of flue gas xi,fluegas
Pressures p2,p3,p4,p5,p6
Temperatures T2,T5,T6,T7
Work rates ˙
WAC,˙
WEXP
ECOS 2022
261
CC
34
10
Figure 3: Model of the combustion chamber with all known parameters
Table 3: Validation of combustion chamber
Ref. value Value from TESPy using
Variable Symbol Unit from [1] Ref. [67] CoolProp [68]
Mass flow rate of air ˙
m3kg/s 91.2757 91.2757 91.2757
fuel ˙
m10 kg/s 1.6419 1.6419 1.6527
Molar analysis of flue gas xi,fluegas –
0.7507
0.1372
0.0314
0.0807
0.0
0.7507
0.1372
0.0314
0.0807
0.0
0.7505
0.1368
0.0316
0.0810
0.0
Using this model four dependent variables can be calculated:
˙
mfuel
,
˙
mfluegas
,p
fluegas
,x
i,fluegas
. The mass flow
rate of the fuel
˙
mfuel
and the molar analysis of the flue gas x
i,fluegas
are calculated from the mass and energy
balances of the combustion chamber. The pressure of the flue gas p
fluegas
is calculated with the given pressure
loss of the combustion chamber. The mass flow rate of the flue gas is calculated using the mass balance.
In a first attempt, the calculation for the combustion chamber using TESPy will be validated with data from
literature [1]. For this purpose, the polynomials of Knacke et al. [67] were supplemented for their use in TESPy.
The LHV listed in Table 1 was used. Another calculation is based on identical input data but state of the art
thermodynamic property data from the CoolProp library [68]. In this case the lower heating values of gaseous
fuels are calculated from enthalpies of formation
2
at standard conditions without additional efforts by TESPy.
For methane, this results in a value of 50.02630 MJ/kg.
Table 3 shows selected results of the validation for the combustion chamber. No deviation between the data
from [1] and the calculation with TESPy using thermodynamic properties from [67] can be observed, given, that
the lower heating value is at 50.01315 MJ/kg as provided in reference [1].
Considering the CoolProp implementation, the results deviate on a very low level due to the differences in the
lower heating value and fluid property functions. Based on the values from literature [1], the highest deviation
regarding the molar analysis are observed in the water and the carbon dioxide fractions, which are 0.43% and
0.68% respectively. The fuel mass flow in CoolProp is higher by 0.66% than in the results from [1]. Comparing
the calculation performance of the polynomial implementation of [67] and CoolProp in TESPy, the polynoms are
faster by a factor of three (about 220 Newton iterations per second) compared to CoolProp (about 75 Newton
iterations per second). However, with the improvements of processing power in the last decades, in our opinion,
there is no reason to use the simplified polynomial equations of state. Additionally, numerical solvers often show
improved stability and faster convergence when using full equations of state instead of polynomial functions.
The following analyses will be carried out with the more sophisticated fluid property models.
4.3. Validation of the overall process
In the second step, a model of the process plant has been created using the industry standard software
Ebsilon (v. 15.02) to validate the TESPy simulation. For this, instead of the air mass flow the net power output of
the system is applied in the model according to the data in Table 1. Note, that the combustion chamber models
in Ebsilon do not allow to use the HEOS [71] fluid property back-end implemented in Coolprop. Air and flue gas
are calculated using FDBR equations [72]. Therefore, the deviations observed in between these two models
can be traced to this fact.
The air and flue gas mass flows in TESPy match the values from Ebsilon and deviate by less than 0.018%. The
fuel mass flow is higher by 0.14% in TESPy. The relative deviations in temperature values is less than 0.1%
2Data from [69] for H2O and CO2, and from [70] for CH4
ECOS 2022
262
Table 4: Validation of CGAM process, reference values and relative deviations
Ref. value ∆rel =Y
Yref −1·100 (%)
Dependant variable YSymbol Unit from [1] Ebsilon TESPy
Mass flow rate of air ˙
mair kg/s 91.2757 -0.35 -0.37
fuel ˙
mfuel kg/s 1.6419 +0.15 +0.29
Molar analysis of flue gas xi,fluegas –
0.7507
0.1372
0.0314
0.0807
0.0
−0.017
−0.211
+0.541
+0.310
+0.000
−0.022
−0.287
+0.677
+0.432
+0.000
Temperature at outlet of AC T2K 603.738 +1.20 +1.29
EXP T5K 1006.162 +0.48 +0.51
APH T6K 779.784 +1.85 +1.93
HRSG T7K 426.897 +0.74 +0.84
Work rate of AC ˙
WAC MW 29.662 -0.01 +0.11
EXP ˙
WEXP MW 59.662 -0.02 +0.04
for all streams. Enthalpy and entropy differences range mostly from 0.01% to 0.17%. The highest deviation is
observed in the entropy at stream 6 with 0.36%. The values for pressure result from the pressure specifications
and the pressure losses in each component. Therefore, they are independent of the fluid properties applied in
the respective model and deviations in these data are caused by rounding errors. Table 4 lists the deviations in
the results of the TESPy and Ebsilon model with respect to [1].
After the full validation of the thermodynamic model, the results of the exergy analysis are presented in the next
section. The analysis was specifically designed for the CGAM case, the integration of the routines into TESPy’s
source code is still under development.
4.4. Exergy-based analysis
Using the implemented routines, the physical and chemical exergy of the streams were determined. The model
of Ahrendts is used for the standard chemical exergies. Table 5 presents the results in comparison with the
literature values. Due to the deviating specifications of air to the composition defined by [15], exact calculation
results in
˙
E1
=
−
0.04
MW
. In [1] this value is set to zero. Therefore, this simplification concerning the specific
exergy of the streams No. 1 to 3 is applied in the following investigations.
Relevant deviations in the physical exergies result from the fundamentally different thermodynamic property
models for enthalpy and entropy, especially for air and flue gas, as well as the resulting deviating temperatures,
see Table 4. The present results are based on state-of-the-art equations of state. A further cause for different
values results from the exhaust gas flow, since the slightly different composition from the energy and mass
balance of the combustion chamber is in turn influenced by the property models mentioned. Standard chemical
exergies are obtained from Ahrendts’ model in both results listed for e
CH
in Table 5. Here, deviations result from
flue gas composition and minor discrepancies of molar mass values.
The exergy destruction rate of the overall process
˙
ETOT
D
represents the real thermodynamic losses that occur
in the components and can be determined with the exergy balance, see
(1)
. If streams of matter or energy
flow rates are released from the process to the thermodynamic environment and are not used further, exergy
loss ˙
ETOT
Loccur. The exergetic efficiency is the ratio between the exergetic fuel and the exergetic product.
εTOT =˙
ETOT
P
˙
ETOT
F
= 1 −˙
ETOT
D+˙
ETOT
L
˙
ETOT
F
(12)
The exergy destruction rate of the overall system is the sum of the contributions of all the components k.
Consequently, the influence of the individual component on the reduction of the overall exergetic efficiency can
be shown. The exergy destruction ratio y
D,k
represents the link between the component and the overall process.
yD,k=˙
ED,k
˙
ETOT
F
(13)
With the data from Table 5, a component-based exergy analysis was carried out. The results are presented
in the form of a waterfall chart, using
(12)
and
(13)
, and as previously shown in [73]. Thus, the influence of
ECOS 2022
263
Table 5: Exergy data from literature and results from TESPy
ePH (kJ/kg) eCH (kJ/kg) ˙
ETOT (MW)
No. Fluid From [1] TESPy From [1] TESPy From [1] TESPy
1 Air 0.00 0.00 0 0 0.0000 0.0000
2 Air 301.70 303.44 0 0 27.5382 27.5943
3 Air 459.47 453.90 0 0 41.9384 41.2778
4 Flue gas 1087.92 1087.48 3.94 4.00 101.4538 101.0554
5 Flue gas 413.44 410.38 3.94 4.00 38.7823 38.3649
6 Flue gas 230.15 234.96 3.94 4.00 21.7516 22.1239
6P Flue gas n/a 71.13 n/a 4.00 n/a 6.9557
7 Flue gas 25.89 26.83 3.94 4.00 2.7726 2.8538
8 Water 1.90 1.90 2.50 2.50 0.0616 0.0616
8P Water n/a 158.04 n/a 2.50 n/a 2.2476
9 Water 912.51 912.88 2.50 2.50 12.8102 12.8153
10 Methane 381.94 379.05 51383.64 51384.30 84.9939 85.2347
each component to the exergy destruction of the overall process can be visualized. It can be seen that the
combustion chamber has the greatest impact. This is followed by the heat exchangers and the turbomachines.
0 10 20 30 40 50 60 70 80 90 100
Exergetic fuel,
˙
EF
Air compressor, AC
Comb. chamber, CC
Expander, EXP
Air preheater, APH
Evaporator, EV
Economizer, ECO
Exergetic loss,
˙
EL
Exergetic products,
˙
EP
Legend:
yD,CC
Exergetic efficiency of overall process ε= 1 −yD,k−yL(%)
˙
E˙
Wnet ˙
EQ
Figure 4: Exergy analysis based on TESPy results
5. Conclusion
We have implemented the calculation of chemical exergy into the free and open-source Python library TESPy.
To that end standard chemical exergy data have been collected from literature data and provided publicly for use
with other thermodynamic property libraries, e.g. CoolProp. Furthermore, functions were created and classes
were extended within the existing architecture of the software. The new feature was validated with reference to
literature data of the CGAM process. The results from Python were also checked using the industry standard
software Ebsilon. All input data, simulations, and scripts used for validation and their results can be obtained
via zenodo [37]. The implementation of the documented calculation of the chemical exergy into the automatic
exergy analysis module of TESPy is in the queue for the next stable release.
Based on our previous work, we extended TESPy regarding exergy analysis of energy conversion processes.
This allows exergy-based analyses of processes with integrated chemical reactions, e.g. combustion. Users
may also specify their own values for standard chemical exergies. Independently of this, it is possible to program
additional user-defined components at any time. These can be integrated into the simulation as well as into
the existing exergy-based analysis. Using github, all developments of TESPy are available and documented.
Researchers and developers can participate in that community.
TESPy uses Coolprop for the calculation of substance properties. Since the calculation for solid fuels, in
particular solid mixtures, is currently not possible, a routine for the determination of the chemical exergy of
solid fuels was omitted. This concerns, for example, the use of coal, biomass and waste in such simulations.
However, since their use has been declining in the recent years, this feature is not crucial.
ECOS 2022
264
Furthermore, we aim at establishing a free class or library, which determines the calculation of standard chemical
exergy values based on a user-specified composition of the thermodynamic environment. This tool should be
connectable to TESPy or comparable software as flawlessly as possible. The long-term objective could be the
integration into established substance databases. However, this requires the set-up of established reference
environments for corresponding use cases.
From today’s point of view, an integration of exergoeconomic analyses seems to be possible without any
problems to a large extent. First preparations for the implementation of cost balances and auxiliary relations
for components as well as the solution of a linear system of equations during postprocessing are in progress.
Beyond that, coupling TESPy with genetic optimization algorithms, as performed in [74], will also enable
exergoeconomic optimization of thermal engineering applications.
CRediT author statement
Mathias Hofmann and Francesco Witte contributed equally to this work. Mathias Hofmann: Conceptualization,
Methodology, Software, Validation, Formal analysis, Investigation, Resources, Writing - Original Draft, Writing
- Review & Editing, Visualization, Supervision Francesco Witte: Methodology, Software, Validation, Formal
analysis, Investigation, Data Curation, Writing - Original Draft, Writing - Review & Editing Karim Shawky:
Software, Writing - Original Draft Ilja Tuschy: Writing - Review & Editing, Supervision George Tsatsaronis:
Writing - Review & Editing, Supervision
Nomenclature
Abbreviations
AC Air compressor
APH Air preheater
CC Combustion chamber
EXP Expander
FDBR Fachverband Dampfkessel-, Beh¨
alter- und Rohrleitungsbau
HEOS Helmholtz energy equation of state
HRSG Heat-recovery steam generator
ECO Economizer
EV Evaporator
Letter symbols
eMass specific exergy, J/kg
eMolar specific exergy, mol/kg
˙
EExergy rate, W
hSpecific enthalpy, J/kg
˙
mMass flow rate, kg/s
MMolar mass, kg/mol
LHV Lower heating value, J/kg
pPressure, bar
TTemperature, K
rRatio, –
RMolar gas constant, see [75], J/molK
˙
WWork rate, W
xQuality, –
xiMolar fraction, –
yExergy ratio, –
yiMass fraction, –
ECOS 2022
265
Greek symbols
∆Difference
εExergetic efficiency
ηEnergetic efficiency
Subscripts and superscripts
0At ambient state
AApproach point
CH Chemical
DDestruction
FFuel
gGaseous
iStream
in At inlet
kComponent
KN Kinetic
lLiquid
LLoss
out At outlet
pPressure
PPinch point
PProduct
PH Physical
PT Potential
ref Reference
rel Relative
sIsentropic
sSolid
sat At saturation
References
[1] Bejan A, Tsatsaronis G, Moran M. Thermal design and optimization. New York: J. Wiley; 1996.
[2] O’Kelly P. Computer Simulation of Thermal Plant Operations. New York: Springer; 2013.
[3]
Witte F, Hofmann M, Meier J, Tuschy I, Tsatsaronis G. Generic and Open-Source Exergy Analysis—Extending the
Simulation Framework TESPy. Energies. 2022;15:4087. doi:10.3390/en15114087.
[4]
Witte F, Tuschy I. TESPy: Thermal Engineering Systems in Python. J Open Source Softw. 2020;5:2178.
doi:10.21105/joss.02178.
[5]
Baehr HD, Schmidt EF. Definition und Berechnung von Brennstoffexergien. Brennst-W
¨
arme-Kraft. 1963;15:375-81. In
German.
[6]
Bo
ˇ
snjakovi
´
c F. Bezugszustand der Exergie eines reagierenden Systems. Forsch Ing-Wes. 1963;29:151-2. In German.
doi:10.1007/bf02558938.
[7]
Fratzscher W, Gruhn G. Die Bedeutung und Bestimmung des Umgebungszustands f
¨
ur exergetische Untersuchungen.
Brennst-W¨
arme-Kraft. 1965;17:337-41. In German.
[8]
Riekert L. The efficiency of energy-utilization in chemical processes. Chem Eng Sci. 1974;29:1613-20.
doi:10.1016/0009-2509(74)87012-0.
[9]
Gaggioli RA, Petit PJ. Second law analysis, for pinpointing the true inefficiencies in fuel conversion systems. In: Net
energetics of integrated synfuel systems, Symposium of the Division of Fuel Chemistry at the 171st National Meeting.
New York; 1976. p. 56-75.
[10]
Morris DR, Szargut J. Standard chemical exergy of some elements and compounds on the planet earth. Energy.
1986;11:733-55. doi:10.1016/0360-5442(86)90013-7.
ECOS 2022
266
[11]
Szargut J, Morris DR, Steward FR. Exergy analysis of thermal, chemical, and metallurgical processes. New York:
Hemisphere; 1988.
[12] Szargut J. Chemical exergies of the elements. Appl Energ. 1989;32:269-86. doi:10.1016/0306-2619(89)90016-0.
[13]
Szargut J, Valero A, Stanek W, Valero A. Towards an International Reference Environment of Chemical Exergy. In:
Proceedings of ECOS. Trondheim, Norway; 2005. p. 409-17.
[14] Szargut J. Egzergia. Gliwice, Poland: Slesian University of Technology; 2007. In Polish.
[15]
Ahrendts J. Die Exergie chemisch reaktionsf
¨
ahiger Systeme. VDI-Forsch.-Heft 579. D
¨
usseldorf, Germany: VDI Verlag;
1977. In German.
[16] Ahrendts J. Reference states. Energy. 1980;5:666-77. doi:10.1016/0360-5442(80)90087-0.
[17]
Kameyama H, Yoshida K, Yamauchi S, Fueki K. Evaluation of reference exergies for the elements. Appl Energ.
1982;11:69-83. doi:10.1016/0306-2619(82)90049-6.
[18]
van Gool W. Thermodynamics of chemical references for exergy analysis. Energ Convers Manage. 1998;39:1719-28.
doi:10.1016/s0196-8904(98)00089-2.
[19]
Diederichsen C. Referenzumgebungen zur Berechnung der chemischen Exergie. Fortschritt-Berichte 50, Reihe 19.
D¨
usseldorf, Germany: VDI Verlag; 1991. In German.
[20]
Shieh JH, Fan LT. Estimation of Energy (Enthalpy) and Exergy (Availability) Contents in Structurally Complicated
Materials. Energ Source. 1982;6:1-46. doi:10.1080/00908318208946020.
[21] Stepanov VS. Chemical energies and exergies of fuels. 2nd ed. Novosibirsk, USSR: Nauka; 1990. In Russian.
[22]
Stepanov VS. Chemical energies and exergies of fuels. Energy. 1995;20:235-42. doi:10.1016/0360-5442(94)00067-D.
[23]
Fratzscher W, Michalek K, Szargut J. Unterschiedliche Bezugssysteme zur Berechnung der chemischen Exergie.
Chem Tech-Leipzig. 1989;41:321-7. In German.
[24]
Rosen MA, Scott DS. The enhancement of a process simulator for complete energy-exergy analysis. In: Analysis of
Energy Systems – Design and Operation. Miami, US-FL; 1985. p. 71-80.
[25]
Munsch M, Mohr T, Futterer E. Exergetische Analyse und Bewertung verfahrenstechnischer Prozesse mit einem
Flow-Sheeting-Programm. Chem-Ing-Tech. 1990;62:995-1002. In German. doi:10.1002/cite.330621204.
[26]
Futterer E, Gruhn G, Munsch M, Mohr T. Rechnergest
¨
utzte exergetische Optimierung verfahrenstechnischer Prozesse.
Chem-Ing-Tech. 1991;63:204-12. In German. doi:10.1002/cite.330630304.
[27]
Yang Y, Yang J, Zhu X, Ling W. Enhancement and application of a flowsheeting simulator for second law analysis. In:
Proceedings of ECOS. Zaragoza, Spain; 1992. p. 85-91.
[28]
Riedl K. Exergetische und Exergo
¨
okonomische Bewertung von Verfahren der Energie- und Stoffwandlung [Ph.D. thesis].
Martin-Luther-Universit¨
at Halle-Wittenberg, Germany; 2006. In German.
[29]
Querol E, Gonzalez-Regueral B, Ramos A, Perez-Benedito JL. Novel application for exergy and thermoeconomic
analysis of processes simulated with Aspen Plus®. Energy. 2011;36:964-74. doi:10.1016/j.energy.2010.12.013.
[30]
Frenzel PE. Bewertung von Syntheserouten auf Basis von Exergiebilanzen [Ph.D. thesis]. RWTH Aachen, Germany;
2014. In German.
[31]
Abdollahi-Demneh F, Moosavian MA, Omidkhah MR, Bahmanyar H. Calculating exergy in flowsheeting simulators: A
HYSYS implementation. Energy. 2011;36:5320-7. doi:10.1016/j.energy.2011.06.040.
[32]
Ghannadzadeh A, Thery-Hetreux R, Baudouin O, Baudet P, Floquet P, Joulia X. General methodology for exergy
balance in ProSimPlus® process simulator. Energy. 2012;44:38-59. doi:10.1016/j.energy.2012.02.017.
[33]
Montelongo-Luna JM, Svrcek WY, Young BR. An exergy calculator tool for process simulation. Asia-Pac J Chem Eng.
2007;2:431-7. doi:10.1002/apj.76.
[34]
Zargarzadeh M, Karimi IA, Alfadala H. Olexan: A Tool for Online Exergy Analysis. In: 17th European Symposium on
Computer Aided Process Engineering (ESCAPE17). Bucharest, Romania; 2007. p. 1-6.
[35]
Zhao P. A Computer Program for the Exergoeconomic Analysis of Energy Conversion Plants [Ph.D. thesis]. Technische
Universt¨
at Berlin, Germany; 2015. doi:10.14279/depositonce-4890.
[36]
Eisermann W, Hasberg W, Tsatsaronis G. THESIS – Ein Rechenprogramm zur Simulation und Entwicklung von
Energieumwandlungsanlagen. Brennst-W¨
arme-Kraft. 1984;36:45-52. In German.
[37]
Witte F, Shawky K, Hofmann M. CGAM model in TESPy, v1.0. Zenodo; 2022. Retrieved: June 2nd, 2022.
doi:10.5281/zenodo.6592257.
[38]
Kotas TJ. The Exergy Method of Thermal Plant Analysis. London: Butterworths; 1985. doi:10.1016/C2013-0-00894-8.
[39]
Tsatsaronis G, Pisa JJ, Gallego LM. Chemical Exergy in Exergoeconomics. In: Thermodynamic Analysis and
Improvement of Energy Systems, Proceedings of the International Symposium. Beijing, China; 1989. p. 195-200.
[40]
Penkuhn M, Tsatsaronis G. Energetische Grundlagen der technischen Reaktionsf
¨
uhrung. In: Handbuch Chemische
Reaktoren. Berlin, Germany: Springer; 2018. p. 1-34. In German. doi:10.1007/978-3-662-56444-8 7-1.
[41]
Valero A, Lozano MA, Serra L, Tsatsaronis G, Pisa J, Frangopoulos C, et al. CGAM problem: Definition and conventional
solution. Energy. 1994;19:279-86. doi:10.1016/0360-5442(94)90112-0.
ECOS 2022
267
[42]
Tsatsaronis G, Pisa J. Exergoeconomic evaluation and optimization of energy systems—application to the CGAM
problem. Energy. 1994;19:287-321. doi:10.1016/0360-5442(94)90113-9.
[43]
Frangopoulos CA. Application of the thermoeconomic functional approach to the CGAM problem. Energy. 1994;19:323-
42. doi:10.1016/0360-5442(94)90114-7.
[44]
von Spakovsky MR. Application of engineering functional analysis to the analysis and optimization of the CGAM
problem. Energy. 1994;19:343-64. doi:10.1016/0360-5442(94)90115-5.
[45]
Valero A, Lozano MA, Serra L, Torres C. Application of the exergetic cost theory to the CGAM problem. Energy.
1994;19:365-81. doi:10.1016/0360-5442(94)90116-3.
[46]
Alvarado S, Gherardelli C. Exergoeconomic optimization of a cogeneration plant. Energy. 1994;19:1225-33.
doi:10.1016/0360-5442(94)90025-6.
[47]
Hua B, Chen QL, Wang P. A new exergoeconomic approach for analysis and optimization of energy systems. Energy.
1997;22:1071-8. doi:10.1016/s0360-5442(97)00038-8.
[48]
Toffolo A. Evolutionary algorithms for multi-objective energetic and economic optimization in thermal system design.
Energy. 2002;27:549-67. doi:10.1016/s0360-5442(02)00009-9.
[49]
Silveira JL, Tuna CE. Thermoeconomic analysis method for optimization of combined heat and power systems. Part I.
Prog Energ Combust. 2003;29:479-85. doi:10.1016/s0360-1285(03)00041-8.
[50]
Lazzaretto A, Toffolo A. Energy, economy and environment as objectives in multi-criterion optimization of thermal
systems design. Energy. 2004;29:1139-57. doi:10.1016/j.energy.2004.02.022.
[51]
Kwak HY, Byun GT, Kwon YH, Yang H. Cost structure of CGAM cogeneration system. Int J Energ Res. 2004;28:1145-58.
doi:10.1002/er.1021.
[52]
Hakanen J, Hakala J, Manninen J. An integrated multiobjective design tool for process design. Appl Therm Eng.
2006;26:1393-9. doi:10.1016/j.applthermaleng.2005.05.032.
[53]
Sayyaadi H. Multi-objective approach in thermoenvironomic optimization of a benchmark cogeneration system. Appl
Energ. 2009;86:867-79. doi:10.1016/j.apenergy.2008.08.017.
[54]
Abusoglu A, Kanoglu M. Exergoeconomic analysis and optimization of combined heat and power production: A review.
Renew Sust Energ Rev. 2009;13:2295-308. doi:10.1016/j.rser.2009.05.004.
[55]
Razmara N, Saray RK. A simple gas turbine system and co-generation power plant improvement based on endogenous
and exogenous exergy destruction. P I Mech Eng A-J Pow. 2009;224:433-47. doi:10.1243/09576509jpe873.
[56]
Kim DJ. A new thermoeconomic methodology for energy systems. Energy. 2010;35:410-22.
doi:10.1016/j.energy.2009.10.008.
[57]
Hammache A, Benali M, Aub
´
e F. Multi-objective self-adaptive algorithm for highly constrained problems: Novel method
and applications. Appl Energ. 2010;87:2467-78. doi:10.1016/j.apenergy.2009.11.026.
[58]
Ahmadi P, Dincer I. Exergoenvironmental analysis and optimization of a cogeneration plant system using Multimodal
Genetic Algorithm (MGA). Energy. 2010;35:5161-72. doi:10.1016/j.energy.2010.07.050.
[59]
Sayyaadi H, Babaie M, Farmani MR. Implementing of the multi-objective particle swarm optimizer and fuzzy decision-
maker in exergetic, exergoeconomic and environmental optimization of a benchmark cogeneration system. Energy.
2011;36:4777-89. doi:10.1016/j.energy.2011.05.012.
[60]
Sayyaadi H, Baghsheikhi M, Babaie M. Improvement of energy systems using the soft computing techniques. Int J
Exergy. 2016;19:315-51. doi:10.1504/ijex.2016.075667.
[61]
Momen M, Shirinbakhsh M, Baniassadi A, Behbahani-nia A. Application of Monte Carlo method in economic
optimization of cogeneration systems – Case study of the CGAM system. Appl Therm Eng. 2016;104:34-41.
doi:10.1016/j.applthermaleng.2016.04.149.
[62]
Keshavarzian S, Rocco MV, Gardumi F, Colombo E. Practical approaches for applying thermoeconomic analysis to
energy conversion systems: Benchmarking and comparative application. Energ Convers Manage. 2017;150:532-44.
doi:10.1016/j.enconman.2017.08.045.
[63]
Penkuhn M, Tsatsaronis G. A decomposition method for the evaluation of component interactions in en-
ergy conversion systems for application to advanced exergy-based analyses. Energy. 2017;133:388-403.
doi:10.1016/j.energy.2017.03.144.
[64]
Luchun Y, Xuebin L, Lei Z, Chi H, Changjie W. Application of multiobjective optimization and multivariate analysis in
multiple energy systems: A case study of CGAM. Int T Electr Energy. 2020;30(7). doi:10.1002/2050-7038.12368.
[65]
Arani AMA, Behbahaninia A. Optimization of thermal systems considering time-varying availability: a case study of the
CGAM problem. J Braz Soc Mech Sci. 2020;42(8). doi:10.1007/s40430-020-02478-0.
[66]
Nondy J, Gogoi TK. Performance comparison of multi-objective evolutionary algorithms for exergetic and ex-
ergoenvironomic optimization of a benchmark combined heat and power system. Energy. 2021;233:121135.
doi:10.1016/j.energy.2021.121135.
[67]
Knacke O, Kubaschewski O, Hesselmann K, editors. Thermochemical properties of inorganic substances. Berlin,
Germany: Springer; 1996.
ECOS 2022
268
[68]
Bell IH, Wronski J, Quoilin S, Lemort V. Pure and Pseudo-pure Fluid Thermophysical Property Evaluation and the Open-
Source Thermophysical Property Library CoolProp. Ind Eng Chem Res. 2014;53:2498-508. doi:10.1021/ie4033999.
[69]
Cox JD, Wagman DD, Medvedev VA, editors. CODATA Key Values for Thermodynamics. New York: Hemisphere
Publishing; 1989.
[70]
Manion JA. Evaluated Enthalpies of Formation of the Stable Closed Shell C1 and C2 Chlorinated Hydrocarbons. J
Phys Chem Ref Data. 2002;31:123-72. doi:10.1063/1.1420703.
[71] Span R. Multiparameter Equations of State. Berlin: Springer; 2000. doi:10.1007/978-3-662-04092-8.
[72]
Brandt F. W
¨
arme
¨
ubertragung in Dampferzeugern und W
¨
armeaustauschern. 2nd ed. Essen, Germany: Vulkan-Verlag;
1995. In German.
[73]
Penkuhn M, Hofmann M, Meinke S, L
¨
osche C. Prozessbewertung und Exergieanalyse f
¨
ur ein Heizkraftwerk. In:
Kraftwerkstechnisches Kolloquium. Dresden, Germany; 2021. p. 1-12. In German.
[74]
Chen C, Witte F, Tuschy I, Kolditz O, Shao H. Parametric optimization and comparative study of an organic Rankine
cycle power plant for two-phase geothermal sources. Energy. 2022:123910. doi:10.1016/j.energy.2022.123910.
[75]
Tiesinga E, Mohr PJ, Newell DB, Taylor BN. CODATA Recommended Values of the Fundamental Physical Constants:
2018. J Phys Chem Ref Data. 2021;50:033105. doi:10.1063/5.0064853.
ECOS 2022
269