3D Transient Thermal Model Colormap Error

I am trying to create a 3D transient thermal model to view a laser heating process using the following code:
k = 0.15; %W/(m*K)
cp = 1.46*1000; %J/(kg*K)
rho = 0.97; %kg/m^3
Pulse_freq = 30000; %Hz or pulses/second
pulse_width = 20; %ns/pulse
curing_depth = 200; %um
w0 = 45; %um
T = .96; %Transparency rate
Temp_i= 25; %C
Area_laser = pi*w0^2; %um^2
Area_m2 = Area_laser/((10^6)^2); %m^2
P_actual = 8; %W
P_T = P_actual*T; %W = J/s
P_area = P_T/Area_m2; %W/m^2 = J/(s*m^2)
Period = 96.2; %ms
Signal_length = Period/2; %ms
Num_Pulses = Pulse_freq*Signal_length*.001; %pulses
Time_Laser = Num_Pulses*pulse_width/10^6; %ms
Time = Time_Laser/1000; %s
%%Create Thermal Model
thermalmodel = createpde('thermal','transient');
importGeometry(thermalmodel,'voxel.STL')
figure
pdegplot(thermalmodel,'FaceLabels','on');
%%Boundary and Initial Conditions
thermalBC(thermalmodel,'Face',[1,3,4,5,6,7,8,10],'HeatFlux',0);
thermalProperties(thermalmodel,'ThermalConductivity',k,'MassDensity',rho,'SpecificHeat',cp);
thermalBC(thermalmodel,'Face',9,'HeatFlux',P_area); %Laser Energy application
thermalIC(thermalmodel,Temp_i);
%%Mesh
generateMesh(thermalmodel,'Hmax',0.01);
figure
pdeplot3D(thermalmodel)
%%Solve
tfinal = Time;
tlist = 0:0.00000001:tfinal; %Account for small time of laser application
thermalmodel.SolverOptions.ReportStatistics = 'on';
results = solve(thermalmodel,tlist);
T = results.Temperature;
%%Visualize
pdeplot3D(thermalmodel,'colormapdata',T)
I receive the following error when trying to run the code:
Error using pdeplot3D (line 94)
The value of 'colormapdata' is invalid. Operands to the || and && operators must be convertible to
logical scalar values.
Error in Debugging (line 52)
pdeplot3D(thermalmodel,'colormapdata',T)
The voxel.STL file is a simple cylinder, and the code file is attached. What is the cause of the error?

1 Comment

You should use
pdeplot3D(thermalmodel,'ColorMapData',T(:,length(tlist)))
instead of
pdeplot3D(thermalmodel,'colormapdata',T)
(this is using for steady state analysis type)

Sign in to comment.

Answers (0)

Asked:

on 18 Jul 2017

Edited:

on 30 Dec 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!