Calculate total heat loss by conduction given temperature and depth profile vectors
4 views (last 30 days)
Show older comments
Hi all,
I need to solve this problem in Matlab. I have a hot body placed over cold ground, this having a thermal conductivity k = 1.
I need to estimate the total heat loss by conduction into the substratum at each timestep.
For each of these timesteps I have a temperature profile and the associated vertical profile at 1cm intervals (see .mat files attached).
How can I estimate the total heat loss (w/m2) at each time interval (i.e., the heat loss for every profile)?
Any help woud be grately appreciated!
0 Comments
Accepted Answer
Torsten
on 31 May 2024
Moved: Torsten
on 31 May 2024
Here is another way to determine the temporal change of heat content in the substratum.
rho*cp*dT/dt = d/dx (k*dT/dx)
Integrating with respect to x gives
d/dt (integral_{x=-20}^{x=0} (rho*cp*T) dx ) = k*dT/dx @h=0 - k*dT/dx @h=-20
Above, we tried to approximate the right-hand side. Here, we try to approximate the left-hand side.
close all
clc
load("time_in_days.mat")
load("Depth_Profiles.mat")
load("Temperature_Profiles.mat")
num_intervals = size(Temperature_Profiles, 2);
depth_index = find(Depth_Profiles <= -20, 1, 'last');
rhocp = 1.0; % Specify rho*cp of the substratum [J/(m^3*K)]
for i = 1:num_intervals
temperature_profile = Temperature_Profiles(:, i);
energy_content(i) = trapz(Depth_Profiles(depth_index:end),temperature_profile(depth_index:end))*rhocp; %[J/m^2]
end
figure(1)
plot(time_in_days,energy_content) %[J/m^2]
change_of_energy_content = gradient(energy_content)./gradient(time_in_days*24*3600);%[W/m^2]
figure(2)
plot(time_in_days,change_of_energy_content*1e3) %[mW/m^2]
8 Comments
Torsten
on 1 Jun 2024
Here is a second-order approximation of the temperature gradients at the boundaries, but it doesn't seem to change that much:
dT_dh_surface = (1.5*temperature_profile(end) - 2*temperature_profile(end-1) + 0.5*temperature_profile(end-2)) / 0.01;
dT_dh_Depth = (-1.5*temperature_profile(2+depth_index) + 2*temperature_profile(1+depth_index) - 0.5*temperature_profile(1+depth_index - 1)) / 0.01;
For reference:
More Answers (1)
Torsten
on 31 May 2024
Edited: Torsten
on 31 May 2024
How can I estimate the total heat loss (w/m2) at each time interval (i.e., the heat loss for every profile)?
Total heat flow into the domain is (k*dT/dh @h=0) - (k*dT/dh @h=-20). Maybe you only want to evaluate this at one end.
To estimate the gradient, use a finite difference approximation.
2 Comments
Torsten
on 31 May 2024
Edited: Torsten
on 31 May 2024
Maybe you only want to evaluate this at one end. Sorry, can you provide more details on this? What does it mean?
It means that at h = 0, you have a heat flow into the domain and at h = -20, you have a heat flow out of the domain. Maybe you only want to compute the flow into the domain (k*dT/dh @h=0) or only the flow out of the domain (-k*dT/dh @h=-20) and not the net flow (k*dT/dh @h=0) - (k*dT/dh @h=-20).
To estimate the gradient, use a finite difference approximation: I came up with this code, but the output does not make any sense... :
You could use difference quotients of higher order that involve more h-points than only two to approximate the temperature gradient. But if it's correct that the distance between two adjacent h-points is 0.01 m, your code looks fine in principle. But you have to use
dT_dh_surface = (temperature_profile(end) - temperature_profile(end-1)) / 0.01;
instead of
dT_dh_surface = (temperature_profile(2) - temperature_profile(1)) / 0.01;
See Also
Categories
Find more on General Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!