Engee documentation
Notebook

Thermodynamic processes in the oil and gas industry: calculations of changes in level, volume and pressure

In the oil and gas industry, accurate calculations related to temperature changes and its effect on fluids and structures play a key role. This article discusses three practical tasks that demonstrate how temperature fluctuations affect:

  1. the oil level in the tank,
  2. the volume of gasoline when it cools down,
  3. Pressure in the pipeline when the temperature changes.

These tasks are united by a common concept: the thermal expansion (or compression) of substances and materials, as well as its consequences for engineering systems. In each case, coefficients of thermal expansion, elastic modulus, and laws of thermodynamics are used to predict the behavior of liquids and structures.

Let's start our analysis with a script for calculating the change in the oil level in the tank during temperature fluctuations.

In [ ]:
# Input data
t1 = 20.0   # Daytime temperature, °C
t2 = 10.0   # Temperature at night, °C
H = 6.0     # Tank height, m
ρ20 = 850.0 # Oil density at 20°C, kg/m3
β = 0.0007  # Coefficient of thermal expansion of oil, 1/°C

# Calculating the level change
Δt = t1 - t2
h = H * β * Δt

# Output of results with formulas
println("Task 1:")
println("Formula: h = H * β * (t1 - t2)")
println("Substitution: h = $H * * ($t1 - $t2)")
println("Calculation: h = $H *  * $(Δt) = ", H*β*Δt)
println("\Change in oil level h = ", round(h, digits=4), " m")
println("The level change does not depend on the diameter of the tank, as")
println("volumetric expansion only affects the height of the liquid column.")
Задача 1:
Формула: h = H * β * (t1 - t2)
Подстановка: h = 6.0 * 0.0007 * (20.0 - 10.0)
Расчет: h = 6.0 * 0.0007 * 10.0 = 0.041999999999999996

Изменение уровня нефти h = 0.042 м
Изменение уровня не зависит от диаметра резервуара, так как
объемное расширение влияет только на высоту столба жидкости.

Physical interpretation

  • Oil expands when heated, and contracts when cooled.
  • The coefficient β = 0.0007 1/°C this means that when heated at 1°C, the volume of oil increases by 0.07%.
  • In this case, the temperature difference (Δt = 10°C) leads to a level change of 4.2 cm .

The calculation demonstrates how a simple thermodynamic property of a liquid (thermal expansion) affects the operational parameters of a tank. For accurate stock monitoring, these changes must be taken into account, especially in regions with significant daily temperature fluctuations.

Now consider the following example: a change in the volume of gasoline during cooling. This script calculates the change in gasoline volume as it cools from the transportation temperature to the ground temperature. A two-step calculation is used:

  1. Adjusting the volume to standard conditions (20°C),

  2. Conversion of volume to ground temperature.

In [ ]:
# Input data
t = 25.0    # Transportation temperature, °C
t1 = 15.0   # Ground temperature, °C
V = 10.0    # Volume during transportation, m3
ρ20 = 730.0 # Gasoline density at 20°C, kg/m3
β = 0.0012  # Coefficient of thermal expansion of gasoline, 1/°C

# Volume calculation at 20°C
V20 = V / (1 + β * (t - 20))

# Calculation of volume at ground temperature
V1 = V20 * (1 + β * (t1 - 20))

# Output of results with formulas
println("\nThe task 2:")
println("1. Find the volume at 20°C:")
println("   V20 = V / (1 + β * (t - 20))")
println("   V20 = $V / (1 +  * ($t - 20)) = ", round(V20, digits=4), " m3")

println("2. We find the volume at the ground temperature:")
println("   V1 = V20 * (1 + β * (t1 - 20))")
println("   V1 = $(round(V20, digits=4)) * (1 +  * ($t1 - 20))")

println("\The minimum amount of gasoline after cooling: ", round(V1, digits=2), " m3")
Задача 2:
1. Находим объем при 20°C:
   V20 = V / (1 + β * (t - 20))
   V20 = 10.0 / (1 + 0.0012 * (25.0 - 20)) = 9.9404 м³

2. Находим объем при температуре грунта:
   V1 = V20 * (1 + β * (t1 - 20))
   V1 = 9.9404 * (1 + 0.0012 * (15.0 - 20))

Итоговый объем бензина после остывания: 9.88 м³

After cooling, the volume of gasoline decreased from 10.0 m3 to 9.88 m3.

Physical interpretation

  1. Gasoline has a significant coefficient of expansion (β=0.0012 1/°C), which is 1.7 times higher than that of oil from the first task.

  2. Cooling at 10°C (from 25°C to 15°C) results in a 1.2% reduction in volume.

  3. The calculation using a reference temperature of 20°C ensures accuracy, since the density p20 is set precisely for these conditions.

Practical conclusions

  1. For commercial accounting, it is necessary to take into account the temperature correction – a difference of 1.2% is significant for large volumes.

  2. When designing tanks, it is important to provide for a "thermal reserve" of volume.

  3. The calculation method by reduction to 20 °C is a standard practice in oil refining.

Feature: unlike the first task, here a change in volume directly affects the quantity of a marketable product, which is of direct economic importance.

