cfdesign theory

48
CFdesign Solver Technical Reference 3-1 CHAPTER 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. Com- pressible flows involve gases at very high speeds. One major difference between com- pressible 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

Upload: mrchado

Post on 23-Oct-2014

158 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cfdesign Theory

CFdesign Solver Technical Reference 3-1

CHAPTER 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. Com-pressible flows involve gases at very high speeds. One major difference between com-pressible 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

Page 2: Cfdesign Theory

CFdesign Theory

3-2 CFdesign Solver Technical Reference

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:

(EQ 1)

where is the speed of sound, is the ratio of the specific heats, is the Universal Gas Constant and 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:

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

(EQ 3)

where Cp is the mechanical specific heat value calculated using:

a γRT=

a γ RT

htotal12---ρV

2hstatic+=

ρ

Ttotal12---ρV

2

Cp---------- Tstatic+=

Page 3: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-3

Th

eory

(EQ 4)

where is the ratio of the constant pressure specific heat to the constant volume spe-cific heat and is the gas constant for this gas. The total temperature is also called the stagnation temperature. The first term on the right hand side of this equa-tion 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:

(EQ 5)

Hypersonic flows cannot be modelled using the Ideal Gas assumption and must con-sider real gas effects.

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 pres-sure to that calculated from the pressure equation. Referring to the relative pressure as

, the absolute pressure is calculated as:

cp

γRgasγ 1–

---------------=

γRgas

ρ pRT-------=

prel

Page 4: Cfdesign Theory

CFdesign Theory

3-4 CFdesign Solver Technical Reference

(EQ 6)

where the subscript refers to reference values, the subscript refers to the 3 coor-dinate directions, 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 rela-tive 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:

(EQ 7)

(EQ 8)

Note that the specific heat used to calculate the dynamic temperature is not the ther-mal value entered on the property window, but is a mechanical value calculated using:

(EQ 9)

where is the ratio of the constant pressure specific heat to the constant volume spe-cific heat and is the gas constant for this 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 stag-nation temperature minus the dynamic temperature.

pabsolute prel pref ρref giXi

i

∑ ρref ωi2

Xi2

i

∑+ + +=

ref ig ω

TdynamicV

2

2cp---------=

pdynamic12---ρV

2=

cp

γRgasγ 1–

---------------=

γRgas

Page 5: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-5

Th

eory

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 fluc-tuating 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:

