Boundary Conditions and Boundary Treatment

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

NGM_JF006_1: Computational Fluid Dynamics Széchenyi University

Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

9. BOUNDARY CONDITIONS AND


BOUNDARY TREATMENT
First of all, let us make a distinction between the terms of Boundary Conditions
and Boundary Treatment.

9.1. Boundary Conditions (BC)

 In CFD, Boundary Conditions (BC) are equally important than the governing
equations, even if most textbooks deal predominantly with the governing
equations only.

 From mathematical point of view, BC’s are inherently linked with PDE’s. A
PDE must have BC’s to obtain a unique solution.

 In CFD, the various solutions to the same governing equations are


distinguished by the BC’s. In other words, the flow over a car differs from the
flow over a Space Shuttle exactly because of the different BC’s applied.

 BC’s are a set of mathematical relations we want to impose at the edges of


the computational domain, for example:

u = 0, v = 0, w = 0 for no-slip wall (applied for the N-S eqs.)

v=0 for slip wall (applied for the Euler equations)

 = ∞
u = u∞
v = v∞ for supersonic far-field inlet
w = w∞
p = p∞

 However, BC’s only partially specify the flow at the boundary. For example,
the no-slip wall condition of (u=0, v=0, w=0) only specifies these three cell
variables and leaves the other two (pfree.

 Also, BC’s don’t tell us that in what way should we ensure that (u=0, v=0,
w=0), i.e. what kind of formula should we apply (a linear or quadratic
extrapolation?) to ensure these conditions at the wall.

 The list of typical BC’s used in CFD is provided below:

1
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

SOLID WALL: - no-slip wall (for viscous flows)


u = 0, v = 0, w = 0
- slip walls (for inviscid flows)
v=0

- WALL: MOVING WALL: u = uw,A , v = vw,A ,w = ww,A,


(where w,A stands for wall speed at point
A on solid surface)

POROUS WALL: - permeable walls with (p/x) through


the wall defined as a quadratic
function

INFLOW (inlet): - typically means freestream conditions

- FAR-FIELD:
- freestream, OR
OUTFLOW (outlet): - prescribed pressure, OR
- pressure extrapolated from
interior

- SYMMETRY: - no flow across boundary


- no scalar flux across boundary, e.g.

[n100]
SYMMETRY PLANE
(same in wind tunnel and CFD)

TOP VIEW OF F-18

Instead of full cylinder, solve only half


of it if the angle of attack is 0 deg.

Fig. 9.1. Illutstration of symmetry boundary conditions in two different CFD problems. an F-18 aircraft (top)
and a cylinder (bottom).

2
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

- PERIODIC BC’s: - flux of all variables at the PERIODIC OUTLET is equal to


the flux of all variables at the PERIODIC INLET

- usually used in cases with special symmetry, e.g. gas


turbine blade rows, etc.

[n101]
COMPRESSOR STAGE COMBUSTOR TURBINE STAGE

a)

COMPUTATIONAL
BLADE 1
DOMAIN

BLADE 2
PERIODIC OUTLET

BLADE 3

PERIODIC INLET

b)

Fig. 9.2. Illustration of periodic boundary conditions for a turbine blade in a jet engine. General Electric J85
jet engine (a) and the computational domain for one of the blades (b).

3
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

9.2. Boundary Treatment

 Boundary Treatment (BT) reconstructs & models the flow properties at the
edges of the computational domain, using both BC’s and interior flow.

 BT defines all flow properties at the boundaries, not just the ones required by
the BC’s.

 In essence, BT’s are specific numerical methods applied at the boundary of


the computational domain.

 There are two basic methods of BT:

1) Change of numerical method at the edge

2) Change of computational domain at the edge: “ghost cells”

9.2.1. Change of numerical method at the edge

Normally, a numerical scheme involves a certain “stencil” of cells from one or


both sides of the cell solved for. Examples [n102]:

Scheme: Stencil:
Cell to be solved

Central Differencing (CD)

Forward Differencing (FD)

Backward Differencing (BD)

Fig. 9.3. Computational stencils for central, forward and backward differencing.

4
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