Now let's look at how to calculate the pressure change in the pipeline during fuel cooling.

The script simulates pressure changes in a closed pipeline when the temperature of the transported fuel decreases. Joint influence is taken into account

  • thermal compression of fuel,

  • thermal compression of pipeline material,

  • elastic properties of the pipe-liquid system.

In [ ]:
# Input data
d0 = 0.514       # Pipeline diameter, m
δ = 0.008        # Wall thickness, m
E = 2e11         # Young's Module, Pa
αT = 3.3e-5      # Coefficient of thermal expansion of metal, 1/°C
ρ20 = 840.0      # Fuel density, kg/m3
K = 1.5e9        # Modulus of elasticity of the fuel, Pa
py = 5e3         # Vapour elasticity, Pa
p1 = 2.5e6       # Initial pressure, Pa
t1 = 10.0        # Initial temperature, °C
t2 = 7.0         # Final temperature, °C
βT = 0.0007      # Coefficient of thermal expansion of fuel, 1/°C

# Calculation of changes
Δt = t2 - t1

println("\nThe task 3:")
println("1. Changing the pipeline volume:")
println("   ΔVT/V = 3 * αT * Δt")
println("   ΔVT/V = 3 * $αT * ($t2 - $t1) = ", 3*αT*Δt)

# Changing the pipeline volume
ΔVT_V = 3 * αT * Δt

println("2. Fuel volume change:")
println("   ΔVf/V = βT * Δt")
println("   ΔVf/V = $βT * ($t2 - $t1) = ", βT*Δt)

# Changing the fuel volume
ΔVf_V = βT * Δt

println("\n3. Total volume change:")
println("   ΔV/V = ΔVT/V + ΔVf/V")
println("   ΔV/V = $(ΔVT_V) + $(ΔVf_V) = ", ΔVT_V + ΔVf_V)

# Total volume change
ΔV_V = ΔVT_V + ΔVf_V

println("4. Effective modulus of elasticity of the system:")
println("   KT = (E * δ) / d0 = ($E * ) / $d0 = ", (E*δ)/d0)
KT = (E * δ) / d0
println("   1/K_eff = 1/K + 1/KT = 1/$K + 1/$KT")
K_eff = 1 / (1/K + 1/KT)
println("   K_eff = ", K_eff)

println("\n5. Pressure change:")
println("   Δp = -K_eff * ΔV/V")
println("   Δp = -$K_eff * $(ΔV_V) = ", -K_eff*ΔV_V)
Δp = -K_eff * ΔV_V

println("6. Final pressure:")
println("   p2 = p1 + Δp = $p1 + $(Δp) = ", p1 + Δp)
p2 = p1 + Δp

# Conversion to MPa and atm
p2_MPa = p2 / 1e6
p2_atm = p2 / 101325

println("\Result:")
println("Pressure at a temperature of $t2 °C:")
println("  ", round(p2_MPa, digits=2), " MPa")
println("  ", round(p2_atm, digits=2), " atm")
Задача 3:
1. Изменение объема трубопровода:
   ΔVT/V = 3 * αT * Δt
   ΔVT/V = 3 * 3.3e-5 * (7.0 - 10.0) = -0.000297

2. Изменение объема топлива:
   ΔVf/V = βT * Δt
   ΔVf/V = 0.0007 * (7.0 - 10.0) = -0.0021

3. Суммарное изменение объема:
   ΔV/V = ΔVT/V + ΔVf/V
   ΔV/V = -0.000297 + -0.0021 = -0.002397

4. Эффективный модуль упругости системы:
   KT = (E * δ) / d0 = (2.0e11 * 0.008) / 0.514 = 3.1128404669260697e9
   1/K_eff = 1/K + 1/KT = 1/1.5e9 + 1/3.1128404669260697e9
   K_eff = 1.0122311261071277e9

5. Изменение давления:
   Δp = -K_eff * ΔV/V
   Δp = -1.0122311261071277e9 * -0.002397 = 2.426318009278785e6

6. Итоговое давление:
   p2 = p1 + Δp = 2.5e6 + 2.426318009278785e6 = 4.926318009278785e6

Результат:
Давление при температуре 7.0 °C:
  4.93 МПа
  48.62 атм

Physical interpretation

  1. When cooled at 3°C:

    • the pipeline is compressed by 0.03%,

    • Fuel is compressed by 0.21%

  2. The pressure increases by 97% of the initial value.

  3. Main contribution (87%) provides fuel compression

Important: the pressure obtained (4.92 MPa) is close to the standard operating pressure for main pipelines (5-7 MPa), which confirms the need for such calculations.

Conclusion

The considered tasks clearly show that even minor temperature changes can affect key parameters in the oil and gas industry.

  • The change in the oil level in the tank depends on the temperature difference and the coefficient of expansion, but not on the geometry of the tank.
  • The volume of gasoline during cooling is adjusted taking into account its density and temperature coefficient.
  • The pressure in the pipeline is determined not only by the properties of the fuel, but also by the elasticity of the pipe walls.

These calculations help prevent accidents, optimize storage and transportation, and design more reliable systems.