HeatExchangeModel

Title: ODE Modeling in Excel: Heat Exchanger

Authors: Teresa Misiti, Carly Ehrenberger, Danesh Deonarain, Georgina Mang

Date Presented: September 26,2006    Date Revised:
 * First round reviews for this page
 * Rebuttal for this page

Introduction
In process industries, heat exchangers are designed to transfer heat from one fluid to another. Heat exchangers have many different applications, especially in chemical processes, air conditioning, and refrigeration. They are classified by their design and type of flow. In some types of heat exchangers, the two fluids are separated by a wall or membrane and the heat transfer takes place by both convection and conduction. In another, less common type of exchanger, the two fluids physically come into contact with each other as the heat transfer occurs.

Since heat exchangers have a wide variety of applications and are commonly used in industry, control of the system is essential. A dynamic model may be created to allow the chemical engineer to optimize and control the heat exchanger. By utilizing this model, predictions can be made about how altering the independent variables of the system will change the outputs. There are many independent variables and considerations to account for in the model. If done so correctly, accurate predictions can be made about the system.

Types of Heat Exchangers
1. Double - Pipe Heat Exchanger

A double-pipe heat exchanger is the simplest type of heat exchanger and can operate with co-current (Figure 1) or counter-current (Figure 2) flow. The design consists of a single small pipe (tube-side) inside of a larger one (shell-side). A co-current heat exchanger is most commonly used when you want the exiting streams to leave the exchanger at the same temperature. A counter-current heat exchanger is used more often than co-current because they allow for a more efficient transfer of energy.





2. Shell-and-Tube Exchanger

A shell-and-tube exchanger is used for larger flows, which are very common in chemical process industries. The design of this exchanger is a shell with a bundle of tubes inside. The tubes are in parallel and a fluid flows around them in the shell. There are many different arrangements such as straight (Figure3) or u-tube (Figure 4). Each arrangement allows for a different type of flow such as co-current, counter-current and cross flow. The tube-side can have one or more passes to increase the energy exchange from the tube-side fluid. The shell-side may contain baffles, or walls, that channel the fluid flow and induce turbulence, and thus, increase energy exchange. Correlations can be developed to predict the increase in energy exchange. These correlations are out of the scope of this article.



3. Cross-flow Exchanger

The most common application for a cross-flow heat exchanger is when a gas is being heated or cooled. This device consists of multiple tubes in parallel, usually containing a liquid, and the exterior gas flows across the tubes. In some cases the air is confined in separate flow chambers, such as fins, and in others it is open to flow freely (Figure 5).



Dynamic Modeling of Heat Exchangers
Since heat exchangers are so widely used in industry, it necessary for a chemical engineer to be able to optimize and control the system and know how independent variables will affect the outputs from teh system. To do this, a dynamic model is developed and utilized.

A dynamic model of a heat exchanger may be used, for example, to predict how a change in the fluid flowrates or the addition of an insulating jacket will affect the outlet temperature of the product stream. The model uses ordinary differential equations (ODEs) to describe the process and, using a program like Microsoft EXCEL, gives plots of the variables vs. time for the entire process. There are many independent variables in a heat exchanger, which can cause modeling to be very complex since multiple ODEs are required to define all of the process variables.

Some of the independent variables in a heat exchanger system include:
 * Shell-side:
 * fluid
 * flowrate
 * temperature
 * number of baffles
 * Tube-side:
 * fluid
 * flowrate
 * temperature
 * number of passes
 * Flow configuration
 * Co-current
 * Counter-current
 * Cross flow
 * Insulating jacket

The primary dependent variable of concern is the outlet temperature of the product stream (usually the tube-side fluid.) The outlet temperature, in a controlled system, is monitored by a sensor. The sensor then transmits a signal to an actuating device of one or more of the independent variables (usually shell-side flow controller) to perform some desired response.

