31.07.2013 Views

Conjugate Heat Transfer Finite Difference Method for Turbulent

Conjugate Heat Transfer Finite Difference Method for Turbulent

Conjugate Heat Transfer Finite Difference Method for Turbulent

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MATH6640 – Numerical <strong>Method</strong>s <strong>for</strong> PDEs :<br />

Final Project Report<br />

Submitted by:<br />

Nathan Rolander<br />

Prepared <strong>for</strong>:<br />

Dr. Yingjie Liu<br />

Georgia Institute of Technology<br />

Monday, December 06, 2004


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

CONTENTS<br />

NOMENCLATURE 4<br />

INTRODUCTION 5<br />

PROBLEM OVERVIEW 5<br />

MOTIVATION 5<br />

PROBLEM DESCRIPTION & GEOMETRY 6<br />

MODEL DEVELOPMENT 7<br />

FLUID FLOW 7<br />

CA_POD_SVD 7<br />

CA_EXTRACT 7<br />

HEAT TRANSFER 8<br />

CONTROL VOLUME BASED FINITE DIFFERENCE APPROACH 8<br />

STAGGERED FLOW GRID 10<br />

DISCRETIZATION APPROACHES 10<br />

UPWINDING SCHEMES APPROXIMATION & STABILITY 11<br />

UPWINDING SCHEMES ACCURACY 13<br />

COMPUTING THE CELL PECLET NUMBER 14<br />

SOLUTION METHODS 16<br />

OVERALL ROUTINE 16<br />

COLD AISLE SIMULATION 16<br />

ADVECTION 17<br />

CONSTRUCTING THE STIFFNESS MATRIX 17<br />

BUILDK 18<br />

FA 18<br />

BOUNDARY CONDITIONS 18<br />

APPLYBCS 19<br />

SOLVE SYSTEM 19<br />

LINESOLVER 19<br />

TRANSFORMTEMP 20<br />

THOMAS 20<br />

SIMULATION ACCURACY 21<br />

CONDUCTION ACCURACY 21<br />

CONVECTION ACCURACY 23<br />

Page 2


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

RESULTS 25<br />

TEST 1 26<br />

TEST 2 27<br />

TEST 3 28<br />

DISCUSSION 29<br />

ALGORITHM SPEED 29<br />

TRANSIENT STABILITY 29<br />

SUMMARY 29<br />

REFERENCES 30<br />

APPENDIX 31<br />

Page 3


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

Nomenclature<br />

RANS - Reynolds Averaged Navier Stokes<br />

k-, - k epsilon turbulence model,<br />

k - turbulent kinetic energy,<br />

, - turbulent dissipation<br />

CFD - computational fluid dynamics<br />

HVAC - <strong>Heat</strong>ing Ventilation and Air Conditioning<br />

POD - Proper Orthogonal Decomposition<br />

Page 4


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

INTRODUCTION<br />

In this project a two-dimensional convection diffusion thermal system corresponding to a<br />

simulation of a data center cold aisle is presented. This results in a two-dimensional<br />

steady state elliptic system which is solved using a finite difference approach. This<br />

system has a degree of nonlinearity, requiring iteration of the system to achieve<br />

convergence to steady parameter values.<br />

PROBLEM OVERVIEW<br />

A Data Center is a dedicated room of computers systems. These computers are racks in a<br />

cabinet enclosure, and include servers, computational workstations, or switches <strong>for</strong><br />

communications. The heat load of these rooms can be 200kW, hundreds of times that of a<br />

human occupied room. The computers require a cool, dry environment <strong>for</strong> best<br />

per<strong>for</strong>mance, and there<strong>for</strong>e require a dedicated environmental conditioning system. This<br />

system often uses as much as 40% of the power to the room just <strong>for</strong> HVAC. As the cost<br />

reaches millions of dollars per year, efficiency is of utmost concern.<br />

MOTIVATION<br />

In order to improve cooling efficiency of the HVAC system, numerical thermal fluid<br />

simulations are per<strong>for</strong>med to determine superior cabinet configurations. The cabinet<br />

geometry and air flow velocities of the data center create turbulent convective conditions,<br />

leading to long convergence times using CFD solvers such as the k-, RANS turbulence<br />

model. This high computational expense is compounded when a large number of design<br />

variables are incorporated into the problem. The long computational time incurred makes<br />

these tools, poorly suited <strong>for</strong> use in iterative algorithms employed in optimization<br />

methods. In the preliminary stages of design, model fidelity can be traded-off <strong>for</strong><br />

computational speed in order to effectively investigate and map the feasible design space.<br />

There<strong>for</strong>e the development and application of computationally efficient reduced order<br />

models is essential <strong>for</strong> effective design of complex thermal systems.<br />

An emerging reduced order model development approach <strong>for</strong> turbulent convective flow is<br />

proper orthogonal decomposition (POD). This method has been used successfully to<br />

create low dimensional steady state flow models within a prescribed range of parameters.<br />

The POD construct is used to build a two-dimensional convective flow simulation of aircooled<br />

server cabinet located within a data center. This two dimensional model is<br />

representative of a cross-section of a fully loaded cabinet. This cabinet simulation<br />

contains four individual racks, each with a prescribed airflow rate and power generation.<br />

With the development of this computationally efficient fluid flow model, a heat transfer<br />

model is required to solve <strong>for</strong> the cabinet temperature profile. The temperature profile<br />

dictates the operating temperature of the computer chips, and this whether they will<br />

overheat. This thermal model development is presented in this project.<br />

Page 5


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

PROBLEM DESCRIPTION & GEOMETRY<br />

The problem geometry, fluid flow, and thermal system to be simulated is shown below in<br />

Figure 1. This geometry shows two server cabinets with four racks each on both sides.<br />

The central flow path is called the cold aisle, and acts as the plenum to distribute the air<br />

