thermalmodel = createpde('thermal','transient');
importGeometry(thermalmodel,'heatsink.stl');
pdegplot(thermalmodel,'FaceLabel','on','FaceAlpha',0.5);
axis equal
generateMesh(thermalmodel,'Hmax',0.4);
figure;
pdeplot3D(thermalmodel);
TCval = @(location,state)139.3 + 0.204*state.u;
MDval = 2770;
SHval = 875;
ATval = 25;
CCval = 30;
REval = 0.77;
thermalmodel.StefanBoltzmannConstant = 5.670373E-8;
faces = [1,3:30];
thermalProperties(thermalmodel,'ThermalConductivity',TCval,'MassDensity',MDval,'SpecificHeat',SHval);
thermalBC(thermalmodel,'Face',faces,'ConvectionCoefficient',@(region,state)CCval,'AmbientTemperature',ATval);
thermalBC(thermalmodel,'Face',faces,'Emissivity',@(region,state)REval,'AmbientTemperature',ATval);
thermalBC(thermalmodel,'Face',2,'ConvectionCoefficient',5,'AmbientTemperature',ATval);
thermalBC(thermalmodel,'Face',2,'Emissivity',0.1,'AmbientTemperature',ATval);
thermalIC(thermalmodel,60);
tlist= [0:10];
thermalTransientResults = solve(thermalmodel,tlist);
pdeplot3D(thermalmodel,'ColorMapData',thermalTransientResults.Temperature(:,10))