Class HIPPSValve

All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, ValveInterface, SimulationInterface, NamedInterface

public class HIPPSValve extends ThrottlingValve
High Integrity Pressure Protection System (HIPPS) Valve.

HIPPS is a Safety Instrumented System (SIS) designed to prevent overpressure by shutting down the source of pressure rather than relieving it. It provides an alternative or complement to traditional pressure relief devices (PSVs/rupture disks).

Key Features:

  • SIL-rated (Safety Integrity Level) protection, typically SIL 2 or SIL 3
  • Redundant pressure transmitters (voting logic: 1oo2, 2oo3, etc.)
  • Fast-acting isolation valve(s) with partial stroke testing capability
  • Closes on high pressure to prevent overpressure before PSV setpoint
  • Prevents loss of containment and flaring/venting
  • Diagnostic monitoring with proof testing support

HIPPS vs. PSV:

Comparison between HIPPS and PSV protection systems
Aspect HIPPS PSV
Action Stops flow (isolation) Relieves pressure (venting)
Set Point Below MAWP (e.g., 90%) At/above MAWP
Emissions Prevents flaring Releases to flare
SIL Rating SIL 2 or SIL 3 Mechanical (not SIL)
Testing Partial stroke, diagnostics Periodic inspection
Response 2-5 seconds typical Instantaneous (spring)

Typical Applications:

  • Subsea pipelines (prevents overpressure at receiving platform)
  • Blocked outlet scenarios (pump/compressor deadhead protection)
  • Thermal expansion protection (isolated segments)
  • High-pressure gas injection systems
  • Where flaring is environmentally/economically undesirable

Voting Logic:

  • 1oo1 (1 out of 1): Single transmitter trips (simple, lower SIL)
  • 1oo2 (1 out of 2): Any one of two transmitters trips (high availability)
  • 2oo2 (2 out of 2): Both transmitters must trip (low spurious trips)
  • 2oo3 (2 out of 3): Any two of three transmitters trip (balanced, common for SIL 3)

Usage Example:

// Create redundant pressure transmitters with alarm configuration
PressureTransmitter PT1 = new PressureTransmitter("PT-101A", upstreamStream);
PressureTransmitter PT2 = new PressureTransmitter("PT-101B", upstreamStream);
PressureTransmitter PT3 = new PressureTransmitter("PT-101C", upstreamStream);

AlarmConfig alarmConfig = AlarmConfig.builder().highHighLimit(90.0) // HIPPS trip at 90 bara
                                                                    // (below 100 bara MAWP)
    .deadband(2.0).delay(0.5).unit("bara").build();

PT1.setAlarmConfig(alarmConfig);
PT2.setAlarmConfig(alarmConfig);
PT3.setAlarmConfig(alarmConfig);

// Create HIPPS valve with 2oo3 voting (SIL 3 typical)
HIPPSValve hippsValve = new HIPPSValve("HIPPS-XV-101", feedStream);
hippsValve.addPressureTransmitter(PT1);
hippsValve.addPressureTransmitter(PT2);
hippsValve.addPressureTransmitter(PT3);
hippsValve.setVotingLogic(HIPPSValve.VotingLogic.TWO_OUT_OF_THREE);
hippsValve.setClosureTime(3.0); // 3 seconds SIL-rated actuator
hippsValve.setSILRating(3); // SIL 3 system

// In dynamic simulation
system.runTransient(dt, UUID.randomUUID());
// Valve automatically closes when 2 out of 3 transmitters reach HIHI

// Check status
if (hippsValve.hasTripped()) {
  System.out.println("HIPPS activated - pressure source isolated");
  System.out.println("Active transmitters: " + hippsValve.getActiveTransmitterCount());
}

// Perform partial stroke test (required for SIL validation)
hippsValve.performPartialStrokeTest(0.15); // 15% stroke test