to the individual server racks. The flow through this aisle comes primarily from the<br />

bottom, with continuity dictating the flow direction through the upper inlet yielding either<br />

an inflow or outflow boundary condition. The fluid flow in the system is assumed to be<br />

<strong>for</strong>ced convection only, and thus independent from the thermal system. This allows the<br />

energy equation can be solved independently <strong>for</strong> a prescribed flow field. The fluid flow<br />

in the system is normally solved <strong>for</strong> using a linear combination of basis functions, that are<br />

generated by Proper Orthogonal Decomposition of observations that are generated in<br />

FLUENT, a commercial CFD program. However, in this project the FLUENT generated<br />

flow data is used directly <strong>for</strong> simplicity as only the thermal system is being investigated.<br />

System<br />

Boundary<br />

Vout 1<br />

Vout 2<br />

Vout 3<br />

Vout 4<br />

q 1, Tc 1<br />

q 2, Tc 2<br />

q 3, Tc 3<br />

q 4, Tc 4<br />

Left Server<br />

Bank<br />

Ambient Air<br />

Too, Continuity<br />

Cold Aisle<br />

Vin, Tin<br />

q 5, Tc 5<br />

q 6, Tc 6<br />

q 7, Tc 7<br />

q 8, Tc 8<br />

Right Server<br />

Bank<br />

Vout 5<br />

Vout 6<br />

Vout 7<br />

Vout 8<br />

System<br />

Boundary<br />

<br />

Figure 1 -Problem geometry and physics<br />

The thermal model to be developed to obtain the temperature profile of the system<br />

depicted in Figure 1 above must solve <strong>for</strong> both convection and diffusion over a 2D<br />

domain. Because the air that leaves though the arrows labeled Vout is recycled to some<br />

degree thought the top inlet, the double arrows labeled Continuity, Too is dependent upon<br />

the temperature leaving the domain. In this manner, these two variables are coupled<br />

creating a nonlinear problem to solve <strong>for</strong> the steady state Too condition. This recirculation<br />

of this exhausted air is to varied from 0% to 100% to represent the efficiency<br />

of the hot air removal system of the data center.<br />

Page 6


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

MODEL DEVELOPMENT<br />

FLUID FLOW<br />

In order to determine the sole accuracy of the thermal model being developed the flow<br />

fields to be used are the direct output of the FLUENT generated data sets. These<br />

simulations are per<strong>for</strong>med using the k-, RANS turbulence model with a range of<br />

boundary conditions creating a window of flow observations that represent what would<br />

typically occur within a data center such as the one being modeled. These flow data sets<br />

are read into MATLAB and processed <strong>for</strong> use by the thermal model by the function<br />

ca_pod_svd and ca_extract, the headers and descriptions are shown below. The full<br />

programs with detailed comments are available at the end of this report in the Appendix.<br />

ca_pod_svd<br />

function [x2,y2,u,v,um,vm] = ca_pod_svd<br />

%CA_POD.M Extract FLUENT Observations & per<strong>for</strong>m POD<br />

% This function extracts node based FLUENT data representing<br />

% the flow field of teh cold aisle geometry. In this project<br />

% this data is used directly, however in my research the<br />

% Proper Orthogonal Decomposition of the observations is<br />

% applied to generate basis functions called POD modes<br />

% of the flow data <strong>for</strong> use in my reduced order flow model.<br />

% This program is based off of work by Jeff Rambo.<br />

%<br />

% Outputs:<br />

% x2 - vector of FLUENT x-coordinate grid data<br />

% y2 - vector of FLUENT y-coordinate grid data<br />

% u - vector of FLUENT u-flow field data<br />

% v - vector of FLUENT v-flow field data<br />

% um - vector of POD mode u-flow field data<br />

% vm - vector of POD mode v-flow field data<br />

ca_extract<br />

function [x2,y2,u2,v2,r] = ca_extract(name)<br />

%CA_EXTRACT Extract and Process FLUENT data files<br />

% Function to extract data <strong>for</strong> the cold aisle model reduction<br />

% study. Call [x,y,u,v,dimrot]=ca_extract(name) where<br />

% 'name' is the Fluent output ASCII file name. 'x','y','u','v'<br />

% are the nodal coordinates and velocities, 'P' and 'nu' are<br />

% the pressure and effective viscosity, respectively. 'dimrot'<br />

% is vector index numer to pivot about in the vec2mat command<br />

% <strong>for</strong> reshaping vectors into matrices <strong>for</strong> field plotting.<br />

% This program is based off of work by Jeff Rambo.<br />

%<br />

% Inputs:<br />

% name - name of the FLUENT ASCII file name<br />

%<br />

% Outputs:<br />

% x2 - vector of FLUENT x-coordinate grid data<br />

% y2 - vector of FLUENT y-coordinate grid data<br />

% u2 - vector of FLUENT u-flow field data<br />

% v2 - vector of FLUENT v-flow field data<br />

% r - length of y vector <strong>for</strong> creating matrix data<br />

Page 7


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

HEAT TRANSFER<br />

The two dimensional conductive and convective heat transfer problem <strong>for</strong>ms an elliptic<br />

partial differential equation, commonly reffered to as as the energy equation, given below<br />

in equation 1.<br />

d d ⎛ dφ ⎞ d ⎛ dφ<br />

⎞<br />

( ρφ) + ⎜ρuφ−Γ ⎟+<br />

⎜ρvφ−Γ<br />

⎟ = S<br />

(1)<br />

dt dx ⎝ dx ⎠ dy ⎝ dy ⎠<br />

In this equation S is the volumetric heat generation, φ is the temperature, ρ is the fluid<br />

density, u and v are the flow velocities in the x and y directions respectively, Γ is the<br />

thermal conductivity k. In this problem the transient term goes to 0 as it is a steady state<br />

problem. It is also convineint to lump the conductive and convective flux terms together.<br />

