Skip to the content.

ESD Fire Alarm System with Voting Logic

Overview

This implementation demonstrates a comprehensive Emergency Shutdown (ESD) system with fire alarm voting logic in NeqSim. The system showcases how multiple fire detectors can be used in a voting configuration to prevent spurious trips while ensuring safety when multiple alarms confirm a fire event.

Key Features

1. FireDetector Measurement Device

Location: src/main/java/neqsim/process/measurementdevice/FireDetector.java

A new binary sensor for fire detection with features:

Example Usage:

FireDetector fireDetector = new FireDetector("FD-101", "Separator Area - North");
fireDetector.setDetectionThreshold(0.5);
fireDetector.setDetectionDelay(1.0);

// Configure alarm
AlarmConfig alarmConfig = AlarmConfig.builder()
    .highLimit(0.5)
    .delay(1.0)
    .unit("binary")
    .build();
fireDetector.setAlarmConfig(alarmConfig);

// Detect fire
fireDetector.detectFire();

// Check status
if (fireDetector.isFireDetected()) {
    System.out.println("Fire detected!");
}

2. Voting Logic Patterns

2-out-of-2 Voting

Requires both fire detectors to activate before triggering ESD. Provides:

2-out-of-3 Voting

Any two of three detectors trigger ESD. Provides:

Implementation:

// Count active alarms
int activeAlarms = (fireDetector1.isFireDetected() ? 1 : 0)
                 + (fireDetector2.isFireDetected() ? 1 : 0)
                 + (fireDetector3.isFireDetected() ? 1 : 0);

// Apply voting logic
boolean esdShouldActivate = (activeAlarms >= 2);

if (esdShouldActivate && !bdValve.isActivated()) {
    bdValve.activate();
    gasSplitter.setSplitFactors(new double[] {0.0, 1.0}); // Redirect to blowdown
}

3. Complete ESD Blowdown Sequence

The test demonstrates a realistic ESD scenario:

Phase 1: Normal Operation (t=0-5s)

Phase 2: First Fire Alarm (t=5s)

Phase 3: Second Fire Alarm (t=10s)

Phase 4: Blowdown with Emissions Tracking (t=10-20s)

Test Results

Test: testESDWithTwoFireAlarmVoting

System Configuration:

Simulation Results (20-second blowdown):

Time (s) | FD-101 | FD-102 | Alarms | BD Open (%) | BD Flow (kg/hr) | Flare Heat (MW) | CO2 Rate (kg/s) | Cumul Heat (GJ) | Cumul CO2 (kg)
---------|--------|--------|--------|-------------|-----------------|-----------------|-----------------|-----------------|----------------
     0.0 |   FIRE |   FIRE |      2 |         0.0 |        817,553  |        11,657   |         626.4   |           11.66 |          626.4
     2.0 |   FIRE |   FIRE |      2 |         0.0 |        814,203  |        11,610   |         623.8   |           34.90 |         1875.3
    10.0 |   FIRE |   FIRE |      2 |        20.0 |        803,959  |        11,464   |         616.0   |          127.08 |         6828.3
    14.0 |   FIRE |   FIRE |      2 |       100.0 |        800,259  |        11,411   |         613.1   |          172.80 |         9285.0
    20.0 |   FIRE |   FIRE |      2 |       100.0 |        795,957  |        11,349   |         609.8   |          241.04 |        12951.8

Final Summary:

Test: testESDWith2OutOf3FireAlarmVoting

Tests voting combinations:

  1. No alarms → ESD: NO
  2. One alarm (FD-101) → ESD: NO
  3. Two alarms (FD-101 + FD-102) → ESD: YES
  4. Three alarms (all active) → ESD: YES
  5. Reset one detector (FD-103) → ESD maintained with 2 remaining
  6. Reset another (FD-102) → Only 1 active, but BD valve stays latched

Key Safety Feature: BD valve remains activated even when alarms clear, requiring manual reset to prevent automatic system restoration during emergency.

Architecture

