Assuming that the plane wall has a constant thermal conductivity and constant density, we can use the following one-dimensional heat conduction equation to calculate the temperature distribution:
$\frac{\partial T}{\partial t} = \frac{\alpha}{\rho c_p} \frac{\partial^2 T}{\partial x^2}$
where $T$ is the temperature as a function of time $t$ and position $x$ along the plane wall. $\alpha$ is the thermal diffusivity given by $\alpha = \frac{k}{\rho c_p}$, where $k$ is the thermal conductivity, $\rho$ is the density, and $c_p$ is the specific heat capacity.
Since the heat flux is already known, we can apply the following boundary condition at the surface of the wall:
$-k\frac{\partial T}{\partial x}\bigg|_{x=0} = q''$
where $q''$ is the heat flux applied and negative sign indicates direction toward the wall surface. During the period of heating, $q''$ is assumed to stay constant.
To solve this equation numerically, we need to discretize the wall into small segments and approximate the second derivative using finite difference method:
$\frac{\partial^2 T}{\partial x^2} \approx \frac{T(x+\Delta x)-2T(x)+T(x-\Delta x)}{(\Delta x)^2}$
where $\Delta x$ is the size of each segment. Then, we can use the following forward difference scheme to move forward in time:
$T_i^{n+1} = T_i^n + \frac{\Delta t \alpha}{(\Delta x)^2 \rho c_p}(T_{i+1}^n - 2T_i^n + T_{i-1}^n)$
where $i$ is the index for each segment, $n$ is the index for each time step, and $\Delta t$ is the time step size. The initial condition is $T_i^0 = 20$ for all $i$.
We can implement this scheme in Matlab as follows:
main.m916 chars34 lines
This will give us the temperature distribution across the wall at the end of the heating period, which can be plotted using plot(x,T(:,end))
.
gistlibby LogSnag