find the inner surface temperature of a plane wall after the first a large heat flux is applied for 2 seconds in matlab

To find the inner surface temperature of a plane wall after the first large heat flux is applied for 2 seconds in MATLAB, we can use the pdepe (partial differential equation solver) function.

First, we need to define the parameters of the problem, including the thermal conductivity of the wall, the heat transfer coefficient, the temperature of the environment, the initial temperature of the wall, and the heat flux applied to the wall.

Once we have defined these parameters, we can create a function that describes the differential equation that relates the temperature of the wall to the heat flux and boundary conditions. The pdepe function then solves the differential equation for us and returns the temperature of the wall as a function of time and position.

Here's some sample code that solves this problem:

main.m
% Define parameters
k = 0.5; % Thermal conductivity of wall (W/mK)
h = 10; % Heat transfer coefficient (W/m^2K)
T_inf = 25; % Temperature of environment (C)
T_0 = 20; % Initial temperature of wall (C)
q = 100000; % Heat flux applied to wall (W/m^2)

% Define function describing differential equation
function [c,f,s] = wall_heat_eqn(x,t,u,DuDx)
c = 1/(k*u);
f = k*DuDx;
s = -h*(u-T_inf) - q*(x==0);
end

% Define space/time grid
x = linspace(0,0.01,50);
t = linspace(0,2,100);

% Solve differential equation using pdepe
sol = pdepe(0,@wall_heat_eqn,@(x)T_0,@(x)0,x,t);

% Plot results
surf(x,t,sol)
xlabel('Position (m)')
ylabel('Time (s)')
zlabel('Temperature (C)')
668 chars
27 lines

This code defines the parameters of the problem and then defines a function wall_heat_eqn that describes the differential equation that relates the temperature of the wall to the heat flux and boundary conditions.

It then defines a space/time grid and uses the pdepe function to solve the differential equation for the temperature of the wall.

Finally, it plots the results as a surface plot of temperature versus position and time.

Note that this code assumes that the wall has constant thermal properties and that the heat transfer coefficient and heat flux are constant over time and position. If these assumptions are not valid for your problem, you'll need to modify the code accordingly.

related categories

gistlibby LogSnag