Gas Separation Vessel — Control Design
Shared by TSIMEREZIVO Team · 4 Oct 2026 · 50 views
# Oil & Gas Template: Gas Separation Vessel
## 1. Overview
**Purpose:**
Three-phase separator removes liquids (oil + water) from raw gas stream under subsonic conditions. Liquid level is controlled via dump valve to prevent slugging downstream (compressor inlet) while maintaining interface between oil-water. Pressure is constrained by gas outlet backpressure setpoint.
**Industry Standards:**
- API 14E (Design & Installation of Offshore Facilities)
- ASME Section VIII (Pressure Vessel Design)
- ISO 11583 (Separators—Terminology)
- AGA Report No. 6 (Measurement of Natural Gas by Turbine Meters)
**Critical Constraints:**
- **Residence time:** minimum 3–5 minutes for gravity separation; insufficient time → carry-over of water droplets to compressor
- **Liquid level:** must not exceed 75% (slugging risk) or drop below 20% (no interface, pump cavitation)
- **Interface (oil-water):** oil denser ~0.85 sg, water 1.0 sg; detect via density contrast or conductivity
- **Gas outlet:** subsonic flow ensures smooth separation; if sonic velocity reached, all separation fails
- **Dump valve:** must modulate 0–100% to maintain level while gas backpressure is dynamic
**Relevant Physics:**
- **Gas residence time:** $T = V / Q$ where V = vessel volume (bbl), Q = gas flow rate (scf/day)
- **Gravity separation:** settling velocity = $v_s = \sqrt{(18 \mu / (\rho_p - \rho_f)) \times g}$ via Stokes law
- **Gas expansion:** $V_{gas} = V_{ref} \times (P_{ref} / P_{actual})$ (isothermal)
- **Sonic velocity:** pressure ratio = PTR critical; if $P_{downstream}/P_{upstream} < 0.528$, choke condition
---
## 2. Control Philosophy
```
LAYER 1: Pressure Control (Gas Outlet)
Setpoint: backpressure target (e.g., 250 psi)
Actuator: downstream choke valve or separator vent valve
Feedback: gas outlet pressure transmitter
Goal: maintain stable gas dynamics, prevent surging
LAYER 2: Liquid Level Control (Oil + Water Combined)
Setpoint: 40–60% (mid-range between 20% and 75% safety limits)
Actuator: dump valve (proportional 4–20mA control)
Feedback: capacitive or radar level sensor
Cascade: level error → demand flowrate → dump valve %
LAYER 3: Interface Detection (Oil-Water Boundary)
Method: density interface instrument or conductivity probe
Purpose: track where oil stops and water starts
Safety: if interface disappears (all oil floated out), alarm
LAYER 4: Overflow & Underflow Protection
High level alarm (>75%): reduce feed or open dump wider
Low level alarm (<20%): reduce dump or increase feed
LAYER 5: Carry-Over Detection
Downstream: compressor inlet temperature rise or moisture content spike
If liquid reach: compressor efficiency drops; trigger cascade shutdown
```
---
## 3. Control Logic (Condensed)
```pascal
{ === 3-PHASE SEPARATOR (OIL, GAS, WATER) === }
PROCEDURE Gas_Separator_Control
CONSTANTS
PRESSURE_SETPOINT_PSI = 250 { gas outlet backpressure }
LEVEL_SETPOINT_PCT = 50 { oil + water combined level }
INTERFACE_MIN_PCT = 20 { minimum oil layer }
INTERFACE_MAX_PCT = 75 { slug risk threshold }
SONIC_PRESSURE_RATIO = 0.528 { Mach 1 limit }
GAS_RESIDENCE_TIME_MIN = 3 { minutes, minimum for separation }
VARIABLES
level_pct : REAL { capacitive sensor or radar }
level_error_pct : REAL
density_signal : REAL { interface detector }
interface_oil_pct : REAL { where oil stops }
pressure_outlet_psi : REAL { gas exiting vessel }
pressure_inlet_psi : REAL { from upstream source }
pressure_ratio : REAL
dump_valve_cmd_pct : REAL { 0–100% }
choke_valve_cmd_pct : REAL { gas backpressure controller }
gas_flow_rate_scf_day : REAL { measured or estimated }
residence_time_min : REAL { V_vessel / gas_flow }
level_pid_integral : REAL
level_pid_prev_error : REAL
slug_detected : BOOLEAN
interface_lost : BOOLEAN
sonic_approach : BOOLEAN
BEGIN
{ === READ INSTRUMENTS === }
level_pct = Read_Level_Transmitter() { 0–100% full scale }
density_signal = Read_Interface_Detector() { 0–20mA or 4–20mA }
pressure_outlet_psi = Read_Pressure_Gas_Outlet()
pressure_inlet_psi = Read_Pressure_Inlet()
temperature_outlet_f = Read_Temperature_Outlet()
{ === INTERFACE POSITION === }
{ Convert 4–20mA interface signal to oil % }
interface_oil_pct = (density_signal − 4) / 16 × 100
IF interface_oil_pct < 5 THEN
interface_lost = TRUE
Log_Alarm("INTERFACE_LOST_OIL_CARRY_OVER")
ELSE
interface_lost = FALSE
END IF
{ === PRESSURE CONTROL (Gas Outlet) === }
{ Cascade PID: target outlet pressure = setpoint }
pressure_error_psi = PRESSURE_SETPOINT_PSI − pressure_outlet_psi
{ Proportional term }
choke_valve_cmd_pct = 50 + (pressure_error_psi × 2) { tuning: 2%/psi }
{ Clamp choke to 0–100% }
IF choke_valve_cmd_pct < 0 THEN choke_valve_cmd_pct = 0 END IF
IF choke_valve_cmd_pct > 100 THEN choke_valve_cmd_pct = 100 END IF
{ Check for sonic approach }
pressure_ratio = pressure_outlet_psi / pressure_inlet_psi
IF pressure_ratio < 0.55 THEN
sonic_approach = TRUE
Log_Warning("APPROACHING_SONIC_VELOCITY_CHOKE")
ELSE
sonic_approach = FALSE
END IF
{ === LEVEL CONTROL (Dump Valve) === }
level_error_pct = LEVEL_SETPOINT_PCT − level_pct
{ Anti-windup integral; only if error small }
IF ABS(level_error_pct) < 10 THEN
level_pid_integral = level_pid_integral + level_error_pct × 0.01
ELSE
level_pid_integral = 0
END IF
{ PID for dump valve (Kp=1.5, Ki=0.01, Kd=0.5) }
level_derivative = (level_error_pct − level_pid_prev_error) / scan_time_sec
level_pid_output_pct = (1.5 × level_error_pct) + level_pid_integral + (0.5 × level_derivative)
{ Demand flowrate from PID }
dump_valve_cmd_pct = 50 + level_pid_output_pct { nominal 50%, ±50% around midpoint }
{ Clamp to 0–100% }
IF dump_valve_cmd_pct < 0 THEN dump_valve_cmd_pct = 0 END IF
IF dump_valve_cmd_pct > 100 THEN dump_valve_cmd_pct = 100 END IF
{ === SAFETY LIMITS === }
{ High level protection }
IF level_pct > INTERFACE_MAX_PCT THEN
slug_detected = TRUE
dump_valve_cmd_pct = 100 { fully open dump }
Log_Alarm("SLUG_HIGH_LEVEL", level_pct=level_pct)
ELSE
slug_detected = FALSE
END IF
{ Low level protection }
IF level_pct < INTERFACE_MIN_PCT THEN
dump_valve_cmd_pct = 0 { fully close dump }
Log_Warning("LOW_LEVEL_PUMP_CAVITATION_RISK", level_pct=level_pct)
END IF
{ === RESIDENCE TIME CHECK === }
{ Estimate residence time if gas flow available }
gas_flow_rate_scf_day = 1.5 × flow_estimate_from_pressure_ratio { rough calc }
residence_time_min = (vessel_volume_bbl × 5.615) / (gas_flow_rate_scf_day / 1440)
IF residence_time_min < GAS_RESIDENCE_TIME_MIN THEN
Log_Warning("SHORT_RESIDENCE_TIME_POOR_SEPARATION", rt_min=residence_time_min)
END IF
{ === OUTPUTS === }
Command_Control_Valve("DUMP_VALVE", dump_valve_cmd_pct)
Command_Control_Valve("DOWNSTREAM_CHOKE", choke_valve_cmd_pct)
{ === DATA LOG (every 30 min) === }
IF MOD(scan_count, 1800) = 0 THEN
Log_Process_Data({
timestamp: Get_Timestamp(),
level_pct: level_pct,
interface_oil_pct: interface_oil_pct,
pressure_outlet_psi: pressure_outlet_psi,
dump_valve_cmd_pct: dump_valve_cmd_pct,
choke_valve_cmd_pct: choke_valve_cmd_pct,
residence_time_min: residence_time_min,
slug_detected: slug_detected,
interface_lost: interface_lost
})
END IF
level_pid_prev_error = level_error_pct
END PROCEDURE
```
---
## 4. Tag List
```
LEVEL_VESSEL_PCT { capacitive level 0–100% }
DENSITY_INTERFACE_MA { 4–20mA interface position }
PRESSURE_GAS_OUTLET_PSI { separator outlet pressure }
PRESSURE_INLET_PSI { incoming stream }
TEMPERATURE_OUTLET_F { for vapor correction }
DUMP_VALVE_COMMAND_PCT { 0–100 modulation }
CHOKE_VALVE_COMMAND_PCT { backpressure control }
GAS_RESIDENCE_TIME_MIN { quality check }
SLUG_DETECTED { boolean }
INTERFACE_OIL_PCT { oil layer position }
INTERFACE_LOST { alarm }
SONIC_APPROACH { warning }
```
---
## 5. Alarm & Trip Matrix
| **Condition** | **Severity** | **Action** |
|---|---|---|
| **Level > 75%** | 🔴 CRIT | Open dump fully; check inlet capacity |
| **Level < 20%** | 🟡 WARN | Close dump; check gas production |
| **Interface lost** | 🔴 CRIT | Oil carry-over to compressor; trip inlet or vent gas |
| **Pressure ratio < 0.55** | 🟡 WARN | Risk of sonic choke; restrict inlet |
| **Residence time < 3 min** | 🟡 WARN | Reduce inlet or enlarge vessel |
---
**Document Version:** 1.0
**Last Updated:** 2026-04-13
**Status:** Ready for Production