When we reach the edge of the computational domain, the scheme for the
interior cannot be applied since there are no neighbouring cells to solve for the
stencil. Thus, for boundary cells, the original numerical scheme applied for the
interior cells needs to be changed.

Example: [n103]

Last cell where Central Differencing


(CD) can be used

In these cells Central Differencing (CD) needs to be


changed to Forward Differencing (FD)

Fig. 9.4. Graphical illustration of changing the numerical method around a solid wall boundary.

The disadvantage of such method is that the solution algorithm needs to be


altered around the boundaries, which increases the coding complexity.

9.2. Change of computational domain at the edge: “ghost cells”

Another alternative is to change the computational domain by introducing so-


called “ghost cells” outside of the boundary. Usually, 1 or 2 layers of ghost cells
are introduced, depending on the size of the stencil.

[n103]

BOUNDARY OF COMPUTATIONAL
DOMAIN

Fig. 9.5. Graphical illustration of changing the computational domain around a solid wall boundary.

5
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

The big advantage of the ghost cell method is that the numerical scheme used
for the interior can be used unaltered for the boundaries. The idea is to introduce
“fake”, fictitious flow in the ghost cells – the so-called “ghost flow” - which will
yield the desired boundary conditions on the edge, i.e.

[n104]
For NO-SLIP SOLID WALL B.C. For FREE-STREAM FARFIELD B.C.

Fig. 9.6. Graphical illustration of setting up the ghost cell values for a solid wall and a free-stream
boundary condition.

9.3. Criteria for Boundary Treatment development

The two major criteria for a successful Boundary Treatment are:

1) Boundaries should not absorb or reflect waves in unphysical manner

Information in fluid flows propagates in waves, either in the form of


pressure waves or entropy waves, which propagate with the speed of
sound. Any Boundary Treatment (BT) should be designed in a way so that
where reflection of such waves is physically required (such as at a solid
wall), then this is enabled and where reflection of the waves would be
unphysical (such as at inlet or outlet), the waves become absorbed. This is
not simple to achieve and therefore, the development of correct Boundary
Treatment methods is one of the most important undertaking in CFD code
development.

6
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

[n105]
Solid Wall Solid Wall
Farfield Farfield
Boundary Boundary
Boundary Boundary

DESIRED

ACTUAL (WRONG)

ORIGINAL WAVE REFLECTION WAVE REFLECTION

Fig. 9.7. Graphical illustration of a signal’s reflection from a solid wall (left) and farfield (right)
boundary condition.

2) Boundary Treatment should not compromise numerical stability

The second major criterion for developing Boundary Treatment is its effect
on the stability of a simulation. The selection of the proper combination of
the boundary conditions around all edges of the computational domain
will have a major effect on the stability of the simulation. To deal with
this, it is absolutely essential that one understands the mathematics and
physics behind Boundary Treatment.

In the following sections, the basics of the “ghost cell” method will be described
for the two most fundamental types of BC’s: solid wall and far-field, from the
point of view of compressible flow applications.

This will be followed by a look at the choice of BC’s on the stability of CFD
simulations, or in other words: what combination of BC’s should we set to not to
compromise the convergence of the solution.

9.4. Solid Wall Boundary Treatment

For solid walls in 2D, the following BC’s are set as the requirement:

No-slip wall Slip wall


(viscous flow) (inviscid flow)
Velocity component parallel to wall: u=0 u = up1
Velocity component normal to wall: v=0 v=0

Note: - up1 is the velocity in the first cell near the wall.
- v = 0 is called the “no penetration BC”

7
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

As an illustration, we will deal with the simplest possible scenario: a 2D slip


wall. For this, only the no-penetration BC is prescribed. We will illustrate the
ghost cell method only.

For the ghost cell method, the most popular technique for constructing the BT
formula for solid walls is the “method of images”, also called as the “method of
reflections”. This method was originally invented for solving linear equations
around solid boundaries.

In the method of images,


- the scalar quantity reflects symmetrically (in other words: is mirrored)
- the vector quantity reflects with change of sign, i.e.

[n106]
v-distribution p and distribution

+2

+1