This makes the calculation of the numerical flux balance easier and is important <strong>for</strong><br />

stability reasons to be explored later. This results in the following equation <strong>for</strong>m given<br />

below in equation 2.<br />

dJ dJ<br />

dx dy<br />

x y<br />

+ = S<br />

(2a)<br />

dφ<br />

Jx= ρuφ −Γ (2b)<br />

dx<br />

dφ<br />

Jy= ρφ v −Γ (2c)<br />

dy<br />

Control Volume based <strong>Finite</strong> <strong>Difference</strong> Approach<br />

The basis of the numerical method is the conversion of the general differential equation 1<br />

to an algebraic equation relating the temperature of the point under consideration, P, to<br />

the temperatures of the surrounding points N, E, S, W. This results in a flux balance into<br />

and out of the control volume as shown in Figure 2 below.<br />

Figure 2 - Example control volume<br />

Page 8


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

These flux equations are given in equation 2. However, there are multiple ways to<br />

discretize them. There are explored in the next section, however, be<strong>for</strong>e this it is<br />

important to define the dimensionless numbers that are used in these discretization<br />

schemes and help to characterize the system.<br />

Diffusion Conductance<br />

The diffusion conductance D is the quantity of heat flux from the diffusive term of the<br />

equation. The subscript De is the diffusion conductance across the control volume face e,<br />

as shown in Figure 2. The diffusion conductance De is given by equation 3a. This is a<br />

more accurate approximation to the average thermal conduictivity between nodes P and E<br />

over a simple average. However, in this project the thermal condictivity of the air is<br />

taken to be constant because of the low temperature variation and thus equation 3a<br />

simplifies to equation 3b.<br />

Mass Flow Rate<br />

D = A<br />

D<br />

e e<br />

e<br />

1<br />

( δx ) ( δx<br />

)<br />

e<br />

+<br />

Γ Γ<br />

e e− e e+<br />

P E<br />

(3a)<br />

Γ<br />

= (3b)<br />

δ x<br />

The mass flow rate is F is the quantity of mass flowing across a boundary. The subscript<br />

Fe is the mass flow rate across the control volume face e and. The mass flow rate Fe is<br />

obtained from equation 4 shown below.<br />

Peclet Number<br />

Fe = ( ρu)<br />

eAe (4)<br />

The Peclet number is defined locally across each face of the control volume, yielding a<br />

maximum cell Peclet number. The general <strong>for</strong>m of the Peclet number is shown in<br />

equation 5a and the Peclet number specific to the face e, Pee, in equation 5b.<br />

uL<br />

P ρ<br />

= (5a)<br />

Γ<br />

Pe<br />

F<br />

e<br />

e = (5b)<br />

De<br />

Page 9


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

Equation 5 shows that the Peclet number is in fact the ratio of conductive flux to diffusive<br />

flux. This is a critical parameter in the analysis of the possible discritization schemes<br />

explored next.<br />

Staggered Flow Grid<br />

The u variable, the velocity across the face of the element is read in from the generated<br />

velocity field by the flow model. However, because there needs to be a velocity at all<br />

four sides of each element where the temperature is computed, a staggered flow grid is<br />

employed. This is shown below in Figure 3. Here the grey area is the element of<br />

constant temperature, the node at the center is the point where temperature is computed.<br />

The intersecting dashed lines are where the u and v components of the velocity are<br />

computed by the flow model. This results in the temperature matrix being one element<br />

smaller in each dimension, as well as the “artifact” of the grid that is the missing u, v<br />

point at the top right hand corner.<br />

Discretization Approaches<br />

Figure 3 - Staggered grid diagram<br />

To discretize the equation is space, the coefficients to multiply the surrounding nodes by<br />

must be found. This general discretization is given in equation 6a, where a a represents<br />

the coefficients of the surrounding nodes and b is equal to the heat flux input to the<br />

element.<br />

a φ = a φ + a φ + a φ + a φ + b<br />

(6a)<br />

P P E E W W N N S S<br />

The following equations give the general <strong>for</strong>m of the coefficients <strong>for</strong> each side of the<br />

control volume. These coefficents are functions of the dimensionless parameters defined<br />

ab , represents<br />

earlier, and a function of the Peclet number A(|Pe|) . In these equations <br />

the maximum of a and b.<br />

( ) ,0<br />

a = D A Pe + − F<br />

(6b)<br />

E e e e<br />

( ) ,0<br />

a = D A Pe + F<br />

(6c)<br />

W w w w<br />

Page 10


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

( ) ,0<br />

a = D A Pe + − F<br />

(6d)<br />

N n n n<br />

( ) ,0<br />

a = D A Pe + F<br />

(6e)<br />

S s s s<br />

aP= aE + aW + aN + aS<br />

These coefficeints a are related to the fluxes into the element Jx and Jy given in equation 2<br />

through equation 7, shown in general <strong>for</strong>m as the flux through the control volume face<br />

between two adjacent elements. Here the capitalized letters represent opposite face<br />

coefficients from adjacent nodes.<br />

*<br />

J B i A i 1<br />

= φ − φ +<br />

(7)<br />

Substituting one of equations 6b-f with an appropriate function A(|Pe|) and equation 7<br />

yields the function <strong>for</strong> the total flux entering a specific control volume face. There are<br />

many approaches to approximating the function A(|Pe|), these are all dependent upon the<br />

Peclet number, Pe. This choice of approximation also determines the accuracy and the<br />

stability of the method, as investigated next.<br />

Upwinding Schemes Approximation & Stability<br />

In order to determine the most accurate and stable approximation of the flux function J<br />

though the there are several schemes <strong>for</strong> the function A(|Pe|). These are based upon the<br />

Taylor series expansion of equation 2, an approximation or exact solution to the<br />

differential equation between two nodes, or a combination of these. These schemes are<br />

presented below in equations 8.<br />

