The problem that I am trying to solve is the temperature distribution in two media (with different thermal conductivities) joined at a common surface . I have had success with a 1 D model but can not seem to be able to extend the analysis to two dimensions.
Here is my 1-D model
1 D
1 D
In[]:=
k1=2;(*thermalconductivitiyinregion1*)k2=4;(*thermalconductivitiyinregion2*)
In[]:=
eqs=(*equations*)k1T1[x]0,(*region1*)k2T2[x]0(*region2*);
2
∇
{x}
2
∇
{x}
In[]:=
bcs=(*boundaryconditions*){T1[0]20,T2[1]10,T1[1/2]T2[1/2],k1T1'[1/2]k2T2'[1/2]};
In[]:=
eqsbcs=Join[eqs,bcs](*equationsandboundaryconditions*)
Out[]=
2[x]0,4[x]0,T1[0]20,T2[1]10,T1T2,24
′′
T1
′′
T2
1
2
1
2
′
T1
1
2
′
T2
1
2
In[]:=
{sol1,sol2}=NDSolveValue[eqsbcs,{T1,T2},{x,0,1},WorkingPrecision30]
Out[]=
InterpolatingFunction,InterpolatingFunction
In[]:=
T1plot=Plot[sol1[x],{x,0,0.5}];
In[]:=
T2plot=Plot[sol2[x],{x,0.5,1.0}];
In[]:=
Show[T1plot,T2plot,PlotRangeAll]
Out[]=
Here is my 2D model
2 D
2 D
In[]:=
k1=2;k2=4;
In[]:=
eqs=k1T1[x,y]0,k2T2[x,y]0;
2
∇
{x,y}
2
∇
{x,y}
In[]:=
bcs={T1[0,y]20,T2[1,y]10,T1[1/2,y]T2[1/2,y],k1(D[T1[x,y],x]/.x1/2)k2(D[T2[x,y],x]/.x1/2)};
In[]:=
eqsbcs=Join[eqs,bcs]
Out[]=
2[x,y]+[x,y]0,4[x,y]+[x,y]0,T1[0,y]20,T2[1,y]10,T1,yT2,y,2,y4,y
(0,2)
T1
(2,0)
T1
(0,2)
T2
(2,0)
T2
1
2
1
2
(1,0)
T1
1
2
(1,0)
T2
1
2
In[]:=
NDSolveValue[eqsbcs,{T1[x,y],T2[x,y]},{x,0,1},{y,0,1},WorkingPrecision30]
1
2
1
2
Out[]=
NDSolveValue2[x,y]+[x,y]0,4[x,y]+[x,y]0,T1[0,y]20,T2[1,y]10,T1,yT2,y,2,y4,y,{T1[x,y],T2[x,y]},{x,0,1},{y,0,1},WorkingPrecision30
(0,2)
T1
(2,0)
T1
(0,2)
T2
(2,0)
T2
1
2
1
2
(1,0)
T1
1
2
(1,0)
T2
1
2
