- 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.
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!
0 个评论
回答(3 个)
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:
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
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
- In your Simscape model, connect a “Controlled Heat Flow Rate Source” to your Thermal Mass block. (https://www.mathworks.com/help/simscape/ref/controlledheatflowratesource.html )
2. Decide When to “Reset”
- Use Simulink blocks (like a “Pulse 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!
Yifeng Tang
2025-9-3,18:31
Hi @Alexander
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Two-Phase Fluid Library 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!