Scheme Formula <strong>for</strong> A(|Pe|)<br />

The value of these functions A(|Pe|) versus the input Peclet Number is shown below in<br />

Figure 4.<br />

(6f)<br />

Central difference 1− 0.5 Pe<br />

(8a)<br />

Upwind 1 (8b)<br />

Power law ( ) 5<br />

<br />

0, 1− 0.1 Pe<br />

<br />

<br />

<br />

(8c)<br />

Exponential (exact)<br />

Pe<br />

( )<br />

exp Pe − 1<br />

(8d)<br />

Page 11


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

A(|Pe|)<br />

1<br />

0.9<br />

0.8<br />

0.7<br />

0.6<br />

0.5<br />

0.4<br />

0.3<br />

0.2<br />

0.1<br />

Central <strong>Difference</strong><br />

Flux Function A(|Pe|) <strong>for</strong> Various Schemes<br />

Central difference<br />

Upwind<br />

Power law<br />

Exponential (exact)<br />

0<br />

0 1 2 3 4<br />

|Pe|<br />

5 6 7 8<br />

Figure 4 - Flux function A(|Pe|) versus Peclet number<br />

The central difference scheme is based upon a piece-wise linear profile <strong>for</strong> φ between<br />

nodes. Viewing the plot above all schemes produce a physically realistic solution, except<br />

<strong>for</strong> the central difference scheme which produces values outside of the [0,1] range when<br />

the Peclet number is greater than 2. This means that the mesh would have to be fine<br />

enough to keep the grid Pe < 2 so keep the scheme stable, as Pe is defined on a local<br />

scale.<br />

Upwind<br />

The upwind scheme, or upwind-difference scheme, assumes that the value of φ at the<br />

interface is equal to φ at the upwind node. This assumption creates a more stable scheme,<br />

however its accuracy is questionable, as to be shown next.<br />

Exponential<br />

The exponential scheme is based upon the analytical solution to equation 2b, which is the<br />

equivalent to substituting equation 8c into equation 6. This scheme there<strong>for</strong>e gives the<br />

exact solution regardless of the grid spacing, however the exponential function is<br />

computationally expensive to compute.<br />

Page 12


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

Power law<br />

The power law scheme is an approximation to the exponential scheme that produces very<br />

close results. An added advantage beyond the increased computational speed is that if a<br />

fluid flow speed of 0 is encountered the equation does not fail, as the exponential scheme<br />

does.<br />

Upwinding Schemes Accuracy<br />

With the stability of the schemes established, their accuracies must be established. This<br />

is done through the application of a simple one dimensional system given below in<br />

equation 9.<br />

φ = φ + φ (9a)<br />

aPP aE E aW W<br />

aE<br />

φ P =<br />

a + a<br />

E W<br />

In this system the diffusion D is taken to equal 1 thus φ is a function of Pe only. φW is<br />

taken as 0 while φE is taken to be 1. This results in the following values of φ <strong>for</strong> a wide<br />

range of Pe shown below in Figure 5.<br />

φ p<br />

1.2<br />

1<br />

0.8<br />

0.6<br />

0.4<br />

0.2<br />

0<br />

-0.2<br />

Prediction of φ p by Various Schemes<br />

Central difference<br />

Upwind<br />

Power law<br />

Exponential (exact)<br />

-10 -8 -6 -4 -2 0<br />

Pe<br />

2 4 6 8 10<br />

(9b)<br />

Figure 5 - Prediction of φP by various schemes<br />

This plot shows that the power law is an almost exact approximation to the exact solution<br />

generated by the exponential scheme. This plot also shows that the upwind scheme<br />

Page 13


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

yields good results when Pe < 1, and the upwind scheme when Pe > 10. There<strong>for</strong>e the<br />

selection of scheme depends upon the cell Peclet number as given by the fluid properties<br />

and the FLUENT generated flow field.<br />

Computing the Cell Peclet Number<br />

For this simulation and all further runs, the following fluid parameters are used <strong>for</strong> air at<br />

300K, given by Incopera and DeWitt [3]. Because the bulk temperature of the fluid does<br />

not change very much, these constant properties are an accurate approximation.<br />

Property Value<br />

Density, ρ 1.1614 kg/m 3<br />

Thermal conductivity, k 26.3e-3 W/m 2<br />

Of the 48 FLUENT generated flow fields, the more extreme inlet and outlet velocity<br />

cases were selected that would yield the higher cell Peclet numbers. The flow field<br />

selected is shown below in Figure 6.<br />

Figure 6 - Flow field <strong>for</strong> computation of cell Peclet number<br />

This yields a cell Peclet number distribution as shown below in Figure 7.<br />

Page 14


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

Y Axis (m)<br />

2<br />

1.5<br />

1<br />

0.5<br />

Cell Peclet Number Distribution<br />

0.5 1 1.5 2 2.5 3<br />

X Ax is (m)<br />

0.5 1 1.5 2 2.5 3 3.5 4 4.5<br />

Figure 7 - Cell Peclet number distribution<br />

Viewing the figure above, the maximum cell Peclet number occurs in the regions of<br />

highest flow velocity, as to be expected. The highest numbers reach values of 4.5.<br />

Viewing Figure 5 shows that this is the region of maximum error <strong>for</strong> the upwind and<br />

central difference schemes. Furthermore, reducing the mesh size is undesirable because<br />

of the increased computational time as well as the need to interpolate the fluid flow field<br />

introducing erroneous data!<br />

There<strong>for</strong>e the A(|Pe|) function selected is the power law, as given in equation 8c.<br />

Substitution of this equation into equation 7 yields the final flux across the control<br />

volume interface e given by equation 10 below.<br />

{ ( ) }<br />

JA= Fφ + DA Pe + [ −F ,0] ( φ − φ )<br />

(10)<br />

e e e P e e e P E<br />

