Evaporator heat-flow reversed in refrigerant loop model (Simscape)

Hello everyone,
I’m currently modeling a refrigerant test loop in Simscape. The flow path is:
High-pressure reservoir → condenser → short pipe → valve (TXV or EXV) → short pipe → evaporator → low-pressure reservoir. All parameters are set to realistic values (pressures, diameters, temperatures, etc.).
The issue I’m facing is that the evaporator appears to be removing heat from the refrigerant instead of adding it, the temperature at port B is higher than at port A, even though the evaporator’s ambient is hotter. This causes downstream effects such as superheat decreasing when the valve closes, which is the opposite of physical behavior. Meanwhile, the condenser behaves correctly (temperature drops from port A → B as it rejects heat). Has anyone seen this before or know why the evaporator heat direction might flip in Simscape?

5 Commenti

Hi @Aiden,

I took a close look at your block diagram screenshot and went through your comments, then dug into the Simscape Two-Phase Fluid documentation to figure out what's going on with your evaporator.

Your evaporator temperature behavior (T_B > T_A) is totally normal! Refrigerant enters at saturation temperature and leaves superheated, so temperature naturally rises as heat is absorbed. Heat is flowing in correctly and the temperature rise is what should happen when refrigerant evaporates and superheats.

The problem is the superheat decreasing when you close the valve. This is most likely because:

  • You're calculating superheat wrong (using T_B - T_A instead of T_B - T_sat)
  • Or you're seeing transient pressure effects
  • Or there's thermal lag in your system
  • Or maybe your thermal boundary connections are backwards

Next steps:

1. Add a Saturation Properties Sensor at the evaporator inlet 2. Calculate superheat properly: T_outlet - T_sat(P_inlet) 3. Monitor through valve transients and check steady-state behavior 4. Verify your thermal boundary conditions are hooked up right

Once you add those sensors and check the actual superheat calculation, let me know what you see. If it's still decreasing when the valve closes (after reaching steady state), then we can dig deeper into the dynamics.

Hi Umar,
Thanks you very much for the detailed reply earlier that helped me narrow this down.
I’m building a valve-test simulation that eventually needs to run a superheat control loop for an electronic expansion valve (EXV). The final version will use Two-Phase Fluid, but I’m prototyping the control structure with Thermal Liquid for stability and speed.
Here’s what I’m seeing:
  • The Two-Phase model behaves with no problem, refrigerant (two-phase) inlet at saturation, outlet slightly superheated (T_out > T_in).
  • For the Thermal Liquid version shows the opposite: T_in > T_out even though the heat-transfer direction is the same and the valve & boundaries are identical.
  • Superheat calculation (T_out − T_sat(P_out)) only makes sense in the Two-Phase case; in Thermal Liquid there’s no phase-change reference, so the control signal doesn’t behave physically.
I'm having hard time attaching my model and parameter, but here is a github link to the model (https://github.com/AltoAuto/Daikin-.git). Would you mind taking a quick look and confirming whether this behavior is expected from the Thermal-Liquid library, or if there’s a workaround to mimic an evaporator-like temperature rise?
The goal is to verify if my controller structure can be validated in Thermal Liquid before I migrate it to the Two-Phase library. Thank you for your time please let me know if the model opens correctly or if you prefer a stripped-down version with only Simscape blocks and no configuration script.
Best regards,
Aiden

Hi @Aiden,

Thanks for the update and glad my earlier comments helped you narrow this down.

What you’re seeing fits well with how the Two-Phase Fluid and Thermal Liquid libraries work:

  • The Two-Phase Fluid model captures phase change and saturation, so it’s expected that the outlet temperature is higher than the inlet due to superheating as the refrigerant absorbs heat and evaporates.
  • The Thermal Liquid model, however, does *not*model phase changes or saturation. Because of that, it’s normal for the outlet temperature to be lower than the inlet, even though heat transfer direction is the same. Since it’s simulating a single-phase fluid, the temperature behaves differently compared to the two-phase refrigerant.

This means superheat calculations only make sense for the Two-Phase model. Using superheat in Thermal Liquid won’t give physically meaningful results, so control signals based on that may behave unexpectedly.

I tried to open your GitHub model, but I don’t have Simulink access to inspect the .slx files directly. If you can share a simplified version — maybe just the screenshot of Simscape blocks without the configuration scripts — or a MATLAB-only representation, I’d be happy to take a closer look and help suggest how to approximate evaporator-like temperature rise in the Thermal Liquid model. This would help you validate your controller before migrating fully to the Two-Phase Fluid library.

Let me know what you think!

I agree with Umar that you'll need to use the Two-Phase Fluids domain to model your system.
I happened to notice this Reddit post and I suppose that's from @Aiden, too? As one of the comments mentioned:
"Based on the screenshot, the model is using the thermal liquid (TL) domain. However, to model a refrigeration system, one will need to use the two-phase fluids (2P) domain. Only in the 2p domain, the pressure drop through the expansion valve will result in phase change into the mixture regime. Suggestion: rebuild a model in the 2P domain. It shouldn't take long since the model already has most of the parameters."
@Umar Feel free to copy your comments into the Answer section.
Yes, that's exactly right, thanks for the thoughtful breakdown! Two-Phase Fluids works well for our case.

Accedi per commentare.

 Risposta accettata

Hi @Aiden,

Thanks for the update and glad my earlier comments helped you narrow this down.

What you’re seeing fits well with how the Two-Phase Fluid and Thermal Liquid libraries work:

The Two-Phase Fluid model captures phase change and saturation, so it’s expected that the outlet temperature is higher than the inlet due to superheating as the refrigerant absorbs heat and evaporates. The Thermal Liquid model, however, does *not*model phase changes or saturation. Because of that, it’s normal for the outlet temperature to be lower than the inlet, even though heat transfer direction is the same. Since it’s simulating a single-phase fluid, the temperature behaves differently compared to the two-phase refrigerant. This means superheat calculations only make sense for the Two-Phase model. Using superheat in Thermal Liquid won’t give physically meaningful results, so control signals based on that may behave unexpectedly.

I tried to open your GitHub model, but I don’t have Simulink access to inspect the .slx files directly. If you can share a simplified version — maybe just the screenshot of Simscape blocks without the configuration scripts — or a MATLAB-only representation, I’d be happy to take a closer look and help suggest how to approximate evaporator-like temperature rise in the Thermal Liquid model. This would help you validate your controller before migrating fully to the Two-Phase Fluid library.

Let me know what you think!

Più risposte (0)

Categorie

Prodotti

Release

R2025b

Tag

Richiesto:

il 21 Ott 2025

Commentato:

il 28 Ott 2025

Community Treasure Hunt

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

Start Hunting!

Translated by