Sei sulla pagina 1di 16

Chapter 7

System Simulation


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


Classification of System Simulation

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.



Mechanical Equipment and Systems

Methods of Solution

Since simulation invariably requires solution to a set of equations, we shall discuss

some useful techniques to solve linear and non-linear systems of equations. Two
common methods of solution in system simulation are successive substitution and
Newton-Raphson iteration. Most students are aware of both approaches.
Successive substitution involves the repeated substitution of a solution back into the
equation or system of equations until desired convergence is achieved. This approach
is frequently encountered in basic fluid mechanics when solving pipe friction problems.
A guess is made for the friction factor and the equation solved for another variable
such as flow or pipe diameter. The solution variable is then used to re-calculate the
friction factor and a new solution for the flow or pipe diameter is found, and so on,
until the solution variable no longer changes significantly.
In Newton-Raphson iteration, solution of non-linear equations is facilitated through
a linearization procedure. Iterations are performed, but the solution is generally found
in fewer iterations than successive substitution gives.
Both methods have divergence problems if the initial guess is poorly chosen. However, good engineering intuition can often avoid such problems. For example, one
would never guess a system flow rate outside of the maximum permissible flow of the
system pump. Physical intuition dictates that it must be less than the maximum flow
when a system flow resistance only diminishes the output.


Newton-Raphson in One Variable

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
xi+1 = xi

f (xi )
f (xi )


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



System Simulation
Hsys = 25 + 0.5Q1.75


Hp = Hsys


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.


Newton-Raphson in Multi-Variables

If solution is desired to a system of non-linear equations, the Newton-Raphson method

can be generalized for any number of variables. The details of the mathematical
method can be found in any text on numerical methods and is presented in a simple
manner in Stoecker (1989). Consider a system defined in standard form:
f1 (x1 , x2 , x3 , . . . xn ) = 0
f2 (x1 , x2 , x3 , . . . xn ) = 0
f3 (x1 , x2 , x3 , . . . xn ) = 0


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

x1 x2


xn x2 f2
x1 x2
f3 f3


x3 = f3
x1 x2 xn .. ..
. .


fn x

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


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.


Mechanical Equipment and Systems

Example 7.2
Solve the system below using multi-variable Newton-Raphson iteration.

= z 7.2w2 392.28 = 0
= z 810 + 25x + 3.75x2 = 0
= z 900 + 65y + 30y 2 = 0
=wxy =0


Use an initial guess of xo = [w, x, y, z] = [5, 3, 1.5, 750]. As a further exercise

consider other guesses and examine the stability of the solution process.


Steady State Simulation of Thermal Systems

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.


Some Examples of Steady Simulation

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


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
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


pH/X,liq = 689.5 + 68145.3m

l + 537060.8m


pH/X,air = 3.896 + 86.03m

a + 882.1m


Te T
7.73 + 520.7m
l + 512.2m
a 1157.1m
2l + 111.7m
a 863.9m


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
Rsink =

Ts Ti
= 0.1495 4.748m
l + 58.02m


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


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.


Mechanical Equipment and Systems

The solution begins by first developing an expression for the liquid mass flow rate
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


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 +
689.5 + 68145.3m
l + 537060.8m
17797 0.2989 10 m
l + 0.1087 109 m


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 )
0.1495 4.748m
l + 58.02m


QH/X,liq = m
l Cp,liq (Te Ti )


QH/X,air = m
a Cp,air (Ta T )


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

Ts T = Q

+ Rsink
(QH/X /IT D) m
l Cp,l


System Simulation

The following variables remain: Q, Ts , T , m

