The Pipe (G) block simulates the dynamics of gas flow in a pipe. The block takes into account viscous friction losses and convective heat exchange with the pipe wall. There is a constant volume of gas in the pipe. The pressure and temperature vary with the compressibility and heat capacity of the gas. The flow becomes critical when the gas velocity at the outlet reaches the speed of sound.
Gas flow through this block can become critical. If the Flow Rate Sensor (G) block or the Controlled Mass Flow Rate Source (G) block connected to the Pipe (G) block sets a higher mass flow rate than the possible mass flow rate of the block, you get a simulation error.
Mass Conservation
The Law of Conservation of Mass relates mass flow rates to the pressure and temperature dynamics of an internal node representing a volume of gas:
,
where:
- is the partial derivative of the mass of gas in terms of pressure at constant temperature and volume.
- is the partial derivative of the gas mass by temperature at constant pressure and volume.
- pressure of the volume of gas. The pressure at ports A, B, C and D is assumed to be equal to this pressure, .
- gas temperature. The temperature at port H is assumed to be equal to this temperature, .
- time.
- is the mass flow rate through port A. The flow rate associated with the port is positive when the gas flows into the block.
- mass flow rate through port B. The flow rate associated with the port is positive when gas flows into the block.
Energy balance
The law of conservation of energy relates energy and heat expenditure to the pressure and temperature dynamics of an internal unit representing a volume of gas:
,
where:
- is the partial derivative of the internal energy of the gas in terms of pressure at constant temperature and volume.
- is the partial derivative of the internal energy of gas by temperature at constant pressure and volume.
- energy flow rate at port A.
- energy consumption at port B.
- heat flow rate at port H.
Partial derivatives for ideal and semi-ideal gas models
The partial derivatives of the mass M and internal energy U of a gas in terms of pressure and temperature at constant volume depend on the model properties of the gas. For the ideal and semi-ideal gas models, the equations are as follows:
Where:
- is the density of the gas.
- is the volume of the gas.
- specific enthalpy of a gas.
- compressibility coefficient.
- universal gas constant.
- specific heat capacity at constant gas pressure.
Partial derivatives for the real gas model
For the real gas model, the partial derivatives of the mass M and internal energy U of the gas with respect to pressure and temperature at constant volume are equal:
Where:
- isothermal volume modulus of gas compression.
- isobaric coefficient of thermal expansion of gas.
momentum balance
The momentum balance for each half of the pipe models the pressure drop due to the momentum of gas flow and viscous friction:
Where:
- Gas pressure at port A, port B or internal node I as indicated by the lower index.
- density at port A, port B or internal node I, as indicated by the lower case.
- cross-sectional area of the pipe.
and - pressure loss due to viscous friction.
Heat exchange with the pipe wall through port H is added to the energy of the gas represented by the internal node through the energy conservation equation. Therefore, the momentum balance for each half of the pipe between port A and the internal node and between port B and the internal node is considered an adiabatic process. Adiabatic relations:
where is the specific enthalpy at port A, port B, or internal node I as indicated by the lower index.
Pressure losses due to viscous friction and depend on the flow regime. The Reynolds numbers for each half of the pipe are defined as:
μ
Where:
- is the hydraulic diameter of the pipe.
μ - dynamic viscosity in the internal node.
If the Reynolds number is less than the Laminar flow upper Reynolds number limit, the flow is in laminar regime. If the Reynolds number is greater than the Turbulent flow lower Reynolds number limit, the flow is in the turbulent regime.
In the laminar flow regime, the pressure loss due to viscous friction is:
μρ
μρ
Where:
- Shape factor for laminar flow viscous friction parameter value.
- parameter value Aggregate equivalent length of local resistances.
In turbulent flow regime the pressure losses for viscous friction are:
ρ
ρ
Where:
- Darcy coefficient at port A or B as indicated by the lower index.
Darcy coefficients are calculated from the Haaland correlation:
When the Reynolds number is between the upper Reynolds number limit for laminar flow and the parameter values of the lower Reynolds number limit for turbulent flow, the flow is in a transition state between laminar flow and turbulent flow. Pressure losses due to viscous friction in the transition region follow a smooth relationship between losses in the laminar flow regime and losses in the turbulent flow regime.
Convective heat transfer
Equation of convective heat transfer between the pipe wall and the internal volume of gas:
Where:
- surface area of the pipe, .
Assuming exponential temperature distribution along the pipe, convective heat transfer is equal to
where:
- inlet temperature depending on the direction of flow.
- is the average mass flow rate from port A to port B.
- specific heat capacity calculated at the average temperature.
The heat transfer coefficient depends on the Nusselt number:
Where:
- is the heat transfer coefficient calculated at the average temperature.
Nusselt number depends on the flow regime. Nusselt number in laminar flow regime is constant and is equal to the value of parameter Nusselt number for laminar flow heat transfer. Nusselt number in turbulent flow regime is calculated from Gnelinski equation:
Where:
- Prandtl number calculated at mean temperature.
The average Reynolds number is
μ
where:
μ - dynamic viscosity estimated at mean temperature.
When the average Reynolds number is between the parameter values of the upper Reynolds number limit for laminar flow and the lower Reynolds number limit for turbulent flow, the Nusselt number corresponds to a smooth transition between the Nusselt number values for laminar and turbulent flows.
Critical flow
The mass flow rate at the depressurisation of the gas from the pipe at ports A and B is:
ρ
ρ
Where:
and are the speed of sound at ports A and B respectively.
The open state pressure at port A or B is equal to the value of the corresponding variable:
The pressures at reduced gas pressure at ports A and B are obtained by substituting the mass flow rates at reduced gas pressure into the momentum balance equations for the pipe:
ρρ
ρρ
and represent the pressure losses due to viscous friction assuming that there has been a decrease in gas pressure. They are calculated in the same way as and , replacing the mass flow rates at ports A and B with the mass flow rate of the critical flow.
Depending on whether the flow has become critical, the unit assigns the closed or open pressure value as the actual pressure at the port. Flow can become critical at the outlet of the pipe, but not at the inlet. Hence, if , then port A is the inlet and . If , then port A is the outlet.
Similarly, if , then port B is an input and . If , then port B is an output.
Assumptions and limitations
The pipe wall is completely rigid.
The flow is fully developed. Friction and heat transfer losses do not include inlet effects.
The effect of gravity is negligible.
The inertia of the gas is negligible.
This block does not simulate supersonic flow.
Ports
A - input or output port gas
Gas port, corresponds to the inlet or outlet of the pipe. This unit has no internal directionality.
B - inlet or outlet port gas
Gas port, corresponds to the inlet or outlet of the pipe. This unit has no internal directionality.
H - pipe wall temperature heat
Heat port associated with the pipe wall temperature. This temperature may be different from the gas temperature.
Parameters
Pipe length - pipe length 5.0 m (by default)
Pipe length along the flow direction.
Cross-sectional area - internal area of the pipe 0.01 m² (by default).
The cross-sectional area of the pipe in the direction perpendicular to the flow direction.
Hydraulic diameter - diameter of an equivalent cylindrical pipe with the same cross-sectional area `0.1 m (by default)
The diameter of an equivalent cylindrical pipe with the same cross-sectional area.
Aggregate equivalent length of local resistances - total length of all local resistances present in the pipe `0.1 m (By default)
The total length of all local resistances present in the pipe. Local resistances include bends, fittings, fittings, pipe inlets and outlets. The effect of local resistances is to increase the effective length of the pipe segment. This length is added to the geometric length of the pipe for friction calculations only. The gas volume depends only on the geometric length of the pipe, defined by the parameter Pipe length.
Internal surface absolute roughness - average depth of all surface defects on the internal surface of the pipe `15e-6 m (By default).
Average depth of all surface defects on the internal surface of the pipe affecting pressure losses in turbulent flow regime.
Laminar flow upper Reynolds number limit - Reynolds number above which the flow starts to change from laminar to turbulent flow mode 2e3 (by default).
The Reynolds number above which the flow starts to change from laminar to turbulent. This number is equal to the maximum Reynolds number corresponding to fully developed laminar flow.
Turbulent flow lower Reynolds number limit - the Reynolds number below which the flow begins to change from turbulent to laminar flow 4e3 (By default).
The Reynolds number below which the flow begins to change from turbulent to laminar. This number is equal to the minimum Reynolds number corresponding to a fully developed turbulent flow.
Laminar friction constant for Darcy friction factor - laminar friction constant for Darcy friction factor 64 (By default)
Dimensionless coefficient encoding the effect of pipe cross-sectional geometry on viscous friction losses in laminar flow regime. Typical values: 64 for circular cross section, 57 for square cross section, 62 for rectangular cross section with aspect ratio 2 and 96 for thin annular cross section.
Nusselt number for laminar flow heat transfer is the ratio of convective to conductive heat transfer `3.66 (by default).
The ratio of convective to conductive heat transfer in laminar flow regime. Its value depends on the geometry of the pipe cross-section and the thermal boundary conditions of the pipe wall, such as constant temperature or constant heat flux. A typical value of 3.66 is for a circular cross section with constant wall temperature.
Initial value of pressure of gas volume - initial value of gas pressure 101325.0 (By default).
Initial value of gas pressure.
Initial value of temperature of gas volume - initial value of gas temperature `293.15 K (by default).
Initial value of gas temperature.
Initial value of density of gas volume - initial value of gas density `1.2 (By default).