Engee documentation

Pipe (G)

Rigid pipeline for gas flow.

blockType: AcausalFoundation.Gas.Elements.Pipe

Path in the library:

/Physical Modeling/Fundamental/Gas/Elements/Pipe (G)

Description

Block Pipe (G) simulates the dynamics of gas flow in a pipe. The unit takes into account losses due to viscous friction and convective heat exchange with the pipe wall. There is a constant volume of gas in the pipe. Pressure and temperature vary depending on the compressibility and heat capacity of the gas. The flow becomes critical when the gas velocity at the outlet reaches the speed of sound.

The gas flow through this unit can become critical. If the block Flow Rate Sensor (G) or a block Controlled Mass Flow Rate Source (G) connected to the block Pipe (G), sets a larger mass flow rate than the possible mass flow rate of the block, you get a simulation error.

Conservation of mass

The law of conservation of mass relates mass flow rates to the dynamics of pressure and temperature of the internal unit representing the volume of gas:

where

  • is the partial derivative of the gas mass in terms of pressure at constant temperature and volume;

  • is the partial derivative of the mass of a gas with respect to temperature at constant pressure and volume;

  • — the pressure of the gas volume. The pressure at ports A, B, C and D is considered equal to this pressure, ;

  • — the temperature of the gas volume;

  • — time;

  • — mass flow through port A. The mass flow rate associated with the port is positive when the gas enters the unit;

  • — mass flow through port B. The mass flow rate associated with the port is positive when the gas enters the unit.

Energy conservation

The law of conservation of energy relates the expenditure of energy and heat to the dynamics of pressure and temperature of the internal unit representing the volume of gas:

where

  • is the partial derivative of the internal energy of a gas in terms of pressure at constant temperature and volume;

  • is the partial derivative of the internal energy of a gas with respect to temperature at constant pressure and volume;

  • — power consumption on port A;

  • — power consumption on port B;

  • — the rate of heat flow at port H.

Partial derivatives for models of ideal and semi-ideal gases

Partial derivatives of mass M and internal energy U The gas pressure and temperature at constant volume depend on the model of the gas properties. For models of an ideal and semi-ideal gas, the equations are as follows:

,

,

,

,

where

  • — gas density;

  • — gas volume;

  • — specific enthalpy of the gas;

  • — the coefficient of compressibility;

  • — universal gas constant;

  • — specific heat capacity at constant gas pressure.

Partial derivatives for the real gas model

For a real gas model, partial derivatives of mass M and internal energy U gases with respect to pressure and temperature at constant volume are equal to:

,

,

,

,

where

  • — isothermal volumetric gas compression module;

  • — isobaric coefficient of thermal expansion of the gas.

Conservation of momentum

The momentum balance for each half of the pipe simulates a pressure drop due to the momentum of the gas flow and viscous friction:

,

,

where

  • — gas pressure at port A, port B or internal node I, as indicated by the subscript;

  • — density at port A, port B, or internal node I, as indicated by the subscript;

  • — the cross-sectional area of the pipe;

  • and — pressure loss due to viscous friction.

The heat exchange with the pipe wall through the H port is added to the energy of the gas represented by the internal node through the energy conservation equation. Therefore, the pulse balance for each half of the pipe between port A and the inner node and between port B and the inner node is considered an adiabatic process. Adiabatic relations:

,

,

where — specific enthalpy at port A, port B, or internal node I, as indicated by the subscript.

Pressure loss due to viscous friction and they depend on the flow regime. The Reynolds numbers for each half of the pipe are defined as:

,

,

where

  • — hydraulic pipe diameter;

  • — dynamic viscosity in the inner node.

If the Reynolds number is less than the parameter value Laminar flow upper Reynolds number limit, then the flow is in laminar mode. If the Reynolds number is greater than the limit value of the parameter Turbulent flow lower Reynolds number limit, then the current is in a turbulent mode.

