PDE thermal model with internal heat sources as a function of temperature

13 visualizzazioni (ultimi 30 giorni)
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?

Risposte (2)

Tadeu Fagundes
Tadeu Fagundes il 12 Feb 2020
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 Commenti
Urban Simoncic
Urban Simoncic il 13 Feb 2020
Exactly, you can use location, but not the state. But I found a solution for my problem. I wanted to have an internal heat source LINEARLY proportional to the local temperature and that can be done by solving general PDE in Matlab and setting appropriate terms to 0.
Diego
Diego il 1 Mag 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.

Accedi per commentare.


Bradley
Bradley il 3 Ott 2023
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.

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by