Modeling with ODEs
The following section outlines the method for developing a dynamic model of a heat exchanger. The model is for a double-pipe heat exchanger that has the ability to flow in co-current or counter-current configurations and the option of an external insulating jacket. It assumes constant fluid properties and perfect heat transfer through the metal of the tubing. The outlet temperature of the tube-side fluid is monitored by a temperature sensor, and the flow rate of the shell-side fluid is controlled by a actuated flow-controlling device.

Energy Balance
An energy balance is first performed on the tube-side fluid.

(Eq 1)

The left-most term in the above energy balance is the amount of thermal energy that accumulates in the tube-side fluid and causes a change in its outlet temperature. The terms on the right side of the above energy balance describe the thermal energy of the fluid flowing in and the fluid flowing out and the amount of heat transfer from the shell side fluid. In the term for heat transfer from the shell-side, the temperatures are the temperatures of the outlet streams. The outlet temperatures will change according to whether you are running co-currently or counter-currently. The energy balance is written as:

$$\ mc_{p, t}\frac{dT_{t,out}}{dt}=\rho c_{p, t}F_{t, in}T_{t, in}-\rho c_{p, t}F_{t, out}T_{t, out}- \frac {kA_{i}}{\Delta z} (T_{t, out} - T_{s,out})$$             (Eq 2)


 * where,


 * $$ \ m = $$ mass of the fluid = $$\ V \rho = \rho A_{cross sectional} \Delta z $$


 * $$ \ c_{p} = $$ constant pressure heat capacity of the fluid


 * $$\ T = $$ Temperature


 * $$\ t = $$ time


 * $$\ k = $$ conductive heat transfer coefficent


 * $$ \ A = $$ surface area of tube that fluid contacts


 * $$\ \Delta z = $$ length of tube


 * $$\ \rho = $$ density of the fluid


 * $$\ F = $$ volumetric flowrate of the fluid


 * and subscripts denote


 * $$\ t $$  - tube-side fluid


 * $$\ out $$ - outlet


 * $$\ in $$ - inlet


 * $$\ i $$ - inside

An similar energy balance is next performed on the shell-side fluid.

(Eq 3)

The left-most term in the above energy balance is the amount of thermal energy that accumulates in the shell-side fluid and causes a change in its outlet temperature. The terms on the right side of the above energy balance describe the thermal energy of the fluid flowing in and the fluid flowing out, heat transfer to the tube-side fluid, and also the heat lost by convection to the surroundings. The energy is written as;