In the laminar flow regime, the pressure loss due to viscous friction is:

,

,

where

  • — the value of the parameter Shape factor for laminate flow viscous friction;

  • — parameter value Aggregate equivalent length of local resistances.

In the turbulent flow regime, the pressure loss due to viscous friction is:

,

,

where — the Darcy coefficient on port A or B, as indicated by the subscript.

The Darcy coefficients are calculated from the Haaland correlation:

,

,

where — parameter value Internal surface absolute roughness.

When the Reynolds number is between the upper limit of the Reynolds number for laminar flow (parameter value Laminar flow upper Reynolds number limit) and the value of the lower limit of the Reynolds number for a turbulent flow (the value of the parameter Turbulent flow lower Reynolds number limit), the flow is in a transition state between laminar and turbulent flow. Pressure losses due to viscous friction in the transition region smoothly change between losses in the laminar flow regime and losses in the turbulent flow regime.

Convective heat exchange

The equation of convective heat transfer between the pipe wall and the internal gas volume:

where — pipe surface area, .

Assuming an exponential temperature distribution along the pipe, the convective heat transfer is

where

  • — inlet temperature, depending on the flow direction;

  • — average mass flow rate from port A to port B;

  • — specific heat capacity calculated at an average temperature.

Heat transfer coefficient depends on the Nusselt number:

where — the coefficient of thermal conductivity calculated at an average temperature.

The Nusselt number depends on the flow regime. The Nusselt number in the laminar flow mode is constant and is equal to the value of the parameter Nusselt number for laminar flow heat transfer. The Nusselt number in the turbulent flow regime is calculated from the Gnelinsky equation:

where tem:[Pr_("avg")] is the Prandtl number calculated at an average temperature.

The average Reynolds number is

where — dynamic viscosity, estimated at an average temperature.

When the mean is between the upper limit of the Reynolds number for laminar flow (parameter value Laminar flow upper Reynolds number limit) and the value of the lower limit of the Reynolds number for the turbulent flow (the value of the parameter Turbulent flow lower Reynolds number limit), the Nusselt number smoothly varies between the values of the Nusselt number for laminar and turbulent flows.

Critical flow

The mass flow rate when the gas pressure from the pipe decreases at ports A and B is determined by the following expressions:

,

,

where and — the speed of sound on ports A and B respectively.

The pressure at subcritical flow at port A or B is equal to the value of the corresponding variable:

,

.

At critical flow, the pressure at ports A and B is obtained by substituting mass flow rates at critical flow into the momentum balance equations for the pipe:

,

,

where and They represent pressure losses due to viscous friction under the assumption that the flow goes into critical mode. They are calculated similarly and with the replacement of the mass flow values at ports A and B with the mass flow values of the critical flow.

Depending on whether the flow has become critical, the unit assigns the pressure value in the critical or subcritical flow as the actual pressure at the port. The flow may become critical at the outlet of the pipe, but not at the inlet. Therefore, if , then port A is the input and . If , then port A is the output.

Similarly, if , then port B is the input and . If , then port B is the output.

Assumptions and limitations

  • The pipe wall is absolutely rigid.

  • The stream is fully developed. Friction losses and heat transfer do not include input effects.

  • The effect of gravity is negligible.

  • The inertia of the gas is negligible.

  • This block does not simulate supersonic flow.

Variables

Use the parameter group Initial Targets to set the priority and initial target values for the block parameter variables before modeling. For more information, see Configuring physical blocks using target values.

Ports

Conserving

# A — input or output port
gas

Details

The gas port corresponds to the inlet or outlet of the pipe. This block has no internal orientation.

Program usage name

port_a

# B — input or output port
gas

Details

The gas port corresponds to the inlet or outlet of the pipe. This block has no internal orientation.

Program usage name

port_b

# H — pipe wall temperature
warm

Details

A thermal port related to the temperature of the pipe wall. This temperature may differ from the temperature of the gas.