Fig. 9.8. Graphical illustration of the “method of images” for the treatment of solid wall boundary conditions
via the ghost cell method. Note that the illustration is for primitive variables, but similar definition could be
done for conservative variables too.

Note that the method of images means setting up equal but opposite flow in the
ghost cells, which will cause the interior flow to reflect back from the solid wall.
In other words, if there is a wave traveling at 50 m/s towards the wall from one
side, there will be an opposite wave traveling at 50 m/s from the other side. This
mechanism is in essence equivalent to the physics of shock-shock interaction.
[n107]
SHOCK REFLECTION DUE TO SHOCK 1-
SHOCK 2 INTERACTION.

Fig. 9.9. Shock reflection from two wedges exposed to supersonic (Mach > 1) flow. Flow from a solid wall
boundary should reflect in the same way as for example a shock wave from the symmetry line.

8
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

The problem with the ghost cell method is “cusping”. Cusping means that the
scalar quantities (, p) exhibit a discontinuity in their first derivatives at the
wall.

[n108]

CUSPING: , p ARE CONTINUOUS THROUGH THE BOUNDARY


BUT (d/dy) AND (dp/dy) ARE NOT.

Fig. 9.10. Illustration of cusping.

Cusping was originally seen as a problem since it might impose non-physical


conditions on (, p) at the wall (Moretti), but this has been proven otherwise
lately (Laney pp.437).

However, cusping can be the source of spurious oscillations in the waves


reflected back to the interior, thus lowering computational accuracy.

Anyway, after discussing this simple Boundary Treatment in detail, now we are
in the position to summarize the pro’s and con’s of the ghost cell method:

Ghost cell method pro’s and con’s:

ADV: - simple and elegant


- no need to alter method at boundaries – simple to code.

DIS: - cusping: jumps in the 1st derivatives across the boundary can
lower the computational accuracy of the method at the boundaries.
- extra storage requirements (of the ghost cell geometry & values)
- quality of Boundary Treatment is determined by interior method

Note: - ghost cells are usually generated automatically within the code
and not in the grid generator.

9
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

9.5. Far-field boundary treatment

Setting up the “ghost flow” for far-field BC’s is much trickier that it is for solid
walls. Why?

Because while solid boundaries are designed to reflect waves from the interior,
the far-field boundaries shall allow them to travel freely out of the domain, i.e. to
let them pass without reflection. Setting up such “non-reflecting BC’s” is not
simple.

Before looking into the Boundary Treatment of far-field boundaries, let us clarify
the terms far-field & freestream.

FREESTREAM: - flow, which would occur if the computational domain would


be completely “empty”, i.e. free of any solid objects. If a solid
object is present in the computational domain (which is the
point of CFD simulations) then freestream conditions would
occur at infinite distance from the solid object.

FAR-FIELD: - boundary at finite distance from the solid object, with


values slightly (or more) different than the freestream values
would be.

The real problem is that we do not know the far-field values, but only the
freestream ones. But, we need to set some values for the far-field, and we usually
set the freestream values for these.

Example: [n109]

FAR-FIELD INLET FAR-FIELD OUTLET

(CLOSE TO FREESTREAM
CONDITIONS)
WAKE
THESE ARE NOT
FREESTREAM
CONDITIONS YET THE
EDGE IS DEFINED AS
FAR-FIELD OUTLET.

Fig. 9.11. Computational domain around an airfoil. Note that we impose freestream conditions at the far-
field inlet and outlet boundaries, even if these do not theoretically occur at these boundaries.

10
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

There are 3 steps for designing Boundary Treatment for a far-field boundary:

 STEP 1: Decide on how many flow variables to specify (0, 1, 2, 3)

 STEP 2: Decide which flow variables to specify

 STEP 3: Assign values to chosen flow variables. This is the hardest step of
all, exactly because “far-field  freestream” but we only know the free-
stream values.

We will go through these 3 steps in the following.

STEP 1: Number of flow variables to specify

The table below shows the number of flow variables to be specified for a far-field
boundary. We will explain later that how one arrives to these numbers.

Type of FAR-FIELD Boundary Number of quantities required