$$\ mc_{p, s}\frac{dT_{s, out}}{dt}=\rho c_{p, s}F_{s, in}T_{s, in}-\rho c_{p, s}F_{s, out}T_{s, out}- \frac {kA_{o}}{\Delta z} (T_{s, out} - T_{t, out})- hA_{o'}(T_{s}- T_{\infty})$$ (Eq 4)


 * where,


 * $$\ h $$= coefficient of convective heat transfer for air


 * $$\ k $$   - conductive heat transfer coefficient.


 * and subscripts denote


 * $$\ s $$   - shell-side fluid


 * $$\infty$$ - air


 * $$\ o$$ - outside of tube


 * $$\ o'$$ - outside of shell

Considerations
There are considerations and simplifications you can make in order to solve the differential energy balances. The validity of these assumptions depends on how accurate of a model you require.

1. The heat capacity of the fluid may be temperature dependent.  If this is the case, a polynomial equation could be written for the $$ C_{p} $$ values of each of the fluids. It would take the form-

$$\ C_{p} = a + bT + cT^{2} + dT^{3}$$ (Eq 5)

Values of a, b, c, and d are properties of the fluid and can be found in Perry's Chemical Engineers' Handbook.

It should also be noted that if the fluids in the process are gases, their fluid properties will be affected by changes in pressure and the use of a constant $$ C_{p} $$ value would be inappropriate.

2. The density of the fluid may be temperature dependent.  This would be likely if the fluid were a vapor, as in the case of using steam as the shell-side fluid to heat the tube-side process fluid. If this is the case, a differential equation could be written for the $$\ \rho $$ value of the fluid and would take the form-

$$\ \frac{d\rho}{dT} \propto C $$ (Eq 6)

where;


 * $$ \ C $$ - is the coefficient of cubic expansion (relates kinetic energy to temperature).

3. Heat loss to the surroundings may be neglected.  This would be the case if the heat exchanger is well insulated or if the shell-side fluid is about the same as ambient temperature. In this case-

$$\ hA(T_{s}-T_{\infty})= 0 $$ (Eq 7)

4. The temperature sensor may have an inherent time delay. This means the temperature output from the sensor lags the actual temperature at the time of the reading. The temperature lag may be accounted for with the differential equation-

$$\ \frac{dT_{outlet,sensor}}{dt} = \frac{1}{\tau_{Ts}}(T_{outlet,actual}-T_{outlet,sensor}) $$ (Eq 8)

$$\ \tau_{Ts}$$ = time constant for the temperature sensor
 * where,

$$\ \tau_{Ts}$$ is a process parameter and usually ranges from 6 to 20 seconds depending on the properties of the sensor. This value would either be given in literature from the manufacturer or would have to be determined through experimentation.

5. The actuator system for the control valve may have a slow dynamic response.  When the actuator system is based on a control valve, the response to the pressure change is slower than the flow through the valve. The flow rate through a control valve can be modeled with the differential equation-

$$\ \frac{dQ_{actual}}{dt} = \frac{1}{\tau_{v}}(Q_{setpoint}-Q_{actual}) $$ (Eq 9)

$$\ \tau_{v}$$ = time constant for the flow control valve
 * where,

$$\ \tau_{v}$$ is a process parameter and usually ranges from 0.5 to 2 seconds depending on the properties of the sensor. This value would have to be determined through experimentation.

Using EXCEL to Solve ODEs
Since temperature of the heat exchanger varies across the metal as well as along the length of the pipe, a partial derivative for how temperature varies with length must be described. In order to solve this problem using excel, an approximation of length was used. Instead of taking the partial derivative across the length with respect to temperature, the pipe was divided into differential segments, Δz. Ideally Δz is an infinitesimally small cross section of the length of the heat exchanger. We will assume that through this differential segment, the temperature of the liquid that leaves the segment is the same as the temperature of the liquid within the segment. Since we are assuming the same temperature for the exiting streams as the inside of the segment, the choice of length for these Δz’s helps dictate the accuracy of the solution. The combination of these differential units allows us to model a heat exchanger without the use of partial derivatives. The figure below shows an example of the simplification where the heat exchanger is split into three segments (Figure 6).



To begin modeling, start by solving the appropriate energy balance (either Eq 2 or Eq 4) for $$\frac{dT}{dt} $$ and make any simplifications necessary. Then use a method to solve ODEs in Excel, such as Euler's or Heun's. Go here: ExcelModelingODE for further explanation on how to set up an Excel spreadsheet using these methods. For each unit, Δz, and each fluid in that unit of the heat exhanger, you should have an approximation equation. Because ideally Δz represents an infinitesimal section, it follows from the first assumption that we can take the temperature in Δz as being the exit temperature of the hot and cold streams for the Δz’s respectively.

The equation for Euler's Method takes the form:  (Eq 10)

The equation for Heun's Method takes the form:  (Eq 11)

The temperatures can then be plotted versus time in order to model how the system inputs affect heat exchange. The following examples walk you through a model of a simple heat exchanger in Excel.

Worked out Example 1
As a process engineer in a chemical processing company, you were assigned to scale up a process for your company’s latest and greatest chemical. Between one of the steps of the reaction, it is necessary to quickly and efficiently cool down the solution from 330K before allowing it to enter the next step. From your previous knowledge, you know that a heat exchanger is necessary and the counter current heat exchanger is the most efficient to achieve a desired temperature. You decide to use cold water entering in at 250K as your coolant since it is relatively inexpensive. In order to allow for the plant engineers in the future to have more control, create a model to determine when this process will go to steady state and graph the temperature profiles of the outlet streams. You can assume the heat exhanger is perfectly insulated and that there is perfect conduction through the metal from shell-side fluid to the tube-side fluid, and this conduction is described by the heat transfer coefficient, k, between the two fluids.

General Relevant Information: $$T_{air}$$=296.15 K (Temp. of the Air) $$r_{i}$$=0.1	m (Inner Diameter of Inner Tube) $$r_{o}$$=0.12	m (Outer Diameter of Inner Tube) $$r_{o}'$$=0.15 m (Outer Diameter of Outer Tube) Δz=1 m  (Increment of length) $$k$$=450000	W/m2*K	(heat transfer coefficient between shell and tube-side fluids)

Shell Side Fluid Information (Cold Water) $$C_{ps}$$=4185 J/kg*K	(shell side fluid heat capacity) $$T_{0s}$$=250	K	(input temp. of shell side fluid) $$A_{s}$$=0.02543 m	(cross sectional area where shell side fluid is present) $$\rho_{s}$$=1000	kg/m^3	(density of shell side fluid) $$F_{s}$$=0.1 m3/s	(volumetric flow rate of shell side fluid)

Tube Side Fluid Information (Solution) $$C_{pt}$$=1200 J/kg*K	(tube side fluid heat capacity) $$T_{0t}$$=330	K	(input temp. of tube side fluid) $$A_{t}$$=0.0314 m	(cross sectional area where tube side fluid is present) $$\rho_{t}$$=1030	kg/m^3	(density of tube side fluid) $$F_{t}$$=0.2 m3/s	(volumetric flow rate of tube side fluid)

---Solution---

The general Algorithm can be followed to develop the Excel model.


 * 1.	Make a spreadsheet that has all relevant process information (ie: T inputs, $$ \rho $$ values, etc).
 * 2.	Perform an overall energy balance for the tube-side and shell-side fluids. Make simplifications and state assumptions.  Solve for $$ \frac{dT}{dt} $$
 * 3.	Divide the heat exchanger into smaller segments of length $$ \Delta z $$
 * 4.	In your spreadsheet, set up a column for time. In the first row, start at t=0 and then increase time by $$ \Delta h $$ down the column.
 * 5.	Set up a column for the incoming tube-side temperature, $$T_{t0}$$. The value of incoming temperature is inputted by the user.  Do the same for the shell-side temperature, $$T_{s0}$$.
 * 6.	Set up a column for the exiting tube-side temperature from each $$ \Delta z $$ unit. Do the same for the shell-side temperatures.  For each of these temperature columns:
 * a.	In the first row, make an initial guess of the temperature. This is usually done by setting the temperature equal to the temperature of the stream coming into the heat exchanger.
 * b.	In subsequent rows, input the Euler’s equation (Eq 10) by referencing the appropriate cells for the process information and take all temperatures from time, $$t_{i}$$, which are the temperatures in the row above.
 * 7.	Make a graph of variables of interest (Temperatures) vs. time.

The graph below illustrates how the exiting hot and cold temperature changes over a short period of time.



For a more detailed view of this process please see the attached spreadsheet:

Worked out Example 2
Again, you are working on the same process, but your supervisor requires you to have a more accurate description of the dynamics of the system. Being as bright as you are, you decide to utilize the 2nd order Runga Kutta method, known as the Heun's method.

---Solution---

Follow the Algorithm in Example 1, except in step 6b, use the equation for Heun's method, Eq 11.

The graph below illustrates how the exiting hot and cold temperature changes over a short period of time.



For a more detailed view of this process please see the attached spreadsheet:

Worked out Example 3
A month after you developed a model of the heat exchanger used in the process for your company's latest and greatest chemical, one of the plant engineers calls you and says that at t=2s into the process, the temperature of the incoming fluid changes abruptly from 330K to 300K. How do the temperatures of the outlet streams react to this change. Use the information and model from Example 1.

---Solution---

The Excel spreadsheet can be modified so that at time t=2s, the incoming temperature of the tube-side fluid is 300K. The graph below illustrates how the exiting hot and cold temperature changes over a short period of time.



For a more detailed view of this process please see the attached spreadsheet: