程序代写代做 05/02/2020

05/02/2020
MAT6669 Heat and Materials with Application 1
MAT6669
Numerical modelling of heat transfer
Part 4 Boundary conditions
Magnus Anderson and Karl Travis

Types of boundary conditions
The following table lists several options for describing a boundary. The boundary conditions may vary for each surface.
Boundary condition
Description
Dirichlet
Fixed value of the temperature at the boundary
Neumann
Fixed flux at the boundary
Dirichlet & Neumann
A fixed temperature and fixed flux of heat into the system
Periodic
Typically used to simulate a representative volume element.
Extrapolated
The outside temperature is approximated from known values.
Mirrored
This is used to take advantage of symmetry planes.
05/02/2020 MAT6669 Heat and Materials with Application 2

Dirichlet boundary conditions
A Dirichlet condition is simple to implement. Consider the left hand boundary of the matrix shown below:
𝑇1,1 𝑇2,1 𝑇3,1 𝑇…,1 𝑇𝑖,1 𝑇…,1 𝑇𝑛−2,1 𝑇𝑛−1,1 𝑇𝑛,1
𝑻=
𝑇1,2 𝑇1,3 𝑇2,2 𝑇2,3 𝑇3,2 𝑇3,3 𝑇…,2 𝑇…,3 𝑇𝑖,2 𝑇𝑖,3 𝑇…,2 𝑇…,3
𝑇1,… 𝑇1,𝑗 𝑇1,… 𝑇2,… 𝑇2,𝑗 𝑇2,… 𝑇3,… 𝑇3,𝑗 𝑇3,… 𝑇…,… 𝑇…,𝑗 𝑇…,… 𝑇𝑖,… 𝑇𝑖,𝑗 𝑇𝑖,… 𝑇…,… 𝑇…,𝑗 𝑇…,…
𝑇1,𝑚−2 𝑇1,𝑚−1 𝑇1,𝑚 𝑇2,𝑚−2 𝑇2,𝑚−1 𝑇2,𝑚 𝑇3,𝑚−2 𝑇3,𝑚−1 𝑇3,𝑚 𝑇…,𝑚−2 𝑇…,𝑚−1 𝑇…,𝑚 𝑇𝑖,𝑚−2 𝑇𝑖,𝑚−1 𝑇𝑖,𝑚 𝑇…,𝑚−2 𝑇…,𝑚−1 𝑇…,𝑚
𝑇𝑛−2,2 𝑇𝑛−2,3 𝑇𝑛−2,… 𝑇𝑛−2,𝑗 𝑇𝑛−2,… 𝑇𝑛−2,𝑚−2 𝑇𝑛−2,𝑚−1 𝑇𝑛−2,𝑚 𝑇𝑛−1,2 𝑇𝑛−1,3 𝑇𝑛−1,… 𝑇𝑛−1,𝑗 𝑇𝑛−1,… 𝑇𝑛−1,𝑚−2 𝑇𝑛−1,𝑚−1 𝑇𝑛−1,𝑚 𝑇𝑛,2 𝑇𝑛,3 𝑇𝑛,… 𝑇𝑛,𝑗 𝑇𝑛,… 𝑇𝑛,𝑚−2 𝑇𝑛,𝑚−1 𝑇𝑛,𝑚
We can set the temperature for these elements of the array to the Dirichlet condition𝑇 1,: =𝑇 .
The finite difference scheme does not need to be applied to these elements as the temperature is already known. If the value for the Dirichlet condition changes during the simulation, the value can be calculated and updated for each model iteration.
0
05/02/2020 MAT6669 Implicit finite difference 3

Neumann boundary conditions
A Neumann boundary condition fixes the flux to a constant value. This is often used at an interface so that one of the heat fluxes describes the Neumann boundary condition
𝑛 𝑑𝑇 𝜕𝑇
෍𝑄 =𝑚𝐶 𝑄 =𝑘 =fixedvalue
𝑖 𝑝𝑑𝑡 𝑁 𝜕𝑡 𝑖=1
𝑑𝑇 123𝑁 𝑝𝑑𝑡
𝑄 +𝑄 +𝑄 +𝑄 =𝑚𝐶
A Neumann boundary condition describes where a fixed value is set for 𝒋𝒙. Note that this flux acts in a direction 𝒋𝒙, 𝒋𝒚, 𝒋𝒛 . This value is used within the finite difference scheme.
05/02/2020 MAT6669 Implicit finite difference
4

