I'm trying to solve a 1D-Heat Equation with Finite Difference Method in python.
The object I'm trying to depict has "Material A" with a high conductivity on the outside and a core of "Material B" with a small conductivity on the inside. I assigned the materials and their conductivity to the relative nodes with the help of an array.
After many steps, I would expect the resulting graph to show a dip in temperature where the "Material B" lies. The resulting graph shows a linear line though.
Is the heat equation applicable to different conductivities, or is my method flawed?
Heat Equation: $$\frac{\partial}{\partial t} T(x,t) - a \frac{\partial^2}{\partial x^2} T(x,t) = f(x,t).$$
FDM 1: $$\frac{\partial}{\partial t}T = \frac{T_{n,k+1} - T_{n,k}}{\Delta t}.$$
FDM 2: $$\frac{\partial^2}{\partial x^2}T = \frac{T_{n+1,k} - 2 \cdot T_{n,k} - T_{n-1,k}}{\Delta x^2}.$$
Added together and solved for T(k+1): $$T_{n,k+1} = m(T_{n+1,k} - 2 \cdot T_{n,k} + T_{n-1,k}) + T_{n,k} + \Delta t \cdot f_{n,k}.$$
EDIT 2:
I think my problem does not lie in solving a heat equation, but rather coming up with the correct formulation of the Boundary conditions. I tried to depict what I want to model in the graphic below.
My goal is to simulate the shown case in python with the help of the FDE Method.
So far my Boundary conditions where:
$$u(x_0, t) = 100 ~~ \text{and} ~~ u(x_3, t) = 20 $$
also $$ u(x,0) = 20$$
Within the program, I used these BC's and the homogenous heat equation in an FDM approach:
$$T_{n,k+1} = m(T_{n+1,k} - 2 \cdot T_{n,k} + T_{n-1,k}) + T_{n,k}$$
I thought that, if $k(x)$ just using:
$$ k(x) = k_1 ~~~for~~~ x_0 < x < x_1 ~~~and ~~~x_2 < x < x_3 $$ and $$ k(x) = k_2~~~ for~~~ x_1 < x < x_2 $$
I would have a realistic representation of my problem.
I tried to transfer Gert's question to mine but am not sure. If I understand correctly, I have to include two additional Boundary conditions. One for each interface at $x_1$ and $x_2$. I would then have to calculate 3 separate heat equations. One that depicts $x_0 ~~ to ~~ x_1$ and so forth.
Would that be a correct approach to solve my problem?