Class OREDADataImporter

java.lang.Object
neqsim.process.safety.risk.data.OREDADataImporter
All Implemented Interfaces:
Serializable

public class OREDADataImporter extends Object implements Serializable
Imports equipment reliability data from OREDA-format CSV files.

OREDA (Offshore and Onshore Reliability Data) is the industry standard for equipment reliability data in the oil and gas industry. This class imports data from CSV files following the OREDA format structure.

CSV Format

The expected CSV format is:
EquipmentType,EquipmentClass,FailureMode,FailureRate,MTBF_hours,MTTR_hours,DataSource,Confidence
Compressor,Centrifugal,All modes,1.14e-4,8772,72,OREDA-2015,High
Separator,Two-phase,All modes,5.71e-5,17513,24,OREDA-2015,High

Usage Example

OREDADataImporter importer = new OREDADataImporter();
importer.loadFromResource("/reliabilitydata/oreda_equipment.csv");

ReliabilityRecord record = importer.getRecord("Compressor", "Centrifugal");
double mtbf = record.getMtbfHours();
double failureRate = record.getFailureRate();
Since:
3.3.0
Version:
1.0
Author:
NeqSim Development Team
See Also:
  • Field Details

  • Constructor Details

    • OREDADataImporter

      public OREDADataImporter()
      Creates a new OREDA data importer.
  • Method Details

    • loadFromResource

      public void loadFromResource(String resourcePath) throws IOException
      Loads reliability data from a resource file.
      Parameters:
      resourcePath - path to resource file (e.g., "/reliabilitydata/oreda.csv")
      Throws:
      IOException - if file cannot be read
    • loadFromFile

      public void loadFromFile(Path filePath) throws IOException
      Loads reliability data from a file path.
      Parameters:
      filePath - path to CSV file
      Throws:
      IOException - if file cannot be read
    • loadFromReader

      private void loadFromReader(BufferedReader reader) throws IOException
      Loads reliability data from a BufferedReader.
      Parameters:
      reader - BufferedReader to read from
      Throws:
      IOException - if reading fails
    • parseRecord

      private OREDADataImporter.ReliabilityRecord parseRecord(String line)
      Parses a CSV line into a ReliabilityRecord.
      Parameters:
      line - CSV line
      Returns:
      parsed record
    • parseDouble

      private double parseDouble(String value)
      Parses a double value, handling scientific notation.
      Parameters:
      value - string value
      Returns:
      parsed double
    • addRecord

      public void addRecord(OREDADataImporter.ReliabilityRecord record)
      Adds a record to the importer.
      Parameters:
      record - record to add
    • getRecord

      public OREDADataImporter.ReliabilityRecord getRecord(String equipmentType, String equipmentClass, String failureMode)
      Gets a specific record by equipment type, class, and failure mode.
      Parameters:
      equipmentType - equipment type
      equipmentClass - equipment class
      failureMode - failure mode
      Returns:
      record or null if not found
    • getRecord

      public OREDADataImporter.ReliabilityRecord getRecord(String equipmentType, String equipmentClass)
      Gets a record by equipment type and class (defaults to "All modes").
      Parameters:
      equipmentType - equipment type
      equipmentClass - equipment class
      Returns:
      record or null if not found
    • getRecordsByType

      public List<OREDADataImporter.ReliabilityRecord> getRecordsByType(String equipmentType)
      Gets all records for an equipment type.
      Parameters:
      equipmentType - equipment type
      Returns:
      list of records (empty if none found)
    • getEquipmentTypes

      public List<String> getEquipmentTypes()
      Gets all unique equipment types.
      Returns:
      list of equipment types
    • getAllRecords

      public List<OREDADataImporter.ReliabilityRecord> getAllRecords()
      Gets all records.
      Returns:
      list of all records
    • getRecordCount

      public int getRecordCount()
      Gets the number of records loaded.
      Returns:
      record count
    • getDataSource

      public String getDataSource()
      Gets the data source identifier.
      Returns:
      data source
    • search

      Searches for records matching a pattern.
      Parameters:
      pattern - pattern to match (case-insensitive)
      Returns:
      matching records
    • getFailureRate

      public double getFailureRate(String equipmentType, String equipmentClass, String failureMode)
      Gets the failure rate for specified equipment.
      Parameters:
      equipmentType - equipment type (e.g., "Pump")
      equipmentClass - equipment class (e.g., "Centrifugal")
      failureMode - failure mode (e.g., "All modes")
      Returns:
      failure rate per hour, or -1 if not found
    • getMTBF

      public double getMTBF(String equipmentType, String equipmentClass, String failureMode)
      Gets the MTBF for specified equipment.
      Parameters:
      equipmentType - equipment type
      equipmentClass - equipment class
      failureMode - failure mode
      Returns:
      MTBF in hours, or -1 if not found
    • getMTTR

      public double getMTTR(String equipmentType, String equipmentClass, String failureMode)
      Gets the MTTR for specified equipment.
      Parameters:
      equipmentType - equipment type
      equipmentClass - equipment class
      failureMode - failure mode
      Returns:
      MTTR in hours, or -1 if not found
    • getDataSourceForRecord

      public String getDataSourceForRecord(String equipmentType, String equipmentClass, String failureMode)
      Gets the data source for specified equipment.
      Parameters:
      equipmentType - equipment type
      equipmentClass - equipment class
      failureMode - failure mode
      Returns:
      data source identifier, or null if not found
    • getEquipmentClasses

      public List<String> getEquipmentClasses(String equipmentType)
      Gets all equipment classes for a given equipment type.
      Parameters:
      equipmentType - equipment type
      Returns:
      list of equipment classes
    • getFailureModes

      public List<String> getFailureModes(String equipmentType, String equipmentClass)
      Gets all failure modes for a given equipment type and class.
      Parameters:
      equipmentType - equipment type
      equipmentClass - equipment class
      Returns:
      list of failure modes
    • loadAllPublicDataSources

      public void loadAllPublicDataSources() throws IOException
      Loads all built-in public domain reliability data sources.

      This method loads data from:

      • Generic literature (Lees, CCPS, MIL-HDBK-217F)
      • IEEE 493 (Gold Book) electrical equipment data
      • IOGP/OGP oil and gas industry data
      • Representative OREDA data

      Data is loaded in priority order with later sources overriding earlier ones for matching equipment.

      Throws:
      IOException - if any data file cannot be read
    • loadIEEE493Data

      public void loadIEEE493Data() throws IOException
      Loads IEEE 493 (Gold Book) reliability data.

      IEEE 493 provides reliability data primarily for electrical and power distribution equipment.

      Throws:
      IOException - if data file cannot be read
    • loadIOGPData

      public void loadIOGPData() throws IOException
      Loads IOGP/OGP oil and gas industry reliability data.

      IOGP data includes offshore equipment, safety systems, and hydrocarbon release frequencies.

      Throws:
      IOException - if data file cannot be read
    • loadGenericLiteratureData

      public void loadGenericLiteratureData() throws IOException
      Loads generic reliability data from published literature.

      Sources include Lees' Loss Prevention, CCPS Guidelines, and MIL-HDBK-217F.

      Throws:
      IOException - if data file cannot be read
    • loadFromCSV

      public void loadFromCSV(String csvPath) throws IOException
      Loads reliability data from a CSV file path string.
      Parameters:
      csvPath - path to CSV file
      Throws:
      IOException - if file cannot be read
    • clear

      public void clear()
      Clears all loaded records.
    • createWithDefaults

      public static OREDADataImporter createWithDefaults()
      Creates a default importer with built-in OREDA data.
      Returns:
      importer with default data
    • createWithAllPublicData

      public static OREDADataImporter createWithAllPublicData()
      Creates an importer with all public domain data sources loaded.

      This factory method loads data from IEEE 493, IOGP, generic literature, and OREDA representative values. This provides the most comprehensive coverage for risk analysis.

      Returns:
      importer with all public data sources loaded
    • createForElectricalEquipment

      public static OREDADataImporter createForElectricalEquipment()
      Creates an importer optimized for electrical equipment analysis.

      Loads IEEE 493 (Gold Book) data which is the primary reference for electrical equipment reliability in industrial and commercial power systems.

      Returns:
      importer with IEEE 493 data
    • createForOilAndGas

      public static OREDADataImporter createForOilAndGas()
      Creates an importer optimized for oil and gas equipment analysis.

      Loads IOGP/OGP and OREDA data which are the primary references for oil and gas industry equipment reliability.

      Returns:
      importer with O&G specific data