Unexpected behavior in two-phase pipe model : outlet temperature increases while heat flow is out of the fluid

Hi,
I am currently doing a research internship at I2M (Talence, France) on numerical modeling of energy systems for undergraduate and postgraduate teaching using Simscape. I am a junior mechanical/aerospace engineering student.
We are trying to model a simple case: water vapor flowing in a pipe exposed to an isothermal environment, with possible condensation. Perhaps, we have some very weird behaviors of our Simscape model. What we expected is that at the pipe inlet, we have water vapor at 150°C, 1 atm. The pipe exchanges heat with an ambient environment at T_\infty through the thermal port H (convection + conduction network). If heat transfer is sufficient, we expect:
  1. Superheated vapor cools down to T_{sat}=100°C (isobaric at 1 atm),
  2. During phase change, temperature remains at 100°C while vapor quality decreases from 1 to 0,
  3. Once fully liquid, temperature decreases further toward T_\infty (depending on heat transfer magnitude and pipe length).
This behavior is reproduced with a simple MATLAB 1D model (attached to this ticket).
Our Simscape model setup is :
  • Pipe (2P) block
  • Inlet side connected to Reservoir (2P) set to 1 atm and T_{in}=150°C
  • Outlet side connected to Reservoir (2P) set to 1 atm and T_{out}=T_{in}=150°C (we also tested Controlled Reservoir (2P) and Constant Volume Chamber (2P))
  • Flow driven by a Mass Flow Rate Source (2P) (imposed \dot{m})
  • Thermal interaction: the pipe thermal port H is connected to an external thermal network representing ambient temperature T_\infty (Convection and conduction are all ready modeled with the Pipe (2P) block)
When plotting outlet temperature and vapor quality versus time, we observe non-physical results. For example:
  • The fluid temperature at the outlet sometimes increases, even though the measured heat flow from the pipe to the environment is negative (i.e., heat leaving the fluid/pipe toward the ambient).
  • Changing the outlet boundary block (Reservoir vs Controlled Reservoir vs Constant Volume Chamber) changes the behavior, but the results remain very weird.
  • Using a Reservoir (2P) at the outlet requires specifying a temperature, which is confusing for this application since the outlet temperature should be determined by the model. Moreover, changing this outlet reservoir temperature leads to very different and sometimes non-physical results.
Our questions are :
  1. What is the recommended boundary condition setup for a two-phase pipe open to atmosphere when the outlet temperature should be computed, not imposed?
  2. Is Reservoir (2P) an appropriate outlet boundary for this type of problem, or should we use another block (e.g., constant volume, controlled reservoir, etc.)?
  3. Have we correctly understood how to modelise the heat transfer between the pipe and the environment to ensure consistent energy balance and physically correct condensation behavior?
PS : Please run the MATLAB file first. Both files share the same workspace.
Thank you for your help.
Best regards,
Enzo COMBAUD--NIETO
I2M – Talence, France

 Accepted Answer

Hi Enzo,
It is possible to build an Rankine Cycle in Simscape: Rankine Cycle (Steam Turbine) - MATLAB & Simulink Other customers have successfully used this model to get started on their more detailed systems.
The time to equilibrium depends on the size of the pipe. In your case it's 100 m long, and 10 cm in diameter, with a flow rate of 2 g/s. That flow rate is pretty slow given the diamter. If so, diffusion would dominate over bulk flow. Smaller diameters/port areas may help. See this link on port areas. You want the flow to be turbulent for good heat transfer, right now it's probably laminar in the Simscape model.
HTH,
Erin

4 Comments

With your advice, I have changed my mass flow rate to 0.2kg/s, but also I've changed the 3-Zone Pipe (2P) to the Pipe (2P), adding a conductive and convective block.
Two things very strange are that this new model doesn't do the same things as the previous model. For example, with the files I'm giving with this answer, I have an exit temperature of 100°C (T_sat at 1 atm) and 10^-5 of the quality of vapor. My MATLAB model gives me 0 of the quality of vapor and 78°C at 100m, so we are close but not totally. Sadly, I think that the Simscape model doesn't want to cool the fluid because we still have a very small fraction of vapor.
What do you think about that ? Any new idea ?
Hi Enzo,
The model you sent still only flows at 2 g/s. Not sure, maybe you didn't save it?
You can see the difference between the 3-Zone Pipe and the Pipe by reading the docs. Essentially, the former uses a boundary following model to track the VLE states within the pipe, and the latter provides a mean field approximation. To use the latter, you may want to break it up into segments, especially since it's 100 m long. A segmented pipe would allow you to have different values of x along the length.
Depending on your purpose, you can choose the appropriate pipe model to use. Without context it's hard to provide further advice.
HTH,
Erin
Hello back @Erin McGarrity, sorry for this late answer.
Thank you for taking your time to help me. Now, I understand the main difference between both blocks.
I decided that for main purpose, the best choice is to use the Pipe (2P) block divided into segments, so I connected 10 pipes where each pipe has a length of L/10. I tried again to simulate that easy problem on Simscape but I'm still in trouble. This really annoys me because I would like to finish this problem before working on another. I am attaching to this answer my model.
Do you mind modeling a simple Simscape model that illustrates what I want to do if you have enough free time ?
Thank you again @Erin McGarrity.
Hi Enzo,
Unfortunately, I can't make and post models for this forum for various reasons. I suggest you poke around in the documentation. There is an example that vaporizes fluid in a segmented pipe here:
HTH,
Erin

Sign in to comment.

More Answers (1)

Hi Enzo,
Try extending the simulation time for your model to 3600 s. I believe this will produce the expected result (outlet temp asymptotes to slightly above T_infty -- see plot below.). As a debugging tool, I suggest you turn on the Simscape Results Explorer. This tool will let you examine the states inside the pipe.
Another thing I noticed is that your Flow Rate Source (2P) is set to Isentropic, which means it will raise the fluid temperature isentropcally. You may want to set that to "None".
HTH,
Erin

1 Comment

Hi @Erin McGarrity, thank you for your reply.
Sadly, I changed the "Power added" parameter of my "Flow Rate Source (2P)" from "Isentropic" to "None" but my problem still happens.
If I take a big time of simulation like five thousand seconds or one hour like you said, I converge to an outlet temperature of 22.13°C, almost at my environment temperature. But the problems are that this result from Simscape is only available for a mass flow rate of 0.1 kg/s and my MATLAB model tells me that my outlet temperature will be 44.26°C.
One thing very weird is that if you simulate with a mass flow rate of 1 kg/s, the outlet temperature of my SIMSCAPE model is at T_sat (here 100°C) and the quality of vapor is at 60%, as well as my MATLAB model that tells me that the outlet will be at 100°C and 55% of quality of vapor (it's a reasonable margin of error).
I can do many assumptions with this : or my MATLAB model is false (I didn't work on the flow of a fluid with phase changes so it may be that), or my SIMSCAPE model has a problem that can be solved only if I increase the mass flow rate above 1 kg/s.
Do you have an idea of what I can do next ? I need fix this model to build a realistic Rankine Cycle.

Sign in to comment.

Products

Release

R2025a

Community Treasure Hunt

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

Start Hunting!