┌──────────────────────────────────────────────────────────────┐
│                    ESD FIRE ALARM SYSTEM                     │
└──────────────────────────────────────────────────────────────┘

Fire Detectors:                  Voting Logic:
┌────────────┐                  ┌─────────────────┐
│  FD-101    │─────┐           │ Count Active    │
│  (North)   │     │           │ Alarms >= 2?    │──► ESD Trigger
└────────────┘     ├──────────►│                 │
                   │           └─────────────────┘
┌────────────┐     │
│  FD-102    │─────┤
│  (South)   │     │
└────────────┘     │
                   │
┌────────────┐     │
│  FD-103    │─────┘
│  (East)    │ [Optional - for 2-out-of-3]
└────────────┘

Process Flow:
┌────────────┐     ┌──────────┐     ┌─────────────┐
│ Separator  │────►│ Splitter │────►│  To Process │
│  50 bara   │     └──────────┘     └─────────────┘
└────────────┘          │
                        │ (ESD redirects flow)
                        ▼
                  ┌─────────────┐
                  │ BD Valve    │
                  │ (opens 5s)  │
                  └─────────────┘
                        │
                        ▼
                  ┌─────────────┐
                  │  Orifice    │ (flow control)
                  └─────────────┘
                        │
                        ▼
                  ┌─────────────┐
                  │   Flare     │ ◄── Heat & CO2
                  │  1.5 bara   │     Calculations
                  └─────────────┘

Emissions Calculations

The flare tracks cumulative values during blowdown:

Heat Release:

CO2 Emissions:

Gas Burned:

Test Execution

Run all ESD fire alarm tests:

mvnw test -Dtest=ESDFireAlarmSystemTest

Run specific test:

mvnw test -Dtest=ESDFireAlarmSystemTest#testESDWithTwoFireAlarmVoting

Integration Points

With Existing NeqSim Components

Compatible Equipment:

Alarm System Integration:

Safety Instrumented Systems (SIS) Applications

This implementation demonstrates concepts used in:

Best Practices Demonstrated

  1. Voting Logic: Prevents spurious trips while maintaining safety
  2. Safety Latching: BD valve stays activated until manual reset
  3. Alarm Confirmation: Requires multiple independent sensors
  4. Dynamic Simulation: Realistic transient behavior during blowdown
  5. Emissions Tracking: Cumulative tracking for regulatory compliance
  6. Comprehensive Testing: Both unit tests and integration scenarios

Future Enhancements

Potential additions:

References

Files Created/Modified

New Files:

  1. src/main/java/neqsim/process/measurementdevice/FireDetector.java
  2. src/test/java/neqsim/process/equipment/valve/ESDFireAlarmSystemTest.java
  3. docs/wiki/esd_fire_alarm_system.md

Key Dependencies:

Example: Implementing Custom Voting Logic

/**
 * Custom voting logic class for ESD systems.
 */
public class ESDVotingLogic {
    private final List<FireDetector> detectors;
    private final int requiredAlarms;
    private final BlowdownValve bdValve;
    
    public ESDVotingLogic(BlowdownValve bdValve, int requiredAlarms, 
                          FireDetector... detectors) {
        this.bdValve = bdValve;
        this.requiredAlarms = requiredAlarms;
        this.detectors = Arrays.asList(detectors);
    }
    
    public void evaluate() {
        int activeAlarms = (int) detectors.stream()
                                          .filter(FireDetector::isFireDetected)
                                          .count();
        
        if (activeAlarms >= requiredAlarms && !bdValve.isActivated()) {
            bdValve.activate();
            System.out.println("ESD ACTIVATED: " + activeAlarms + 
                             " of " + detectors.size() + " alarms active");
        }
    }
    
    public boolean isESDActive() {
        return bdValve.isActivated();
    }
}

// Usage:
ESDVotingLogic esdLogic = new ESDVotingLogic(bdValve, 2, 
                                             fireDetector1, 
                                             fireDetector2, 
                                             fireDetector3);

// In simulation loop:
esdLogic.evaluate();

Author: ESOL
Date: November 2025
Version: 1.0