Mixed Dirichlet and Neumann boundary conditions
We can fix the flux entering a location to 𝑄𝑁 and fix the temperature at the location to 𝑇 . For example,
consider the heat loss at the right interface described below
𝑇 𝑖−1,𝑚
𝑄3
𝑇𝑄𝑄
𝑇 𝑖,𝑚
𝑄 1
𝑑𝑇 123𝑁 𝑝𝑑𝑡
𝑄 +𝑄 +𝑄 +𝑄 =𝑚𝐶 Neumann condition
𝐷
𝑖,𝑚−1 2
𝑁
Δ𝑥 𝑇 −𝑇 𝑄=k 𝜔 𝑖−1,𝑚 𝐷
1 2 Δ𝑦
𝑇−𝑇 𝑖,𝑚−1 𝐷
𝑇 𝑖+1,𝑚
𝑄2 = k Δ𝑦𝜔
Δ𝑥 𝑇 −𝑇
Δ𝑥
𝑄3 = k 𝜔 𝑖−1,𝑚 𝐷 2 Δ𝑦
Dirichlet condition
05/02/2020
MAT6669 Implicit finite difference
5

Ghost points
One way to implement periodic, extrapolated, or mirrored boundary conditions is to introduce “ghost” points that describe the neighboring region outside of the discretized space.
Consider a 3×3 array representing a 2D field describing the spatial temperature.
𝑇𝑇𝑇 1,1 1,2 1,3
𝑇𝑇𝑇 2,1 2,2 2,3
𝑇𝑇𝑇 3,1 3,2 3,3
Let us introduce a larger grid 𝐺 that contains ghost points for all index elements considering the finite difference scheme. The interior points of 𝐺 correspond to 𝑇 . Consider a finite difference scheme that indexes ±1 points. We need the following ghost points
𝐺 =
𝑇=
𝐺1,1 𝐺1,2 𝐺1,3 𝐺1,4 𝐺1,5 𝐺1,1 𝐺1,2 𝐺1,3 𝐺1,4 𝐺1,5 𝐺𝐺𝐺𝐺𝐺𝐺𝑇𝑇𝑇𝐺
2,1 2,2 2,3 2,4 2,5 2,1 1,1 1,2 1,3 2,5 𝐺3,1 𝐺3,2 𝐺3,3 𝐺3,4 𝐺3,5 = 𝐺3,1 𝑇2,1 𝑇2,2 𝑇2,3 𝐺3,5
𝐺𝐺𝐺𝐺𝐺𝐺𝑇𝑇𝑇𝐺 4,1 4,2 4,3 4,4 4,5 4,1 3,1 3,2 3,3 4,5
𝐺5,1 𝐺5,2 𝐺53 𝐺5,4 𝐺5,5 𝐺5,1 𝐺5,2 𝐺53 𝐺5,4 𝐺5,5
The finite difference scheme may be applied to the interior elements of the 𝐺 array highlighted in red. 05/02/2020 MAT6669 Implicit finite difference 6

Periodic / Mirrored / Extrapolated boundaries
Consider an array of dimensions 𝑛 × 𝑚 that describes the temperature in a 2D field.
The corresponding ghost array has dimensions of 𝑛𝑒𝑥𝑡 × 𝑚𝑒𝑥𝑡 where 𝑛𝑒𝑥𝑡 = n + 1 and 𝑚𝑒𝑥𝑡 = m + 1. The following assumes an evenly spaced spatial discretization.
Periodic
Left side
𝐺 2:𝑛𝑒𝑥𝑡−1,1 = 𝑇 1:𝑛,𝑚−1 right side
𝐺 2:𝑛𝑒𝑥𝑡−1,𝑚_𝑒𝑥𝑡 = 𝑇 1:𝑛,2 top side
𝐺 𝑛𝑒𝑥𝑡,2:𝑚𝑒𝑥𝑡−1 = 𝑇 2,1:𝑚 bottom side
𝐺 1,2:𝑚𝑒𝑥𝑡−1 = 𝑇 𝑛−1,1:𝑚 05/02/2020
Mirrored
Left side
𝐺 2:𝑛𝑒𝑥𝑡−1,1 = 𝑇 1:𝑛,2 right side
𝐺 2:𝑛𝑒𝑥𝑡−1,𝑚_𝑒𝑥𝑡 = 𝑇 1:𝑛,𝑚−1 top side
𝐺 𝑛𝑒𝑥𝑡,2:𝑚𝑒𝑥𝑡−1 = 𝑇 𝑛−1,1:𝑚 bottom side
𝐺 1,2:𝑚𝑒𝑥𝑡−1 = 𝑇 2,1:𝑚 MAT6669 Implicit finite difference
Extrapolated
Left side
= 2𝑇 1:𝑛,1 right side
= 2𝑇 1:𝑛,𝑚 top side
𝐺 2:𝑛𝑒𝑥𝑡−1,1 𝐺 2:𝑛𝑒𝑥𝑡−1,𝑚_𝑒𝑥𝑡
− 𝑇 1:𝑛,2
− 𝑇 1:𝑛,𝑚−1
− 𝑇 𝑛−1,1:𝑚 − 𝑇 2,1:𝑚
7
𝐺 𝑛𝑒𝑥𝑡,2:𝑚𝑒𝑥𝑡−1
bottom side
= 2𝑇 𝑛,1:𝑚 𝐺 1,2:𝑚𝑒𝑥𝑡−1 = 2𝑇 1,1:𝑚