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 [ ]:
# Входные данные
t1 = 20.0   # Температура днем, °C
t2 = 10.0   # Температура ночью, °C
H = 6.0     # Высота резервуара, м
ρ20 = 850.0 # Плотность нефти при 20°C, кг/м³
β = 0.0007  # Коэффициент температурного расширения нефти, 1/°C

# Расчет изменения уровня
Δt = t1 - t2
h = H * β * Δt

# Вывод результатов с формулами
println("Задача 1:")
println("Формула: h = H * β * (t1 - t2)")
println("Подстановка: h = $H *  * ($t1 - $t2)")
println("Расчет: h = $H *  * $(Δt) = ", H*β*Δt)
println("\nИзменение уровня нефти h = ", round(h, digits=4), " м")
println("Изменение уровня не зависит от диаметра резервуара, так как")
println("объемное расширение влияет только на высоту столба жидкости.")
Задача 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 [ ]:
# Входные данные
t = 25.0    # Температура при транспортировке, °C
t1 = 15.0   # Температура грунта, °C
V = 10.0    # Объем при транспортировке, м³
ρ20 = 730.0 # Плотность бензина при 20°C, кг/м³
β = 0.0012  # Коэффициент температурного расширения бензина, 1/°C

# Расчет объема при 20°C
V20 = V / (1 + β * (t - 20))

# Расчет объема при температуре грунта
V1 = V20 * (1 + β * (t1 - 20))

# Вывод результатов с формулами
println("\nЗадача 2:")
println("1. Находим объем при 20°C:")
println("   V20 = V / (1 + β * (t - 20))")
println("   V20 = $V / (1 +  * ($t - 20)) = ", round(V20, digits=4), " м³")

println("\n2. Находим объем при температуре грунта:")
println("   V1 = V20 * (1 + β * (t1 - 20))")
println("   V1 = $(round(V20, digits=4)) * (1 +  * ($t1 - 20))")

println("\nИтоговый объем бензина после остывания: ", round(V1, digits=2), " м³")
Задача 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 greater 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 [ ]:
# Входные данные
d0 = 0.514       # Диаметр трубопровода, m
δ = 0.008        # Толщина стенки, m
E = 2e11         # Модуль Юнга, Pa
αT = 3.3e-5      # Коэф. теплового расширения металла, 1/°C
ρ20 = 840.0      # Плотность топлива, kg/m³
K = 1.5e9        # Модуль упругости топлива, Pa
py = 5e3         # Упругость паров, Pa
p1 = 2.5e6       # Начальное давление, Pa
t1 = 10.0        # Начальная температура, °C
t2 = 7.0         # Конечная температура, °C
βT = 0.0007      # Коэф. температурного расширения топлива, 1/°C

# Расчет изменений
Δt = t2 - t1

println("\nЗадача 3:")
println("1. Изменение объема трубопровода:")
println("   ΔVT/V = 3 * αT * Δt")
println("   ΔVT/V = 3 * $αT * ($t2 - $t1) = ", 3*αT*Δt)

# Изменение объема трубопровода
ΔVT_V = 3 * αT * Δt

println("\n2. Изменение объема топлива:")
println("   ΔVf/V = βT * Δt")
println("   ΔVf/V = $βT * ($t2 - $t1) = ", βT*Δt)

# Изменение объема топлива
ΔVf_V = βT * Δt

println("\n3. Суммарное изменение объема:")
println("   ΔV/V = ΔVT/V + ΔVf/V")
println("   ΔV/V = $(ΔVT_V) + $(ΔVf_V) = ", ΔVT_V + ΔVf_V)

# Суммарное изменение объема
ΔV_V = ΔVT_V + ΔVf_V

println("\n4. Эффективный модуль упругости системы:")
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. Изменение давления:")
println("   Δp = -K_eff * ΔV/V")
println("   Δp = -$K_eff * $(ΔV_V) = ", -K_eff*ΔV_V)
Δp = -K_eff * ΔV_V

println("\n6. Итоговое давление:")
println("   p2 = p1 + Δp = $p1 + $(Δp) = ", p1 + Δp)
p2 = p1 + Δp

# Перевод в МПа и атм
p2_MPa = p2 / 1e6
p2_atm = p2 / 101325

println("\nРезультат:")
println("Давление при температуре $t2 °C:")
println("  ", round(p2_MPa, digits=2), " МПа")
println("  ", round(p2_atm, digits=2), " атм")
Задача 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.