Pipe (G)
Rigid conduit for gas flow
Libraries:
Simscape /
Foundation Library /
Gas /
Elements
Description
The Pipe (G) block models pipe flow dynamics in a gas network. The block accounts for viscous friction losses and convective heat transfer with the pipe wall. The pipe contains a constant volume of gas. The pressure and temperature evolve based on the compressibility and thermal capacity of this gas volume. Choking occurs when the outlet reaches the sonic condition.
Caution
Gas flow through this block can choke. If a Mass Flow Rate Source (G) block or a Controlled Mass Flow Rate Source (G) block connected to the Pipe (G) block specifies a greater mass flow rate than the possible choked mass flow rate, you get a simulation error. For more information, see Choked Flow.
Mass Balance
Mass conservation relates the mass flow rates to the dynamics of the pressure and temperature of the internal node representing the gas volume:
where:
is the partial derivative of the mass of the gas volume with respect to pressure at constant temperature and volume.
is the partial derivative of the mass of the gas volume with respect to temperature at constant pressure and volume.
pI is the pressure of the gas volume.
TI is the temperature of the gas volume.
t is time.
A and B are mass flow rates at ports A and B, respectively. Flow rate associated with a port is positive when it flows into the block.
Energy Balance
Energy conservation relates the energy and heat flow rates to the dynamics of the pressure and temperature of the internal node representing the gas volume:
where:
is the partial derivative of the internal energy of the gas volume with respect to pressure at constant temperature and volume.
is the partial derivative of the internal energy of the gas volume with respect to temperature at constant pressure and volume.
ΦA and ΦB are energy flow rates at ports A and B, respectively.
QH is heat flow rate at port H.
Partial Derivatives for Perfect and Semiperfect Gas Models
The partial derivatives of the mass M and the internal energy U of the gas volume, with respect to pressure and temperature at constant volume, depend on the gas property model. For perfect and semiperfect gas models, the equations are:
where:
ρI is the density of the gas volume.
V is the volume of gas.
hI is the specific enthalpy of the gas volume.
Z is the compressibility factor.
R is the specific gas constant.
cpI is the specific heat at constant pressure of the gas volume.
Partial Derivatives for Real Gas Model
For real gas model, the partial derivatives of the mass M and the internal energy U of the gas volume, with respect to pressure and temperature at constant volume, are:
where:
β is the isothermal bulk modulus of the gas volume.
α is the isobaric thermal expansion coefficient of the gas volume.
Momentum Balance
The momentum balance for each half of the pipe models the pressure drop due to momentum flux and viscous friction:
where:
p is the gas pressure at port A, port B, or internal node I, as indicated by the subscript.
ρ is the density at port A, port B, or internal node I, as indicated by the subscript.
S is the cross-sectional area of the pipe.
ΔpAI and ΔpBI are pressure losses due to viscous friction.
The heat exchanged with the pipe wall through port H is added to the energy of gas volume represented by the internal node via the energy conservation equation (see Energy Balance). Therefore, the momentum balances for each half of the pipe, between port A and the internal node and between port B and the internal node, are assumed to be adiabatic processes. The adiabatic relations are:
where h is the specific enthalpy at port A, port B, or internal node I, as indicated by the subscript.
The pressure losses due to viscous friction, ΔpAI and ΔpBI, depend on the flow regime. The Reynolds numbers for each half of the pipe are defined as:
where:
Dh is the hydraulic diameter of the pipe.
μI is the dynamic viscosity at internal node.
If the Reynolds number is less than the Laminar flow upper Reynolds number limit parameter value, then the flow is in the laminar flow regime. If the Reynolds number is greater than the Turbulent flow lower Reynolds number limit parameter value, then the flow is in the turbulent flow regime.
In the laminar flow regime, the pressure losses due to viscous friction are:
where:
fshape is the Shape factor for laminar flow viscous friction parameter value.
Leqv is the Aggregate equivalent length of local resistances parameter value.
In the turbulent flow regime, the pressure losses due to viscous friction are:
where fDarcy is the Darcy friction factor at port A or B, as indicated by the subscript.
The Darcy friction factors are computed from the Haaland correlation:
where εrough is the Internal surface absolute roughness parameter value.
When the Reynolds number is between the Laminar flow upper Reynolds number limit and the Turbulent flow lower Reynolds number limit parameter values, the flow is in transition between laminar flow and turbulent flow. The pressure losses due to viscous friction during the transition region follow a smooth connection between those in the laminar flow regime and those in the turbulent flow regime.
Convective Heat Transfer
The convective heat transfer equation between the pipe wall and the internal gas volume is:
Ssurf is the pipe surface area, Ssurf = 4SL/Dh. Assuming an exponential temperature distribution along the pipe, the convective heat transfer is
where:
Tin is the inlet temperature depending on flow direction.
is the average mass flow rate from port A to port B.
is the specific heat evaluated at the average temperature.
The heat transfer coefficient, hcoeff, depends on the Nusselt number:
where kavg is the thermal conductivity evaluated at the average temperature. The Nusselt number depends on the flow regime. The Nusselt number in the laminar flow regime is constant and equal to the value of the Nusselt number for laminar flow heat transfer parameter. The Nusselt number in the turbulent flow regime is computed from the Gnielinski correlation:
where Pravg is the Prandtl number evaluated at the average temperature. The average Reynolds number is
where μavg is the dynamic viscosity evaluated at the average temperature. When the average Reynolds number is between the Laminar flow upper Reynolds number limit and the Turbulent flow lower Reynolds number limit parameter values, the Nusselt number follows a smooth transition between the laminar and turbulent Nusselt number values.
Choked Flow
The choked mass flow rates out of the pipe at ports A and B are:
where aA and aB is the speed of sound at ports A and B, respectively.
The unchoked pressure at port A or B is the value of the corresponding Across variable at that port:
The choked pressures at ports A and B are obtained by substituting the choked mass flow rates into the momentum balance equations for the pipe:
ΔpAIchoked and ΔpBIchoked are the pressure losses due to viscous friction, assuming that the choking has occurred. They are computed similar to ΔpAI and ΔpBI, with the mass flow rates at ports A and B replaced by the choked mass flow rate values.
Depending on whether choking has occurred, the block assigns either the choked or unchoked pressure value as the actual pressure at the port. Choking can occur at the pipe outlet, but not at the pipe inlet. Therefore, if pAunchoked ≥ pI, then port A is an inlet and pA = pAunchoked. If pAunchoked < pI, then port A is an outlet and
Similarly, if pBunchoked ≥ pI, then port B is an inlet and pB = pBunchoked. If pBunchoked < pI, then port B is an outlet and
Variables
To set the priority and initial target values for the block variables prior to simulation, use the Initial Targets section in the block dialog box or Property Inspector. For more information, see Set Priority and Initial Target for Block Variables and Initial Conditions for Blocks with Finite Gas Volume.
Nominal values provide a way to specify the expected magnitude of a variable in a model. Using system scaling based on nominal values increases the simulation robustness. Nominal values can come from different sources, one of which is the Nominal Values section in the block dialog box or Property Inspector. For more information, see Modify Nominal Values for a Block Variable.
Assumptions and Limitations
The pipe wall is perfectly rigid.
The flow is fully developed. Friction losses and heat transfer do not include entrance effects.
The effect of gravity is negligible.
Fluid inertia is negligible.
This block does not model supersonic flow.
Examples
Ports
Conserving
Parameters
References
[1] White, F. M., Fluid Mechanics. 7th Ed, Section 6.8. McGraw-Hill, 2011.
[2] Cengel, Y. A., Heat and Mass Transfer – A Practical Approach. 3rd Ed, Section 8.5. McGraw-Hill, 2007.