How to reset the temperature of a Simscape Thermal Mass block at a specific time?

45 次查看(过去 30 天)
Hi,
I’m working on simulating the cooling system of an iron casting process. Right now, the hot cast pipes are represented as Thermal Mass blocks that cool down over time.
What I’d like to do is reset the temperature of a Thermal Mass after a certain time, to represent a new hot pipe being introduced.
At the moment, I simulate one pipe at a time and then export/import the last values of the cooling system for the next pipe. This works fine for a single centrifugal casting. However, in reality, i have several of them running parallel with different cooling times.
Is there a straightforward way to reset the state/temperature of a Simscape block at a given time, or do I need to handle this with an additional Simulink block?
Thanks in advance!

回答(3 个)

sanidhyak
sanidhyak 2025-9-1,9:58
I understand that you are trying to reset the temperature of a Simscape “Thermal Mass” block at a specific time in order to simulate the introduction of a new hot pipe. At the moment, the “Thermal Mass” block does not provide a direct way to reset its internal temperature state. However, this behavior you can achieve by adding auxiliary Simscape components or by defining some custom block.
When I tested a scenario similar to yours, I found that the most simplest approach is to use an “Ideal Heat Flow Source” driven by a Simulink signal. This will allow you to inject or remove the required amount of heat to bring the “Thermal Mass” to the desired temperature whenever the reset time is reached.
Kindly refer to the following implementation:
% Parameters:
% Cth - Thermal mass heat capacity [J/K]
% Treset - Desired reset temperature [K]
% Tcurr - Measured temperature [K] (via Temperature Sensor)
% Heat flow needed to reset
Q = (Treset - Tcurr) * Cth * (time >= something);
In this setup:
  • We will use “Temperature Sensor” to measure the current block temperature.
  • The signal “Q” is fed into the “Ideal Heat Flow Source”, which connects to the “Thermal Mass”.
  • The conditional (“time >= 50”) will make sure that the reset occurs only at the specified simulation time.
Alternatively, if you prefer a reusable solution, you may implement a custom Simscape component where the block accepts a “resetTrigger” and “Treset” input. Whenever the trigger is active, the block enforces the specified temperature, otherwise it behaves like a standard "Thermal Mass".
For further reference on modeling with Simscape custom components, please see the following documentation:
Cheers & Happy Modeling!

Shivangi
Shivangi 2025-9-1,10:08
Hi Alexander Zeller,
I understand that the issue is the need to simulate the cooling system of an iron casting process, where hot cast pipes are represented as Thermal Mass blocks in Simscape.
Simscape blocks like the Thermal Mass do not let you directly reset their temperature while the simulation is running. Once the simulation starts, the initial temperature is fixed, and there is no simple button or input to change it mid-way. (https://www.mathworks.com/help/simscape/ref/thermalmass.html#refsect-extended-capabilities )
Instead of resetting the temperature directly, you can add or remove heat to get the temperature you want.
The most practical and widely used method is to use additional Simulink blocks to control the reset behaviour:
1. Add a Heat Source
2. Decide When to “Reset”
  • Use Simulink blocks (like aPulse Generator) to create a signal that “turns on” at the time you want to introduce a new hot pipe.
3. Figure Out How Much Heat You Need
  • When your reset signal triggers, you want to add just enough heat to bring the pipe up to the starting temperature.
4. Apply the Heat Quickly
  • Use a Simulink Function block to apply this heat over a very short time.
5. Repeat for Multiple Pipes
  • If you have multiple pipes cooling in parallel, just set up this logic for each one, with their own reset times.
Hope this solves your query!
  1 个评论
Alexander
Alexander 2025-9-4,7:06
Hi Shivangi,
thank you for your detailed solution. This is quite similar to the workaround I’m currently using. I’m working with historical data from a real-life plant and have a dataset that contains the production time of each pipe. I use this timeline as a signal source and trigger a new heat flow into the system for each pipe (essentially like a pulse signal). At the same time, the temperature of the thermal mass is measured. When a new pipe enters, I subtract the remaining temperature from the incoming one to calculate the required heat flow.
In addition, I vary the weight of the thermal mass and adjust the conductivity to simulate different pipe sizes and molds.

请先登录,再进行评论。


Yifeng Tang
Yifeng Tang 2025-9-3,18:31
Maybe this setup will do what you want. I attached a proof-of-concept model.
A thermal mass is heated by a heat flow rate source (1000W). It's also connected to a temperature source at 30 degC, via a thermal resistance. The thermal resistance value is very high most of the time, so there is almost no heat flow out of the thermal mass. Every 20 second, for a short period of time, the thermal resistance is dropped to almost zero, and the temperature source will try to heat/cool the thermal mass to 30 degC. If the thermal resistance is small enough, the temperature will essentially be reset to 30. See below.
Hope this helps.
  1 个评论
Alexander
Alexander 2025-9-4,7:09
Hello Yifeng Tang,
Thank you for your solution. Using a changing thermal resistance is an interessting approach. Maybe i will implement that in my model.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Two-Phase Fluid Library 的更多信息

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by