Time dependent external heat flux in PDE Toolbox
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Pascal Kobuß
am 21 Nov. 2019
Kommentiert: Ravi Kumar
am 25 Nov. 2019
Dear Community;
i am dealing with an issue with my model of a heat distribution of a cylindrical circular rod. My model is quite similar to https://de.mathworks.com/help/pde/examples/heat-distribution-in-a-circular-cylindrical-rod.html, but i am trying to create a heat flux, which is time-dependent. None of the tutorials or examples is really helpful. Unfortunately i am a beginner with Matlab, so i dont offer much skills in programming.
This is my code for the heatflux at the moment. Right now i am just working with an average heatflux, but i would like to use a time-dependent formula.
y_dach = 600;
n=2;
ts=1/8000; %increment
T=4; %T_max
t=0:ts:T; %timelist
heat = y_dach*sin(2*pi*n*t+pi/2); %Formula i want to use
heatflux_percentage = 0.35;
Positive = heat >0;
heat(~Positive)=0; % only positive values
heatflux = heat/ V_cyl; ,
avg_heatflux=mean(heatflux_percentage*heatflux);
thermalBC(thermalModelT,'Edge',[7,8],'HeatFlux',avg_heatflux)
This is my solver:
tfinal = 50; %tmax
tlist = 0:2:tfinal; %timeincrements
thermalModelT.SolverOptions.ReportStatistics = 'on';
result = solve(thermalModelT,tlist);
T = result.Temperature;
I know that i somehow have to use a function handle with state.time, but i dont know how to use it.
Many thanks in advance!
0 Kommentare
Akzeptierte Antwort
Ravi Kumar
am 21 Nov. 2019
Hi Pascal,
You are on the right track, refer to the externalHeatFlux in the example:
Thought the example is for spatial variaion, you can make your heat flux funciton of time using state.time, state is available to you as second argument.
function Qflux = timeDepHeatFlux(region,state)
if isnan(state.time)
Qflux = nan(size(region.x));
return;
end
% Write you time dependent function here....
end
Regards,
Ravi
4 Kommentare
Ravi Kumar
am 25 Nov. 2019
You should be able to do this in the function. Use state.time to switch from 'on' and 'off' conditions using, if-statement for example.
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!