(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 numer-ically predict.

3.1.1.7 Inviscid - Viscous Flow

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.

Re ρVLµ

-----------=

ρ µ

Page 6: Cfdesign Theory

CFdesign Theory

3-6 CFdesign Solver Technical Reference

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 func-tion 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 irrota-tional are extremely limiting. However, potential flow solutions can offer some infor-mation 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 pres-sure in the boundary layer is virtually constant. Outside the boundary layer, the pres-sure 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 essen-tially 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:

(EQ 11)τxy µ u∂y∂

-----=

Page 7: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-7

Th

eory

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 vis-cosity 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:

(EQ 12)

For a non-Newtonian power law fluid, the shear stress is written as:

(EQ 13)

where m is the consistency index and n is the power law index. In terms of viscosity, this equation can be written:

(EQ 14)

where and .

A Herschel-Bulkley non-Newtonian fluid can be described as:

(EQ 15)

In terms of viscosity, this can be written as:

(EQ 16)

τµ

τxy η∂u∂y------= η, f

∂u∂y------ =

τxy m∂u∂y------

n=

µ µ0

∂Vi∂Xj-------- p

=

µ0 m= p n 1–=

τxy τ0 k∂u∂y------

n+=

µ µ0 k∂Vi∂Xj-------- p

+=

Page 8: Cfdesign Theory

CFdesign Theory

3-8 CFdesign Solver Technical Reference

Another non-Newtonian fluid representation is a Carreau model fluid:

(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 Conduction, Convection, Conjugate and Radiation Heat Transfer

There are three modes by which heat can be transferred. In conduction, heat is trans-ferred via molecular motion. The heat transfer rate is dependent upon the thermal con-ductivity. 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 combi-nation 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-to-surface radiant interchange will affect the surface temperatures and hence the gas tem-peratures via convection and conduction. To include radiant interchange in the gov-erning equations, an additional heat flux term, qr is added to the wall surface elements. This term is calculated from:

(EQ 18)

µ µ∞–

µ0 µ∞–-------------------- 1 λ

∂Vi∂Xj--------

2

+

n 1–2

------------

=

qri Ai Gi Ji–( )=

Page 9: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-9

Th

eory

where is the net heat flux to the fluid at element from surface-to-surface radia-tion. is the incident radiation on the face of element and is the radiosity of element face . The radiosity can be written as:

(EQ 19)

where is the emissivity of element surface and is the black body emissive power of element surface :

(EQ 20)

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

(EQ 21)

where is the view factor between element surface and element surface . So 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 engi-neering calculations. This approach is very fast and requires very little extra memory.

3.1.1.12 Natural, Mixed and Forced Convection

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 prop-erties, 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 domi-nates the flow. Conversely, in forced convection flows, the temperature is dominated

qri iGi i Ji

i

Ji 1 εi–( )Gi εiEbi+=

εi i Ebii

Ebi σTi4

=

σ

Gi JjFi j–

j 1=

N

∑=

Fi j– i j

Page 10: Cfdesign Theory

CFdesign Theory

3-10 CFdesign Solver Technical Reference

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:

(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. Some-times, the Rayleigh number, which is combination of the Grashof and Prandtl num-bers, is also referenced. The Prandtl number is defined as:

(EQ 23)

The Rayleigh number is defined as:

(EQ 24)

where Cp is the constant pressure specific heat, is the absolute viscosity, is the density and k is the thermal conductivity.

Gr βgL3∆T

ν2

---------------------=

βν

PrCPµ

k-----------=

Ra GrPr=

RaβgL

3∆T

ν2

---------------------Cpµ

k-----------=

Raβgρ

2CpL

3∆T

µk-----------------------------------=

µ ρ

Page 11: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-11

Th

eory

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:

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

(EQ 26)

where h is the film coefficient, L is a characteristic length and k is the thermal conduc-tivity. 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:

(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 neces-sarily 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 gen-erally the length along the surface for which film coefficients are being calculated.

hqresidual

∆T-------------------------=

Nu hLk

------=

Nu CRea

Prb

=

Page 12: Cfdesign Theory

CFdesign Theory

3-12 CFdesign Solver Technical Reference

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 mod-elled 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:

(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 K-factor used by CFdesign has units of length-1. Most handbooks use an unit-lessK-fac-tor.

The second form for entering distributed resistances is the friction factor method. In this form, the excess pressure gradient is written as:

(EQ 29)

p∂Xi∂

-------- Ki

ρVi2

2----------=

p∂Xi∂

--------f

DH--------

ρVi2

2----------=

Page 13: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-13

Th

eory

where f is the friction factor and DH is the hydraulic diameter. The friction factor can be calculated using the Moody relation:

(EQ 30)

where is the surface roughness in length units and is the hydraulic diameter in length units.

Friction factor can also be calculated using the relation:

(EQ 31)

where a and b are constants.

The last form for the distributed resistance terms follows the Darcy relation:

(EQ 32)

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.

1

f----- 2.0 ε

3.7DH---------------- 2.51

ReDHf

----------------------+

log–=

ε DH

f aReDH

b–=

p∂Xi∂

-------- CµVi=

µ

Page 14: Cfdesign Theory

CFdesign Theory

3-14 CFdesign Solver Technical Reference

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:

(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 fac-tors 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 equa-tions 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 equa-tions 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 iteration’s 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-

ρuu∂x∂

-----

Page 15: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-15

Th

eory

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:

(EQ 34)

where is the load vector, is the unknown vector and 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.,

(EQ 35)

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.

AijUj Fi=

Fi Uj Aij

A12 A21= A34 A43=

Page 16: Cfdesign Theory

CFdesign Theory

3-16 CFdesign Solver Technical Reference

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:

(EQ 36)

(EQ 37)

(EQ 38)

(EQ 39)

ρ∂t∂

------ ρu∂x∂

--------- ρv∂y∂

--------- ρw∂z∂

----------+ + + 0=

continuity equation

ρ u∂∂t----- ρu

u∂x∂

----- ρvu∂y∂

----- ρwu∂z∂

-----+ + +

ρgxp∂x∂

-----x∂∂ 2µ u∂

x∂-----

y∂∂ µ u∂

y∂----- v∂

x∂-----+

z∂∂ µ u∂

z∂----- w∂

x∂------+

+ + +–=

Sω SDR+ +

x momentum– equation

ρ v∂xt∂

------- ρuv∂x∂

----- ρvv∂y∂

----- ρwv∂z∂

-----+ + +

ρgyp∂y∂

-----x∂∂ µ u∂

y∂----- v∂

x∂-----+

y∂∂ 2µ v∂

y∂-----

z∂∂ µ v∂

z∂----- w∂

y∂------+

+ + +–=

Sω SDR+ +

y momentum– equation

ρ w∂t∂

------ ρuw∂x∂

------ ρvw∂y∂

------ ρww∂z∂

------+ + +

ρgzp∂z∂

-----x∂∂ µ u∂

z∂----- w∂

x∂------+

y∂∂ µ v∂

z∂----- w∂

y∂------+

z∂∂ 2µ w∂

z∂------+ + +–=

Sω SDR+ +

z momentum– equation

Page 17: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-17

Th

eory

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:

(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 oper-ate 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:

(EQ 41)

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

For incompressible and subsonic compressible flow, the energy equation is written in terms of static temperature:

(EQ 42)

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

SDR Kif

DH--------+

ρVi

2

2---------- CµVi––=

Sω 2ρωi Vi×– ρωi ωi ri××–=

ω

ρCpT∂∂t------ ρCpu

T∂x∂

------ ρCpvT∂y∂

------ ρCpwT∂z∂

------+ + +x∂∂ k

T∂x∂

------y∂∂ k

T∂∂y------

z∂∂ k

T∂z∂

------ qV+ + +=

energy equation

Page 18: Cfdesign Theory

CFdesign Theory

3-18 CFdesign Solver Technical Reference

(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 com-pressible flows.

The variables in these equations are defined in Table 1.

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.

Variable Description

Cp constant pressure specific heat

gx , gy , gz gravitational acceleration in x, y, z directions

k thermal conductivity

p pressure

qV volumetric heat source

T temperature

t time

u velocity component in x-direction

v velocity component in y-direction

w velocity component in z-direction

viscosity

density

ρCp

T0∂

t∂--------- ρCpVi

T0∂

Xi∂---------

+Xi∂∂ k

T0∂

Xi∂--------- qV+=

µ+ Vi Xj Xj∂

2

∂ ViXi∂∂ Vj∂

Xj∂--------+

12CP-----------

Xj∂∂

kXj∂∂

VjVj( ) Φ+ +

total energy equation

Φ

µ

ρ

Page 19: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-19

Th

eory

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 compo-nent (out-of-plane component), these equations can be written as:

(EQ 44)

(EQ 45)

(EQ 46)

(EQ 47)

r∂∂

rρur( )z∂∂

rρvz( )+ 0=

continuity equation

ρur

ur∂

r∂-------- ρvz

ur∂

z∂--------

ρwθ2

r-----------–+

p∂r∂

-----–1r---

r∂∂

rµur∂

r∂--------

z∂∂ µ

ur∂

z∂-------- 1

r---

r∂∂

rµur∂

r∂--------

z∂∂ µ

vz∂

r∂--------

2µvr

r2

------------–+ + + +=

Sω SDR+ +

r momentum– equation

ρur

vz∂

r∂-------- ρvz

vz∂

z∂--------+

p∂z∂

-----– ρgz1r---

r∂∂

rµvz∂

r∂--------

z∂∂ µ

vz∂

z∂-------- 1

r---

r∂∂

rµur∂

z∂--------

z∂∂ µ

vz∂

z∂--------+ + + + +=

SDR+

z momentum– equation

ρur

wθ∂

r∂---------- ρvz

wθ∂

z∂----------

ρurwθr

----------------+ + =

1r---

r∂∂

rµwθ∂

r∂----------

z∂∂ µ

wθ∂

z∂----------

wθr

------- µ∂r∂

------–µwθ

r2

----------- SDR Sω+ +–+

swirl velocity– equation

Page 20: Cfdesign Theory

CFdesign Theory

3-20 CFdesign Solver Technical Reference

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 equa-tions 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 sim-ple 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 writ-ten as:

(EQ 48)

where U is the mean velocity and u is the fluctuation about that mean. This represen-tation 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 aver-aged governing equations can be written as:

(EQ 49)

u U u′+=

ρ∂t∂

------ ρu∂x∂

--------- ρv∂y∂

--------- ρw∂z∂

----------+ + + 0=

continuity equation

Page 21: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-21

Th

eory

(EQ 50)

(EQ 51)

(EQ 52)

(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

ρ U∂t∂

------- ρUU∂x∂

------- ρVU∂y∂

------- ρWU∂z∂

-------+ + + ρgxP∂x∂

------ SDR Sω+ + +–=

x∂∂ 2µ U∂

x∂------- ρuu–

y∂∂ µ U∂

y∂------- V∂

x∂------+

ρuv–z∂∂ µ U∂

z∂------- W∂

x∂-------+

ρuw–+ +

x momentum– equation

ρ V∂∂t------ ρU

V∂x∂

------ ρVV∂y∂

------ ρWV∂z∂

------+ + + ρgyP∂y∂

------ SDR Sω+ + +–=

x∂∂ µ U∂

y∂------- V∂

x∂------+

ρuv–y∂∂ 2µ V∂

y∂------ ρvv–

z∂∂ µ V∂

z∂------ W∂

y∂-------+

ρvw–+ +

y momentum– equation

ρ W∂t∂

------- ρUW∂x∂

------- ρVW∂y∂

------- ρWW∂z∂

-------+ + + ρgzP∂z∂

------ SDR Sω+ + +–=

x∂∂ µ U∂

z∂------- W∂

x∂-------+

ρuw–y∂∂ µ V∂

z∂------ W∂

y∂-------+

ρvw–z∂∂ 2µ W∂

z∂------- ρww–+ +

z momentum– equation

ρCpT∂t∂

------ ρCpUT∂x∂

------ ρCpVT∂y∂

------ ρCpWT∂z∂

------+ + +

x∂∂ k

T∂x∂

------ ρCpuT′

–y∂∂ k

T∂∂y------ ρCpvT

′–

z∂∂ k

T∂z∂

------ ρCpwT′

– qV+ + +=

energy equation

ρ ρ ρ ρ ρ ρ ρ ′ ρ ′ρ ′

ρ ρ ρ ρ ρ ρ ρ ρρ

Page 22: Cfdesign Theory

CFdesign Theory

3-22 CFdesign Solver Technical Reference

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:

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

(EQ 56)

(EQ 57)

µtρuu–

2U∂x∂

-------------------- ρuv–

U∂y∂

------- V∂x∂

------+-------------------- ρvw–

V∂z∂

------ W∂y∂

-------+--------------------- …= = = =

kt

ρCput–

T∂x∂

-------------------------

ρCpvt–

T∂y∂

-------------------------

ρCpwt–

T∂z∂

--------------------------= = =

ρ∂t∂

------ ρU∂x∂

---------- ρV∂y∂

---------- ρW∂z∂

-----------+ + + 0=

continuity equation

ρ U∂t∂

------- ρ+ UU∂x∂

------- ρVU∂y∂

------- ρWU∂z∂

-------+ + ρgxP∂x∂

------ SDR Sω+ + +–=

x∂∂ 2 µ µt+( ) U∂

x∂-------

y∂∂ µ µt+( ) U∂

y∂------- V∂

x∂------+

z∂∂ µ µt+( ) U∂

z∂------- W∂

x∂-------+

+ +

x momentum– equation

Page 23: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-23

Th

eory

(EQ 58)

(EQ 59)

(EQ 60)

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 dissi-pation, . The eddy viscosity and eddy conductivity are calculated using:

(EQ 61)

(EQ 62)

where is a turbulent Prandt number, usually taken to be 1.0 and is an empirical constant. The transport equations for K and are derived using moments of the momentum equations. They are:

ρ V∂∂t------ ρ+ U

V∂x∂

------ ρVV∂y∂

------ ρWV∂z∂

------+ + ρgyP∂y∂

------ SDR Sω+ + +–=

x∂∂ µ µt+( ) U∂

y∂------- V∂

x∂------+

y∂∂ 2 µ µt+( ) V∂

y∂------

z∂∂ µ µt+( ) V∂

z∂------ W∂

y∂-------+

+ +

y momentum– equation

ρ W∂t∂

------- ρ+ UW∂x∂

------- ρVW∂y∂

------- ρWW∂z∂

-------+ + ρgzP∂z∂

------ SDR Sω+ + +–=

x∂∂ µ µt+( ) U∂

z∂------- W∂

x∂-------+

y∂∂ µ µt+( ) V∂

z∂------ W∂

y∂-------+

z∂∂ 2 µ µt+( ) W∂

z∂-------+ +

z momentum– equation

ρCpT∂t∂

------ ρ+ CpUT∂x∂

------ ρCpVT∂y∂

------ ρCpWT∂z∂

------+ +

x∂∂ k kt+( ) T∂

x∂------

y∂∂ k kt+( ) T∂

∂y------

z∂∂ k kt+( ) T∂

z∂------ qV+ + +=

energy equation

ε

µt CµρK

2

ε-------=

kt

µtCpσt

------------=

σt Cµε

Page 24: Cfdesign Theory

CFdesign Theory

3-24 CFdesign Solver Technical Reference

(EQ 63)

(EQ 64)

where 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, , kt ,K, .

ρ K∂t∂

------ ρ+ UK∂x∂

------ ρVK∂y∂

------ ρWK∂z∂

------+ +

x∂∂ µt

σK------- µ+ K∂

x∂------

y∂∂ µt

σK------- µ+ K∂

∂y------

z∂∂ µt

σK------- µ+ K∂

z∂------ ρε +–+ +=

µt 2U∂x∂

------- 2

2V∂y∂

------ 2

2W∂z∂

------- 2 U∂

y∂------- V∂

x∂------+

2 U∂z∂

------- W∂x∂

-------+ 2 V∂

z∂------ W∂

y∂-------+

2+ + + + +

turbulent kinetic energy equation

ρ ε∂t∂

----- ρ+ Uε∂x∂

----- ρVε∂y∂

----- ρWε∂z∂

-----+ +

x∂∂ µt

σε------ µ+ ε∂

x∂-----

y∂∂ µt

σε------ µ+ ε∂

∂y-----

z∂∂ µt

σε------ µ+ ε∂

z∂----- C2ρ

ε2

K-----–+ +=

C1µtεK---- 2

U∂x∂

------- 2

2V∂y∂

------ 2

2W∂z∂

------- 2 U∂

y∂------- V∂

x∂------+

2 U∂z∂

------- W∂x∂

-------+ 2 V∂

z∂------ W∂

y∂-------+

2+ + + + +

turbulent energy dissipation equation

σK σε

µtε

Page 25: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-25

Th

eory

The two-equation turbulence model just described has been used for numerous appli-cations 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 com-plexity of the analysis and usually the ability to obtain a solution, another two-equa-tion 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-nor-malization 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 numeri-cally 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:

Constant Value CFdesign Name Result of Increasing Value

0.09 CMu more mixing, mores shear, greater change in pressure

1.44 CE1 less mixing, lower shear, smaller change in pressure

1.92 CE2 more mixing, mores shear, greater change in pressure

1.0 (not available for user modifica-tion)

1.3 (not available for user modifica-tion)

C1

C2

σK

σε

Page 26: Cfdesign Theory

CFdesign Theory

3-26 CFdesign Solver Technical Reference

(EQ 65)

where is defined as:

(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 Value CFdesign Name Result of Increasing Value

0.085 CMu more mixing, mores shear, greater change in pressure

1.42 RNG CE0 less mixing, lower shear, smaller change in pressure

1.68 CE2 more mixing, mores shear, greater change in pressure

0.015 RNG Beta more mixing, mores shear, greater change in pressure

4.38 RNG Eta more mixing, mores shear, greater change in pressure

0.7179 (not available for user modifica-tion)

0.7179 (not available for user modifica-tion)

C1 C0

η 1 ηη0------–

1 βη3

+-------------------------–=

η

η GKε

------------=

G 2U∂x∂

------- 2 V∂

y∂------ 2 W∂

z∂------- 2

+ + U∂y∂

------- V∂x∂

------+ 2 U∂

z∂------- W∂

x∂-------+

2 V∂z∂

------ W∂y∂

-------+ 2

+ + +=

C0

C2

β

η0

σK

σε

Page 27: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-27

Th

eory

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:

(EQ 67)

where the velocities in this equation are the fluctuating portion of the velocity. The turbulence intensity is defined as:

(EQ 68)

The combination of two equations above yield an estimate for the inlet turbulent kinetic energy based on the inlet velocity distribution:

(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 FAC-TOR”. 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:

ε

K12--- u

2v2

w2

+ +( )=

I uU---- v

V--- w

W-----= = =

K12--- IU( )

2IV( )

2IW( )

2+ +[ ]=

Page 28: Cfdesign Theory

CFdesign Theory

3-28 CFdesign Solver Technical Reference

(EQ 70)

where 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 turbu-lent 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 theo-retically 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 mod-els 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 gen-erally 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 turbu-lent flows.

The main purpose of the “wall functions” is to enforce the Law of the Wall, which can be written as:

ε CµK

1.5

δs-----------=

δs

Page 29: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-29

Th

eory

(EQ 71)

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

(EQ 72)

where Ut is the velocity tangent to the wall, is the wall shear stress, is the den-sity, 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:

(EQ 73)

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-predict-ing 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:

(EQ 74)

U+ 1

κ--- y

+log B+=

κ

U+ Ut

τwρ

------

-----------=

y+

δτwρ

------

ν--------------=

τw ρδ ν

35 y+

350≤ ≤

U+ 1

κ--- y

+log B

1κ--- 1 .3

rSVν

---------+ log–+=

Page 30: Cfdesign Theory

CFdesign Theory

3-30 CFdesign Solver Technical Reference

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” sub-menu. 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.

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 rel-ative 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, Spalding’s Inner Law [1] is used to obtain:

(EQ 75)

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

Constant Value CFdesign Name Result of Increasing Value

26.0 VanDriest less thermal mixing in wall boundary layer

5.50 Wall Parameter lower wall shear, smaller change in pressure

0.0 Roughness higher wall shear, greater change in pressure

0.40 Kappa higher wall shear, greater change in pressure

ν

A+

B

r

κ

T+

σLUσT σL–

κ--------------------SV

1σL-------

1σT------- κe

κB–1 .3

rSVν

---------+ e

κ USV------

+log+=

σL σT

Page 31: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-31

Th

eory

(EQ 76)

Here, Cp is the specific heat, is the absolute viscosity and k is the thermal conduc-tivity. T+ is defined as:

(EQ 77)

where is the distance from the wall, 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 formulafor eddy viscosity is used in the Temperature Law of the Wall to yield:

(EQ 78)

where A+ is Van Driest’s constant. This constant is assigned the value of 26.0 by CFdesign. It can be modified under the “CONTROL” main menu and “TURBU-LENCE PARAMETERS” sub- menu.

3.2.3 Properties

From the previous sections, the fluid properties required for fluid flow and heat trans-fer 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

σL

Cpµ

k-----------=

µ

T+ Cpδτw

kw-----------------=

δ τw

T+

σTUSV------

σLσT------- 1– σT

σL-------

14---

A+

κ-------

12---

π

4 π4---sin

--------------+=

Page 32: Cfdesign Theory

CFdesign Theory

3-32 CFdesign Solver Technical Reference

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 User’s Guide.

3.3 Discretization Method

In CFdesign, the finite element method is used to reduce the governing partial differ-ential 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 func-tion 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:

Symbol Description Units - cm Units - inch

constant pressure specific heat

Joule/gram-K Btu-inch/lbf-sec2-R

conversion factor 1.0 gram-cm/sec2-dyne 386.4 lbm-inch/lbf-sec2

thermal conductivity Watt/cm-K Btu/sec-inch-R

ratio of specific heats

absolute viscosity gram/cm-sec lbf-sec/inch2

density gram/cm3 lbf-sec2/inch4

Cp

gc

k

γµρ

Page 33: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-33

Th

eory

(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 coor-dinates:

(EQ 80)

where s is the streamwise coordinate and Us is the velocity component in the stream-wise 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:

(EQ 81)

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

3.3.2 Transient Discretization

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

(EQ 82)

ρUφ∂x∂

------ ρVφ∂y∂

------ ρWφ∂z∂

------+ +x∂∂ Γφ

φ∂x∂

------

y∂∂ Γφ

φ∂y∂

------

z∂∂ Γφ

φ∂z∂

------ Sφ+ + +=

ρUφ∂x∂

------ ρVφ∂y∂

------ ρWφ∂z∂

------+ + ρUsφ∂s∂

------=

N ρUφ∂x∂

------ ρVφ∂y∂

------ ρWφ∂z∂

------+ + Vd∫ ρUs

φ∂s∂

------ N Vd∫=

Aijuj Fi=

Page 34: Cfdesign Theory

CFdesign Theory

3-34 CFdesign Solver Technical Reference

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

The transient terms in the governing equations took the form:

(EQ 83)

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

(EQ 84)

We can add this term to the matrix equation above:

(EQ 85)

where is a diagonal matrix composed of terms like:

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

Aijuj

Fi

ρ∂ϕ∂t------

ϕ

∂ϕ∂t------ ϕ

newϕ

old–∆t

--------------------------------≈

Aij Bii+( )ujnew

Fi Biiujold

+=

Bii

Bii1∆t----- Niρ Vd∫=

Page 35: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-35

Th

eory

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, pres-sure never appears explicitly in the continuity equation. There are a plethora of ave-nues 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 solu-tion 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:

(EQ 87)

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 ele-ment 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 equa-tion.

N ρU∂x∂

---------- ρV∂y∂

---------- ρW∂z∂

-----------+ + Ωd∫

NρUdΓ∫° NρVdΓ∫° NρWdΓ∫°N∂x∂

------ρUN∂y∂

------ρVN∂z∂

------ρW+ + Ωd∫–+ +=

Page 36: Cfdesign Theory

CFdesign Theory

3-36 CFdesign Solver Technical Reference

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 velocity-pressure relationship can be written as:

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

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

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

U Uh KUP∂x∂

------–=

V Vh KVP∂y∂

------–=

W Wh KWP∂z∂

------–=

N∂x∂

------ρKUP∂x∂

------ N∂y∂

------ρKVP∂y∂

------ N∂z∂

------ρKWP∂z∂

------+ + ∫ dΩ

NρUdΓ∫°– NρVdΓ∫° NρWdΓ∫° ρ UhN∂x∂

------ VhN∂y∂

------ WhN∂z∂

------+ + Ωd∫+––=

ρU ρUo

ρo

U+=

Page 37: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-37

Th

eory

(EQ 91)

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 com-pressible 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 sep-arately. 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 equa-tion 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.

3.5 Boundary Conditions

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

N∂x∂

------ρo

KUP∂x∂

------ N∂y∂

------ρo

KVP∂y∂

------ N∂z∂

------ρo

KWP∂z∂

------ NρU

o∂

x∂-------------- N

ρVo

∂y∂

------------- NρW

o∂

z∂--------------+ + + + +

∫ dΩ

Nρo

Uo

dΓ∫°– Nρo

Vo

dΓ∫° Nρo

Wo

dΓ∫°––=

ρo

UhN∂x∂

------ VhN∂y∂

------ WhN∂z∂

------+ + N

ρo

Uo

∂x∂

----------------- Nρ

oV

o∂

y∂---------------- N

ρo

Wo

∂z∂

------------------+ + + Ωd∫+

Page 38: Cfdesign Theory

CFdesign Theory

3-38 CFdesign Solver Technical Reference

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 dissipa-tion 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 tur-bulence 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 CFde-sign.

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 calcu-lated by CFdesign. For compressible or supersonic flows, the outlet should be speci-fied 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 automati-cally by CFdesign.

ε

Page 39: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-39

Th

eory

The wall boundary conditions for the turbulence quantities are also handled automati-cally 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 ambi-ent 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 symme-try plane for the scalar quantities T, K, are zero. This condition is applied automati-cally in CFdesign.

For the velocity and pressure equations, the velocity component normal to the bound-ary should be set to zero implying no flow across the boundary. The velocity compo-nents tangential to the symmetry boundary should have a zero gradient normal to this boundary, which is handled automatically by CFdesign. The pressure boundary condi-tion of no flow across the boundary is also handled automatically.

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

ε

ε

Page 40: Cfdesign Theory

CFdesign Theory

3-40 CFdesign Solver Technical Reference

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 axisym-metric geometries. Each node has 4 degrees of freedom for laminar flow: U, V, P, Tand 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 axisymmet-ric 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, .

ε

ε

ε

Page 41: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-41

Th

eory

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 turbu-lent 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 turbu-lent flows: U, V, W, P, T, K, .

3.7 Segregated Solver

In the previous sections, the governing equations that are solved by the CFdesign seg-regated 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

ε

ε

ε

Page 42: Cfdesign Theory

CFdesign Theory

3-42 CFdesign Solver Technical Reference

isothermal, the energy equation solution is skipped. Likewise if the analysis is lami-nar, 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 equa-tions 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 solu-tion 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 crite-rion is the level at which the specified variable’s residual norm must reach. The resid-ual 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 conver-gence is measured.

ε

Page 43: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-43

Th

eory

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

12. Write out data

11. Perform output calcuations

13. Exit

10. Check Convergence (GOTO 3.)

Figure 1

Page 44: Cfdesign Theory

CFdesign Theory

3-44 CFdesign Solver Technical Reference

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 solu-tion. 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. We’ve tried a lot. No one value is best for every situa-tion. 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 dis-cretized, 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:

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

(EQ 93)

where 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 diffi-culties (highest residual values). Adjusting the mesh in these areas may overcome convergence problems.

εφ

Aiiφi Aijφj

j i≠∑ Fi=+

Rφi Fi Aiiφi Aijφj

j i≠∑––=

Rφi φ

Page 45: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-45

Th

eory

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:

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 sta-tus file and plots in the convergence monitor window to indicate convergence.

Other indicators of convergence include looking at the minimum, maximum and aver-age 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 itera-tions. If the results do not change appreciably between the two runs, the solution may be converged enough for your purpose.

3.7.4 Matrix Solvers

As shown in the above equation, the discretization process produces algebraic equa-tions 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 coeffi-cients 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.

Ri2

i

φ

Page 46: Cfdesign Theory

CFdesign Theory

3-46 CFdesign Solver Technical Reference

The alternative to using elimination techniques is to use iterative matrix solvers, where approximations are made to reduce the number of computations and to com-pletely 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 equa-tions, 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:

(EQ 94)

The 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 Gauss- Seidel 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:

(EQ 95)

φ

φ

φi

Fi Aijφj

j i≠∑–

Aii-----------------------------------=

φj

Ai 1 j,– φi 1– Ai j, φi 1– Ai 1+ j, φi 1++ + Ai j, φj

j i 1 j i j i 1+≠,≠,–≠∑ Fi+=

Page 47: Cfdesign Theory

CFdesign Theory

CFdesign Solver Technical Reference 3-47

Th

eory

The TDMA algorithm effectively solves 1-dimensional planes of nodes simulta-neously. 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 conju-gate 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 under-shoots 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:

(EQ 96)

where is the current solution, 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 relax-ation to a value of .1-.3 may solve the problem.

φ αφnew 1 α–( )φold+=

φnew φold α

Page 48: Cfdesign Theory

CFdesign Theory

3-48 CFdesign Solver Technical Reference

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 govern-ing equations in the following manner:

(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 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 low-ered. 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

Ai i,

ρi N Ωd∫∆tinertia------------------------+

φi Ai j, φj

j i≠∑+ Fi

ρi N Ωd∫∆tinertia------------------------φi

old+=

∆tinertia