INFLOW: SUBSONIC 2
SUPERSONIC 3

OUTFLOW: SUBSONIC 1
SUPERSONIC 0 (since no upstream
propagation of inform.)

Based on the above table, one can define the terms of ILL-POSED and WELL-
POSED problems:

WELL-POSED problem: number of quantities defined along all far-field


boundaries is just sufficient.

ILL-POSED problem: number of quantities defined along all far-field


boundaries is either:

- UNDER-SPECIFIED: less is defined than required


- OVER-SPECIFIED: more is defined than required

11
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

An ILL-POSED problem is likely to suffer from convergence problems. Note that


specifying more quantities than required does not help either: this is equally
wrong.

Why do we need to define 3 quantities for supersonic inlet and none for
supersonic outlet, etc.?

This can be explained by looking at the characteristic curves of the flow. Any
flow can be described by the so-called characteristic curves or wavefronts, which
are in essence the curves along which the derivatives of the flow are
indeterminate (see Anderson pp. 97-100 and Laney pp. 36 for more details). An
example of the characteristic waves in a 1D subsonic and supersonic flow is
shown below.

[n110]

straight lines
for steady
uniform flow

SUBSONIC FLOW SUPERSONIC FLOW


Info propagates both upstream Info propagates downstream only
and downstream

Fig. 9.12. Characteristic waves in subsonic and supersonic flow.

Now, imposing a boundary at x=0 in the x-t plane (i.e. the point in the x-t plane
where the characteristic curves will emanate from) leads to:

12
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

[n111]
INFLOW – Subsonic: OUTFLOW – Subsonic:

EXTERIOR INTERIOR INTERIOR EXTERIOR

2 chars. running into the domain 1 chars. running into the domain
(+ and 0) (-)

INFLOW – Supersonic: OUTFLOW – Supersonic:

EXTERIOR INTERIOR
INTERIOR EXTERIOR

3 chars. running into the domain 0 chars. running into the domain
(+, - and 0) (none of +, - and 0)

Fig. 9.13. Characteristic waves running in and out of the domain at inflow and outflow
boundaries for both subsonic and supersonic flow.

Thus, the above figure explains the number of variables required for the various
types of far-field boundaries, as it was shown in the table at the beginning of this
section.

Now that we understand the role of characteristics in Boundary Treatment, we


can re-define from another point of view that what UNDER-SPECIFIED and
OVER-SPECIFIED problems mean:

UNDER-SPECIFIED: not all incoming characteristics are defined


OVER-SPECIFIED: beside all incoming characteristics, some of the
outgoing characteristics have been defined too.

13
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

So, for a WELL-POSED problem, we aim to define just enough (primitive or


conservative) variables to uniquely determine the incoming characteristics only.

STEP 2: Selecting the variables to specify

Recall that the characteristics are related to the primitive variables via the
following differential equations:

dp
dv0  d 
a2
dp
Right running characteristic: dv  du 
 a
dp
Left-running characteristic: dv  du 
 a

Now, for example for SUBSONIC INLET, the two characteristics to be specified
at the boundary shall be the one, which are coming INTO the domain, i.e. :
dv 0
dv 
The question is then that through which set of primitive variables can we define
dv0 and dv+ without ill-posing the problem? The possible choices and their
consequences are listed in the table below:

Specification of
Specify dv0 dv+ dv- Problem becomes

dp partial partial partial ill-posed: under-specified

dp, d, du full full full ill-posed: over-specified


(dv- specified too)

du, dp partial full full ill-posed


(dv0 incomplete, dv- specified too)

14
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

du, d partial partial partial ill-posed : under-specified

However, since dv- is known from


the interior, this can help to
calculate dp without over-spe-
cifying the problem, i.e.:

du, d, dv- full full from int. well-posed !!

d, dp full partial partial ill-posed: under-specified

However, since dv- is known from


the interior, this can help to
calculate du without over-spe-
cifying the problem, i.e.:

d, dp, dv- full full from int. well-posed !!

IN ENGLISH: for a SUBSONIC INLET, one can specify ( and p) or


( and u) but not (pand u) !!

