Hello,
I am a new user to the pde toolbox. The script I am using is at the bottom of thiis question. If I run the code as it stands, I get the output:
thermalresults =
TransientThermalResults with properties:
Temperature: [8654×11 double]
SolutionTimes: [0 0.5000 1 1.5000 2 2.5000 3 3.5000 4 4.5000 5]
XGradients: [8654×11 double]
YGradients: [8654×11 double]
ZGradients: [8654×11 double]
Mesh: [1×1 FEMesh]
Error using pdeplot3D
Length of colormapdata vector must equal number of nodes.
Error in heatTransfer_v2 (line 33)
pdeplot3D(thermalmodel,"ColorMapData",thermalresults.Temperature(:,end), ...
====================================================================
whereas if I uncomment the alternative pdeplot3D command (commented out below), I get:
========================================================
thermalresults =
TransientThermalResults with properties:
Temperature: [8654×11 double]
SolutionTimes: [0 0.5000 1 1.5000 2 2.5000 3 3.5000 4 4.5000 5]
XGradients: [8654×11 double]
YGradients: [8654×11 double]
ZGradients: [8654×11 double]
Mesh: [1×1 FEMesh]
Error using pdeplot3D
The value of 'colormapdata' is invalid. Operands to the logical AND (&&) and OR (||) operators must
be convertible to logical scalar values. Use the ANY or ALL functions to reduce operands to logical
scalar values.
Error in heatTransfer_v2 (line 29)
pdeplot3D(thermalmodel,"ColorMapData",thermalresults.Temperature, ...
================================================================================
I have looked through the various examples in the pdetoolbox such as here:
but so far I can't see what I need to do.
Thanks in advance
Chris
======================================================================
thermalmodel = createpde('thermal','transient');
pg = importGeometry(thermalmodel,'cylinder3.stl');
pdegplot(thermalmodel,'FaceLabels','on')
ylim([-1,1])
axis equal
thermalProperties(thermalmodel,'ThermalConductivity',1,...
'MassDensity',1,...
'SpecificHeat',1);
thermalBC(thermalmodel,'Face',1,'Temperature',100);
thermalBC(thermalmodel,'Face',5,'HeatFlux',10);
thermalIC(thermalmodel,0);
generateMesh(thermalmodel);
figure
pdemesh(thermalmodel)
title('Mesh with Quadratic Triangular Elements')
tlist = 0:0.5:5;
thermalresults = solve(thermalmodel,tlist)
[qx,qy] = evaluateHeatFlux(thermalresults);
%pdeplot3D(thermalmodel,"ColorMapData",thermalresults.Temperature, ...
% 'FlowData',[qx,qy], ...
% 'ColorMap','hot')
pdeplot3D(thermalmodel,"ColorMapData",thermalresults.Temperature(:,end), ...
'FlowData',[qx(:,end),qy(:,end)], ...
'ColorMap','hot')