l , and m
a . At this point we have
two equations and five unknowns. Since the mechanical energy balance is only a
function of m
l , the simulation is now based solely on the energy equation. In an
actual design simulation we may know either Ts or Q or both and know T . Thus if
all of these variable are known, the only unknown is the airflow m
a . In reality, the
air flow would be controlled through a fan. Specification of a fan curve would make
this variable known by solving a mechanical energy balance on the air side. A likely
simulation would entail knowing the heat dissipation rate Q and environment temperature T and simulating the surface temperature Ts as a function of m
a . Another
likely simulation is knowing the maximum surface temperature Ts and simulating the
heat dissipation rate Q versus air flow rate m
a . Several scenarios are provided in
the Maple
worksheet, which also addresses some pitfalls of using fitted data.
Finally, the inlet and exit fluid temperatures can be solved using the energy balances
given earlier. These variables are often required to ensure the mean fluid temperature
is not excessively high for safety reasons in the event of a leak.
Example 7.4 - Brayton Cycle
Consider the simple power generation system based on an open Brayton cycle. The
system consists of a compressor, combustion chamber, and turbine. The compressor
and turbine characteristics are given in the handout. The performance data for
the turbine and compressor which run at a fixed speed can be fit to the following


p = 331 + 45.6m


c = 1020 0.383p + 0.00513p2



= 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


t = 1727.5 10.06p + 0.033033p2 7.4709T + 0.003919T 2

+0.050921pT 0.8525 104 p2 T 0.02356 104 pT 2 +
+0.447 107 p2 T 2



[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.


Mechanical Equipment and Systems

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.
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


T1 = 25 C


Qc = 8000 kW


p2 = p3


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
p (T2 T1 )


t = mC
p (T3 T4 )



Finally, for simulation purposes, we may define the thermal efficiency as:



The problem is discussed in the course text Stoecker (1989), the solution is: m

10.765 kg/s, T2 = 162.99 C, T3 = 884.47 C, p2 = p3 = 354.85 kP a, Wc = 1530.1 kW ,

t = 3128.6 kW , and W
s = 1598.5 kW . The plant efficiency is = 0.1998. The
problem may be re-solved varying either Qc , p1 = p4 , and/or T1 . Plotting plant
efficiency as a function of any one of these variables would constitute an example of
steady state simulation.
Example 7.5 - Refrigeration Cycle
A refrigeration plant operates on a simple vapour compression cycle and serves as
a water chiller. The refrigeration capacity in kW of the compressor as a function of
the evaporating and condensing temperatures Te and Tc is:
Qe = 239.5 + 10.073Te 0.109Te2 3.41Tc 0.00250Tc2 0.2030Te Tc
+0.00820Te2 Tc + 0.0013Te Tc2 0.000080005Te2 Tc2



System Simulation
while the compressor has the following power characteristic (in kW ):

P = 2.634 0.3081Te 0.00301Te2 + 1.066Tc 0.00528Tc2 0.0011Te Tc

0.000306Te2 Tc + 0.000567Te Tc2 0.0000031Te2 Tc2 (7.37)
The overall heat transfer coefficient for the evaporator is U Ae = 30600 W/K and
for the condenser is U Ac = 26500 W/K. Water circulates through the condenser and
evaporator with a mass flow rate of m
c = 7.6 kg/s and m
e = 6.8 kg/s. Simulate the
performance for the system if the water inlet temperature to the evaporator varies
between 10 C and 15 C and the water inlet temperature to the condenser varies
between 25 C and 30 C. What is the COP for this range.


Dynamic Behaviour of Thermal Systems

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.


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


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
= hA(T (t) T ) + S V
which is subject to the initial condition
Cp V

T (0) = To



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:


Mechanical Equipment and Systems

S V + hAT

T (t)
Cp V
Cp V


= C1 C2 T (t)



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 =

hi A kA ho A


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:
= mC
p Ti mC
p T (t) U A(T (t) T ) + S V
The differential equation may be written as:
Cp V

U A + mC
S V + U AT + mC
p Ti

T (t)
Cp V
Cp V



or, once again:

= C1 C2 T (t)
Later we will consider several examples and their solution.



Laplace Transform Solutions

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)


L1 (F (s)) = f (t)


and the inverse transform as:


System Simulation
The Laplace transform is evaluated through the following integral:
L(f (t)) = F (s) =
f (t)est dt


Some important properties of the Laplace Transform are:

L(f (t)) = F (s)


L(f (t)) = sF (s) f (0)


L(f (t)) = s2 F (s) sf (0) f (0)