Substitution of this same A(|Pe|) function into equation 6 yields the final discrimination,<br />

used in the finite difference schemes presented next.<br />

Page 15


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

SOLUTION METHODS<br />

Three different solution methods were used in this project and compared with regard to<br />

their speed. All methods are implicit, the solutions obtained through the inversion of the<br />

resulting NxM by NxM stiffness matrix. The methods to be used are direct inversion of<br />

the stiffness matrix through Gauss Elimination and the alternating direction line by line<br />

iterative method. The direct inversion method is to be applied to the full matrix as well<br />

as a “sparse” matrix, a bandwidth reduced matrix <strong>for</strong>mat used by MATLAB <strong>for</strong><br />

comutational efficincy.<br />

OVERALL ROUTINE<br />

The overall routine of constructing and solving the matrix system is per<strong>for</strong>med by the<br />

function Advection. This function solves <strong>for</strong> the thermal profile of the data center cold<br />

aisle <strong>for</strong> a perscirbed upper air inlet temperature. This function is itterated by the<br />

function ColdAisleSimulation. The headers and descriptions of both functions are given<br />

below. The complete code <strong>for</strong> all functions in this report are at the end of this report in<br />

the Appendix.<br />

Cold Aisle Simulation<br />

function [T,X,Y,x,y,u,v,u2,v2,x2,y2]<br />

= ...<br />

ColdAisleSimulation(Q,eta,method,plots,x2,y2,u2,v2)<br />

%COLDAISLESIMULATION Convection Simulation of Cold Aisle<br />

% This program computes the temperature field of the<br />

% cold aisle of a data center. The bulk of the code is<br />

% in the function Advection, which is iterated here<br />

% to find the appropriate inlet temperature.<br />

%<br />

% Inputs:<br />

% Q - power generated from each PCB server board<br />

% eta - ratio of heat energy recycled into system<br />

% method - solution algorithm to be implemented<br />

% 'full': direct inversion of full matrix<br />

% 'sprs': direct inversion of sparse matrix<br />

% 'line': alternating line by line TDMA algorithm<br />

% plots - number of plots to be generated<br />

% 1: Temperature profile<br />

% 2: Vector flow field<br />

% 3: Cell Peclet number<br />

% 4: Streamlines & velocity partidcles<br />

% x2 - vector of FLUENT x-coordinate grid data<br />

% y2 - vector of FLUENT y-coordinate grid data<br />

% u2 - vector of FLUENT u-flow field data<br />

% v2 - vector of FLUENT v-flow field data<br />

%<br />

% Outputs:<br />

% T - matrix of computed nodal temperature data<br />

% X - vector of ascending unique x coordinates<br />

% Y - vector of ascending unique y coordinates<br />

% x - matrix of sorted x-coordinate grid data<br />

% y - matrix of sorted y-coordinate grid data<br />

% u - matrix of sorted u-flow field data<br />

% v - matrix of sorted v-flow field data<br />

% x2 - vector of FLUENT x-coordinate grid data<br />

Page 16


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

% y2 - vector of FLUENT y-coordinate grid data<br />

% u2 - vector of FLUENT u-flow field data<br />

% v2 - vector of FLUENT v-flow field data<br />

Advection<br />

function [T,X,Y,x,y,u,v,dT2] = ...<br />

Advection(x2,y2,u2,v2,Q,dT,eta,method,plots)<br />

%ADVECTION Numerical Energy Equation Solver with Advection<br />

% This function computes the temperature field of the cold<br />

% aisle of a data center using a given flow field. The<br />

% function can use one of three solution methods, direct<br />

% matrix inversion, sparse matrix inversion, and alternating<br />

% line by line solution using the TDMA algorithm. The<br />

% resulting temperature, flow, Peclet number, and streamline<br />

% data can be plotted. The energy continuity is computed<br />

% allowing <strong>for</strong> the iteration of the function to converge<br />

% to a steady state solution.<br />

%<br />

% Inputs:<br />

% x2 - vector of FLUENT x-coordinate grid data<br />

% y2 - vector of FLUENT y-coordinate grid data<br />

% u2 - vector of FLUENT u-flow field data<br />

% v2 - vector of FLUENT v-flow field data<br />

% Q - power generated from each PCB server board<br />

% dT - top inlet air temperature rise<br />

% eta - ratio of heat energy recycled into system<br />

% method - solution algorithm to be implemented<br />

% 'full': direct inversion of full matrix<br />

% 'sprs': direct inversion of sparse matrix<br />

% 'line': alternating line by line TDMA algorithm<br />

% plots - number of plots to be generated<br />

% 1: Temperature profile<br />

% 2: Vector flow field<br />

% 3: Cell Peclet number<br />

% 4: Streamlines & velocity partidcles<br />

%<br />

% Outputs:<br />

% T - matrix of computed nodal temperature data<br />

% X - vector of ascending unique x coordinates<br />

% Y - vector of ascending unique y coordinates<br />

% x - matrix of sorted x-coordinate grid data<br />

% y - matrix of sorted y-coordinate grid data<br />

% u - matrix of sorted u-flow field data<br />

% v - matrix of sorted v-flow field data<br />

% dT - top inlet air temperature rise from continuity<br />

CONSTRUCTING THE STIFFNESS MATRIX<br />

The stiffness matrix is constructed by a routine that scans through each line of the flow<br />

field matrix and fills in the computed coefficents from equation 6 into the appropriate<br />

elements. This function BuildK and its subfunctions fa header and description is given<br />

below.<br />

Page 17


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

BuildK<br />

fa<br />

function [K,B,Peclet] = BuildK(N,M,u,v,dx,dy,Tin,method)<br />

%BUILDK Constructs Stiffness Matrix <strong>for</strong> <strong>Heat</strong> <strong>Transfer</strong> Problem<br />

% Scans through the flow field of the given geometry and<br />

