PDE thermal model with internal heat sources as a function of temperature
Afficher commentaires plus anciens
For the steady state heat transfer model I want to specify internal heat source as a function of local temperature. I tried as:
internalHeatSource(myPde, @(location, state) A*((interpolateTemperature(state.u, [location.x; location.y; location.z]))' - Tb), 'cell', 11);
but when I try to solve the model, I get an error:
Function specifying a heat source must accept two
input arguments and return one output argument.
Perhaps I have to somehow transform state.u to thermalresults form. Can you explain me how to properly do that?
Réponses (2)
Tadeu Fagundes
le 12 Fév 2020
1 vote
I have the same issue. It seems like if you only use the location input, it works fine. But anything using the state input gives me the same error.
2 commentaires
Urban Simoncic
le 13 Fév 2020
Diego
le 1 Mai 2020
Same issue. I have been looking around, but I can't find an answer for this problem. I have been trying to simulate the steady state of a curing process inside a heated die and I can’t progress because of this problem with a temperature dependent internal heat source.
Bradley
le 3 Oct 2023
0 votes
I might have something for this... after many hours of trial and error.
For my model, I created an anonymous function as you did. In my model, I have a temperature minimum which will trigger the internal heat generated to switch between 0 and whatever my net heat value is for the system.
Q_int = @(location,state) myInternalHeat(TemperatureMin,HeatParams,state.u);
TemperatureMin is a double, and HeatParams is a structure containing Q_net.
Then, myInternalHeat works like this:
function Q_int = myInternalHeat(TemperatureMin,HeatParams,state)
mean_temp = mean(state);
if mean_temp <= TemperatureMin
Q_int = zeros(size(state));
else
Q_int = zeros(size(state)) + HeatParams.Q_net;
end
end
It was important to keep Q_int the same size as state so it would actually read and return correctly. From there, I assigned my internal heat with the normal internalHeatSource function. From their documentation here it seems that the form of your function must follow the two in, one out format.
Catégories
En savoir plus sur Heat Transfer dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!