find the inner surface of a plane wall undergoing heat flux for 0.2 seconds with a constant initial temperature and a constant ambient temperature on the opposite side of the wall in matlab

To find the inner surface of a plane wall undergoing heat flux, we need to solve the heat transfer equation. Assuming 1D heat transfer in the x-direction, the heat transfer equation is given as:

<img src="https://latex.codecogs.com/gif.latex?\frac{\partial}{\partial&space;x}(&space;kA\frac{\partial&space;T}{\partial&space;x})&space;=&space;\rho&space;C_p&space;\frac{\partial&space;T}{\partial&space;t}" title="\frac{\partial}{\partial x}( kA\frac{\partial T}{\partial x}) = \rho C_p \frac{\partial T}{\partial t}" />

where k is the thermal conductivity, A is the cross-sectional area of the wall, T is the temperature, rho is the density, Cp is the specific heat, and t is time.

We need to specify the initial temperature T(x,0) and the boundary conditions at x=0 and x=L (L is the thickness of the wall). The boundary condition at x=0 is given as:

<img src="https://latex.codecogs.com/gif.latex?kA(\frac{\partial&space;T}{\partial&space;x})_{x=0}&space;=&space;q_0" title="kA(\frac{\partial T}{\partial x})_{x=0} = q_0" />

where q0 is the heat flux on the inner surface of the wall. The boundary condition at x=L is given as:

<img src="https://latex.codecogs.com/gif.latex?kA(\frac{\partial&space;T}{\partial&space;x})_{x=L}&space;=&space;-h(T_{\infty}-T(L,t))" title="kA(\frac{\partial T}{\partial x})_{x=L} = -h(T_{\infty}-T(L,t))" />

where h is the convective heat transfer coefficient and T_inf is the constant ambient temperature on the opposite side of the wall.

We can solve this equation using the finite difference method. Let us assume that we have discretized the x-axis into N nodes. Then, the temperature at node i and time step n can be represented as T(i,n). Similarly, the boundary conditions and initial condition can be discretized accordingly.

We can write the discretized form of the heat transfer equation as:

<img src="https://latex.codecogs.com/gif.latex?\frac{kA}{\Delta&space;x^2}(T_{i-1,n}&plus;T_{i&plus;1,n}-2T_{i,n})&space;=&space;\rho&space;C_p\frac{T_{i,n&plus;1}-T_{i,n}}{\Delta&space;t}" title="\frac{kA}{\Delta x^2}(T_{i-1,n}+T_{i+1,n}-2T_{i,n}) = \rho Cp\frac{T_{i,n+1}-T_{i,n}}{\Delta t}" />

where Δx is the distance between two adjacent nodes and Δt is the time step.

We need to solve this equation for all the nodes at each time step using an iterative scheme such as the Gauss-Seidel method. The computation ends after 0.2 seconds.

The MATLAB code for solving this problem is quite lengthy and beyond the scope of this answer. However, there are several MATLAB toolboxes and functions available that can solve this problem efficiently such as the Partial Differential Equation Toolbox and pdepe function.

related categories

gistlibby LogSnag