% applies the correct cefficeints into the stiffness matrix<br />

% to be solved implicitly either by direct matrix inversion<br />

% or a line by line technique. This function apples insulation<br />

% boundary conditions to all geometry edges.<br />

%<br />

% Inputs:<br />

% N - number or elements in x<br />

% M - number of elements in y<br />

% u - vector of u-flow field data<br />

% v - vector of v-flow field data<br />

% dx - delta x<br />

% dy - delta y<br />

% Tin - top inlet air temperature<br />

% method - solution algorithm to be implemented<br />

% 'full': direct inversion of full matrix<br />

% 'sprs': direct inversion of sparse matrix<br />

% 'line': alternating line by line TDMA algorithm<br />

%<br />

% Outputs:<br />

% K - stiffness matrix<br />

% B - heat flux vector<br />

% Peclet - matrix of cell Peclet numbers<br />

function [fa,PE] = fa(u,L,A,s)<br />

%FA Determines stiffness matrix coefficeint<br />

% This function computes the discrete flux coefficients<br />

% into the control volume (CV) under consideration. This is<br />

% computed using the power law upwinding approximation,<br />

% using the Peclet number, Convective flux, and Diffusion<br />

% flux into the element. These are computed using<br />

% seperate subfunctions.<br />

%<br />

% Inputs:<br />

% u - scalar flow magnitude into control volume<br />

% L - width of CV w.r.t. face under consideraton<br />

% A - height of CV w.r.t. face under consideraton<br />

% s - sign to be used in Power Law approximation<br />

%<br />

% Outputs:<br />

% fa - flux coefficient<br />

% PE - cell Peclet number<br />

BOUNDARY CONDITIONS<br />

The boundary conditions were applied as adiabatic, outflow, or with an input flux either<br />

from the air inlet at a specified temperature, or from the heat generated from the surface<br />

of the racks. These were implemented through changing the appropriate coefficient of<br />

the flux between elements. There are two functions to per<strong>for</strong>m this operation, ApplyBCs<br />

and ApplyBCs_rot, which applies the same boundary conditions to the system that has<br />

Page 18


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

been rotated 90 degrees <strong>for</strong> use by the alternating direction line by line solution method.<br />

The function header and description of ApplyBCs is given below.<br />

ApplyBCs<br />

function [K,B] = ApplyBCs(K,B,N,M,u,v,dx,dy,Tin,q,Delta_T)<br />

%APPLYBCS Applies Boundary Conditions to Equation System<br />

% This function modifies the system stiffness matrix to<br />

% apply the specific boundary conditions of the cold aisle<br />

% simulation. This includes the adiabatic PCB boards and<br />

% associated heat flux inputs as well as the inflow and<br />

% outflow boundaries.<br />

%<br />

% Inputs:<br />

% K - stiffness matrix<br />

% B - heat flux vector<br />

% N - number or elements in x<br />

% M - number of elements in y<br />

% u - vector of u-flow field data<br />

% v - vector of v-flow field data<br />

% dx - delta x<br />

% dy - delta y<br />

% Tin - top inlet air temperature<br />

% Q - power generated from each PCB server board<br />

% dT - top inlet air temperature rise<br />

%<br />

% Outputs:<br />

% K - corrected stiffness matrix<br />

% B - corrected heat flux vector<br />

SOLVE SYSTEM<br />

The Gauss Elimination of the full stiffness matrix is per<strong>for</strong>med using the internal<br />

MATLAB routines <strong>for</strong> both the full and sparse matrix systems. The alternating line by<br />

line solution works by looking at a single line and setting the flux input to elements from<br />

the lines above and below the line to constants using the most recently computed<br />

temperature values. This creates a tridiagonal matrix system which is solved <strong>for</strong> by the<br />

Thomas algorithm, the header of which is given below as Thomas. This is then repeated<br />

<strong>for</strong> orthogonal lines, in this case alternating between lines of x and y. In order to<br />

alternate lines, two stiffness matrices are constructed, one <strong>for</strong> the normal geometry and<br />

second <strong>for</strong> the geometry rotated 90 degrees. This allows the same solution function to be<br />

applied, as shown in Advection. A trans<strong>for</strong>mation algorithm is then applied to trans<strong>for</strong>m<br />

the solution temperature vector into the order required <strong>for</strong> multiplication with the rotated<br />

stiffness matrix <strong>for</strong> the next iteration of the routine. The header of this function<br />

Trans<strong>for</strong>mTemp is given below, as is the function LineSolver which is the entire routine.<br />

LineSolver<br />

function T = LineSolver(M,N,K,b,temp)<br />

%LINESOLVER Line by Line Numerical Solution <strong>Method</strong><br />

% This function solves the banded matrix system that<br />

% is <strong>for</strong>med from two dimensional implicit schemes.<br />

% It solves each line seperately using the TDMA<br />

% algorithm using the latest values of T to compute<br />

Page 19


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

% the flux inputs from above and below the line.<br />

% This function can be used with alternating x and y<br />

% direction <strong>for</strong> generally increased convergence<br />

% speed.<br />

%<br />

% Inputs:<br />

% N - Number of elements in x<br />

% M - Number of elements in y<br />

% K - Stiffness Matrix<br />

% b - <strong>Heat</strong> flux input vector<br />

% temp - temperature input vector<br />

%<br />

% Outputs:<br />

% T - temperature output vector<br />

Trans<strong>for</strong>mTemp<br />

function tr = Trans<strong>for</strong>mTemp(M,N)<br />

%TRANSFORMTEMP Trans<strong>for</strong>m Temperature Vector <strong>for</strong> Next Iteration<br />

% Computes the vector of indices of the computed Temperature<br />

% vector such that these indeces return the Temperature<br />

% vector such that it can be multipled by the rotated<br />

% stiffness matrix. This allows the itteration between the<br />

