458 Partial differential equations
At the interface ˜x=1/2, we need to have continuity of the temperature, θ1( ˜x=
1/2,˜y)=θ2( ˜x=1/2,˜y) and continuity of the flux
∂˜x
∂˜x
Since the discontinuous boundary condition does not allow for continuity of the
temperature, we will set the temperature at the interface to be the average of the
two temperatures, θ1( ˜x=1/2,˜y=0) =(1 +Tr)/2.
(b) The diffusion equations inside the boundary are
For the top and bottom boundary, the equations are fixed to the constants 1, 0, and
Trdepending on the location. For the left boundary, we need to use the fictitious
node to get
where the subscripts iis the interfacial node in material 1(and we store the tem-
perature condition in that node). For the flux condition, which is stored in the
interface node for material 2, using backward differences gives
where inow refers to the interfacial node for material 2.
The Matlab script of this problem is:
1function s13c12p2
12
13 [Tline,A,b,Tplot] = getT(k,L,nx,Tr);
14 dlmwrite(‘s13c12p2A.dat’,A)
15 dlmwrite(‘s13c1212p2b.dat’,b)
16 dlmwrite(‘s13c12p2T.dat’,Tline)