Safety Simulation Considerations:

  • Model both successful operation and failure modes (spurious trip, fail to close)
  • Account for response time delay (typically 2-5 seconds)
  • Validate pressure never exceeds MAWP before HIPPS closes
  • Consider transmitter failure scenarios and voting logic
  • Model interaction with downstream PSV (HIPPS should prevent PSV from lifting)
  • Account for water hammer/surge when valve closes rapidly
  • Proof test intervals affect availability (typical: 1-2 years)
Version:
$Id: $Id
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • pressureTransmitters

      private final List<MeasurementDeviceInterface> pressureTransmitters
      List of pressure transmitters providing redundancy.
    • votingLogic

      private HIPPSValve.VotingLogic votingLogic
      Voting logic for transmitter redundancy.
    • hasTripped

      private boolean hasTripped
      Indicates if HIPPS has tripped.
    • closureTime

      private double closureTime
      Time required for valve to close (seconds).
    • silRating

      private int silRating
      Safety Integrity Level (1, 2, or 3).
    • tripEnabled

      private boolean tripEnabled
      Flag to enable/disable automatic trip.
    • lastTripTime

      private double lastTripTime
      Timestamp of last trip event (for diagnostics).
    • cumulativeTime

      private double cumulativeTime
      Cumulative time in simulation (for diagnostics).
    • spuriousTripCount

      private int spuriousTripCount
      Count of spurious trips (for diagnostics).
    • partialStrokeTestActive

      private boolean partialStrokeTestActive
      Flag indicating if partial stroke test is active.
    • partialStrokeTestTarget

      private double partialStrokeTestTarget
      Target opening for partial stroke test.
    • partialStrokeTestStartTime

      private double partialStrokeTestStartTime
      Time when partial stroke test started.
    • partialStrokeTestDuration

      private double partialStrokeTestDuration
      Duration of partial stroke test.
    • proofTestInterval

      private double proofTestInterval
      Proof test interval (hours) - required for SIL validation.
    • timeSinceProofTest

      private double timeSinceProofTest
      Time since last proof test (hours).
  • Constructor Details

    • HIPPSValve

      public HIPPSValve(String name)
      Constructor for HIPPSValve.
      Parameters:
      name - name of HIPPS valve
    • HIPPSValve

      public HIPPSValve(String name, StreamInterface inletStream)
      Constructor for HIPPSValve.
      Parameters:
      name - name of HIPPS valve
      inletStream - inlet stream to valve
  • Method Details

    • addPressureTransmitter

      public void addPressureTransmitter(MeasurementDeviceInterface transmitter)
      Adds a pressure transmitter to the redundant array.
      Parameters:
      transmitter - pressure transmitter for HIPPS monitoring
    • removePressureTransmitter

      public void removePressureTransmitter(MeasurementDeviceInterface transmitter)
      Removes a pressure transmitter from the array (e.g., failed transmitter).
      Parameters:
      transmitter - pressure transmitter to remove
    • getPressureTransmitters

      public List<MeasurementDeviceInterface> getPressureTransmitters()
      Gets the list of configured pressure transmitters.
      Returns:
      list of pressure transmitters
    • setVotingLogic

      public void setVotingLogic(HIPPSValve.VotingLogic logic)
      Sets the voting logic for transmitter redundancy.
      Parameters:
      logic - voting logic to use
    • getVotingLogic

      public HIPPSValve.VotingLogic getVotingLogic()
      Gets the current voting logic.
      Returns:
      voting logic
    • setClosureTime

      public void setClosureTime(double closureTime)
      Sets the valve closure time.
      Parameters:
      closureTime - time in seconds for valve to close completely
    • getClosureTime

      public double getClosureTime()
      Gets the configured closure time.
      Returns:
      closure time in seconds
    • setSILRating

      public void setSILRating(int sil)
      Sets the Safety Integrity Level (SIL) rating.
      Parameters:
      sil - SIL rating (1, 2, or 3)
    • getSILRating

      public int getSILRating()
      Gets the SIL rating.
      Returns:
      SIL rating
    • hasTripped

      public boolean hasTripped()
      Checks if HIPPS has tripped.
      Returns:
      true if HIPPS has tripped
    • getLastTripTime

      public double getLastTripTime()
      Gets the time of last trip event.
      Returns:
      time in seconds, or -1 if never tripped
    • getSpuriousTripCount

      public int getSpuriousTripCount()
      Gets the number of spurious trips recorded.
      Returns:
      spurious trip count
    • recordSpuriousTrip

      public void recordSpuriousTrip()
      Manually marks a trip as spurious (for diagnostics).
    • reset

      public void reset()
      Resets the trip state, allowing valve to be reopened.

      In real operations, this requires:

      • Operator authorization
      • Verification that alarm condition has cleared
      • Safety system approval
      • Documentation of trip cause

      The valve will not automatically reopen after reset - it must be manually opened via setPercentValveOpening().

    • setTripEnabled

      public void setTripEnabled(boolean enabled)
      Enables or disables automatic trip on HIHI alarm.
      Parameters:
      enabled - true to enable trip, false to disable (bypass)
    • isTripEnabled

      public boolean isTripEnabled()
      Checks if trip is enabled.
      Returns:
      true if trip is enabled
    • setProofTestInterval

      public void setProofTestInterval(double hours)
      Sets the proof test interval (required for SIL validation).
      Parameters:
      hours - hours between proof tests (typical: 8760 for annual)
    • getProofTestInterval

      public double getProofTestInterval()
      Gets the proof test interval.
      Returns:
      proof test interval in hours
    • getTimeSinceProofTest

      public double getTimeSinceProofTest()
      Gets time since last proof test.
      Returns:
      hours since last proof test
    • isProofTestDue

      public boolean isProofTestDue()
      Checks if proof test is due.
      Returns:
      true if proof test interval has been exceeded
    • performProofTest

      public void performProofTest()
      Performs a proof test (resets the timer).
    • performPartialStrokeTest

      public void performPartialStrokeTest(double strokeFraction)
      Initiates a partial stroke test (required for SIL validation).

      Partial stroke testing verifies valve operation without full closure, allowing testing during operation. Typical test strokes: 10-20% of full travel.

      Parameters:
      strokeFraction - fraction of full stroke to test (0.0-0.9, e.g., 0.15 for 15%)
    • isPartialStrokeTestActive

      public boolean isPartialStrokeTestActive()
      Checks if partial stroke test is active.
      Returns:
      true if test is in progress
    • getActiveTransmitterCount

      public int getActiveTransmitterCount()
      Counts how many transmitters are currently in HIHI alarm state.
      Returns:
      number of transmitters in HIHI alarm
    • evaluateVotingLogic

      private boolean evaluateVotingLogic()
      Evaluates voting logic to determine if HIPPS should trip.
      Returns:
      true if voting logic condition is met
    • runTransient

      public void runTransient(double dt, UUID id)
      Performs dynamic simulation step with HIPPS logic.

      This method implements:

      • Redundant transmitter monitoring with voting logic
      • Automatic trip on voting condition
      • Partial stroke test execution
      • Proof test tracking
      • Trip state enforcement
      Specified by:
      runTransient in interface SimulationInterface
      Overrides:
      runTransient in class ThrottlingValve
      Parameters:
      dt - time step in seconds
      id - unique identifier for this calculation
    • setPercentValveOpening

      public void setPercentValveOpening(double opening)
      Overrides setPercentValveOpening to prevent opening when tripped.

      If HIPPS has tripped, it cannot be opened until reset() is called. This prevents inadvertent reopening during an alarm condition.

      Specified by:
      setPercentValveOpening in interface ValveInterface
      Overrides:
      setPercentValveOpening in class ThrottlingValve
      Parameters:
      opening - desired valve opening percentage (0-100)
    • toString

      public String toString()
      Gets a comprehensive status string for the HIPPS valve.
      Overrides:
      toString in class Object
      Returns:
      string describing HIPPS state including diagnostics
    • getDiagnostics

      public String getDiagnostics()
      Gets diagnostic information for safety analysis.
      Returns:
      diagnostic string with detailed HIPPS metrics