% x and y line by line solution method. Can be use to compute<br />

% trans<strong>for</strong>mation and reverse trans<strong>for</strong>mation.<br />

%<br />

% Inputs:<br />

% N - number or elements in x<br />

% M - number of elements in y<br />

%<br />

% Outputs:<br />

% tr - vector of indices <strong>for</strong> trans<strong>for</strong>mation of T<br />

Thomas<br />

function x = Thomas(A,b,N)<br />

%THOMAS Thomas Algorithm <strong>for</strong> Solving Tridiagonal Systems<br />

% This function is the Thomas algorithm <strong>for</strong> solving tridiagonal<br />

% systems of the <strong>for</strong>m Ax = b. In this project it is used to<br />

% solve <strong>for</strong> the temperature distribution along a single line<br />

% of the computaitional domain.<br />

%<br />

% Inputs:<br />

% A - tridiagonal matrix<br />

% b - right hand vector<br />

% N - length of matrix side<br />

%<br />

% Outputs:<br />

% x - solution<br />

Page 20


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

SIMULATION ACCURACY<br />

In order to determine if my simulation is accurate I have compared it to an analytically<br />

computed conduction problem and a commercial CFD program called FEMLAB’s<br />

solution to a convective problem. This is because there are no analytical solutions to a<br />

problem that is similar enough to mine to test my simulation against.<br />

CONDUCTION ACCURACY<br />

To test the simulations accuracy of conduction only the output is compared to an<br />

analytical solution to a square region with one side at higher temperature at steady state<br />

as follows in equation 11.<br />

Txx + Tyy<br />

= 0<br />

(11)<br />

The analytical series solution to this problem is given below in equation 12, where λnL =<br />

nπ.<br />

∞ 1−cos( λnL)<br />

T( x, y) = T0 + 2( TL −T0) ∑ sinh( λnx)sinh( λny)<br />

(12)<br />

λ Lsinh( λ L)<br />

n= 1 n n<br />

The resulting temperature distribution is plotted in Figure 8 below.<br />

y-position (m)<br />

1<br />

0.9<br />

0.8<br />

0.7<br />

0.6<br />

0.5<br />

0.4<br />

0.3<br />

0.2<br />

0.1<br />

Temperature Distribution<br />

0<br />

0 0.2 0.4 0.6 0.8 1<br />

x-position (m)<br />

Figure 8 – Conductive test temperature distribution<br />

1<br />

0.9<br />

0.8<br />

0.7<br />

0.6<br />

0.5<br />

0.4<br />

0.3<br />

0.2<br />

0.1<br />

0<br />

Page 21


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

The comparison of the numerical simulation with the analytical solution <strong>for</strong> lines of y and<br />

x are shown in Figure 9 and Figure 10 respectively below.<br />

Temperature (C)<br />

Temperature (C)<br />

1<br />

0.9<br />

0.8<br />

0.7<br />

0.6<br />

0.5<br />

0.4<br />

0.3<br />

0.2<br />

0.1<br />

Comparison of Numerical Conduction Model<br />

y = 0.1<br />

y = 0.25<br />

y = 0.5<br />

y = 0.1<br />

y = 0.25<br />

y = 0.5<br />

0<br />

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1<br />

x-position (x)<br />

0.7<br />

0.6<br />

0.5<br />

0.4<br />

0.3<br />

0.2<br />

0.1<br />

Figure 9 - Comparison model <strong>for</strong> constant y<br />

Comparison of Numerical Conduction Model<br />

x = 0.25<br />

x = 0.5<br />

x = 0.75<br />

x = 0.25<br />

x = 0.5<br />

x = 0.75<br />

0<br />

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1<br />

y-position (m)<br />

Figure 10 - Comparison model <strong>for</strong> constant x<br />

Viewing the figures above it is shown that the results match perfectly, showing the<br />

simulation represents the conductive flux excellently.<br />

Page 22


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

CONVECTION ACCURACY<br />

The convective case selected was made similar to the system being simulated. Thus a<br />

square region measuring 2m by 2m with a vertical flow of 0.5m/s with an inlet<br />

temperature of 25 degrees C was subjected to a heat flux of 0.2W/m on the right and<br />

0.4W/m on the left. These conditions were set up identically in both FEMLAB and the<br />

finite difference simulation. The resulting temperature profile is shown below in Figure<br />

11<br />

Y Axis (m)<br />

40<br />

35<br />

30<br />

25<br />

20<br />

15<br />

10<br />

5<br />

Temperature Field<br />

5 10 15 20<br />

X Ax is (m)<br />

25 30 35 40<br />

160<br />

140<br />

120<br />

100<br />

Figure 11 - Convective test temperature profile<br />

The comparison of the numerical simulation with the analytical solution <strong>for</strong> lines of y and<br />

x are shown in Figure 12 and Figure 13 respectively below.<br />

80<br />

60<br />

40<br />

Page 23


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

Temperature (C)<br />

Temperature (C)<br />

110<br />

100<br />

90<br />

80<br />

70<br />

60<br />

50<br />

40<br />

30<br />

Comparison of Numerical Convection Model<br />

y = -0.5<br />

y = -0.5<br />

y = 0<br />

y = 0<br />

y = 0.5<br />

y = 0.5<br />

20<br />

-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1<br />

x-position (m)<br />

44<br />

42<br />

40<br />

38<br />

36<br />

34<br />

32<br />

30<br />

28<br />

26<br />

Figure 12 - Comparison model <strong>for</strong> constant y<br />

Comparison of Numerical Convection Model<br />

x = -0.5<br />

x = -0.5<br />

x = 0<br />

x = 0<br />

x = 0.5<br />

x = 0.5<br />

24<br />

-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1<br />

y-position (m)<br />

Figure 13 - Comparison model <strong>for</strong> constant x<br />

The figures above show an almost perfect match, except <strong>for</strong> some slight deviation along<br />

