Open hmdnt opened 10 months ago
If parameter alpha is != 0, the heat flow is multiplied by (1 + alpha*(port.T - T_ref)) in order to simulate temperature dependent losses (which are given with respect to reference temperature T_ref).
In Modelica it works with alpha=0. Here, for alpha=0, the correct solution is that the 7th equation should no be here at all, and wall.port_b.T has to be determined from the heat flow, the resistance and wall.port_a.T.
I see this more as an issue with the observed generation.
Yes I know that MSL defines this the way it is. May be as you said there is a problem with observed generation. But defining a temperature dependent heat flow for a fixed heat source is illogical unless MTSL is going to be an exact replica of MSL.
Here is an MWE that shows this:
The last line gives the following error:
The problem stems from the temperature dependence of the heat flow implemented in
Thermal.FixedHeatFlow
.observed(sys)
gives the following list for the observed variables.The culprit is the 7th equation in which
alpha
is in denominator and for constant heat source is zero. Also if the source is modeling an insulated point whereQ_flow = 0
, the same symptom occurs regardless of the value ofalpha
.The remedy is to correctly define the
Thermal.FixedHeatFlow
equation asport.Q_flow ~ -Q_flow
and ditch the temperature dependence, which is meaningless for a fixed heat flow source anyway. Note that the same argument applies toThermal.PrescribedHeatFlow
for which the correct equation should beport.Q_flow ~ -Q_flow.u
.PS. I know that Modelica Standard Library defines the above sources the same way that they are currently implemented in ModelingToolkit Standard Library, but I think the correct way to define them is as discussed above. When a temperature dependent heat flow source is desired, it can be achieved by combining
Thermal.PrescribedHeatFlow
,Thermal.TemperatureSensor
and some function block.