Gas Compression & Discharge Throttling — Control Design
Shared by TSIMEREZIVO Team · 4 Oct 2026 · 40 views
# Oil & Gas Template: Gas Compression & Discharge Throttling
## 1. Overview
**Purpose:**
Operate centrifugal or reciprocating gas compressor to maintain pipeline discharge pressure (setpoint typically 800–1500 psia) while protecting equipment from surge (compressor pre-surge condition) and limiting discharge temperature. As downstream demand fluctuates throughout the day (peak load evening, minimum load 3 AM), compressor inlet flow varies; must modulate compressor capacity via recycle valve (internal bypass) or inlet guide vanes (IGV) to match demand without surge.
**Industry Standards:**
- API 617 (Centrifugal Compressors)
- API 675 (Reciprocating Compressors)
- ASME B31.8 (Gas Transmission & Distribution Piping)
- ISO 10169 (Compressor Recirculation / Anti-surge systems)
- NFPA 68 (Deflagration Prevention)
**Critical Constraints:**
- **Surge margin:** compressor must stay right of surge line map (Q vs. head); if Q drops below surge → unit goes unstable, mechanical damage
- **Antisurge valve:** recycles a percentage of discharge gas back to suction to maintain minimum flow; opening controlled by pressure ratio feedback
- **Suction pressure:** typically 50–200 psia (field separator outlet); temperature range 40–100°F (cold weather = higher density = lower volume)
- **Discharge pressure:** regulated setpoint (800–1500 psia typical); cannot exceed equipment rating or relief valve opens
- **Temperature rise:** ΔT = (T_discharge − T_suction) ∝ compression ratio; high compression → high temp → cooler duty
- **Choke point:** if compressor throttles too much (low mass flow) → energy efficiency drops, heat generation high
- **Recycle rate:** 5–15% typical during part-load; every % recycled = waste energy (must recompress same gas)
**Relevant Physics:**
- **Polytropic head:** $H = \frac{Z × R × T_s}{1-n} × (\frac{P_d}{P_s})^{(1-n)/n} - 1)$ (joules/kg; Z = compressibility factor)
- **Surge line:** $Q_{surge} = k × H^{0.5}$ (empirical; k from manufacturer map; as pressure ratio rises, minimum allowable flow drops)
- **Antisurge logic:** $\Delta P_{valve} ∝ (\frac{P_d}{P_s} − SP) × margin\_factor$ (proportional to pressure ratio deviation)
- **Efficiency:** polytropic efficiency $\eta_p$ = ideal work / actual work; typically 75–85% for centrifugal; declines at surge
---
## 2. Control Philosophy
**Challenge:**
Pipeline demand variable 5:1 throughout day. Compressor surge line forces operation in a safe envelope (above line, below choke). Naive approaches fail:
- Fixed discharge pressure setpoint + no antisurge → surge into wall during low-demand hours
- Full recycle @ all times → waste energy
- Solution: **pressure ratio feedback + surge margin tracking**
```
LAYER 1: Pressure Ratio Monitor
Inputs: Discharge pressure (Pd), Suction pressure (Ps)
Output: Pressure ratio = Pd / Ps
Note: As Ps drops (cold morning) or Pd demanded rises, ratio increases → moves toward surge line
LAYER 2: Antisurge Valve Control (Anti-surge Recirculation)
Setpoint: Pressure ratio margin = 1.05 × Current_Ratio (5% safety margin)
Logic: If ratio > margin → open recycle valve proportionally
Effect: Reduces net export, increases suction recirculation → flow stays >surge point
LAYER 3: Discharge Pressure Regulator (Main Control Loop)
Setpoint: 1000 psia (typical)
Feedback: Discharge pressure transmitter
Output: Modulates main recirculation valve opening
Note: Varies recycle % to maintain discharge pressure as demand changes
LAYER 4: Temperature Protection
If discharge T > 250°F → throttle inlet (reduce suction pressure) or open cooler bypass
Prevents equipment damage, extends compressor life
```
---
## 3. Control Logic (Condensed)
```pascal
{ === GAS COMPRESSOR ANTISURGE & DISCHARGE PRESSURE CONTROL === }
PROCEDURE Gas_Compressor_Subsurface_Pressure_Control
CONSTANTS
DISCHARGE_PRESSURE_SETPOINT_PSIA = 1000
SUCTION_PRESSURE_MIN_SAFE = 50 { psia, prevents choke }
PRESSURE_RATIO_SP = 15 { typical for centrifugal }
SURGE_MARGIN_SAFETY_FACTOR = 1.05 { 5% above measured ratio }
ANTISURGE_VALVE_CLOSED_PCT = 0
ANTISURGE_VALVE_OPEN_PCT = 100
TEMPERATURE_MAX_DISCHARGE_F = 250
COMPRESSOR_SPEED_MAX_RPM = 10000
VARIABLES
discharge_pressure_psia : REAL
suction_pressure_psia : REAL
discharge_temperature_f : REAL
discharge_gas_flow_mmcfpd : REAL { million cubic feet per day }
pressure_ratio : REAL { Pd / Ps }
pressure_ratio_setpoint : REAL { adaptive }
pressure_ratio_error : REAL
antisurge_valve_position_pct : REAL
antisurge_valve_setpoint_pct : REAL
compressor_speed_rpm : REAL
compressor_speed_command_pct : REAL { 0–100% for variable-speed }
surge_margin_current : REAL { distance from surge line }
BEGIN
discharge_pressure_psia = Read_Discharge_Pressure()
suction_pressure_psia = Read_Suction_Pressure()
discharge_temperature_f = Read_DISCHARGE_TEMPERATURE()
discharge_gas_flow_mmcfpd = Read_GAS_FLOW()
{ === PRESSURE RATIO & SURGE ASSESSMENT === }
pressure_ratio = discharge_pressure_psia / suction_pressure_psia
{ Estimate surge line for current compressor speed }
{ Simplified: surge_ratio = k / speed_factor; as speed ↑, surge ratio lowers }
estimated_surge_ratio = 12 − (0.0015 × compressor_speed_rpm) { empirical }
surge_margin_current = pressure_ratio − estimated_surge_ratio
IF surge_margin_current < 0.5 THEN
Log_Warning("APPROACHING_SURGE_LINE_OPEN_ANTISURGE")
surge_detected = TRUE
END IF
{ === ANTISURGE VALVE CONTROL (Recirculation) === }
{ Dynamic setpoint: always maintain 5% margin above current ratio }
pressure_ratio_setpoint = pressure_ratio × SURGE_MARGIN_SAFETY_FACTOR
{ PID to modulate recirculation valve }
pressure_ratio_error = pressure_ratio_setpoint − pressure_ratio
pid_antisurge = KP_AS × pressure_ratio_error + KI_AS × Integral(error)
{ If ratio rising → open recycle to maintain flow above surge }
antisurge_valve_setpoint_pct = 20 + (pid_antisurge × 50)
antisurge_valve_setpoint_pct = LIMIT(antisurge_valve_setpoint_pct, 0, 100)
Write_Antisurge_Valve(antisurge_valve_setpoint_pct)
{ Effect: as more gas recirculates, net export Q drops, but suction circulation ↑ }
{ Keeps compressor on stable side of surge line }
{ === DISCHARGE PRESSURE FEEDBACK (Main Control) === }
discharge_error = DISCHARGE_PRESSURE_SETPOINT_PSIA − discharge_pressure_psia
pid_discharge = KP_DP × discharge_error + KI_DP × Integral(error)
{ Output modulates main throttle valve (or IGV for variable-speed) }
{ More throttling → higher upstream backpressure → lower compressor inlet }
main_throttle_valve_pct = 50 + (pid_discharge × 30)
main_throttle_valve_pct = LIMIT(main_throttle_valve_pct, 0, 100)
Write_Main_Throttle_Valve(main_throttle_valve_pct)
{ Alternative for variable-speed: adjust compressor RPM instead of throttle }
IF Compressor_Is_Variable_Speed THEN
compressor_speed_rpm_target = 5000 + (discharge_error × 50)
compressor_speed_rpm_target = LIMIT(compressor_speed_rpm_target, 3000, 10000)
Write_VFD_Compressor_Speed(compressor_speed_rpm_target)
END IF
{ === TEMPERATURE PROTECTION === }
IF discharge_temperature_f > TEMPERATURE_MAX_DISCHARGE_F THEN
Log_Warning("DISCHARGE_TEMP_EXCEED_LIMIT_" + STR(discharge_temperature_f) + "_F")
{ Option 1: throttle inlet (reduce suction → lower compression ratio) }
suction_throttle_valve_pct = 80 { restrict inlet }
Write_Inlet_Throttle_Valve(suction_throttle_valve_pct)
{ Option 2: open cooler bypass (if intercooler present) }
cooler_bypass_valve_pct = 50
Write_Cooler_Bypass_Valve(cooler_bypass_valve_pct)
ELSE
suction_throttle_valve_pct = 100 { fully open }
cooler_bypass_valve_pct = 0 { full cooler duty }
END IF
{ === LOGGING === }
IF MOD(scan_count, 10) = 0 THEN { every 10 seconds }
Log_Process_Data({
timestamp: Get_Timestamp(),
discharge_psia: discharge_pressure_psia,
suction_psia: suction_pressure_psia,
pressure_ratio: pressure_ratio,
antisurge_valve_pct: antisurge_valve_position_pct,
discharge_temp_f: discharge_temperature_f,
gas_flow_mmcfpd: discharge_gas_flow_mmcfpd,
compressor_speed_rpm: compressor_speed_rpm,
surge_margin: surge_margin_current
})
END IF
END PROCEDURE
```
---
## 4. Tag List (Selected)
```
DISCHARGE_PRESSURE_PSIA { main control variable }
DISCHARGE_PRESSURE_SETPOINT_PSIA { target }
SUCTION_PRESSURE_PSIA { feedback for pressure ratio }
PRESSURE_RATIO { Pd / Ps, surge indicator }
SURGE_MARGIN_PERCENT { distance from surge line }
ANTISURGE_VALVE_POSITION_PCT { recirculation valve }
DISCHARGE_TEMPERATURE_F { protection setpoint }
GAS_FLOW_MMCFPD { production rate }
COMPRESSOR_SPEED_RPM { for variable-speed units }
RECYCLE_RATE_PERCENT { % of flow recirculated }
```
---
## 5. Alarm & Trip Matrix
| **Condition** | **Severity** | **Action** |
|---|---|---|
| **Surge margin < 0** | 🔴 CRIT | Open antisurge to maximum; reduce demand |
| **Discharge temp >250°F** | ⚠ WARN | Throttle inlet; check cooler |
| **Discharge pressure > 1200 psia** | ⚠ WARN | Relief likely venting; reduce demand |
| **Suction pressure < 50 psia** | ⚠ WARN | Feed line choking; check upstream |
---
## 6. Configuration
**JSON (gas_compressor_config.json)**
```json
{
"compressor": {
"type": "centrifugal_variable_speed",
"design_flow_mmcfpd": 100,
"discharge_pressure_setpoint_psia": 1000,
"speed_rated_rpm": 8000
},
"antisurge": {
"surge_margin_safety_factor": 1.05,
"recirculation_valve_type": "proportional",
"estimated_surge_ratio_base": 12
},
"pid_tuning": {
"discharge_kp": 0.5,
"discharge_ki": 0.05,
"antisurge_kp": 1.0,
"antisurge_ki": 0.1
},
"safety": {
"temperature_max_f": 250,
"pressure_max_psia": 1200,
"suction_min_psia": 50
}
}
```
---
**Document Version:** 1.0
**Last Updated:** 2026-04-13
**Status:** Ready for Production