modelDynamicTwoPhaseFlowPipe

Dynamic two-phase flow pipe
Diagram of DynamicTwoPhaseFlowPipe

Information

## Copyright © EDF 2002 - 2026   
## ThermoSysPro Version 4.2  
This component model is documented in Sect. 9.4.2 of the ThermoSysPro book.   
# Dynamic two phase flow pipe  

This component is a tube bundle, one of the three parts composing a shell-and-tube heat exchanger.  
The component represents a two-phase fluid flowing inside the bundle and exchanging heat with the wall.  
The conduction inside the wall is represented in the associated model [Heat exchanger wall](modelica://ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall).  

The model of the tube bundle relies on several assumptions:  
- the fluid is homogeneous in each mesh cell (i.e. same velocity for both liquid and steam phases),  
- mass accumulation is considered in each mesh cell,  
- the inertia of the fluid is taken into account,  
- the longitudinal heat conduction in the metal wall and in the fluid is neglected,  
- the thermophysical properties are calculated via the average pressure and enthalpy in each cell.  

## Modelica component model  

The equations mentioned below are implemented in the component *DynamicTwoPhaseFlowPipe*, located in the *WaterSteam.HeatExchangers* sub-library.  
This component has 3 connectors:  
- C1: fluid inlet,  
- CTh: thermal connector,  
- C2: fluid outlet.  

![modelica://ThermoSysPro/UsersGuide/Documentation/ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe.svg](modelica://ThermoSysPro/UsersGuide/Documentation/ThermoSysPro.WaterSteam.HeatExchangers.DynamicTwoPhaseFlowPipe.svg)  

## Nomenclature  


| Symbol          | Description                                                         | Unit                          | Definition                                | Modelica name |  
|---------------- |------------------------------------------------------------------ |----------------------------- |------------------------------------------------------ | :----------- |  
| \\( A \\) | Internal cross section of the pipe bundle | \\( \mathrm{m^2} \\) | \\( N_t \cdot \pi \cdot D^2 / 4 \\) | A |  
| \\( D \\) | Internal diameter of one pipe | \\( \mathrm{m}\\) | | D |  
| \\( D_t \\) | Sum of the internal diameter of the pipes in the bundle | \\( \mathrm{m} \\) | \\( N_t \cdot D  \\) | - |  
| \\( h\_{c,i} \\) | Convective heat exchange coefficient  in thermal cell *i* | \\( \mathrm{W/m^2/K} \\) || hi[i] |  
| \\( h_i \\) | Fluid specific enthalpy in thermal cell *i* | \\( \mathrm{J/kg} \\) | | h[i] |  
| \\( h\_{i:i+1} \\) | Fluid specific enthalpy of the mass flow  \\( \dot{m}\_{i:i+1} \\) at the boundary between thermal cells *i* and *i+1* | \\( \mathrm{J/kg} \\) | | hb[i] |  
| \\( L \\) | Pipe length | \\( \mathrm{m} \\) | | L |  
| \\( \dot{m}_{i:i+1} \\) | Mass flow rate crossing the boundary between cells *i* and *i+1*,  oriented positively from *i* to *i+1* | \\( \mathrm{kg/s} \\) | | Q[i] |  
| \\( N \\) | Number of hydraulic cells equal to the number of  thermal cells plus one | - | | N + 1 |  
| \\( N_t \\) | Number of pipes in parallel | - | | ntubes |  
| \\( P_i \\) | Fluid pressure in thermal cell *i* | \\( \mathrm{Pa} \\) | | P[i] |  
| \\( T_i \\) | Fluid temperature in thermal cell *i* | \\( \mathrm{K} \\) | | T1[i] |  
| \\( T\_{w,i} \\) | Wall temperature in thermal cell *i* | \\( \mathrm{K} \\) | | Tp1[i] |  
| \\( T_m \\) | Melting temperature of the metal tubes | \\( \mathrm{K} \\) | | - |  
| \\( u_i \\) | Specific internal energy in thermal cell *i* | \\( \mathrm{J/kg} \\) | | - |  
| \\( V_i \\) | Volume of thermal cell *i* | \\( \mathrm{m^3} \\) | \\( A \cdot \Delta x_1 \\) | - |  
| \\( z_i \\) | Inlet altitude of hydraulic cell *i:i+1* | \\( \mathrm{m} \\) | | - |  
| \\( z_{i+1} \\) | Outlet altitude of hydraulic cell *i:i+1 | \\( \mathrm{m} \\) | | - |  
| \\( \alpha \\) | Corrective term for the heat exchange  coefficient \\( h\_{c,i} \\) for each thermal cell | - | | - |  
| \\( \Delta A_i \\) | Internal heat exchange area for thermal cell *i* | \\( \mathrm{m^2} \\) | \\( \pi \cdot D \cdot \Delta x_1 \\) | dSi |  
| \\( \Delta W_i \\) | Thermal power exchanged in the water side  for thermal cell *i* | \\( \mathrm{W} \\) | | dW1[i] |  
| \\( \Delta x_1\\) | Length of a thermal cell | \\( \mathrm{m} \\) | \\( L/(N-1) \\)| dx1 |  
| \\( \Delta x_2\\) | Average length of a hydraulic cell | \\( \mathrm{m} \\) | \\( L/N \\) | dx2 |  
| \\( (\Delta P)\_{i:i+1}^a \\) | Advection pressure loss in hydraulic cell *i:i+1*  when fluid flow from *i* to *i+1* | \\( \mathrm{Pa} \\) | | dpa[i] |  
| \\( (\Delta P)\_{i:i+1}^f \\) | Friction pressure loss in hydraulic cell *i:i+1*  when fluid flow from *i* to *i+1* | \\( \mathrm{Pa} \\) | | dpf[i] |  
| \\( (\Delta P)\_{i:i+1}^g \\) | Gravity pressure loss in hydraulic cell *i:i+1*  when fluid flow from *i* to *i+1* | \\( \mathrm{Pa} \\) | | dpg[i] |  
| \\( \zeta \\) | Corrective term for the friction pressure loss for each cell| - | | dpfCorr |  
| \\( \Lambda\_{i:i+1} \\) | Friction pressure loss coefficient in cell *i:i+1* | - || khi[i] |  
| \\( \rho_i \\) | Fluid densitiy in thermal cell *i* | \\( \mathrm{kg/m^3} \\) | | rho1[i] |  
| \\( \rho\_{i:i+1} \\) | Fluid densitiy in hydraulic cell *i:i+1* | \\( \mathrm{kg/m^3} \\) | | rho2[i] |  
| \\( \Phi_{lo}^2\\) | Lockhart and Martinelli corrective coefficient | || Xtt[i] |  


## Governing equations  

The tube bundle is modeled as \\(N_t\\) instances of the same tube.  


### Dynamic mass balance equation  

- Validity domain:   
   
 \\( \forall \dot{m}\_{i:i+1} \\)  

- Mathematical formulation:  

$$ A \cdot \left[ \left(\frac{\partial \rho_i}{\partial P_i} \right)\_h \cdot \frac{\mathrm{d} P_i}{\mathrm{d} t} + \left(\frac{\partial \rho_i}{\partial h_i} \right)\_P \cdot \frac{\mathrm{d} h_i}{\mathrm{d} t} \right] \cdot \Delta x_1 = \dot{m}\_{i-1:i} - \dot{m}\_{i:i+1} $$  

- Comments:  

This equation uses the expansion of the derivative of the density using \\( P \\) and \\( h \\) as state variables:  

$$ \frac{\partial \rho_i}{\partial t} = \left(\frac{\partial \rho_i}{\partial P_i} \right)\_h \cdot \frac{\mathrm{d} P_i}{\mathrm{d} t} + \left(\frac{\partial \rho_i}{\partial h_i} \right)\_P \cdot \frac{\mathrm{d} h_i}{\mathrm{d} t} $$  



### Static mass balance equation  

- Validity domain:   
   
 \\( \forall \dot{m}\_{i:i+1} \\) and the fluid is incompressible  

- Mathematical formulation:  

$$ 0 = \dot{m}\_{i-1:i} - \dot{m}\_{i:i+1} $$  

- Comments:  

This equation uses \\( \frac{\partial \rho_i}{\partial t} = 0 \\) as the fluid is incompressible.   


### Energy balance equation  

- Validity domain:   
   
 \\( \forall \dot{m}\_{i:i+1} \\)  

- Mathematical formulation:  

$$ A \cdot \left[ \left(h_i \cdot \frac{\partial \rho_i}{\partial P_i} - 1 \right) \cdot \frac{\mathrm{d} P_i}{\mathrm{d} t} + \left(h_i \cdot \frac{\partial \rho_i}{\partial h_i} + \rho_i \right)\_P \cdot \frac{\mathrm{d} h_i}{\mathrm{d} t} \right] \cdot \Delta x_1$$$$ = \dot{m}\_{i-1:i} \cdot h\_{i-1:i} - \dot{m}\_{i:i+1} \cdot h\_{i:i+1} + \Delta W_i $$  

- Comments:  


### Incompressible flow energy balance equation  

- Validity domain:   
   
 \\( \forall \dot{m}\_{i:i+1} \\) and the fluid is incompressible  

- Mathematical formulation:  

$$ A \cdot  \left(\rho_i \cdot \frac{\mathrm{d} h_i}{\mathrm{d} t} - \frac{\mathrm{d} P_i}{\mathrm{d} t} \right) \cdot \Delta x_1 = \dot{m}\_{i-1:i} \cdot h\_{i-1:i} - \dot{m}\_{i:i+1} \cdot h\_{i:i+1} + \Delta W_i $$  

- Comments:  

This equation is derived from the latter with \\( \frac{\partial \rho_i}{\partial P_i} = \frac{\partial \rho_i}{\partial h_i} = 0 \\) as the fluid is incompressible.  


### Simple incompressible flow energy balance equation  

- Validity domain:   
   
 \\( \forall \dot{m}\_{i:i+1} \\) and the fluid is incompressible  

- Mathematical formulation:  

$$ A \cdot  \rho_i \cdot \frac{\mathrm{d} h_i}{\mathrm{d} t} \cdot \Delta x_1 = \dot{m}\_{i-1:i} \cdot h\_{i-1:i} - \dot{m}\_{i:i+1} \cdot h\_{i:i+1} + \Delta W_i $$  

- Comments:  

This equation neglects the pressure derivative in the latter.  


### Dynamic momentum balance equation  

- Validity domain:   
   
 \\( \forall \dot{m}\_{i:i+1} \\) and the fluid is incompressible  

- Mathematical formulation:  

$$ \frac{1}{A} \cdot \frac{\mathrm{d} \dot{m}\_{i:i+1}}{\mathrm{d}} \cdot \Delta x_2 = P\_i - P\_{i+1} - (\Delta P)\_{i:i+1}^a - (\Delta P)\_{i:i+1}^f - (\Delta P)\_{i:i+1}^g  $$ with:  

$$ (\Delta P)\_{i:i+1}^a = \frac{\dot{m}\_{i:i+1} \cdot  | \dot{m}\_{i:i+1} |}{A^2} \cdot \left( \frac{1}{\rho_{i+1}} - \frac{1}{\rho_i} \right) $$  

$$(\Delta P)\_{i:i+1}^f = \zeta \cdot \frac{\Phi\_{lo}^2 \cdot \Lambda\_{i:i+1} \cdot \Delta x_2 \cdot \dot{m}\_{i:i+1} \cdot | \dot{m}\_{i:i+1} |}{2 \cdot D \cdot A^2 \cdot \rho_{i:i+1}} $$  

$$ (\Delta P)\_{i:i+1}^g = \rho\_{i:i+1} \cdot g \cdot (z\_{i+1} - z\_i) $$  

- Comments:  

By default, the flow is considered turbulent (i.e. *Re* > 2300).  


### Static momentum balance equation  

- Validity domain:   
   
 \\( \forall \dot{m}\_{i:i+1} \\) and the fluid inertia can be neglected.  

- Mathematical formulation:  
 $$ P_i - P\_{i+1} = (\Delta P)\_{i:i+1}^a + (\Delta P)\_{i:i+1}^f + (\Delta P)\_{i:i+1}^g $$  

 $$ (\Delta P)\_{i:i+1}^a = \frac{\dot{m}\_{i:i+1} \cdot  | \dot{m}\_{i:i+1} |}{A^2} \cdot \left( \frac{1}{\rho_{i+1}} - \frac{1}{\rho_i} \right) $$  

 $$(\Delta P)\_{i:i+1}^f = \zeta \cdot \frac{\Phi\_{lo}^2 \cdot \Lambda\_{i:i+1} \cdot \Delta x_2 \cdot \dot{m}\_{i:i+1} \cdot | \dot{m}\_{i:i+1} |}{2 \cdot D \cdot A^2 \cdot \rho_{i:i+1}} $$  

$$ (\Delta P)\_{i:i+1}^g = \rho\_{i:i+1} \cdot g \cdot (z\_{i+1} - z\_i) $$  

- Comments:  

As the fluid inertia is neglected, it is assumed that \\( \frac{1}{A} \cdot \frac{\mathrm{d} \dot{m}\_{i:i+1}}{\mathrm{d}t} \cdot \Delta x_2 \approx 0 \\).  


### Convective heat exchanged between the fluid and the wall  

- Validity domain:   
   
 \\( \forall T\_{w,i}, T_i \\)  

- Mathematical formulation:  

 $$ \Delta W_i = \alpha \cdot h\_{c,i} \cdot \Delta A_i \cdot (T\_{w,i} - T\_i) $$  

-  Comments:  

## References  

El Hefni, Baligh and Bouskela, Daniel (2019). [Modeling and Simulation of Thermal Power Plants with ThermoSysPro](https://link.springer.com/book/10.1007/978-3-030-05105-1), sect. 9.4.2. Springer Nature Switzerland AG.

Parameters

TypeNameDefaultDescription
Units.SI.LengthL10.Pipe length
Units.SI.DiameterD0.2Internal pipe diameter
Units.SI.Lengthrugosrel0.0007Pipe relative roughness
Integerntubes1Number of pipes in parallel
Units.SI.Positionz10Pipe inlet altitude
Units.SI.Positionz20Pipe outlet altitude
Realrgliss1Phase slip coefficient
Integera4200Phase pressure loss coefficient
RealdpfCorr1.00Corrective term for the friction pressure loss (dpf) for each node
IntegerNs10Number of segments
Units.SI.Temperature[Ns]T0fill(300, Ns)Initial fluid temperature (active if steady_state = false and option_temperature = 1)
Units.SI.SpecificEnthalpy[Ns]h0fill(1e5, Ns)Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)
Booleaninertiatruetrue: momentum balance equation with inertia - false: without inertia
Booleanadvectionfalsetrue: momentum balance equation with advection terme - false: without advection terme
Booleandynamic_mass_balancetruetrue: dynamic mass balance equation - false: static mass balance equation
Booleansimplified_dynamic_energy_balancetruetrue: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_mass_balance=true)
Booleansteady_statetruetrue: start from steady state - false: start from T0 (if option_temperature=1) or h0 (if option_temperature=2)
Integeroption_temperature11:initial temperature is fixed - 2:initial specific enthalpy is fixed (active if steady_state = false)
Booleancontinuous_flow_reversaltruetrue: continuous flow reversal - false: discontinuous flow reversal
Integermode0IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic

Connectors

TypeNameDefaultDescription
Connectors.FluidInletC1
ThermoSysPro.Thermal.Connectors.ThermalPort[Ns]CTh
Connectors.FluidOutletC2

Components

TypeNameDefaultDescription
Units.SI.AbsolutePressure[N + 1]PFluid pressure in node i
Units.SI.MassFlowRate[N]QMass flow rate in node i
Units.SI.SpecificEnthalpy[N + 1]hFluid specific enthalpy in node i
Units.SI.SpecificEnthalpy[N]hbFluid specific enthalpy at the boundary of node i
Units.SI.AbsolutePressure[N + 1]PbBounded fluid pressure in node i
Units.SI.Density[N - 1]rho1Fluid density in thermal node i
Units.SI.Density[N]rho2Fluid density in hydraulic node i
Units.SI.Density[N + 1]rhocFluid density at the boudary of node i
Units.SI.Power[N - 1]dW1Thermal power exchanged on the liquid side for node i
Units.SI.PowerW1tTotal power exchanged on the liquid side
Units.SI.Temperature[N - 1]Tp1Wall temperature in node i
Units.SI.CoefficientOfHeatTransfer[N - 1]hiFluid heat exchange coefficient in node i
Units.SI.CoefficientOfHeatTransfer[N - 1]hclFluid heat exchange coefficient in node i for the liquid fraction
Units.SI.CoefficientOfHeatTransfer[N - 1]hcvFluid heat exchange coefficient in node i for the vapor fraction
Real[N - 1]SCorrective terme correctif for nucleation removal
Real[N - 1]ECorrective term for hcl
Units.SI.CoefficientOfHeatTransfer[N - 1]hebFluid heat exchange coefficient for vaporization in thermal node i
Units.SI.ReynoldsNumber[N - 1]Rel1Reynolds number in thermal node i for the liquid
Units.SI.ReynoldsNumber[N]Rel2Reynolds number in hydraulic node i for the liquid
Units.SI.ReynoldsNumber[N - 1]Rev1Reynolds number in thermal node i for the vapor
Units.SI.ReynoldsNumber[N]Rev2Reynolds number in hydraulic node i for the vapor
Real[N - 1]PrlFluid Prandtl number in node i for the liquid
Real[N - 1]PrvFluid Prandtl number in node i for the vapor
Units.SI.ThermalConductivity[N - 1]klThermal conductivity in node i for the liquid
Units.SI.ThermalConductivity[N - 1]kvThermal conductivity in node i for the vapor
Real[N - 1]xv1Vapor mass fraction in thermal node i
Real[N]xv2Vapor mass fraction in hydraulic node i
Real[N - 1]xbsBounded upper value for the vapor mass fraction
Real[N - 1]xbiBounded lower value for the vapor mass fraction
Units.SI.DynamicViscosity[N - 1]mul1Dynamic viscosity in thermal node i for the liquid
Units.SI.DynamicViscosity[N]mul2Dynamic viscosity in hydraulic node i for the liquid
Units.SI.DynamicViscosity[N - 1]muv1Dynamic viscosity in thermal node i for the vapor
Units.SI.DynamicViscosity[N]muv2Dynamic viscosity in hydraulic node i for the vapor
Units.SI.SpecificHeatCapacity[N - 1]cplSpecific heat capacity for the liquid
Units.SI.SpecificHeatCapacity[N - 1]cpvSpecific heat capacity for the vapor
Real[N - 1]BoBoiling number
Real[N - 1]XttMartinelli number
Units.SI.SpecificEnthalpy[N - 1]lvSpecific enthalpy for vaporisation
Units.SI.Density[N - 1]rhol1Fluid density in thermal node i for the liquid
Units.SI.Density[N]rhol2Fluid density in hydraulic node i for the liquid
Units.SI.Density[N - 1]rhov1Fluid density in thermal node i for the vapor
Units.SI.Density[N]rhov2Fluid density in hydraulic node i for the vapor
Units.SI.Temperature[N - 1]T1Fluid temperature in thermal node i
Units.SI.Temperature[N]T2Fluid temperature in hydraulic node i
ThermoSysPro.Units.SI.PressureDifference[N]dpaAdvection term for the mass balance equation in node i
ThermoSysPro.Units.SI.PressureDifference[N]dpfFriction pressure loss in node i
ThermoSysPro.Units.SI.PressureDifference[N]dpgGravity pressure loss in node i
Real[N]khiHydraulic pressure loss coefficient in node i
Real[N]lambdalFriction pressure loss coefficient in node i for the liquid
Real[N]lambdavFriction pressure loss coefficient in node i for the vapor)
Real[N]filoPressure loss coefficient for two-phase flow
ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph[N - 1]pro1
ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph[2]proc
ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph[N]pro2
ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat[N]vsat2
ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat[N]lsat2
ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat[N - 1]vsat1
ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat[N - 1]lsat1

Revisions

Authors  

Daniel Bouskela  
Baligh El Hefni  
Guillaume Larrignon