%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % FILE: heat2d.m % PURPOSE: a code that can eventually solve heat transport % in 2d with fixed velocity distribution %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% set(0,'DefaultAxesFontName','Times New Roman') set(0,'DefaultAxesFontSize',15) clear * close all Substance = 1; % 1=air 2=water if(Substance == 1) MyFile = 'AirBox.mat'; % give name of the file to save data in elseif(Substance == 2) MyFile = 'WaterBox.mat'; % give name of the file to save data in end TotalSimuTimeSeconds = 1; % how many seconds to simulate ? myBC = 4; GeometricalDetails; ThermodynamicalDetails; FluidDynamicalDetails; dxmin = min(dx,dy); dt = 0.01e-3; TotalSimuTimesteps = round(TotalSimuTimeSeconds/dt); giveInfo; setTBCs; for(t=1:TotalSimuTimesteps) setTBCs; solveTemperature; visualizeResults; end save(MyFile, 'T', 'U', 'X', 'Y', 'Lx', 'Ly', 'alpha', 'k', 'rho', 'cp', 'iny','inx');