Docsity

Final Project Report - Numerical Methods for Partial Differential Equations | MATH 6640, Study Guides, Projects, Research of Differential Equations

Partial preview of the text

Download Final Project Report - Numerical Methods for Partial Differential Equations | MATH 6640 and more Study Guides, Projects, Research Differential Equations in PDF only on Docsity!

MATH6640 – Numerical Methods for PDEs :

Final Project Report

Submitted by:

Nathan Rolander

Prepared for:

Dr. Yingjie Liu

Georgia Institute of Technology

Monday, December 06, 2004

CONTENTS

Fall 2004

Nomenclature

RANS - Reynolds Averaged Navier Stokes k-, - k epsilon turbulence model, k - turbulent kinetic energy, , - turbulent dissipation CFD - computational fluid dynamics HVAC - Heating Ventilation and Air Conditioning POD - Proper Orthogonal Decomposition

Fall 2004

INTRODUCTION

In this project a two-dimensional convection diffusion thermal system corresponding to a simulation of a data center cold aisle is presented. This results in a two-dimensional steady state elliptic system which is solved using a finite difference approach. This system has a degree of nonlinearity, requiring iteration of the system to achieve convergence to steady parameter values.

PROBLEM O VERVIEW

A Data Center is a dedicated room of computers systems. These computers are racks in a cabinet enclosure, and include servers, computational workstations, or switches for communications. The heat load of these rooms can be 200kW, hundreds of times that of a human occupied room. The computers require a cool, dry environment for best performance, and therefore require a dedicated environmental conditioning system. This system often uses as much as 40% of the power to the room just for HVAC. As the cost reaches millions of dollars per year, efficiency is of utmost concern.

M OTIVATION

In order to improve cooling efficiency of the HVAC system, numerical thermal fluid simulations are performed to determine superior cabinet configurations. The cabinet geometry and air flow velocities of the data center create turbulent convective conditions, leading to long convergence times using CFD solvers such as the k-, RANS turbulence model. This high computational expense is compounded when a large number of design variables are incorporated into the problem. The long computational time incurred makes these tools, poorly suited for use in iterative algorithms employed in optimization methods. In the preliminary stages of design, model fidelity can be traded-off for computational speed in order to effectively investigate and map the feasible design space. Therefore the development and application of computationally efficient reduced order models is essential for effective design of complex thermal systems.

An emerging reduced order model development approach for turbulent convective flow is proper orthogonal decomposition (POD). This method has been used successfully to create low dimensional steady state flow models within a prescribed range of parameters. The POD construct is used to build a two-dimensional convective flow simulation of air- cooled server cabinet located within a data center. This two dimensional model is representative of a cross-section of a fully loaded cabinet. This cabinet simulation contains four individual racks, each with a prescribed airflow rate and power generation. With the development of this computationally efficient fluid flow model, a heat transfer model is required to solve for the cabinet temperature profile. The temperature profile dictates the operating temperature of the computer chips, and this whether they will overheat. This thermal model development is presented in this project.

Fall 2004

MODEL DEVELOPMENT

FLUID FLOW

In order to determine the sole accuracy of the thermal model being developed the flow fields to be used are the direct output of the FLUENT generated data sets. These simulations are performed using the k-, RANS turbulence model with a range of boundary conditions creating a window of flow observations that represent what would typically occur within a data center such as the one being modeled. These flow data sets are read into MATLAB and processed for use by the thermal model by the function ca_pod_svd and ca_extract , the headers and descriptions are shown below. The full programs with detailed comments are available at the end of this report in the Appendix.

ca_pod_svd

function [x2,y2,u,v,um,vm] = ca_pod_svd %CA_POD.M Extract FLUENT Observations & perform POD % This function extracts node based FLUENT data representing % the flow field of teh cold aisle geometry. In this project % this data is used directly, however in my research the % Proper Orthogonal Decomposition of the observations is % applied to generate basis functions called POD modes % of the flow data for use in my reduced order flow model. % This program is based off of work by Jeff Rambo. % % Outputs: % x2 - vector of FLUENT x-coordinate grid data % y2 - vector of FLUENT y-coordinate grid data % u - vector of FLUENT u-flow field data % v - vector of FLUENT v-flow field data % um - vector of POD mode u-flow field data % vm - vector of POD mode v-flow field data

ca_extract

function [x2,y2,u2,v2,r] = ca_extract (name) %CA_EXTRACT Extract and Process FLUENT data files % Function to extract data for the cold aisle model reduction % study. Call [x,y,u,v,dimrot]=ca_extract(name) where % 'name' is the Fluent output ASCII file name. 'x','y','u','v' % are the nodal coordinates and velocities, 'P' and 'nu' are % the pressure and effective viscosity, respectively. 'dimrot' % is vector index numer to pivot about in the vec2mat command % for reshaping vectors into matrices for field plotting. % This program is based off of work by Jeff Rambo. % % Inputs: % name - name of the FLUENT ASCII file name % % Outputs: % x2 - vector of FLUENT x-coordinate grid data % y2 - vector of FLUENT y-coordinate grid data % u2 - vector of FLUENT u-flow field data % v2 - vector of FLUENT v-flow field data % r - length of y vector for creating matrix data

Fall 2004

H EAT TRANSFER

The two dimensional conductive and convective heat transfer problem forms an elliptic partial differential equation, commonly reffered to as as the energy equation, given below in equation 1.

d d d d d u v dt dx dx dy dy

S

In this equation S is the volumetric heat generation, φ is the temperature, ρ is the fluid

density, u and v are the flow velocities in the x and y directions respectively, Γ is the thermal conductivity k. In this problem the transient term goes to 0 as it is a steady state problem. It is also convineint to lump the conductive and convective flux terms together. This makes the calculation of the numerical flux balance easier and is important for stability reasons to be explored later. This results in the following equation form given below in equation 2.

dJ (^) x dJ y S dx dy

  • = (2 a )

x

d J u dx

= ρ φ− Γ (2 b )

y

d J v dy

= ρ φ− Γ (2 c )

Control Volume based Finite Difference Approach

The basis of the numerical method is the conversion of the general differential equation 1 to an algebraic equation relating the temperature of the point under consideration, P, to the temperatures of the surrounding points N, E, S, W. This results in a flux balance into and out of the control volume as shown in Figure 2 below.

Figure 2 - Example control volume

Fall 2004

Equation 5 shows that the Peclet number is in fact the ratio of conductive flux to diffusive flux. This is a critical parameter in the analysis of the possible discritization schemes explored next.

Staggered Flow Grid

The u variable, the velocity across the face of the element is read in from the generated velocity field by the flow model. However, because there needs to be a velocity at all four sides of each element where the temperature is computed, a staggered flow grid is employed. This is shown below in Figure 3. Here the grey area is the element of constant temperature, the node at the center is the point where temperature is computed. The intersecting dashed lines are where the u and v components of the velocity are computed by the flow model. This results in the temperature matrix being one element smaller in each dimension, as well as the “artifact” of the grid that is the missing u , v point at the top right hand corner.

Figure 3 - Staggered grid diagram

Discretization Approaches

To discretize the equation is space, the coefficients to multiply the surrounding nodes by must be found. This general discretization is given in equation 6 a , where a a represents the coefficients of the surrounding nodes and b is equal to the heat flux input to the element.

a P φ P = a E φ E + aW φ W + aN φ N + aS φ S + b (6 a )

The following equations give the general form of the coefficients for each side of the control volume. These coefficents are functions of the dimensionless parameters defined

earlier, and a function of the Peclet number A (| Pe |). In these equations (^) a a b , b represents

the maximum of a and b.

aE = D Ae ( (^) Pee (^) ) + −a Fe , 0b (6 b )

aW = D Aw ( Pew (^) ) + (^) a Fw , 0b (6 c )

Fall 2004

aN = D An ( Pen (^) ) + (^) a − Fn , 0b (6 d )

aS = D As ( Pes (^) ) + (^) a Fs , 0b (6 e )

a P = aE + aW + aN + aS

i

(6 f )

These coefficeints a are related to the fluxes into the element Jx and Jy given in equation 2 through equation 7, shown in general form as the flux through the control volume face between two adjacent elements. Here the capitalized letters represent opposite face coefficients from adjacent nodes.

J = B φ i − A φ + 1 (7)

Substituting one of equations 6 b-f with an appropriate function A (| Pe |) and equation 7 yields the function for the total flux entering a specific control volume face. There are many approaches to approximating the function A (| Pe |), these are all dependent upon the Peclet number, Pe. This choice of approximation also determines the accuracy and the stability of the method, as investigated next.

Upwinding Schemes Approximation & Stability

In order to determine the most accurate and stable approximation of the flux function J though the there are several schemes for the function A (| Pe |). These are based upon the Taylor series expansion of equation 2, an approximation or exact solution to the differential equation between two nodes, or a combination of these. These schemes are presented below in equations 8.

The value of these functions A (| Pe |) versus the input Peclet Number is shown below in Figure 4.

Scheme Formula for A(|Pe|)

Central difference 1 −^ 0.5^ Pe (8 a ) Upwind 1 (8 b ) Power law ( )

5 cd (^) 0, 1 −0.1 Pe fg e h (8 c )

Exponential (exact) exp (^) ( ) 1

Pe Pe −

(8 d )

Fall 2004

Power law

The power law scheme is an approximation to the exponential scheme that produces very close results. An added advantage beyond the increased computational speed is that if a fluid flow speed of 0 is encountered the equation does not fail, as the exponential scheme does.

Upwinding Schemes Accuracy

With the stability of the schemes established, their accuracies must be established. This is done through the application of a simple one dimensional system given below in equation 9.

a P φ P = a E φ E + aW φ W (9 a )

E P E W

a a a

(9 b )

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

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

range of Pe shown below in Figure 5.

-10 -8 -6 -4 -2 0 2 4 6 8 10

-0.

0

1

Prediction of (^) φp by Various Schemes

Pe

φp

Central difference Upwind Power law Exponential (exact)

Figure 5 - Prediction of φ P by various schemes

This plot shows that the power law is an almost exact approximation to the exact solution generated by the exponential scheme. This plot also shows that the upwind scheme

Fall 2004

yields good results when Pe < 1, and the upwind scheme when Pe > 10. Therefore the selection of scheme depends upon the cell Peclet number as given by the fluid properties and the FLUENT generated flow field.

Computing the Cell Peclet Number

For this simulation and all further runs, the following fluid parameters are used for air at 300K, given by Incopera and DeWitt [3]. Because the bulk temperature of the fluid does not change very much, these constant properties are an accurate approximation.

Property Value

Density, ρ 1.1614 kg/m^3

Thermal conductivity, k 26.3e-3 W/m^2

Of the 48 FLUENT generated flow fields, the more extreme inlet and outlet velocity cases were selected that would yield the higher cell Peclet numbers. The flow field selected is shown below in Figure 6.

Figure 6 - Flow field for computation of cell Peclet number

This yields a cell Peclet number distribution as shown below in Figure 7.

Fall 2004

SOLUTION METHODS

Three different solution methods were used in this project and compared with regard to their speed. All methods are implicit, the solutions obtained through the inversion of the resulting NxM by NxM stiffness matrix. The methods to be used are direct inversion of the stiffness matrix through Gauss Elimination and the alternating direction line by line iterative method. The direct inversion method is to be applied to the full matrix as well as a “sparse” matrix, a bandwidth reduced matrix format used by MATLAB for comutational efficincy.

O VERALL ROUTINE

The overall routine of constructing and solving the matrix system is performed by the function Advection. This function solves for the thermal profile of the data center cold aisle for a perscirbed upper air inlet temperature. This function is itterated by the function ColdAisleSimulation. The headers and descriptions of both functions are given below. The complete code for all functions in this report are at the end of this report in the Appendix.

Cold Aisle Simulation

function [T,X,Y,x,y,u,v,u2,v2,x2,y2] = ... ColdAisleSimulation (Q,eta,method,plots,x2,y2,u2,v2) %COLDAISLESIMULATION Convection Simulation of Cold Aisle % This program computes the temperature field of the % cold aisle of a data center. The bulk of the code is % in the function Advection, which is iterated here % to find the appropriate inlet temperature. % % Inputs: % Q - power generated from each PCB server board % eta - ratio of heat energy recycled into system % method - solution algorithm to be implemented % 'full': direct inversion of full matrix % 'sprs': direct inversion of sparse matrix % 'line': alternating line by line TDMA algorithm % plots - number of plots to be generated % 1: Temperature profile % 2: Vector flow field % 3: Cell Peclet number % 4: Streamlines & velocity partidcles % x2 - vector of FLUENT x-coordinate grid data % y2 - vector of FLUENT y-coordinate grid data % u2 - vector of FLUENT u-flow field data % v2 - vector of FLUENT v-flow field data % % Outputs: % T - matrix of computed nodal temperature data % X - vector of ascending unique x coordinates % Y - vector of ascending unique y coordinates % x - matrix of sorted x-coordinate grid data % y - matrix of sorted y-coordinate grid data % u - matrix of sorted u-flow field data % v - matrix of sorted v-flow field data % x2 - vector of FLUENT x-coordinate grid data

Fall 2004

% y2 - vector of FLUENT y-coordinate grid data % u2 - vector of FLUENT u-flow field data % v2 - vector of FLUENT v-flow field data

Advection

function [T,X,Y,x,y,u,v,dT2] = ... Advection (x2,y2,u2,v2,Q,dT,eta,method,plots) %ADVECTION Numerical Energy Equation Solver with Advection % This function computes the temperature field of the cold % aisle of a data center using a given flow field. The % function can use one of three solution methods, direct % matrix inversion, sparse matrix inversion, and alternating % line by line solution using the TDMA algorithm. The % resulting temperature, flow, Peclet number, and streamline % data can be plotted. The energy continuity is computed % allowing for the iteration of the function to converge % to a steady state solution. % % Inputs: % x2 - vector of FLUENT x-coordinate grid data % y2 - vector of FLUENT y-coordinate grid data % u2 - vector of FLUENT u-flow field data % v2 - vector of FLUENT v-flow field data % Q - power generated from each PCB server board % dT - top inlet air temperature rise % eta - ratio of heat energy recycled into system % method - solution algorithm to be implemented % 'full': direct inversion of full matrix % 'sprs': direct inversion of sparse matrix % 'line': alternating line by line TDMA algorithm % plots - number of plots to be generated % 1: Temperature profile % 2: Vector flow field % 3: Cell Peclet number % 4: Streamlines & velocity partidcles % % Outputs: % T - matrix of computed nodal temperature data % X - vector of ascending unique x coordinates % Y - vector of ascending unique y coordinates % x - matrix of sorted x-coordinate grid data % y - matrix of sorted y-coordinate grid data % u - matrix of sorted u-flow field data % v - matrix of sorted v-flow field data % dT - top inlet air temperature rise from continuity

CONSTRUCTING THE STIFFNESS M ATRIX

The stiffness matrix is constructed by a routine that scans through each line of the flow field matrix and fills in the computed coefficents from equation 6 into the appropriate elements. This function BuildK and its subfunctions fa header and description is given below.

Fall 2004

been rotated 90 degrees for use by the alternating direction line by line solution method. The function header and description of ApplyBCs is given below.

ApplyBCs

function [K,B] = ApplyBCs (K,B,N,M,u,v,dx,dy,Tin,q,Delta_T) %APPLYBCS Applies Boundary Conditions to Equation System % This function modifies the system stiffness matrix to % apply the specific boundary conditions of the cold aisle % simulation. This includes the adiabatic PCB boards and % associated heat flux inputs as well as the inflow and % outflow boundaries. % % Inputs: % K - stiffness matrix % B - heat flux vector % N - number or elements in x % M - number of elements in y % u - vector of u-flow field data % v - vector of v-flow field data % dx - delta x % dy - delta y % Tin - top inlet air temperature % Q - power generated from each PCB server board % dT - top inlet air temperature rise % % Outputs: % K - corrected stiffness matrix % B - corrected heat flux vector

SOLVE SYSTEM

The Gauss Elimination of the full stiffness matrix is performed using the internal MATLAB routines for both the full and sparse matrix systems. The alternating line by line solution works by looking at a single line and setting the flux input to elements from the lines above and below the line to constants using the most recently computed temperature values. This creates a tridiagonal matrix system which is solved for by the Thomas algorithm, the header of which is given below as Thomas. This is then repeated for orthogonal lines, in this case alternating between lines of x and y. In order to alternate lines, two stiffness matrices are constructed, one for the normal geometry and second for the geometry rotated 90 degrees. This allows the same solution function to be applied, as shown in Advection. A transformation algorithm is then applied to transform the solution temperature vector into the order required for multiplication with the rotated stiffness matrix for the next iteration of the routine. The header of this function TransformTemp is given below, as is the function LineSolver which is the entire routine.

LineSolver

function T = LineSolver (M,N,K,b,temp) %LINESOLVER Line by Line Numerical Solution Method % This function solves the banded matrix system that % is formed from two dimensional implicit schemes. % It solves each line seperately using the TDMA % algorithm using the latest values of T to compute

Fall 2004

% the flux inputs from above and below the line. % This function can be used with alternating x and y % direction for generally increased convergence % speed. % % Inputs: % N - Number of elements in x % M - Number of elements in y % K - Stiffness Matrix % b - Heat flux input vector % temp - temperature input vector % % Outputs: % T - temperature output vector

TransformTemp

function tr = TransformTemp (M,N) %TRANSFORMTEMP Transform Temperature Vector for Next Iteration % Computes the vector of indices of the computed Temperature % vector such that these indeces return the Temperature % vector such that it can be multipled by the rotated % stiffness matrix. This allows the itteration between the % x and y line by line solution method. Can be use to compute % transformation and reverse transformation. % % Inputs: % N - number or elements in x % M - number of elements in y % % Outputs: % tr - vector of indices for transformation of T

Thomas

function x = Thomas (A,b,N) %THOMAS Thomas Algorithm for Solving Tridiagonal Systems % This function is the Thomas algorithm for solving tridiagonal % systems of the form Ax = b. In this project it is used to % solve for the temperature distribution along a single line % of the computaitional domain. % % Inputs: % A - tridiagonal matrix % b - right hand vector % N - length of matrix side % % Outputs: % x - solution