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

2.3.

Handling Boundary Conditions (BC)

Boundary conditions take 3 forms:


1. Dirichlet-type boundary conditions
2. Neumann-type boundary conditions
3. Robin-type boundary conditions
In the following, we will explain the 3 different boundary conditions.

2.3.1. Dirichlet-type boundary conditions

The Dirichlet BC, also known as the Type 1 BC, is expressed as follows:

(54)

The values of the function are fixed at the limits of domain

2.3.2. Neumann-type boundary conditions

The Neumann-type boundary condition, also known as the type 2 boundary condition, expresses the
value of the flux or the gradient of the function at the boundaries of the domain . It is expressed
as follows:

(55)

is the value of the flux at point

Flow calculation:

1. First Approach: consider the nodes shown in Figure 4:

Figure 4

The Taylor series expansion around node gives :

22
(56)

We derive an estimate of the gradient of phi at point 1 :

(57)

Neglecting the second-degree term, we obtain :

(58)

Equation 58 is perfectly valid, but it is only accurate to first order. We prefer the second approach,
which is more accurate to second order.
2. Second Approach:
Consider the following Taylor series expansion:

(59)

To approximate the flux to order 2, multiply equation 56 by 4 and subtract equation 59 to obtain:

(60)

After rearranging 60 we get:

(61)

The second-order approximation gives us the following estimate of the gradient of :

(62)

23
3. Third Approach
Approximation 62 is more accurate than 58, since it is second-order. However, by writing 62,
equation 39 is not verified at node 1. In order to verify both 55 and 39, let's rewrite equations 56
and 59 as follows:

(63)

(64)

Multiply 63 by 8 and subtract equation 64 to obtain :

(65)

Rearranging 65 we obtain:

(66)

to order 2, 66 can be written as follows :

(67)

Equations 58, 62 and 67 are all valid and reflect the Neumann-type boundary condition. However,
expression 67 is more precise, as it is second-order and verifies differential equation 39, and is the
one we will adopt.

2.3.3. Robin-type boundary conditions

It's a linear combination of and the gradient of :

(68)

24
et are constants.
68 is rewritten as follows:

(69)

By replacing 69 into 56 and 59 we get:

(70)

Multiply 69 by 8 and subtract 70 to obtain:

(71)

By rearranging 71 we get:

(72)

At order 2 equation 72 is writing as:

(73)

25
2.4. Generalization to the 2D case

So far we've applied FDM to the simple one-dimensional case. To generalize SFM to the 2D case,
let's consider the following Poisson's equation:

(74)

The equation 74 is a partial differential equation. is the source term.


The equation 74 is defined on the domain of the Fig. 5
where , is is the number of nodes along the axis and is the
number of nodes along the axis

Figure 5: Domain

Let's write the Taylor series development around the point :

26
(75)

We note that: and equation 75 reduces to :

(76)

Equation 76 is similar to equation 42, except that the total derivative has been replaced by the
partial derivative.

Following the same procedure, we obtain:

(77)

Adding the two previous equations gives us:

(78)

At second order, the previous equation gives the following approximation:

(79)

Following the same procedure, we obtain along y:

27
(80)

Adding equations 79 and 80 we obtain:

(81)

equation 81 is only valid inside the domain , on the boundaries we'll have to use boundary
conditions.

Assume that the domain is subject to the following boundary conditions:

Let's assume that the omega domain is subject to the following boundary conditions:
On the left wall :

(82)

on the right wall :

(83)

on the bottom wall :

(84)

on the top wall

(85)

Boundary conditions rules:

➢ It is assumed that Dirichlet-type boundary conditions override all other forms of BC, so the
left-hand BC will be imposed on the node at the bottom left corner. Similarly, the BC of the
upper wall will be imposed at the node of the upper right corner.

➢ For the top left node, we will apply one of the two Dirichlet BCs or an average of the two.

28
➢ To apply Robin's BCs to the lower wall, we'll use formula 73, but this time along the y-axis,
which gives us :

(86)

All the nodes of the lower wall except those of the two corners have neighbours on the left and on
the right. Formula 79 is thus valid, so we write :

(87)

To satisfy the partial differential equation on the lower wall, we will therefore replace 86 and 87 in
equation 74, which gives us for the lower wall :

(88)

88 is valid

For the right wall, we'll use formula 67 according to the notation in figure 6, as well as formula 79:

(89)

Formula 89 applies to the right wall except at the two corner nodes

Figure 6

For the node of the right corner of the low wall we will use a combination of terms according to x
of 89 and the term according to y of 88 we obtain :

29
(90)

In summary, to solve Poisson's equation 74 on the domain (Fig. 5) subject to BC 82-83-84-85 on


the equidistant grid of Fig. 5 we have:

1°) Equation 81 for all internal nodes et

2°) An equation equivalent to equation 54 to represent the Dirichlet BC on the left wall:

3°) Equation 89 for the right wall

4°) Equation 88 for the lower wall

5°) for the node at the right-hand corner of the bottom wall.

6°) Equation 90 for the right corner node of the bottom wall

Finally, before writing our system of equations in matrix form, we'll use the numbering of the nodes
in the domain as specified in figure 7

Figure 7

A number k is assigned to each node according to the formula

(91)

30
The various equations must be rewritten using the following notation:

(92)

31

You might also like