You are on page 1of 48

C HA PT E R 3

CFdesign Theory

3.1

Introduction

The partial differential equations governing fluid flow and heat transfer include the continuity equation, the Navier-Stokes equations and the energy equation. These equations are intimately coupled and non-linear making a general analytic solution impossible except for a limited number of special problems, where the equations can be reduced to yield analytic solutions. Because most practical problems of interest do not fall into this limited category, approximate methods are used to determine the solution to these equations. There are numerous methods available for doing so. The following sections briefly describe the method used by CFdesign. However, first some general definitions are presented.

3.1.1

Fluid Flow Definitions

The following paragraphs define some of the terms associated with fluid flow and computational fluid dynamics (CFD). 3.1.1.1 Incompressible - Compressible

The term compressible refers to the relationship between density and pressure. If a flow is compressible, changes in fluid pressure affect its density and vice versa. Compressible flows involve gases at very high speeds. One major difference between compressible and incompressible flow is seen in both the physical nature of pressure and consequently, the mathematical character of the pressure equation. For incompressible flow, downstream effects are felt everywhere immediately and the pressure equation is mathematically elliptic, requiring downstream boundary conditions. For compressible flow, particularly supersonic flows, downstream pressure cannot affect anything
CFdesign Solver Technical Reference 3-1

CFdesign Theory

upstream and the pressure equation is hyperbolic, requiring only upstream boundary conditions. Downstream boundaries must be left free of pressure constraints. 3.1.1.2 Mach Number

One measure of compressibility is the Mach number, defined as the fluid velocity divided by the speed of sound, defined as:
a = RT
(EQ 1)

where a is the speed of sound, is the ratio of the specific heats, R is the Universal Gas Constant and T is the static temperature. For Mach numbers less than 0.3, flows can be assumed to be incompressible. Above this value, compressible effects are becoming more influential and must be considered for accurate solutions. 3.1.1.3 Adiabatic Compressible

If there are no heat transfer effects and the fluid is moving below sonic velocities (Mach = 1.0), the flow can be considered adiabatic. For this type of flow, total energy is conserved. That is, the sum of kinetic and thermal energy is a constant. In equation form, this can be expressed as:
h total 1 2 = -- V + h static 2
(EQ 2)

where V is the velocity, is the density and h is the volumetric enthalpy, a measure of energy. Assuming an ideal gas, this equation can be written using temperature:
T 2 1 V = -- --------- + T static total 2C p

(EQ 3)

where Cp is the mechanical specific heat value calculated using:

3-2

CFdesign Solver Technical Reference

CFdesign Theory

R gas = -------------p 1

(EQ 4)

where is the ratio of the constant pressure specific heat to the constant volume specific heat and R is the gas constant for this gas. The total temperature is also gas called the stagnation temperature. The first term on the right hand side of this equation is referred to as the dynamic temperature. 3.1.1.4 Transonic, Supersonic and Hypersonic Flow

These 3 terms are classifications of compressible flow. Transonic flow is at or near sonic velocities. Supersonic refers to the Mach number range: 1<Ma<5. Flows with Mach numbers greater than 5 are called hypersonic. Transonic and supersonic flows can be modelled using the Ideal Gas assumption:
p = -----RT
(EQ 5)

Hypersonic flows cannot be modelled using the Ideal Gas assumption and must consider real gas effects.
Theory

3.1.1.5

Absolute, Total, Static and Dynamic Values

The term absolute is used in conjunction with pressure. Normally, the solution to the pressure equation is a relative pressure. This relative pressure does not contain the gravitational head or the rotational head or the reference pressure. It is the part of the pressure that is affected by the velocities in the momentum equation directly. The absolute pressure adds the gravitational and rotational heads and the reference pressure to that calculated from the pressure equation. Referring to the relative pressure as p , the absolute pressure is calculated as: rel

CFdesign Solver Technical Reference

3-3

CFdesign Theory

absolute

= p

rel

+p

ref

ref

giXi + ref i Xi
i i

2 2

(EQ 6)

where the ref subscript refers to reference values, the subscript i refers to the 3 coordinate directions, g is the gravitional acceleration and is the rotational speed. The reference density is calculated at the beginning of the analysis using the reference pressure and temperature. For flows with a constant density, the reference density is the constant value. For flows which have no gravitational or rotational heads, the relative pressure is the gage pressure. The terms dynamic and static are used most commonly with compressible fluids. The dynamic values are kinetic energy-like terms: 2 V = -------dynamic 2c p 1 2 = -- V 2

(EQ 7)

dynamic

(EQ 8)

Note that the specific heat used to calculate the dynamic temperature is not the thermal value entered on the property window, but is a mechanical value calculated using: R gas = -------------p 1

(EQ 9)

where is the ratio of the constant pressure specific heat to the constant volume specific heat and R is the gas constant for this gas. gas The static temperature is determined by solving the energy equation. For adiabatic properties, the energy equation that is used to determine the static temperature is the constant total temperature equation. Hence, the static temperature is the total or stagnation temperature minus the dynamic temperature.
3-4 CFdesign Solver Technical Reference

CFdesign Theory

The static pressure is the absolute pressure shown earlier. The total temperature is the sum of the static and dynamic temperatures. The total pressure is the sum of the static or absolute pressure and the dynamic pressure. 3.1.1.6 Laminar - Turbulent

Laminar flow is characterized by smooth, steady fluid motion. Turbulent flow is fluctuating and agitated motion. The measure of whether a flow is laminar or turbulent is the speed of the fluid. Laminar flow is typically much slower than turbulent flow. The dimensionless number which is used to classify a flow as either laminar or turbulent is the Reynolds number defined as:
VL Re = ---------
(EQ 10)

where is the density, V is the velocity and is the viscosity. For Reynolds numbers greater than ~2500, the flow exhibits turbulent flow phenomena. Most engineering flows are turbulent. Between the laminar and turbulent flow regimes is the transitional flow regime. In this flow regime, the flow goes through several stages of non-linear behavior before it becomes fully turbulent. These stages are highly unstable, the flow can rapidly change from one type of behavior (turbulent spots, e.g.) to another (vortex breakdown, e.g.) and back again. Due to the unstable nature of this type of flow, it is difficult to numerically predict. 3.1.1.7 Inviscid - Viscous Flow

Theory

Flows for which viscosity or shear effects are neglected are called inviscid. Viscous flows include viscosity or shear effects. All fluids have viscosity. However, there are a limited number of applications where shear effects can be neglected and meaningful results can be obtained.

CFdesign Solver Technical Reference

3-5

CFdesign Theory

Inviscid flows are a class of ideal flows which are solved using Euler equations. These equations are a subset of the Navier-Stokes equations. Some compressible flow codes solve the Euler equations instead of the Navier-Stokes. The Euler equations are numerically easier to solve because the mathematical character of the equations never changes. If you include viscous effects, then the solution domain contains areas where elliptic effects dominate and also areas where hyperbolic effects dominate. This is a much more challenging problem. If the inviscid flow is also irrotational, then you can define a velocity potential function to represent the flow. Such flow is called potential flow. This type of flow is numerically easier still than solving Euler equations, because a single equation can be solved to determine all of the flow parameters. The assumptions of inviscid and irrotational are extremely limiting. However, potential flow solutions can offer some information regarding flow patterns for a very restricted class of fluid flow problems. 3.1.1.8 Boundary Layer Flow

