# Is this the proper way to run a transient simulation on a thermal 3D FEM with the PDE toolbox?

조회 수: 3(최근 30일)
Steven 2018년 9월 25일
편집: Steven 2018년 9월 27일
How can I model a 3d FEM and run a transient simulation?
I've tried this so far and it doesn't seem to work
The real question is how do I run a 3d transient FEM? And view the result this doesn't work.
thermalmodel = createpde('thermal','transient');
gm = multicuboid(1,1,0.5,'ZOffset',0.5);
%if this doesn't work choose your own geometry
thermalmodel.Geometry = gm;
%%%%%%%%%%%%%%%%%%%%%%%GENERATE MESH %%%%%%%%%%%%%%%
% meshsize = 0.4;%mm
meshsize = 4;%mm
generateMesh(thermalmodel,'Hmax',meshsize/1000);
thermalmodel.Mesh
pdemesh(thermalmodel)
htc = vpa(25) *u.Watt/(u.m^2*u.Kelvin);
htc = rewrite(htc,u.Watt/(u.in^2*u.Kelvin));
htc = double(separateUnits(htc));
thermalBC(thermalmodel,'Face',1:thermalmodel.Geometry.NumFaces,...
'ConvectionCoefficient',htc,'AmbientTemperature',288.15);
thermalBC(thermalmodel,'Face',1,'Temperature',50+273);%bottom face
mybc = @(region,state) sin(350*state.time).^2;
thermalBC(thermalmodel,'Face',12,'Temperature',mybc);%top face
tfinal = 6;
tlist = 0:3:tfinal;
thermalIC(thermalmodel,0);
thermalmodel.SolverOptions.ReportStatistics = 'on';
result = solve(thermalmodel,tlist);
figure; pdeplot3D(thermalmodel)
pdeplot3D(thermalmodel,'XYData',T(:,end),...
'Contour','on','ColorMapData',results.Temperature);
title('Temperature in K')
colorbar
pdeplot3D(thermalmodel,'ColorMapData',results.Temperature);
axis equal
title(sprintf('Transient Temperature at Final Time ...
(%g seconds)',tfinal));
##### 댓글 수: 1표시숨기기 없음
Steven 2018년 9월 26일
change the mesh to a larger size if it wont run on your machine

댓글을 달려면 로그인하십시오.

R2018a

### Community Treasure Hunt

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

Start Hunting!

Translated by