Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
System Simulation
7.1
Introduction
System simulation may be defined as the prediction of system performance when performance characteristics of components, properties of working fluids, and conditions
imposed by the surroundings (boundary conditions) are known. System simulation
is performed so that off design performance may be examined. The mathematical
description of the process requires the solution of a set of linear and/or non-linear
equations.
7.1.1
Simulation may be classified broadly into three sub-categories. These are: continuous
versus discrete, deterministic versus stochastic, and steady versus transient. Each is
discussed below.
Continuous versus Discrete: In a continuous system the flow through the system
is that of a continuum, i.e. such as a fluid flow. Whereas in a discrete system the
flow is treated as an integer function, i.e. a traffic flow. In thermo-fluid systems, we
most often undertake a continuous flow analysis.
Deterministic versus Stochastic: In a deterministic analysis the input variables
are precisely known or specified. Whereas in a stochastic analysis, the input variables
are uncertain and rely on probability models to describe their statistical distributions.
An example of a stochastic analysis is found in the oil and gas field where reservoir
simulations usually rely on some form of probabilistic model for reservoir conditions.
In this chapter, we will consider only deterministic models.
Steady versus Dynamic: In a steady state analysis operating variables remain
constant with respect to time. Whereas in a dynamic analysis, the operating conditions do not remain constant with respect to time and usually vary on the basis of
the surrounding conditions or vary as a result of periodic changes in a process.
107
108
7.2
Methods of Solution
7.2.1
The Newton-Raphson method for a single variable was introduced earlier in Chapter
4. The method is quick and easy provided the function can be differentiated easily.
Convergence occurs in a few iterations provided a reasonable guess is made. The
solution for a variable x is found by making an initial guess xi and solving the following
equation:
xi+1 = xi
f (xi )
f (xi )
(7.1)
for the improved solution xi+1 . The procedure is repeated until desired convergence
is achieved, which usually occurs in fewer than three iterations.
Example 7.1
A simple piping system requires fluid to be pumped through a finite length of
pipe and through a fixed elevation. Assuming turbulent pipe friction, the resulting
equation is non-linear in Q, the volumetric flow rate. Solve the simple pump/piping
system equations given by:
Hp = 100 0.25Q2
(7.2)
109
System Simulation
and
Hsys = 25 + 0.5Q1.75
(7.3)
Hp = Hsys
(7.4)
where
defines the operating point. Use Newton-Raphson iteration. Note: the maximum
flow for the pump (when Hp = 0) is 20 m3 /s and the pump head is given in m.
7.2.2
Newton-Raphson in Multi-Variables
(7.5)
fn (x1 , x2 , x3 , . . . xn ) = 0
To solve the above system we may write the general non-linear system in a linearized
form using a truncated Taylor series expansion of each equation:
f1
f1 f1
x1 x2
xn
f
f1
x1
f2
f2
2
xn x2 f2
x1 x2
f3 f3
f3
(7.6)
x3 = f3
x1 x2 xn .. ..
.
. .
..
..
.
.
.
.
fn x
xn
f
o
fn
fn
n
x1 x2
xn xo
The non-linear system is now in the form of a linear system of equations, since the
matrix of partial derivatives is evaluated at the guess xo , as is the right hand matrix.
We solve this new linear system for the xi and refine the guess such that:
xi,new = xi,old xi
(7.7)
The process is then repeated until desired convergence is achieved. In systems containing several variables this may occur after five to ten iterations or more depending
on the initial guess. The method is easily implemented in math programs, and can
easily be carried out in ExcelT M . We will revisit this approach in Chapter 8 when
dealing with optimization problems.
110
Example 7.2
Solve the system below using multi-variable Newton-Raphson iteration.
f1
f2
f3
f4
= z 7.2w2 392.28 = 0
= z 810 + 25x + 3.75x2 = 0
= z 900 + 65y + 30y 2 = 0
=wxy =0
(7.8)
7.3
Steady state simulation is the most common form of system analysis undertaken by
engineers. In this section we will examine a number of problems to demonstrate the
general approach. It is necessary to outline the basic steps required to undertake the
simulation exercise. All simulation analyses must consider the following:
System Identification: all components and sub-systems must be identified and
the process which links them together must be understood, i.e. power plant
operating on a Rankine cycle.
Component Behaviour: performance characteristics for each component/subsystem must be known and be in the form of a mathematical equation based on
a fit of data or model developed from first principles, i.e. pump curves, system
pressure drop, etc.
System Equations: equations based on fundamental principles such as conservation of mass, energy , and momentum are applied to system elements and
process, i.e. mechanical energy balance for system flow, heat exchanger energy
balances, etc.
Closure Equations: using component performance equations and the fundamental system equations, the number of solution variables and equations must be
equal, if there is a mis-match additional closure equations are required or any
additional variables must be assigned fixed values.
System Solution: having developed the necessary equations, the system is solved
using numerical methods such as Newton-Raphson iteration and the process
repeated for a new set of conditions.
7.3.1
We shall now demonstrate the above steps using several examples. Three cases will
be considered: a simple chip cooler system, an open Brayton cycle power generation
111
System Simulation
facility, and a simple refrigeration cycle. In all three cases, the final solution is
obtained using Newton-Raphson iteration and a direct solver using mathematical
software.
Example 7.3 - Chip Cooler System
Solve the closed loop chip cooler system outlined in Chapter 1. The system consists of a pump, tubing, a liquid cooled heat sink, a compact heat exchanger, and a
reservoir. The following information is required for each component: piping losses,
pump curve, heat sink resistance curve, heat sink pressure loss curve, heat exchanger
pressure drop curves, and heat exchanger heat transfer curves. All of the performance
curves have been obtained and fit as follows:
ppump = 94364 + 258036m
l 1598014m
2l
(7.9)
(7.10)
(7.11)
QH/X
QH/X
=
=
IT D
Te T
7.73 + 520.7m
l + 512.2m
a 1157.1m
2l + 111.7m
lm
a 863.9m
2a
(7.12)
The liquid cooled heat sink can be modelled using first principles or using manufacturers actual performance data. For this example, we will use the following curves
which represent a fit of actual data:
psink = 9148.2 0.1537 107 m
l + 0.5499 108 m
2l
Rsink =
Ts Ti
= 0.1495 4.748m
l + 58.02m
2l
Qsink
(7.13)
(7.14)
The above equations could also be replaced by the first principles models developed
in Chapter 6, but for simplicity we shall use the above equations. Finally, the tubing
pressure drop which is based on first principles has been fit for ease of solution to the
following equation:
ptubing = 17797 0.2989 107 m
l + 0.1087 109 m
2l
(7.15)
In all equations, the mass flow rate is given in kg/s, pressure is given in P a, and
the thermal resistance is K/W . Using the above equations, we desire to simulate the
chip cooler system discussed earlier in Example 1.2.
112
Solution
The solution begins by first developing an expression for the liquid mass flow rate
m
l . This is obtained by writing the mechanical energy balance around the closed
loop. We will neglect the expansion tank, although in practice there will be losses
associated with the inlet and exit which should be included.
ppump = psink + pH/X,liq + ptubing
(7.16)
This yields the following equation, which may be solved for the mass flow rate:
94364 + 258036m
l 1598014m
2l =
9148.2 0.1537 107 m
l + 0.5499 108 m
2l +
2
689.5 + 68145.3m
l + 537060.8m
l+
7
17797 0.2989 10 m
l + 0.1087 109 m
2l
(7.17)
This equation is only a function of one variable and is easily solved using the onedimensional Newton-Raphson scheme outlined above and in Chapter 4. It is left as
an exercise to verify that the solution is m
l = 0.0388 kg/s.
Next, we develop the necessary energy balance on the heat sink and the compact
heat exchanger. This gives:
Qsink = m
l Cp,liq (Te Ti )
Qsink =
(Ts Ti )
(Ts Ti )
=
Rsink
0.1495 4.748m
l + 58.02m
2l
(7.18)
(7.19)
QH/X,liq = m
l Cp,liq (Te Ti )
(7.20)
QH/X,air = m
a Cp,air (Ta T )
(7.21)
We see that the the first and third of these equations are the same. This is a
consequence of neglecting the expansion tank. In fact, if we were to allow even a
slight imbalance to exist, the fluid temperature in the reservoir would continue to rise
until eventually it would boil. However, since we desire to dissipate all of the heat
absorbed by the liquid through the heat exchanger, we must set the exit temperature
of the heat exchanger equal to the inlet temperature of the heat sink.
The system of equations may be reduced to two equations. The first is given by the
mechanical energy balance which we developed earlier. The second equation relates
the surface temperature of the heat sink Ts to the environment temperature T . This
equation is obtained by combining the various energy balances to eliminate Ti . This
yields:
1
1
Ts T = Q
+ Rsink
(7.22)
(QH/X /IT D) m
l Cp,l
113
System Simulation
and
p = 331 + 45.6m
4.03m
2
(7.23)
(7.24)
Turbine
m
= 8.5019 + 0.02332p + 0.48 104 p2 0.02644T
+0.1849 104 T 2 + 0.000121pT 0.02736 106 p2 T
0.01137 106 pT 2 + 0.2124 109 p2 T 2
(7.25)
(7.26)
and
[kW ],
In the above equations the variables have the following units: m
[kg/s], W
p [kP a], and T [ C]. The environment conditions which are usually known and assumed to remain constant are the inlet temperature and pressure and exit pressure.
114
However, these may be variables which are varied for simulation purposes. For example, the plant may be designed to operate in different environments where atmospheric
temperature and pressure vary geographically or seasonally.
Solution
The following is the list of variables which are either part of the solution or are
c, W
t , and W
s . Of these
fixed but may be variable: p1 , T1 , p2 , T2 , T3 , p3 , T4 , p4 , m,
Qc , W
thirteen variables we will assume the following:
p1 = p4 = 101 kP a
(7.27)
T1 = 25 C
(7.28)
Qc = 8000 kW
(7.29)
p2 = p3
(7.30)
This leaves eight unknowns. Therefore, since we have four equations representing mechanical equipment performance, we still require four additional equations for
closure. These four equations come from energy balances on the system and its components:
Qc = mC
p (T3 T2 )
c = mC
W
p (T2 T1 )
(7.31)
t = mC
W
p (T3 T4 )
s=W
tW
c
W
(7.33)
(7.32)
(7.34)
Finally, for simulation purposes, we may define the thermal efficiency as:
=
s
W
Qc
(7.35)
The problem is discussed in the course text Stoecker (1989), the solution is: m
=
(7.36)
115
System Simulation
while the compressor has the following power characteristic (in kW ):
7.4
In this section we consider simple dynamic response in thermal and fluid systems.
Dynamic simulation is useful for examining the effects of disturbances in system
operation, start up or shut down transients, or stability and control issues. We
will examine the lumped analysis method for ascertaining the thermal response of a
mechanical system. Using Laplace transforms we will solve uncoupled, coupled, and
intermittent processes.
7.4.1
Lumped Analysis
In these types of problems we do not consider the spatial distribution of the property
of interest, but rather the temporal or time behaviour of the system as a whole.
The conservation law for energy transfer may be written as:
Qstored = Qin Qout + Qgeneration
(7.38)
Closed Systems
We now consider the case of a finite solid body of initial temperature To in an infinite
medium of temperature T , such that To > T . In terms of the temperatures of the
system under consideration we may write
dT
= hA(T (t) T ) + S V
dt
which is subject to the initial condition
Cp V
T (0) = To
(7.39)
(7.40)
The above analysis is only valid for the condition Bi = h(V /A)/ks < 0.1. However,
we may apply the analysis to fluid systems if we assume a well stirred fluid.
The differential equation may be written as:
116
T (t)
dt
Cp V
Cp V
(7.41)
dT
= C1 C2 T (t)
dt
(7.42)
or
Open Systems
In an open system, fluid flows through the system through several inlets/outlets. We
may also include exchanges with the surroundings through a finite wall conductance.
We may modify Eq. (7.39) to account for an additional conduction resistance by
introducing the overall heat transfer co-efficient:
UA =
t
1
1
+
+
hi A kA ho A
(7.43)
Further for a simple inlet/outlet system the net change in enthalpy, Qout = mC
p (T (t)
Ti ), must be introduced into the macroscopic energy balance:
dT
= mC
p Ti mC
p T (t) U A(T (t) T ) + S V
dt
The differential equation may be written as:
Cp V
dT
U A + mC
p
S V + U AT + mC
p Ti
=
T (t)
dt
Cp V
Cp V
(7.44)
(7.45)
dT
= C1 C2 T (t)
dt
Later we will consider several examples and their solution.
7.4.2
(7.46)
Laplace transforms are a useful and relatively simple solution technique for dynamic
response problems. Two important solutions will be examined to demonstrate the
technique. These are the simple lumped system and the simple coupled system.
Before proceeding to the solutions of these two fundamentally useful problems, a
brief review of the Laplace transform method is required.
Given the function f (t), we denote the Laplace transform of this function as:
L(f (t)) = F (s)
(7.47)
L1 (F (s)) = f (t)
(7.48)
117
System Simulation
The Laplace transform is evaluated through the following integral:
Z
L(f (t)) = F (s) =
f (t)est dt
(7.49)
(7.50)
(7.51)
(7.52)
(7.53)
(7.54)
(7.55)
In general we work with tables of Laplace transform pairs, rather than evaluate the
integral given above for each term in an equation.
Example 7.6
Solve the differential equation:
dT
= C1 C2 T (t)
dt
(7.56)
T (0) = To
(7.57)
subject to:
using the Laplace transform method.
Example 7.7
Solve the coupled system of differential equations:
dT1
= C1 C2 T1 (t)
dt
(7.58)
T1 (0) = T1,o
(7.59)
dT2
= C3 + C4 T1 (t) C5 T2 (t)
dt
(7.60)
T2 (0) = T2,o
(7.61)
subject to:
and
subject to:
using the Laplace transform method.
118
7.4.3
We will now examine some simple dynamic simulation problems. These include the
dynamic response in a simple process start up, a mixing process, a coupled two stage
process, and an intermittent process.
Example 7.8 - Energy Balance in a CSTR
We wish to examine the temperature history in a continuously stirred tank reactor
(CSTR). Consider the heating of a process stream using a steam condensing coil. The
process slurry enters the tank at a constant inlet temperature Ti and mass flow rate
m,
and leaves the tank with a temperature of T (t). The steam coil is maintained
at constant temperature Ts with an overall heat transfer co-efficient (U A)c which
accounts for the tube wall resistance and convective heat transfer coefficient. The tank
also loses heat through the tank walls which have an overall heat transfer coefficient
(U A)w and an environment temperature T .
Solution
We may now develop the overall lumped energy balance for this system. Using Eq.
(7.38), we write
Cp V
dT
= (U A)c (Ts T (t)) + mC
p Ti (U A)w (T (t) T ) mC
p T (t)
dt
(7.62)
(7.63)
(U A)c Ts + (U A)w T + mC
p Ti
Cp V
(7.64)
(U A)c + (U A)w + mC
p
Cp V
(7.65)
and
C2 =
C1
C1
T (t) =
exp (C2 t)
(7.67)
+ Ti
C2
C2
T (t) =
System Simulation
Alternatively, the solution may have the form
C1
C1
T (t) =
exp (C2 t)
+ T
C2
C2
119
(7.68)
120
the response time of the system and to determine the final exit temperature of the
mixture, as a function of time.
Example 7.11 - Intermittent Processes
You wish to simulate the transient response of a batch reaction process as shown
below. The chemical reaction is exothermic (meaning heat is released) and is calculated to be 50,000 W/m3 . The batch reactor contains a volume of 7.5 m3 . A cooling
coil circulates cold water at 25 C at a high flow rate such that U A = 2500 W/K
is achieved. The thermal capacity of the mixture is: Cp = 53.362 kJ/m3 K. It is
desired to have the temperature history for a system failure simulation summarized
by the following:
Normal system start up and operation with T (0) = 25 C
At t = 45 minutes, the primary cooling pump shuts down causing U A = 500
W/K
At t = 55 minutes, the primary cooling pump restarts, and the cooling process
resumes with U A = 2500 W/K
Determine the following:
Maximum system temperature after pump failure
Time for the system to resume steady state operation after the primary cooling
pump is re-activated
Sketch the system response labeling each transition point and temperature
If the maximum system temperature were to reach 500 C at anytime in the reactor,
a secondary runaway reaction could occur leading to catastrophic consequences. How
close were you to this dangerous result?
In your analysis, show the required energy balance and solution to the differential
equation. Hint: you only need to solve the system once, by applying an initial
condition of the type T (tc ) = Tc , where Tc is the final temperature after each critical
process and tc is the time at which each new process begins.
System Simulation
7.5
121
References
Hodge, B.K. and Taylor, R.P., Analysis and Design of Energy Systems, PrenticeHall, 1999, Upper Saddle River, NJ.
Rao, S.S., Applied Numerical Methods for Engineers and Scientists, Prentice Hall,
2002.
Rice, R.G. and Do, D.D., Applied Mathematics for Chemical Engineers, Wiley,
1995.
Stoecker, W.F., Design of Thermal Systems, McGraw-Hill, 1989.