This is just one example. For SUPERSONIC INLET, for example, it does not
matter which 3 variables are given.

For external flows, where the nature of the far-field inlet and far-field outlet are
likely to be the same (either both subsonic or both supersonic), one can notice
from the table at the start of this section, that there is always a combination of 3
variables to be specified ALONG ALL far-field boundaries.

SUBSONIC INFLOW (2) + SUBSONIC OUTFLOW (1) = 3


SUPERSONIC INFLOW (3) + SUPERSONIC OUTFLOW (0) = 3

Once we know what to set at the inlet, we must take care not to duplicate these
at the outlet, i.e.

15
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

[n112]

OUTLET: must be u
(cannot be p or )
INLET: p, 

THIS IS VERY-VERY IMPORTANT FOR CONVERGENCE !!

STEP 3: Assigning values to the chosen flow variables

Note: In this section, we will assume that the freestream (and not the far-field!!)
variables of (∞, u∞, p∞) are uniform and steady.

We have seen above that there are waves traveling across the interior of the
computational domain. This is the reason why we cannot simply set the ghost
cell values equal to the free-stream: when an outgoing wave passes across the
far-field boundary, it would like to rewrite the (, u, p) values in the ghost cells
and thus to violate the Boundary Conditions!!!

Thus, if we force the freestream values to be set at a far-field boundary, it will


likely lead to the PARTIAL REFLECTION OF WAVES FROM THE FAR-FIELD
BOUNDARY.

There are two possible solutions to avoid such wave reflections:

Option 1) set far-field boundary far away from the solid object,

Option 2) develop non-reflecting boundary conditions.

16
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

Option 1) means that by the time the waves reach the far-field, they become
significantly damped by the numerical or physical viscosity in the simulations.
Thus, the waves will be too weak to cause significant effect by their reflection. In
this option, we can set far-field conditions equal to the freestream conditions.

However, this setup can introduce significant error. By moving the boundaries
far away, we create a very large circumference (or area) for the far-field, on
which the accumulated error between the enforced freestream and the actual
far-field boundaries can become significant. For example, circulation over an
airfoil must be constant along any closed line around the airfoil, which condition
is always going to be violated at the far-field if the freestream values are
imposed. If the far-field boundary line (or face) is too long, the accumulated error
will be significant.

So, instead of moving the far-field too far away from the solid object, it is better
to consider Option 2) and to develop non-reflecting boundary treatments.

9.6. Non-reflecting boundaries

The basic idea is to:

1) Linearize the Euler equations (since far-fields are dominated by inviscid


phenomena) around the freestream values, i.e.

     
u  u  u back-substitution to the Euler equations and dropping
the (f'g') terms leads to:
p  p  p
W W
 C  0
t x
with the following matrix introduced:

u   0 
 1 
C   0 u 
  
0   a 2 u  

17
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

The linearized Euler equations will then represent the flow in the ghost cells.

2) Choose one of the methods:

a) model outgoing waves by an asymptotic method to prevent their


reflection:

The waves traveling through the domain can be described via the 1D
wave equation as:

p = p1 (x – at) + p2 (x + at)

right-running left-running
wave wave

Thus, the outgoing waves will satisfy 2 equations at the same time:

- 1D wave equation
use these 2 eqs. for employing
- linearized differential eq. an asymptotic method
(math not shown in this course)

18
NGM_JF006_1: Computational Fluid Dynamics Széchenyi University
Instructor: D. Feszty, T. Jakubík Audi Department of Vehicle Engineering

b) set those characteristic variables and/or their derivatives constant,


which we don’t want to reflect back to the interior:

- Take the differential eqs for the characteristics and solve them:

dp p
dv0  d  v0   
a2 a
2

dp
dv  du  v  u 
p
 a    a
dp
dv  du  v  u 
p
 a    a
- For the specific case of SUBSONIC INLET and SUBSONIC OUTLET:

SUBSONIC INLET [n113]

Set dv-=0 (v-=const) and calculate


(, u, p) from above

SUBSONIC OUTLET [n114]

Set dv0=0,dv+=0 (v0=const, v+=const)


and calculate (, u, p) from above

19

You might also like