L(f (t) + g(t)) = L(f (t)) + L(g(t)) = F (s) + G(s)


L(af (t)) = aL(f (t)) = aF (s)


L(eat f (t)) = F (s a) i.e., s (s a)


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:
= C1 C2 T (t)


T (0) = To


subject to:
using the Laplace transform method.
Example 7.7
Solve the coupled system of differential equations:
= C1 C2 T1 (t)


T1 (0) = T1,o


= C3 + C4 T1 (t) C5 T2 (t)


T2 (0) = T2,o


subject to:

subject to:
using the Laplace transform method.



Mechanical Equipment and Systems

Some Examples of Dynamic Simulation

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
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 .
We may now develop the overall lumped energy balance for this system. Using Eq.
(7.38), we write

Cp V

= (U A)c (Ts T (t)) + mC
p Ti (U A)w (T (t) T ) mC
p T (t)


The equation may be re-written as:

= C1 C2 T (t)
C1 =


(U A)c Ts + (U A)w T + mC
p Ti
Cp V


(U A)c + (U A)w + mC
Cp V


C2 =

The solution is easily obtained and has the following form:

+ C exp (C2 t)
The unknown constant C is determined from an initial condition. In this example,
the initial temperature of the tank contents could be at the environment temperature
T or it could be at the process stream temperature Ti , depending upon the system
model which is desired. Assuming that T (0) = Ti before the steam coil is activated,
the system model has a final solution:

T (t) =
exp (C2 t)
+ Ti
T (t) =

System Simulation
Alternatively, the solution may have the form

T (t) =
exp (C2 t)
+ T



if T (0) = T is used as an initial condition.

The solution may also be examined for the special case when m
= 0, i.e. shutdown.
Example 7.9 - Mixing of Process Streams
Consider the system sketched below. In a particular industrial process, two process
water streams at different temperatures and flow rates enter a mixing tank whereby
they are heated by means of an electrical coil. The flow leaves as a single stream at a
temperature T(t). Formulate a model to simulate the thermal response of the system
with time.
Derive the necessary energy balance in terms of all process variables and solve
the equation subject to the initial condition T (0) = Tad
Now, since the process contains three different reference temperatures, the appropriate initial temperature Tad , should be the steady adiabatic mixing temperature, i.e. when there is no heat transfer to the surroundings or from the
electric coil. What is Tad in terms of the process variables. Complete the solution from using this value of Tad
What is the steady state temperature Tss
If m1 = 0.1 kg/s, m2 = 0.5 kg/s , T1 = 40 C , T2 = 65 C, Tf = 20 C,
U Aw = 100 W/m2 K, = 1000 kg/m3 , Cp = 4130 J/kgK, V = 5000 L,
P = 100 kW , how long does the process take to reach steady state, i.e 0.99Tss
Example 7.10 - Coupled Processes
In a certain chemical process, two different fluid streams enter a mixing tank with
mass flow rates m
A and m
B . Each fluid stream has a heat capacity of Cp,A and
Cp,B , respectively. As a result of chemical reaction between the two streams, heat
is generated at a rate S W/m3 , and must be removed by a cooling coil to prevent a
runaway reaction. The cooling coil is maintained at temperature Ts with an overall
heat transfer coefficient of U A. The new contents of the tank which are well stirred,
are removed at a rate equal to the flow entering the tank but now have a new heat
capacity Cp,1 and temperature T1 (t). The new process fluid then enters a second well
stirred tank, where it is mixed with a third stream having a mass flow rate of m
and heat capacity Cp,C . The contents of the second tank are heated, while being
mixed, using an electric coil which has a power input of P . The contents leave with
a total combined mass flow rate equal to the total rate of inflow at temperature T2 (t)
with a heat capacity Cp,2 . Develop the necessary equations and solution to predict


Mechanical Equipment and Systems

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
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




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,
Rice, R.G. and Do, D.D., Applied Mathematics for Chemical Engineers, Wiley,
Stoecker, W.F., Design of Thermal Systems, McGraw-Hill, 1989.