Simscape 2P energy conservation bug ?
3 views (last 30 days)
Show older comments
Hello everyone,
I'd like to report something which I think could be a bug ?
I attached a very simple model showcasing the effect presented below.
I have a tank of steam discharging into a translation mechanical converter (so a piston), no heat losses/gains, no friction etc.. It is linked to a spring just so that it reaches an equilibrium after some time.
The piston moves just like expected but the enthalpy and temperature inside it does not: it actually goes higher than the supply !! Whereas initial conditions in the cylinder are colder than the supply.
I can't think of this being possible in real world physics or am I missing something ??
Thanks, have fun !
3 Comments
Yifeng Tang
on 29 Apr 2021
Hi Joris,
This is indeed an interesting case. While I can confirm the "total" energy of the system didn't increase by looking into the simlog data, I too wonder whether the initial temperature and enthalpy jump is physical or just some numerical weirdness. Will follow up.
Accepted Answer
Yifeng Tang
on 1 May 2021
Hi Joris,
After a closer look at the results, it looks like everything was physically reasonable. There was some very quick action that was happening during the first 2e-5 sec and 0.15 sec that created the initial spike in the T_I of the cylinder. In fact, it's more than a simple spike.
0 ~ 2.5e-5 sec: vapor rush into the cylinder (mdot_A), pressure quickly rises (p_I), T_I quick rises because the incoming fluid is doing work to the volume. At this time, there is a huge amount of force applied by the cylinder on the mass because the initial force from the spring is zero. The mass will accelerate quickly.
0 ~ 0.05sec: the mass is accelerated quickly to 30m/s, expanding the cylinder volume. The pressure and temperature drops quickly because mdot_A can't keep up. The net force on the mass crosses zero ~0.035sec as the spring is compressed enough.
0.05 ~ 0.15sec: mass still moving away but slowing down. mdot_A catches up, doing work to the low pressure volume, increasing both the pressure and temperature. Around this time, the spring force starts to match the cylinder force and the volume starts to stablize.
After that, things start to approach steady-state.
During the process, the temperature of the chamber drops a little bit, while also fluctuates according to the sign/direction of mdot_A. That's also where all the energy comes from.
Hope this makes sense.
6 Comments
Yifeng Tang
on 3 May 2021
The pressure and temperature look like they are well-synchronized at first. Both have an initial sharp rise (0-2e-5sec), a drop (0-0.05sec) and another rise (0.05-0.12sec). The drop and second rise has a lot to do with the inertia of the mass, which was dictating the change in the volume, pressure, and mass flow.
After 0.15 sec, the mass is just moving a little bit around equilibrium, so there isn't much of work done by inflow/outflow on the cylinder volume. Because the pressure is also balanced, the extra internal energy, i.e. temperature, can only leave the cylinder by conduction/diffuction through the restriction. That's why it takes a few hundreds of seconds for T_I to get down again.
More Answers (0)
See Also
Categories
Find more on Oil, Gas & Petrochemical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!