Class RiskMatrix
java.lang.Object
neqsim.process.safety.risk.RiskMatrix
- All Implemented Interfaces:
Serializable
Risk Matrix for equipment failure analysis.
Combines probability (from reliability data) with consequence (from NeqSim simulation) to create a visual risk matrix. Calculates economic cost of different failure scenarios.
Risk Categories
- Probability: Very Low (1) to Very High (5) based on failure frequency
- Consequence: Negligible (1) to Catastrophic (5) based on production loss
- Risk Level: Low (green), Medium (yellow), High (orange), Critical (red)
Example Usage
RiskMatrix matrix = new RiskMatrix(processSystem);
matrix.setProductPrice(500.0, "USD/tonne");
matrix.setDowntimeCostPerHour(10000.0);
// Build risk matrix for all equipment
matrix.buildRiskMatrix();
// Get risk assessment for specific equipment
RiskAssessment risk = matrix.getRiskAssessment("HP Compressor");
System.out.println("Risk Level: " + risk.getRiskLevel());
System.out.println("Annual Cost: $" + risk.getAnnualRiskCost());
// Get matrix data for visualization
String json = matrix.toJson();
- Version:
- 1.0
- Author:
- NeqSim Development Team
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumConsequence categories (1-5).static enumProbability categories (1-5).static classRisk assessment for a single equipment.static enumRisk level categories. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleDowntime cost per hour (fixed costs, personnel, etc.).private StringFeed stream name.private ProductionImpactAnalyzerProduction impact analyzer.private static final org.apache.logging.log4j.LoggerLogger.private doubleHours of operation per year.private ProcessSystemProcess system for simulation.private doubleProduct price (per kg).private StringProduct stream name.private ReliabilityDataSourceReliability data source.private Map<String, RiskMatrix.RiskAssessment> Risk assessments for each equipment.private static final long -
Constructor Summary
ConstructorsConstructorDescriptionRiskMatrix(ProcessSystem processSystem) Creates a risk matrix for the process system. -
Method Summary
Modifier and TypeMethodDescriptionaddEquipmentRisk(String equipmentName, double failuresPerYear, double mttr) Adds custom equipment risk data (overrides database).voidanalyzeEquipment(String equipmentName, String equipmentType) Analyzes a specific equipment.private voidvoidBuilds the risk matrix by analyzing all equipment.private voidcalculateCost(RiskMatrix.RiskAssessment assessment) Gets equipment in a specific risk level.Gets risk matrix data for visualization.getRiskAssessment(String equipmentName) Gets risk assessment for specific equipment.Gets all risk assessments.Gets risk assessments sorted by annual cost (highest first).Gets risk assessments sorted by risk score (highest first).doubleGets total annual risk cost.private StringsetDowntimeCostPerHour(double costPerHour) Sets the downtime cost per hour (fixed costs during shutdown).setFeedStreamName(String name) Sets the feed stream name.setOperatingHoursPerYear(double hours) Sets operating hours per year.setProductPrice(double price, String unit) Sets the product price.setProductStreamName(String name) Sets the product stream name.toJson()Serializes to JSON.toMap()Generates a summary map.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger. -
processSystem
Process system for simulation. -
impactAnalyzer
Production impact analyzer. -
reliabilitySource
Reliability data source. -
riskAssessments
Risk assessments for each equipment. -
feedStreamName
Feed stream name. -
productStreamName
Product stream name. -
productPricePerKg
private double productPricePerKgProduct price (per kg). -
downtimeCostPerHour
private double downtimeCostPerHourDowntime cost per hour (fixed costs, personnel, etc.). -
operatingHoursPerYear
private double operatingHoursPerYearHours of operation per year.
-
-
Constructor Details
-
RiskMatrix
Creates a risk matrix for the process system.- Parameters:
processSystem- the process system
-
-
Method Details
-
autoDetectStreams
private void autoDetectStreams() -
setFeedStreamName
Sets the feed stream name.- Parameters:
name- the feed stream name- Returns:
- this matrix for chaining
-
setProductStreamName
Sets the product stream name.- Parameters:
name- the product stream name- Returns:
- this matrix for chaining
-
setProductPrice
Sets the product price.- Parameters:
price- the priceunit- the unit (e.g., "USD/tonne", "USD/kg", "NOK/Sm3")- Returns:
- this matrix for chaining
-
setDowntimeCostPerHour
Sets the downtime cost per hour (fixed costs during shutdown).- Parameters:
costPerHour- cost per hour- Returns:
- this matrix for chaining
-
setOperatingHoursPerYear
Sets operating hours per year.- Parameters:
hours- operating hours- Returns:
- this matrix for chaining
-
addEquipmentRisk
Adds custom equipment risk data (overrides database).- Parameters:
equipmentName- equipment namefailuresPerYear- expected failures per yearmttr- mean time to repair in hours- Returns:
- this matrix for chaining
-
buildRiskMatrix
public void buildRiskMatrix()Builds the risk matrix by analyzing all equipment. -
analyzeEquipment
-
calculateCost
-
guessEquipmentType
-
getRiskAssessment
Gets risk assessment for specific equipment.- Parameters:
equipmentName- equipment name- Returns:
- risk assessment or null
-
getRiskAssessments
Gets all risk assessments.- Returns:
- map of equipment name to risk assessment
-
getRiskAssessmentsSortedByRisk
Gets risk assessments sorted by risk score (highest first).- Returns:
- sorted list of risk assessments
-
getRiskAssessmentsSortedByCost
Gets risk assessments sorted by annual cost (highest first).- Returns:
- sorted list of risk assessments
-
getEquipmentByRiskLevel
Gets equipment in a specific risk level.- Parameters:
level- the risk level- Returns:
- list of equipment names
-
getTotalAnnualRiskCost
public double getTotalAnnualRiskCost()Gets total annual risk cost.- Returns:
- total annual cost
-
getMatrixData
-
toMap
-
toJson
-
toString
-