As a fluid flows over a rigid surface, a boundary layer forms. This boundary layer grows as you move along the surface. The fluid shear is largely contained in the boundary layer. Boundary layer flow refers to a class of fluid flow problems which are primarily concerned with the growth of this shear layer. The boundary layer flow may be next to a surface or a jet wake type flow. For most boundary layer flows, the pressure in the boundary layer is virtually constant. Outside the boundary layer, the pressure gradient can be varying wildly and this will affect the boundary layer flow. This type of flow is characterized mathematically as parabolic since information is essentially one-way, along the direction of boundary layer growth. 3.1.1.9 Newtonian or Non-Newtonian Fluid

A Newtonian fluid is one which exhibits a linear relationship between fluid shear and strain:
xy u = ----y
(EQ 11)

3-6

CFdesign Solver Technical Reference

CFdesign Theory

where is the fluid shear stress, the velocity gradient represents one component of the strain rate tensor and is the coefficient of viscosity. For Newtonian fluids, the viscosity is either constant or a function of temperature. For non-Newtonian fluids, the shear stress is a non-linear function of the strain rate because the viscosity is also a function of the strain rate: u u = ----- , = f ----- y y
(EQ 12)

xy

For a non-Newtonian power law fluid, the shear stress is written as: u n = m ----xy y

(EQ 13)

where m is the consistency index and n is the power law index. In terms of viscosity, this equation can be written: V i p = -------- 0 X j where 0 = m and p = n 1 .

(EQ 14)

Theory

A Herschel-Bulkley non-Newtonian fluid can be described as: u n xy = 0 + k ----y In terms of viscosity, this can be written as: V i p = 0 + k -------- X j

(EQ 15)

(EQ 16)

CFdesign Solver Technical Reference

3-7

CFdesign Theory

Another non-Newtonian fluid representation is a Carreau model fluid: V i 2 ------------------- = 1 + -------- 0 X j n1 ----------2
(EQ 17)

Most engineering flows are Newtonian (air, water, oil, steam, ..). Fluids which are considered non-Newtonian include: plastic, blood, slurries, rubber and paper pulp. 3.1.1.10 Transfer Conduction, Convection, Conjugate and Radiation Heat

There are three modes by which heat can be transferred. In conduction, heat is transferred via molecular motion. The heat transfer rate is dependent upon the thermal conductivity. Convection heat transfer refers to heat being transported by fluid motion. Radiation heat transfer is an electromagnetic phenomena which is dependent upon the optical conditions of the radiating media. Conjugate heat transfer refers to the combination of 2 or all 3 of these modes of heat transfer. 3.1.1.11 Surface-To-Surface Radiation

For most engineering applications, radiant energy interchange occurs from one solid surface to another. The gas contained by the solids is generally non-participatory. The exception to this rule is if the gas is burning or heated as in a furnace. The surface-tosurface radiant interchange will affect the surface temperatures and hence the gas temperatures via convection and conduction. To include radiant interchange in the governing equations, an additional heat flux term, qr is added to the wall surface elements. This term is calculated from: q ri = A (G J ) i i i
(EQ 18)

3-8

CFdesign Solver Technical Reference

CFdesign Theory

where q is the net heat flux to the fluid at element i from surface-to-surface radiari tion. G is the incident radiation on the face of element i and J is the radiosity of i i element face i . The radiosity can be written as: J = ( 1 )G + E i i i i bi
(EQ 19)

where is the emissivity of element surface i and E is the black body emissive i bi power of element surface i : E = T 4 i
(EQ 20)

bi

where is the Stefan-Boltzman constant. The incident radiation can be calculated from: N G = i

Jj Fi j
j=1

(EQ 21)

where F is the view factor between element surface i and element surface j . So ij the calculation of the radiant heat flux requires the the calculation of view factors between all of the element surfaces. This calculation normally requires a great deal of computer memory and takes quite a long time. However, CFdesign uses an innovative approach to calculating view factors which is approximate but quite accurate for engineering calculations. This approach is very fast and requires very little extra memory. 3.1.1.12 Natural, Mixed and Forced Convection

Theory

These terms refer to the type of heat transfer. In natural convection, fluid motion is generated or at least dominated by temperature differences which affect the fluid properties, most notably the density. These flows are also referred to as buoyant-driven flows because the gravity term or buoyancy term in the momentum equations dominates the flow. Conversely, in forced convection flows, the temperature is dominated
CFdesign Solver Technical Reference 3-9

CFdesign Theory

by the fluid motion and buoyancy or gravity has little or no effect. Mixed convection is a combination of these two, where fluid motion and buoyancy may both play a role. Natural convection frequently has no openings or no clearly defined inlets. Forced convection always has inlet region(s) and outlet region(s), as does mixed convection. Free convection is an un-enclosed or open natural convection problem. Convection problems may also be laminar or turbulent. For forced convection and most mixed convection problems, the Reynolds number is again the measure for determining flow regimes. For natural convection flows, the Grashof number is the measure. The Grashof number is defined as:
3 gL T Gr = -------------------2

(EQ 22)

where is the volumetric expansion coefficient, g is the gravitational acceleration, L is a characteristic length, T is the temperature and is kinematic viscosity. Sometimes, the Rayleigh number, which is combination of the Grashof and Prandtl numbers, is also referenced. The Prandtl number is defined as:
C P Pr = ---------k

(EQ 23)

The Rayleigh number is defined as:


Ra = GrPr 3 C gL T p Ra = -------------------- ---------2 k 2 3 g C L T p Ra = ---------------------------------k

(EQ 24)

where Cp is the constant pressure specific heat, is the absolute viscosity, is the density and k is the thermal conductivity.
3-10 CFdesign Solver Technical Reference

CFdesign Theory

3.1.1.13

Film Coefficients

CFdesign will calculate convection or film coefficients in one of two ways. The first way is to calculate the heat transfer residual. The heat transfer residual is calculated by forming the energy equation and substituting the last temperature (or enthalpy values) solution into the formed equations. The residual is the amount of heat required to maintain the solution temperature. The heat transfer residual is used to determine the film coefficient from the relation:
q residual h = -----------------------T
(EQ 25)

where the temperature difference is that between the wall value and a near wall value. The second method is to use an empirical correlation based on the Reynodls number. The empirical correlation requires the calculation of the Nusselt number which is defined as:
hL Nu = ----k
(EQ 26)

Theory

where h is the film coefficient, L is a characteristic length and k is the thermal conductivity. The Nusselt number is a ratio of convective to conductive heat transfer. The correlation that is used by CFdesign to calculate the Nusselt number is:
a b Nu = CRe Pr
(EQ 27)

where Pr is the Prandtl number, a, b and C are constants. Note that both the Nusselt number and Reynolds number are dependent on a length. These lengths are not necessarily the same and frequently are different. The Reynolds number length is usually an opening length, a cylinder diameter or step height. The Nusselt number length is generally the length along the surface for which film coefficients are being calculated.

CFdesign Solver Technical Reference

3-11

CFdesign Theory

3.1.1.14

Distributed Resistances

For geometries with numerous flow obstacles, distributed resistances can be used to reduce the overall size (number of finite elements) of the problem. Rather than model each flow obstacle with the detail required to resolve pressure and velocity gradients, the flow obstacles can be modelled on a much larger scale and represented by a sink term in the momentum equations. They are effectively modelled as an extra pressure drop. In a shell-and-tube heat exchanger for example, the tubed region can be modelled using a distributed resistance term rather than modelling each tube individually. This modelling technique can be used to model vents, louvres, packed beds, gratings, tube banks, card cages, filters and other porous media. There are three forms which the distributed resistance terms can take. The first is the loss coefficient form, where the excess pressure gradient is written as:
2 V i p------- = K --------i 2 X i

(EQ 28)

where the i indicates a global coordinate direction. The K-factor can be determined from measurements of pressure drop versus flow rate. This factor can also be found in fluid resistance handbooks such as: Handbook of Hydraulic Resistance, 3rd edition by I.E. Idelchik, published by CRC Press, 1994 (ISBN 0-8493-9908-4). Note that the Kfactor used by CFdesign has units of length-1. Most handbooks use an unit-lessK-factor. The second form for entering distributed resistances is the friction factor method. In this form, the excess pressure gradient is written as:
2 V f i p ------- = -------- --------D 2 X H i

(EQ 29)

3-12

CFdesign Solver Technical Reference

CFdesign Theory

where f is the friction factor and DH is the hydraulic diameter. The friction factor can be calculated using the Moody relation:
2.51 1 ----- = 2.0 log --------------- + --------------------- 3.7D f f H Re D H

(EQ 30)

where is the surface roughness in length units and D H is the hydraulic diameter in length units. Friction factor can also be calculated using the relation:
f = aRe b DH
(EQ 31)

where a and b are constants. The last form for the distributed resistance terms follows the Darcy relation:
p ------- = CV i X i
(EQ 32)

Theory

where C is the permeability and is the fluid viscosity. The form which should be used depends upon the information that is available. As mentioned previously, if pressure drop versus flow rate data is available, the K-factor method is probably the best. For some packed beds, the permeability may be available and the last form is best. For geometries with large banks of tubes, the friction factor may be the most suitable form.

CFdesign Solver Technical Reference

3-13

CFdesign Theory

3.1.2

Mathematical Concepts

The following paragraphs present definitions of some of the mathematical terms that are associated with solving CFD equations. 3.1.2.1 Linear - Non-linear

The governing equations are listed in the next section. In these equations, two types of non-linearities appear. The first kind of non-linearity is exemplified by the advection terms. For example, in the u velocity equation, there appears a term:
u u ----x
(EQ 33)

So in these terms, u depends on the product of u and its derivative. The second of type of non- linearity that appears in the governing equations is that the properties or factors of the terms depend upon the dependent variable. For example, the density in the energy equation depends upon the temperature, for which the equation is solved. Also, the eddy viscosity used for turbulent flows for the diffusion terms in the velocity equations is highly dependent upon the velocities. These two types of non-linearities are by far the predominant influences on the numerical solution. For this reason, the equations must be solved in an iterative manner. 3.1.2.2 Explicit - Implicit

If a term is treated implicitly, it becomes part of the coefficient matrix and thus part of the solution. If it is treated explicitly, then previous iterates values are used instead of the most current information. These terms are usually part of the source term or the load vector. They are determined after the current iterations solution. For numerical stability, it is best to treat as many terms implicitly as possible. For transient analyses, an implicit discretization method is used. This implies that the value at the current time is dependent on the neighboring values at the current time. An explicit discretization method implies that the value at the current time is depen-

3-14

CFdesign Solver Technical Reference

CFdesign Theory

dent on the neighboring values from the previous time. An implicit formulation is unconditionally stable numerically - it will yield a solution irregardless of the size of the time step. However, it requires an iterative solution within each time step. An explicit formulation is only conditionally stable numerically. It is highly dependent and frequently highly restrictive in terms of time step size. It is not unheard of to use time steps of 1.E-10 seconds for explicit formulations. However, you do not need to iterate the solution inside each time step. 3.1.2.3 Symmetric - Non-Symmetric

The governing partial differential equations in the next section are discretized, using finite elements, into a set of algebraic equations with the unknowns being nodal values of the solution variables. These algebraic equations can be written in matrix form as:
A U = F ij j i
(EQ 34)

where F i is the load vector, U j is the unknown vector and A ij is the coefficient matrix. For a symmetric system of equations, the upper diagonals of A are a mirror image of the lower diagonals, i.e.,
A 12 = A21 A 34 = A 43
(EQ 35)

Theory

For non-symmetric systems, this is not true. In general, second order derivative terms (e.g., diffusion terms) will produce symmetric matrices and first order derivatives (advection terms) produce non-symmetric matrices.

3.2

Governing Equations

The following paragraphs list the partial differential equations governing fluid flow and some of the associated constitutive terms.

CFdesign Solver Technical Reference

3-15

CFdesign Theory

3.2.1

General Fluid Flow/Heat Transfer Equations

The governing equations for fluid flow and heat transfer are the Navier-Stokes or momentum equations and the First Law of Thermodynamics or energy equation. The governing pdes can be written as:
u v w ----- + -------- + -------- + --------- = 0 t x y z continuity equation

(EQ 36)

u u u u ----- + u ----- + v ----- + w ----t x y z u u w u v p = g ----- + 2 ----- + ----- + ----- ----- + ---- + x x x x z z x y y x +S +S DR x momentum equation v v v v ------ + u ---- + v ---- + w ---x y z xt v v w p u v = g ----- + 2 ---- + ---- + ----- ----- + ---- + y y x y x y z z y y +S +S DR y momentum equation w w w w ------ + u ------ + v ------ + w -----z y x t w v w p u w = g ----- + 2 ----- ---- + ------ + ----- + ------ + z z x z x z z y z y +S +S DR z momentum equation
(EQ 39) (EQ 38) (EQ 37)

3-16

CFdesign Solver Technical Reference

CFdesign Theory

The two source terms in the momentum equations are for distributed resistances and rotating coordinates, respectively. The distributed resistance term can be written in general as:
2 V f i = K + -------- --------- CV S i DR i D H 2

(EQ 40)

where i refers to the global coordinate direction (u, v, w momentum equation) and the other terms are described in the previous section. Note that the K-factor term can operate on a single momentum equation at a time because each direction has its own unique K-factor. The other two resistance types operate equally on each momentum equation. The other source term is for rotating flow. This term can be written in general as:
S = 2 V r i i i i i
(EQ 41)

where i refers to the global coordinate direction, is the rotational speed and r is the distance from the axis of rotation.
Theory

For incompressible and subsonic compressible flow, the energy equation is written in terms of static temperature:
T T T T T ---- T T k - +q k ----- + k ----- + C ----- + C u ----- + C v ----- + C w ----- = V p z p y p x p t z z y y x x energy equation

(EQ 42)

For compressible flow, the energy equation is written in terms of total temperature:

CFdesign Solver Technical Reference

3-17

CFdesign Theory

T T T 0 0 0 k -------- + q C -------- + C V -------- = V p t p i X X X i i i V 1j ------i - + ---------- k ( V V ) + + + V i X X X X 2C X X j j j P j i j j j total energy equation 2 V


(EQ 43)

where is the dissipation function. Note that Einstein tensor notation is used for the total energy equation for conciseness. The last three terms are only present for compressible flows. The variables in these equations are defined in Table 1.
Variable Cp gx , gy , gz k p qV T t u v w

Description constant pressure specific heat gravitational acceleration in x, y, z directions thermal conductivity pressure volumetric heat source temperature time velocity component in x-direction velocity component in y-direction velocity component in z-direction viscosity density

Note, the coupling between equations: x-momentum depends on y-momentum, etc. Besides, the non-linearities discussed previously, this coupling between the equations is a source of solution difficulties.

3-18

CFdesign Solver Technical Reference

CFdesign Theory

The continuity, momentum and energy equations represent 5 equations in the 5 unknowns: u, v, w, p, T or T0. They describe the fluid flow and heat transfer under steady-state conditions for Cartesian geometries. For axisymmetric geometriesand steady-state conditions with swirl velocity component (out-of-plane component), these equations can be written as:
( ru ) + ( rv ) = 0 r z z r continuity equation

(EQ 44)

2 u w u r r u ------- + v ------- ---------z z r r r v u u u 2v r z r 1 r r p 1 = ----- + -r ------- + r ------- + ------- ---------- ------- + -r r z r z z r r 2 r r r r +S +S DR r momentum equation v v z z u ------- + v ------z z r r v v u v 1 z 1 z r z p r ------- + = ----- + g + -r ------- + ------- + - ------z r r r r r z z z z z z +S z momentum DR equation
(EQ 46) (EQ 45)

Theory

w w u r w u --------- + v --------- + ---------------r r z z r

=
(EQ 47)

w w w 1 w -- r --------- + +S --------- ------ ----- ---------- + S DR r r r r r z z 2 r swirl velocity equation 3-19

CFdesign Solver Technical Reference

CFdesign Theory

The energy equations have no additional terms for axisymmetric flows. Note that the w velocity component is the swirl velocity.

3.2.2

Turbulent Flow

The three-dimensional time-dependent continuity, Navier-Stokes and energy equations apply to laminar as well as turbulent flow. However, due to the infinite number of time and length scales inherent in turbulent flows, the solution of these equations would require a great deal of finite elements (on the order of 106 - 108) even for a simple geometry as well as near infinitesimal time steps. For most practical applications, it is unreasonable to model the flow in this manner. To circumvent the need for such immense computer resources, the governing pdes are averaged over the scales present. There are several choices of scale types available for averaging. CFdesign solves the time-averaged governing equations. The time-averaged equations are obtained by assuming that the dependent variables can be represented as a superposition of a mean value and a fluctuating value, where the fluctuation is about the mean. For example, the x-velocity component can be written as:
u = U + u
(EQ 48)

where U is the mean velocity and u is the fluctuation about that mean. This representation is substituted into the governing equations and the equations themselves are averaged over time. Using the notation that capital letters represent the mean values and lower case letters represent fluctuating values except for temperature, the averaged governing equations can be written as:
u v w ----- + -------- + -------- + --------- = 0 t x y z continuity equation

(EQ 49)

3-20

CFdesign Solver Technical Reference

CFdesign Theory

U U U U +S + ---- ------ + U ------ + V ------ + W ------ = g P + S DR x x t x y z U U V U W 2 ------ uu + ------ + ----- uv + ------ + ------- uw x x y y x z z x x momentum equation
(EQ 50)

V V V V P +S + ----- + U ----- + V ----- + W ----- = g ----- + S DR y y t x y z V V W U V 2 ----- vv + ------ + ----- uv + ----- + ------- vw y y z z y x y x y momentum equation
(EQ 51)

W W W W P +S + ------- + U ------- + V ------- + W ------- = g ----- + S DR z z z x y t W ------ + W uw + V + ------- vw + 2 ------- ww U ----------- W z z y z y x z x z momentum equation
(EQ 52)

T T T T C ----- + C U ----- + C V ----- + C W ----p t p z p x p y = T T T k ----- C uT + k ----- C vT + k ----- C wT + q V p p p x x y y z z energy equation


Theory
(EQ 53)

Note that the averaging process has produced extra terms in the momentum and energy equations: uu, uv, uw, vv, vw, ww, CpuT , CpvT , CpwT . These terms are combinations of fluctuating quantities resulting from averaging the non-linear inertia or advection terms. The extra terms in the momentum equations are called the Reynolds stress terms. With the addition of these extra terms, the above equations now represent 5 equations with 14 unknowns: U, V, W, P, T, uu, uv, uw, vv, vw, ww, Cput, Cpvt, Cpwt. Additional equations can be derived for these last 9 extra terms by taking

CFdesign Solver Technical Reference

3-21

CFdesign Theory

moments of the above equations. However, the process of taking moments of these equations will introduce still more unknowns. This closure problem can continue ad infinitum. At some point, the decision must be made to stop creating equations (and thus new terms) and find a way to model the extra terms; i.e., relate these terms back to the previous unknowns. At the zeroth level of closure, the Reynolds stress terms are linked to the mean values of the dependent variables, U, V, W, T. One zeroth level closure that is widely used is the Boussinesq approximation which defines an eddy viscosity and eddy conductivity:
uu uv vw = ------------ = ------------------- = -------------------- = t U U V V W ------ + --------- + ------2 -----x y x z y C ut C vt C wt p p p k = ------------------ = ------------------ = ------------------t T T T ------------x y z

(EQ 54)

(EQ 55)

Note these definitions imply that the effect of turbulence is isotropic. If these definitions are used in the averaged equations, the result is:
U V W ----- + ---------- + --------- + ---------- = 0 t x y z continuity U -----t ---------------+ U U + V U + W U x y z equation P = g ----- + S +S + DR x x
(EQ 57)

(EQ 56)

U U V U W 2 ( + ) ------ + ( + ) ------ + ----- + ( + ) ------ + ------- t y x t z x t x y z x x momentum equation

3-22

CFdesign Solver Technical Reference

CFdesign Theory

V ----t

V V ----+ U ------ + V ------ + W V x y z

= g P + S +S + ----y y DR
(EQ 58)

V V W U V 2 ( + ) ----- + ( + ) ----- + ------- ( + ) ------ + ----- + t z y t y t y x z y x y momentum W ------t W ------------+ U W + V W + W ------x y z equation P = g ----- + S +S + DR z z

W V W U W 2 ( + ) ------( + ) ----- + ------- + ( + ) ------ + ------- + t z t z y t z x z y x z momentum T C ----p t = equation

(EQ 59)

T --------+ Cp U ----- + C p V T + C p W T x y z
(EQ 60)

T T T ( k + k ) ----- + q ( k + k ) ----- + ( k + k ) ----- + V t z t y t x z y x energy equation

This leaves only the eddy viscosity and eddy conductivity to be determined. CFdesign uses a two-equation model to determine these variables. The two equations describe the transport of the turbulent kinetic energy, K and the turbulent energy dissipation, . The eddy viscosity and eddy conductivity are calculated using:
2 K = C -----t C t p k = -----------t t
Theory

(EQ 61)

(EQ 62)

where t is a turbulent Prandt number, usually taken to be 1.0 and C is an empirical constant. The transport equations for K and are derived using moments of the momentum equations. They are:
CFdesign Solver Technical Reference 3-23

CFdesign Theory

K K K K ------ + U ------ + V ------ + W -----t x y z = K K K t t t ------- + ------ + ------ + ------ + ------- + ------ + y z x y z x K K K

(EQ 63)

W 2 V 2 U 2 V W 2 U W 2 U V 2 2 ------ + 2 ----- + 2 ------- + ------ + ----- + ------ + ------- + ----- + ------- t x z y z x y x z y turbulent kinetic energy equation ---- + U ---- + V ---- + W ---t x y z = x t ----- + ---- + x y 2 t t ----- + ----- + ---- C ---- ----- + 2 K z z y

(EQ 64)

W 2 V 2 U 2 V W 2 U W 2 U V 2 C --- 2 ------ + 2 ----- + 2 ------- + ------ + ----- + ------ + ------- + ----- + ------- 1 t K x z y z x y x z y
turbulent energy dissipation equation

where K and are turbulent Schmidt numbers, C1 and C2 are empirical constants. All of the modelled constants associated with this model are listed in Table 2. With these two equations, there are now 9 equations in 9 unknowns: U, V, W, P, T, t , kt , K, .

3-24

CFdesign Solver Technical Reference

CFdesign Theory

Constant C C1 C2 K 0.09 1.44 1.92 1.0 1.3

Value

CFdesign Name CMu CE1 CE2

Result of Increasing Value more mixing, mores shear, greater change in pressure less mixing, lower shear, smaller change in pressure more mixing, mores shear, greater change in pressure (not available for user modification) (not available for user modification)

The two-equation turbulence model just described has been used for numerous applications and generally works quite well for most engineering applications. However, this turbulence model does not predict separation points as accurately as is sometimes required. To improve the prediction of separation without greatly increasing the complexity of the analysis and usually the ability to obtain a solution, another two-equation model called the RNG two-equation model is also available in CFdesign. In this model, the momentum equations are transformed to wave-number space and re-normalization group theory is used to derive the equations for calculating eddy viscosity. Because the resulting equations have a firmer theoretical foundation, the results using the RNG model are usually more accurate. However, this model is less stable numerically and hence subject to more convergence difficulties. It is probably best to start an analysis with the original two-equation model and then switch at some point to the RNG model. The RNG turbulence model is also an eddy viscosity turbulence model. The turbulent kinetic energy and turbulent dissipation rate are calculated as before. The difference between the two turbulence models lies in the determination of the constants in Table 2. The values for the RNG model are listed in Table 3 with C1 caluculated using the expression:

Theory

CFdesign Solver Technical Reference

3-25

CFdesign Theory

1 ------ 0 C = C -----------------------1 0 3 1 +

(EQ 65)

where is defined as:


GK = ----------- U 2 V 2 W 2 U V 2 U W 2 V W 2 G = 2 ------ + ----- + ------- + ------ + ----- + ------ + ------- + ----- + ------- x y z y x z- x z y

(EQ 66)

While several of the constants in Tables 2 and 3 can be adjusted by the user, care should be taken in interpreting the results using modified parameters.

Constant C C0 C2 0 K

Value 0.085 1.42 1.68 0.015 4.38 0.7179 0.7179

CFdesign Name CMu RNG CE0 CE2 RNG Beta RNG Eta

Result of Increasing Value more mixing, mores shear, greater change in pressure less mixing, lower shear, smaller change in pressure more mixing, mores shear, greater change in pressure more mixing, mores shear, greater change in pressure more mixing, mores shear, greater change in pressure (not available for user modification) (not available for user modification)

3-26

CFdesign Solver Technical Reference

CFdesign Theory

3.2.2.1

Inflow Boundary Condition

Inlet boundary conditions must be specified for K and . In rare cases, these values are available. However, in most practical applications, they are not and estimates must be made for them. In order to arrive at these estimates, some definitions will be needed. The turbulent kinetic energy is defined as:
2 2 1 2 K = -- ( u + v + w ) 2
(EQ 67)

where the velocities in this equation are the fluctuating portion of the velocity. The turbulence intensity is defined as:
u v w I = --- = -- = ---U V W
(EQ 68)

The combination of two equations above yield an estimate for the inlet turbulent kinetic energy based on the inlet velocity distribution:
2 2 2 1 K = -- [ ( IU ) + ( IV ) + ( IW ) ] 2
Theory
(EQ 69)

The turbulence intensity is more frequently available or can be more easily guessed. This value can be entered by the user under the CONTROL main menu and the TURBULENCE PARAMETERS sub-menu. It is listed as the INTENSITY FACTOR. A default of 5% is used for internal flows and 1% for external flows. If the incoming flow is highly turbulent such as in swirling flows, a higher value on the order of 10-20% may be substituted for the default. In many internal flow cases, the inlet values do not play a significant role in the downstream effects where local shear dominates the turbulence quantities. The turbulent energy dissipation can be defined in terms of length scale as:

CFdesign Solver Technical Reference

3-27

CFdesign Theory

K = C --------- s

1.5

(EQ 70)

where s is the length scale. Again, the length scale is not typically available so an estimate should be used. The length scale is normally reported as a fraction of the the inlet opening. On TURBULENCE PARAMETERS window, we call this fraction the LENGTH SCALE FACTOR. For most internal flows, this fraction can be assumed to be 1% which is the default value. For external flows the wall surface area is used to calculate a length scale. Since the length scale is usually quite small in external flows, a LENGTH SCALE FACTOR of 0.1% is used for the default value. If the pressure coefficient at the stagnation point is extraordinarily large, the LENGTH SCALE FACTOR should be reduced further. 3.2.2.2 Wall Model

Both of the turbulence models discussed in the previous section are high Reynolds number models. That is, these models are only strictly applicable in the fully turbulent regime and do not apply to the inner layers of the boundary layer. There are low Reynolds number models which can be used in the boundary layer and which theoretically apply to re- laminarization zones as well. However, these models require that several nodes (10 - 100) be placed within the boundary layer (y + values of 1 to 5). For most engineering flows, this mesh requirement would preclude the use of these models as the total analysis model would likely be in the millions of nodes. Rather than use the low Reynolds number models, we have chosen to implement the high Reynolds number models and then use wall functions to model the turbulent flow next to the wall. The wall functions replace the turbulence model in the wall elements and generally only require the placement of one node in the boundary layer. The use of wall functions with high Reynolds number turbulence models do quite well for most turbulent flows. The main purpose of the wall functions is to enforce the Law of the Wall, which can be written as:

3-28

CFdesign Solver Technical Reference

CFdesign Theory

+ 1 = -- log y + B

(EQ 71)

where B and are dimensionless constants. The inner variables U+ and y+ are defined as:
U + U t = --------- w -----

(EQ 72)

w -----+ y = ------------

where Ut is the velocity tangent to the wall, w is the wall shear stress, is the density, is the distance from the wall, and is the kinematic viscosity. CFdesign adjusts the wall effective viscosity based on the velocity and fluid properties next to the wall to enforce the Law of the Wall. With the exception of separating flow, the Law of the Wall is quite valid in the range:
+ 35 y 350
(EQ 73)

Theory

The y+ values calculated by CFdesign are output to the post-processor files so they can be plotted. For some of the verification problems which were done by CFdesign, we found that y+ values below 35 were usually associated with under-predicting the pressure drop in internal flows. Values of y+ above 350 corresponded to over-predicting the pressure drop in internal flows. Also, it is not uncommon to observe y+ values outside of this range near the inlet, especially if a uniform velocity field is specified at this boundary. For rough walls, the Law of the Wall is modified as:
U + rS + 1 V 1 = -- log y + B -- log 1 + .3 -------- 3-29

(EQ 74)

CFdesign Solver Technical Reference

CFdesign Theory

where r is the average roughness height (in length units) measured from the wall, is the kinematic viscosity and SV is the shear velocity. The default value of r is 0.0, so the extra roughness terms disappear as a result. This value can be changed by the user from the CONTROL main menu and TURBULENCE PARAMETERS submenu. Note that the value entered in CFdesign is used for all walls. The wall constants which can be changed and their default values are listed in Table 4.

Constant A B r
+

Value 26.0 5.50 0.0 0.40

CFdesign Name VanDriest Wall Parameter Roughness Kappa

Result of Increasing Value less thermal mixing in wall boundary layer lower wall shear, smaller change in pressure higher wall shear, greater change in pressure higher wall shear, greater change in pressure

For turbulent heat transfer problems, the Temperature Law of the Wall is enforced. Two different forms of this relationship are used by CFdesign depending upon the relative values of the turbulent and laminar Prandtl numbers. The difference between the two equations is which expression is substituted for the eddy viscosity distribution near the wall. In the first case, Spaldings Inner Law [1] is used to obtain:
U ------ S V rS + 1 B V T L 1 1 + .3 -------- e T = U + ------------------- S log ------ + ------ e V L T L

(EQ 75)

where L is the laminar Prandtl number and T is the turbulent Prandtl number. The laminar Prandtl number is:

3-30

CFdesign Solver Technical Reference

CFdesign Theory

C p = ---------L k

(EQ 76)

Here, Cp is the specific heat, is the absolute viscosity and k is the thermal conductivity. T+ is defined as:
T + C p w = ---------------k w

(EQ 77)

where is the distance from the wall, w is the wall shear stress and kw is the thermal conductivity in the wall layer. This formula for the Temperature Law of the Wall is used for laminar Prandtl numbers which are less than the turbulent Prandtl number, which is assigned the value of 1.0 by CFdesign. So, most air or gas flows should use this formula. For fluids with higher laminar Prandtl numbers (like water), the Van Driest formula for eddy viscosity is used in the Temperature Law of the Wall to yield:
1 1 --4 + 2 L T A + U T = ------ + ------ 1 ------ ------ -------------T S 4 sin -V T L 4

(EQ 78)

Theory

where A+ is Van Driests constant. This constant is assigned the value of 26.0 by CFdesign. It can be modified under the CONTROL main menu and TURBULENCE PARAMETERS sub- menu.

3.2.3

Properties

From the previous sections, the fluid properties required for fluid flow and heat transfer analysis are listed in Table 5. A set of consistent units for cm and inches is shown. Other units may be used by making the appropriate conversions. Note for inches, the

CFdesign Solver Technical Reference

3-31

CFdesign Theory

values in Table 5 are obtained by dividing common table values of these properties by the conversion factor, gc and converting feet to inches, where gc is also defined in Table 5. A more complete list of consistent units is included in earlier chapters of the CFdesign Users Guide.

Symbol

Description

Units - cm

Units - inch

Cp gc k

constant pressure specific heat conversion factor thermal conductivity ratio of specific heats absolute viscosity density

Joule/gram-K
1.0 gram-cm/sec2-dyne

Btu-inch/lbf-sec2-R
386.4 lbm-inch/lbf-sec2

Watt/cm-K gram/cm-sec gram/cm3

Btu/sec-inch-R lbf-sec/inch2 lbf-sec2/inch4

3.3

Discretization Method

In CFdesign, the finite element method is used to reduce the governing partial differential equations (pdes) to a set of algebraic equations. In this method, the dependent variables are represented by polynomial shape functions over a small area or volume (element). These representations are substituted into the governing pdes and then the weighted integral of these equations over the element is taken where the weight function is chosen to be the same as the shape function. The result is a set of algebraic equations for the dependent variable at discrete points or nodes on every element.

3.3.1

Streamline Upwind

With the exception of the continuity equation, the governing equations describe the transport of some quantity (e.g., U, V, T) through the solution domain. The governing equations take the form:

3-32

CFdesign Solver Technical Reference

CFdesign Theory

U ----- + V ----- + W ----- = ----- + ----- + ----- + S x y z x x y y z z

(EQ 79)

Note that the genaral scalar transport equation is also in this form without a source term. The finite element method described above is used directly on the diffusion and source terms. However for the advection terms, the streamline upwind method is used along with the weighted integral method. These terms are transformed to stream-wise coordinates:
U ----- + V ----- + W ----- = U ----s s x y z
(EQ 80)

where s is the streamwise coordinate and Us is the velocity component in the streamwise coordinate direction. For a pure advection problem this term is a constant. With this in mind, the weighted integral of the advection terms can be written as:
---------------- N U -x + V -y + W z- dV = Us s- NdV
(EQ 81)

The advection terms in all of the governing partial differential equations (pdes) will be treated with the streamline upwind.

Theory

3.3.2

Transient Discretization

For transient analyses, the transient terms are discretized using an implicit or backward difference method. Using the matrix algebra notation, a typical steady-state transport equation (momentum, energy, turbulence variables, scalar) can be written:

A ij u j = Fi

(EQ 82)

CFdesign Solver Technical Reference

3-33

CFdesign Theory

where A contains the discretized advection and diffusion terms from the governing ij equations, u is the solution vector or values of the dependent variable (u, v, w, T, K, j ....) and F contains the source terms.

The transient terms in the governing equations took the form:


-----t
(EQ 83)

where represents the dependent variable (u, v, w, ....). This term is discretized using a backward difference:
new old ------ ------------------------------t t

(EQ 84)

We can add this term to the matrix equation above: new old = F +B u ( A + B )u ij ii j i ii j where B ii is a diagonal matrix composed of terms like: B 1= ---- N dV i t
(EQ 85)

ii

(EQ 86)

This discretized transient equations must be solved iteratively at each time step to determine all of the new variables (variable values at the latest time).

3.4

Solution Method

Each of the above governing pdes are discretized using the finite element method described previously. The resulting set of algebraic equations must be solved to deter-

3-34

CFdesign Solver Technical Reference

CFdesign Theory

mine the values of the dependent variables at the nodes on the finite elements. The algorithm used by CFdesign to solve these equations is described in this section.

3.4.1

Segregated Solver

The first issue to resolve in solving the discretized equations is that of the missing pressure. If the momentum equations are used to calculate the velocity components, then the continuity equation must be used to determine the pressure. However, pressure never appears explicitly in the continuity equation. There are a plethora of avenues available to circumvent the numerical difficulties with the implicit pressure coupling. Many of these solution methods require that the continuity and momentum equation be solved simultaneously on every node in the finite element mesh. For small problems, this solution is quite adequate. However, for most real-life problems, this solution places a severe penalty on computer resources and in fact may prevent a solution to a problem. To ease this restriction, an equation explicit in pressure must be found. The pressure equation solved by CFdesign is derived from the continuity equation. The weighted integral of the continuity equation is taken where integration by parts is used to reduce the order of integration:
Theory

---------- --------- --------- N U + V- + W- d x y z =

(EQ 87)

NUd + NVd + NWd

N N U + N V + ------ W d ---------- x z y

The first three integrals on the right-hand-side (RHS) of this equation represent the mass flux across element boundaries. These integrals will cancel at the interior element faces and will be zero for all boundaries across which no mass flows (symmetry, walls). So these terms represent the natural boundary condition for the pressure equation.

CFdesign Solver Technical Reference

3-35

CFdesign Theory

To force the appearance of pressure in this equation, a relationship between velocity and pressure must be derived. This relationship can be deduced from the momentum equations. Using a semi-discretized form of the momentum equations, the velocitypressure relationship can be written as:
P U = U K ----h U x P V = V K ----h V y P W = W K ----h W z
(EQ 88)

In these equations, the Uh, Vh, Wh terms contain all of the off-diagonal terms in the momentum equations. If these three equations are now substituted into the previous continuity equation, the following pressure equation results:
---------- ---------- --------- N KU P- + N KV P- + N KW P- d x x y y z z = N N N z y x NUd NVd NWd + Uh ------ + Vh ------ + Wh ------ d

(EQ 89)

Note that this equation is in the discretized form of the Poisson equation and will therefore produce a symmetric coefficient matrix. For compressible flow, the density-pressure coupling must also be considered. This coupling is accounted for by using the following expression:
o o U = U + U
(EQ 90)

where the o refers to old values. This expression is used when the continuity equation is integrated by parts. Then, substituting for velocity yields:

3-36

CFdesign Solver Technical Reference

CFdesign Theory

o o o N o P N o P N o P U V W ------ K U ----- + ------ K V ----- + ------ K W ----- + N ------------- + N ------------ + N ------------- d x y y z z x y z x =

o o N U d

o o N V d

o o N W d

(EQ 91)

o o o o o o o N N N U V W U ------ + V ------ + W ------ + N ---------------- + N --------------- + N ---------------- h x h y h z x y z

The extra advection-like terms on the left-hand side of this equation are re-written in terms of pressure using the Ideal Gas Law. With these extra advection terms, the compressible pressure equation will produce a non-symmetric coefficient matrix, much like the other transport equations. With an explicit pressure equation, each of the governing equations can be solved separately. That is, the x-momentum equation can be solved for U at all of the nodes, the y- momentum equation can be solved for V at all of the nodes, the z-momentum equation can be solved for W at all of the nodes, the pressure equation can be solved for P at all of the nodes, etc. This allows for a much smaller memory requirement since only a single degree of freedom is solved at a time. This approach is called a Segregated Solver because each of the dependent variables are solved separately. In addition, since each of these equations can be solved using iterative matrix techniques, only the non-zero terms in the coefficient matrix need to be stored.

Theory

3.5

Boundary Conditions

There are 6 types of boundaries for which conditions must be imposed on the governing equations: inlets, outlets, no-slip walls, symmetry lines, slip walls and periodic boundaries.

CFdesign Solver Technical Reference

3-37

CFdesign Theory

3.5.1

Inlet Boundary Conditions

At an inlet boundary, most of the dependent variables need to be specified. For the flow equations, either the pressure or all velocity components should be specified for an incompressible or subsonic compressible problem. Specifying both velocity and pressure over-constrains the problem and numerical difficulties can be expected. For compressible or supersonic inlets, both velocity and pressure must be specified. The temperature, general scalar, turbulent kinetic energy and turbulent energy dissipation must also be specified at inlets. Default inlet values for the turbulence quantities will be calculated automatically in CFdesign. These default values are based on a turbulence intensity and a length scale.

3.5.2

Outlet Boundary Conditions

At the outlet, CFdesign assumes that fully developed profiles exist for the transported quantities, U, V, W, T, K, . This condition implies that the gradient of these quantities normal to the outlet boundary is zero. This condition is applied automatically in CFdesign. For incompressible flows, the most robust condition for the pressure equation is to specify a value at the exit. Since only relative pressures are calculated by CFdesign, a value of zero is recommended. To obtain the absolute pressures in the solution domain, the absolute pressure at the exit should be added to the pressure values calculated by CFdesign. For compressible or supersonic flows, the outlet should be specified as an unknown boundary.

3.5.3

No-Slip Wall Boundary Conditions

The no-slip condition indicates that the wall values of velocity should be specified to the velocity of the wall. If the wall is stationary, all of the velocity components should be set to zero. The no-slip wall boundary condition on pressure is handled automatically by CFdesign.
3-38 CFdesign Solver Technical Reference

CFdesign Theory

The wall boundary conditions for the turbulence quantities are also handled automatically by CFdesign. Wall functions are used at the walls as the K and equations shown above do not apply to near wall flows. These wall functions ensure that the shear stress calculated by CFdesign follows the Law of the Wall. The wall condition for the energy equation can be any of the following: specified or known temperature, specified non-zero heat flux, specified film coefficient and ambient temperature and specified surface emissivity, view factor and source temperature. A heat flux of zero or an insulated wall is handled automatically by CFdesign.

3.5.4

Symmetry Boundary Conditions

At symmetry boundaries, CFdesign assumes that the gradients normal to the symmetry plane for the scalar quantities T, K, are zero. This condition is applied automatically in CFdesign. For the velocity and pressure equations, the velocity component normal to the boundary should be set to zero implying no flow across the boundary. The velocity components tangential to the symmetry boundary should have a zero gradient normal to this boundary, which is handled automatically by CFdesign. The pressure boundary condition of no flow across the boundary is also handled automatically.

Theory

3.5.5

Slip Walls

CFdesign treats slip walls the same as symmetry boundaries, namely gradients normal to the boundary are zero and no flow across the boundary.

3.5.6

Periodic Boundaries

Unlike all of the previous boundary conditions which operate on particular solution variables, periodic boundaries are actually a geometric condition which affect all of the solution variables identically. In particular, all solution variables are identical at periodic nodes; i.e., the value at the slave node is exactly the same as that at the master
CFdesign Solver Technical Reference 3-39

CFdesign Theory

node. Periodic boundary conditions can be used in geometrically similar geometries like multi-bladed vaned diffusers, for example. They allow a greatly reduced problem size.

3.6

Element Descriptions

The following elements are available in CFdesign for the analysis of fluid flow and thermal problems.

3.6.1

Quadrilateral Element

The 4 node quadrilateral element can be used to model either 2D cartesian or axisymmetric geometries. Each node has 4 degrees of freedom for laminar flow: U, V, P, T and 6 degrees of freedom for turbulent flows: U, V, P, T, K, . All of the elements must be defined in the x-y plane.

3.6.2

Triangular Element

The 3 node triangular element can be used to model either 2D cartesian or axisymmetric geometries. Each node has 4 degrees of freedom for laminar flow: U, V, P, T and 6 degrees of freedom for turbulent flows: U, V, P, T, K, . All of the elements must be defined in the x-y plane.

3.6.3

Tetrahedral Element

Both the 4 node and 10 node tetrahedral element can be used to model 3D geometries. Each node has 5 degrees of freedom for laminar flow: U, V, W, P, T and 7 degrees of freedom for turbulent flows: U, V, W, P, T, K, .

3-40

CFdesign Solver Technical Reference

CFdesign Theory

3.6.4

Hexahedral Element

The 8 node hexahedral element can be used to model 3D geometries. Each node has 5 degrees of freedom for laminar flow: U, V, W, P, T and 7 degrees of freedom for turbulent flows: U, V, W, P, T, K, .

3.6.5

Wedge Element

The 6 node triangular prism or wedge element can be used to model 3D geometries. Each node has 5 degrees of freedom for laminar flow: U, V, W, P, T and 7 degrees of freedom for turbulent flows: U, V, W, P, T, K, .

3.6.6

Pyramid Element

The 5 node prism element can be used to model 3D geometries. Each node has 5 degrees of freedom for laminar flow: U, V, W, P, T and 7 degrees of freedom for turbulent flows: U, V, W, P, T, K, .

3.7

Segregated Solver

Theory

In the previous sections, the governing equations that are solved by the CFdesign segregated solver were given. In this section, some of the techniques and associated nomenclature used during the solution of these complex and coupled equations are defined.

3.7.1

Segregated Solver Sequence

The sequence of operations in the CFdesign segregated solver are shown in Figure 1. Note that each of governing equations are solved separately. Also, if the analysis is

CFdesign Solver Technical Reference

3-41

CFdesign Theory

isothermal, the energy equation solution is skipped. Likewise if the analysis is laminar, the turbulence equations are skipped. During the analysis, the CFdesign convergence monitoring window will show an arrow pointing to the particular equation it is currently solving. After a few analyses, you will notice that the arrow spends most of its time on the pressure equation. The reason for this is that most flows are driven by the pressure. It has been our experience that if you can obtain a good solution to the pressure equation, all of the other equations will soon follow. Conversely, if the pressure solution is not good enough, the entire analysis could be jeopardized. Consequently, most of the analysis time is spent on getting a good solution to the pressure equation. Another item that you may notice is that the solver arrow sometimes spends almost no time on the V velocity and W velocity equations. Because of the similarity of the momentum equations, we can sometimes set up only the U velocity and use that setup for the other two momentum equations.

3.7.2

Global Iterations

Because the governing equations are non-linear, they must be solved iteratively. A Picard or successive substitution method is used. In this method, estimates of the solution variables (U, V, W, P, T, K, ) are substituted into the governing equations. The equations are solved for new values which are then used as the estimates for the next pass. The global iteration is shown in Figure 1 inside the dashed line box. CFdesign will either perform a fixed number of these global iterations, or it will check for the convergence criterion, or it will stop when either is reached. The convergence criterion is the level at which the specified variables residual norm must reach. The residual norm is defined in the next sub-section. In conjunction with the comments made earlier, we recommend that the pressure equation be the one on which solution convergence is measured.

3-42

CFdesign Solver Technical Reference

CFdesign Theory

1. Read in geometry, bc and control data 2. Create data structures 3. Solve x-momentum equation 4. Solve y-momentum equation 5. Solve z-momentum equation 6. Solve pressure equation and correct velocities 7. Solve energy equation 8. Solve turbulent kinetic energy equation 9. Solve turbulent energy dissipation equation
Theory

10. Check Convergence (GOTO 3.) 11. Perform output calcuations 12. Write out data 13. Exit

Figure 1

CFdesign Solver Technical Reference

3-43

CFdesign Theory

3.7.3

Convergence, Residuals, and Residual Norm

Hopefully, as we march through the global iterations just described, the values that are calculated at each step are getting closer and closer or converging to the correct solution. Since the correct solution is not known apriori, some measure of the convergence must be found. There are any number of parameters which can be used to check the level of solution convergence. Weve tried a lot. No one value is best for every situation. However, we have found that the parameter which yields the most information for the widest range of problems is the residual norm. First, the residual must be defined. After the governing equations have been discretized, they will become a set of algebraic equations for the dependent variables: U, V, W, P, T, K, . For each of these variables, there will be an equation for each finite element node in the analysis model. A typical algebraic equation for variable at node i can be written as:

A + ii i

Aijj = Fi
ji

(EQ 92)

where Aij are the algebraic coefficients resulting from discretizing the advection and diffusion terms in the governing equation and Fi are the discretized source terms. The residual of this equation is defined as:

= F A i ii i

Aijj
ji

(EQ 93)

where R i is the nodal residual for at node i. The nodal residual can be output to the plot file and displayed in CFDisplay. Contours of the nodal residuals will point out areas of the mesh where the solver is having difficulties (highest residual values). Adjusting the mesh in these areas may overcome convergence problems.
3-44 CFdesign Solver Technical Reference

CFdesign Theory

With each pass through the segregated solver or global iteration, these residuals should become smaller if the solution is converging. Rather than plotting each nodal residual after every global iteration, the norm of the nodal residuals is calculated. The norm effectively combines all of the nodal residuals into a single number:

R
i

2 i

As with the nodal residuals, the norm of the residuals should also get smaller as the solution converges. The norm of the nodal residual is what CFdesign prints in the status file and plots in the convergence monitor window to indicate convergence. Other indicators of convergence include looking at the minimum, maximum and average values of the dependent variables. All of these parameters should asymptote to a single value. When this happens, the solver is no longer significantly changing these values and the solution can be considered converged. The ultimate test of convergence is to look at the results of the analysis in the post-processor at different global iterations. If the results do not change appreciably between the two runs, the solution may be converged enough for your purpose.
Theory

3.7.4

Matrix Solvers

As shown in the above equation, the discretization process produces algebraic equations at every node. These equations form a matrix, Aij which has as many rows as there are finite element nodes and columns enough to contain the non-zero coefficients for nodal values. The classical method for solving the matrix equation is Gaussian elimination. This is a rather expensive way to get a solution because the elimination process requires at least a banded matrix for the fill produced during the decomposition. The Aij stored by CFdesign is much smaller than a banded matrix. Also, the elimination process is fairly compute-intensive. Since we are solving these equations repeatedly, this expensive elimination procedure would be prohibitively slow and arduous.
CFdesign Solver Technical Reference 3-45

CFdesign Theory

The alternative to using elimination techniques is to use iterative matrix solvers, where approximations are made to reduce the number of computations and to completely eliminate the fill process. Hence, only non-zero matrix entries are required, greatly reducing the computer storage requirements (2 - 3 orders of magnitude in 3D problems). Specifically, the approximation being made is that old values of can be used as estimates of current values. Repeated passes or iterations through the solver will eventually yield the same solution as the Gaussian elimination technique minus any round-off errors. However, again because of the non-linear nature of the equations, we may want to stop the iterations before we get to this point. The simplest iterative matrix solver is the Gauss-Seidel procedure where the values are determined from:

F i

ji = ---------------------------------i A ii

Aijj

(EQ 94)

The j values in this equation are the most recently available values. Effectively, what this does is transfer all of the off-diagonal terms to the right-hand-side of the equation. Because the number of Gauss-Seidel iterations it takes to get a decent solution is quite large, this method is not often used. Another iterative matrix solver which gives a considerably better solution than GaussSeidel particularly for transport problems is the Tri-Diagonal Matrix Algorithm (TDMA). In this method, a tri-diagonal matrix equation is constructed. Here, the two columns adjacent to the diagonal of the coefficient matrix are kept and the other terms are transferred to the right-hand- side of the equations where old values of are used. The matrix equation for TDMA can be written as:

= +A +A i 1 ,j i 1 i ,j i 1 i + 1 ,j i + 1

j i 1 ,j i , j i + 1

A +F i i ,j j

(EQ 95)

3-46

CFdesign Solver Technical Reference

CFdesign Theory

The TDMA algorithm effectively solves 1-dimensional planes of nodes simultaneously. In the transport equations, information passes from the inlet plane on to each successive plane. Hence, using the TDMA algorithm to solve the transport equations mimics this physical information flow process. There are several iterative matrix solvers which are variants of the conjugate gradient method. Some methods are applicable only to symmetric matrices; others apply to non-symmetric matrices. All of these variants use the similar techniques to solve the matrix equation. Namely, they use a searching technique to direct the solution of the matrix equations and converge faster. They are frequently referred to as a semi-direct matrix solvers because they yield highly accurate solutions. In CFdesign, the conjugate gradient solvers will iterate through the elimination process until the convergence criterion is met or the number of iterations set by the user is exceeded.

3.7.5

Relaxation

Because we only approximately solve the non-linear governing equation during the segregated solver passes or global iterations, the resulting new solution variables may well over- shoot or under-shoot their correct values. These over-shoots and undershoots can easily cause divergence. To prevent the solution from going to far off the mark, we slow the changes made to the solution variables using relaxation techniques. The first technique which is used is called under-relaxation. In this form, the new solution is weighted by the old solution using the formula:
= new + ( 1 ) old
(EQ 96)

Theory

where new is the current solution, old is the previous value and is the relaxation value. This value should be in the range of 0.0 to 1.0. If a value of 0.0 is used, the new solution is ignored. If 1.0 is used, the previous value is ignored. For most situations, the value of 0.5 is best. If convergence difficulties occur, lowering the pressure relaxation to a value of .1-.3 may solve the problem.

CFdesign Solver Technical Reference

3-47

CFdesign Theory

The second form of relaxation is called inertial relaxation. Where under-relaxation is typically applied to the solution variables themselves, inertial relaxation is used in the governing equations to slow the solution down in the same manner as the transient terms for non-steady problems. So, the inertial relaxation term is added to the governing equations in the following manner:
N d N d i i old A + ----------------------- + A = F + ----------------------- i, j j i t i i, i t i inertia inertia ji

(EQ 97)

The second term within the parantheses and the last term on the right hand side of this equation are the inertial relaxation terms. The t inertia can be adjusted to affect the influence of inertia. A value of 1.E+15 is the default which effectively eliminates any inertial influence. For analyses with convergence difficulties, this term should be lowered. Values on the order of 1.E-4 to 1.E-1 are recommended. For incompressible flows, inertia should only be applied to the momentum equations (velocities). For compressible flows, using inertial relaxation on pressure frequently aids solution progress.

3.8

References

1. White, F.M., Viscous Fluid Flow, McGraw-Hill, New York, 1974 2. Schnipke, R.J., A Streamline Upwind Finite Element Method For Laminar And Turbulent Flow, Ph.D. Dissertation, University of Virginia, May 1986

3-48

CFdesign Solver Technical Reference

You might also like