the boundary. This is to be expected from the comparison of different numerical schemes<br />

employing different solution techniques, however this is still a very strong result that the<br />

simulation matches a commercial CFD package.<br />

Page 24


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

RESULTS<br />

The complete simulation only has to iterate three times to converge to a steady solution to<br />

overcome the nonlienarity incurred by the variable upper air inlet temperature. This<br />

convergence is shown below in Figure 14.<br />

Inlet Temperature 9C)<br />

10<br />

9<br />

8<br />

7<br />

6<br />

5<br />

4<br />

3<br />

2<br />

1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3<br />

Itteration Number<br />

Figure 14 - Convergence of the Advection simulation routine<br />

The simulation was then run <strong>for</strong> three different cases representing a low flow velocity<br />

case, a high side velocity case, and a strong mixed velocity case. These cases would<br />

yield very different temperature profiles and thoroughly test the convergence speed<br />

capabilities of the different methods. The nomenclature used here is “Full” <strong>for</strong> the full<br />

direct matrix inversion method, “Sparse” <strong>for</strong> the sparse matrix inversion method, and<br />

“Line” <strong>for</strong> the line by line method.<br />

The convergence time is measured until the change in delta t < 0.01 C between iterations<br />

of Advection. The timing was per<strong>for</strong>med with the internal MATLAB function tic toc<br />

with multiple runs to ensure accurate results.<br />

Page 25


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

TEST 1<br />

Convergence in 3 iterations.<br />

Full: Convergence took 7.375 seconds.<br />

Sparse: Convergence took 0.046 seconds.<br />

Line: Convergence took 129 iterations in 1.680 seconds.<br />

Y Axis (m)<br />

2<br />

1.5<br />

1<br />

0.5<br />

Temperature Field<br />

0.5 1 1.5 2 2.5 3<br />

X Ax is (m)<br />

30 35 40 45 50 55 60 65 70<br />

Figure 15 - Temperature field<br />

Figure 16 - Flow field<br />

Page 26


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

TEST 2<br />

Convergence in 3 iterations.<br />

Full: Convergence took 7.390 seconds.<br />

Sparse: Convergence took 0.047 seconds.<br />

Line: Convergence took 67 iterations in 0.938 seconds.<br />

Y Axis (m)<br />

2<br />

1.5<br />

1<br />

0.5<br />

Temperature Field<br />

0.5 1 1.5 2 2.5 3<br />

X Ax is (m)<br />

26 28 30 32 34 36 38 40 42 44 46<br />

Figure 17 - Temperature field<br />

Figure 18 - Flow field<br />

Page 27


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

TEST 3<br />

Convergence in 3 iterations.<br />

Full: Convergence took 7.375 seconds.<br />

Sparse: Convergence took 0.047 seconds.<br />

Line: Convergence took 143 iterations in 1.890 seconds.<br />

Y Axis (m)<br />

2<br />

1.5<br />

1<br />

0.5<br />

Temperature Field<br />

0.5 1 1.5 2 2.5 3<br />

X Ax is (m)<br />

30 35 40 45 50 55 60 65<br />

Figure 19 - Temperature field<br />

Figure 20 - Flow field<br />

Page 28


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

DISCUSSION<br />

ALGORITHM SPEED<br />

Analysis of the results presented in the previous section show that the Line-by-Line<br />

solution is considerably faster than the direct matrix inversion. However, when the<br />

sparse matrix bandwidth reduction function is employed, the inversion becomes much<br />

faster because of the vast memory savings. However, this has been a useful learning and<br />

coding experience <strong>for</strong> me.<br />

TRANSIENT STABILITY<br />

In this project the transient part of the energy equation has been ignored because of the<br />

interest in the steady state solution. However, expanding the system to a transient<br />

analysis is straight<strong>for</strong>ward. The discretization of the time derivative can be done using an<br />

explicit, implicit, or Crank-Nicholson scheme. Howver, <strong>for</strong> stability reasons the explicit<br />

scheme must obey the CFL condition <strong>for</strong> it to be stable, given buy the courant number<br />

shown in equation 13 below.<br />

∆t<br />

Cr = u (13)<br />

∆ x<br />

This equation is also true of the y-direction, with v and ∆y substituted <strong>for</strong> the x terms.<br />

SUMMARY<br />

Overall, I feel that the numerical scheme presented in this report is an excellent energy<br />

equation solver <strong>for</strong> convective flow fields. This will aid me significantly with my future<br />

research work on simulation based design of data center server cabinets.<br />

Page 29


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

REFERENCES<br />

1. S. V. Patankar and D. B. Spalding, “A Calculation Procedure <strong>for</strong> <strong>Heat</strong>, Mass and<br />

momentum <strong>Transfer</strong> in Three-Dimensional Parabolic Flows,” Int. J. <strong>Heat</strong> Mass<br />

<strong>Transfer</strong>, 15, 1787-1806.<br />

2. Patankar, S. V. Chapter 6 - Elliptic Systems: <strong>Finite</strong>-<strong>Difference</strong> <strong>Method</strong> I<br />

Department of Mechanical Engineering, University of Minnesota – Twin Cities,<br />

Minneapolis, Minnesota 55455<br />

3. Rambo, Jeffrey “Model Reduction of Multiscale <strong>Turbulent</strong> Convection:<br />

Application to Data Center Thermal Management”, PhD proposal, G. W.<br />

Woodruff School of Mechanical Engineering, Georgia Institute of Technology<br />

4. Incropera, F., Dewitt, D., “Fundamentals of <strong>Heat</strong> and Mass <strong>Transfer</strong>,” 2002<br />

Page 30


Nathan Rolander MATH6640 – Final Project<br />

Fall 2004<br />

APPENDIX<br />

The compilation of all of my MATLAB functions are compiled here in the order in which<br />

they are called.<br />

Page 31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!