Program usage name

thermal_port

Parameters

Geometry

# Pipe length — pipe length
m | um | mm | cm | km | in | ft | yd | mi | nmi

Details

The length of the pipe along the flow direction.

Units

m | um | mm | cm | km | in | ft | yd | mi | nmi

Default value

5.0 m

Program usage name

length

Evaluatable

Yes

# Cross-sectional area — the inner area of the pipe
m^2 | um^2 | mm^2 | cm^2 | km^2 | in^2 | ft^2 | yd^2 | mi^2 | ha | ac

Details

The cross-sectional area of the pipe in the direction perpendicular to the flow direction.

Units

m^2 | um^2 | mm^2 | cm^2 | km^2 | in^2 | ft^2 | yd^2 | mi^2 | ha | ac

Default value

0.01 m^2

Program usage name

port_area

Evaluatable

Yes

# Hydraulic diameter — the diameter of an equivalent cylindrical tube with the same cross-sectional area
m | um | mm | cm | km | in | ft | yd | mi | nmi

Details

The diameter of an equivalent cylindrical tube with the same cross-sectional area.

Units

m | um | mm | cm | km | in | ft | yd | mi | nmi

Default value

0.1 m

Program usage name

hydraulic_diameter

Evaluatable

Yes

Friction and Heat Transfer

# Aggregate equivalent length of local resistances — the total length of all local resistances present in the pipe
m | um | mm | cm | km | in | ft | yd | mi | nmi

Details

The total length of all local resistances present in the pipe. Local resistances include bends, fittings, fittings, pipe entrances and exits. 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 only to calculate the friction. The volume of gas depends only on the geometric length of the pipe, determined by the parameter Pipe length.

Units

m | um | mm | cm | km | in | ft | yd | mi | nmi

Default value

0.1 m

Program usage name

length_add

Evaluatable

Yes

# Internal surface absolute roughness — the average depth of all surface defects on the inner surface of the pipe
m | um | mm | cm | km | in | ft | yd | mi | nmi

Details

The average depth of all surface defects on the inner surface of the pipe that affect pressure losses in the turbulent flow regime.

Units

m | um | mm | cm | km | in | ft | yd | mi | nmi

Default value

15e-6 m

Program usage name

roughness

Evaluatable

Yes

# Laminar flow upper Reynolds number limit — the Reynolds number, above which the flow begins to transition from laminar to turbulent

Details

The Reynolds number, above which the flow regime begins to transition from laminar to turbulent. This number is equal to the maximum Reynolds number corresponding to a fully developed laminar flow.

Default value

2e3

Program usage name

Re_laminar

Evaluatable

Yes

# Turbulent flow lower Reynolds number limit — the Reynolds number, below which the flow begins to transition from turbulent to laminar

Details

The Reynolds number, below which the flow regime begins to transition from turbulent to laminar. This number is equal to the minimum Reynolds number corresponding to a fully developed turbulent flow.

Default value

4e3

Program usage name

Re_turbulent

Evaluatable

Yes

# Laminar friction constant for Darcy friction factor — laminar friction constant for the Darcy coefficient

Details

A dimensionless coefficient reflecting the effect of the geometry of the pipe cross-section on losses from viscous friction in the laminar flow regime. Typical values: 64 for circular cross section, 57 for a square section, 62 for a rectangular section with an aspect ratio 2 and 96 for a thin annular section.

Default value

64

Program usage name

shape_factor

Evaluatable

Yes

# Nusselt number for laminar flow heat transfer — the ratio of convective heat transfer to conductive

Details

The ratio of convective to conductive heat exchange in the laminar flow regime. Its value depends on the geometry of the pipe’s cross-section and the thermal boundary conditions of the pipe wall, such as constant temperature or constant heat flow. Typical value 3.66 for a circular cross-section with a constant wall temperature.

Default value

3.66

Program usage name

Nu_laminar

Evaluatable

Yes