neqsim-hazid-fmea-eta-fta
Skill170 starsChanged 7 months agoApache-2.0View on GitHub
Structured hazard identification - IEC 61882 HAZOP worksheets with deviation-to-NeqSim-calculator mapping, FMEA with RPN scoring, event trees, fault trees with beta-factor common cause and minimal cut sets, escalation (domino) screening. USE WHEN: a task needs systematic hazard identification, quantified HAZOP/HAZID deviations, top-event decomposition or domino analysis. Anchors on neqsim.process.safety.hazid, .risk.eta, .risk.fta and .escalation.
In this repository143 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- analyze-convergenceSkill
- analyze-gibbs-convergenceSkill
- book-creationSkill
- design-flash-benchmarkSkill
- design-reactor-benchmarkSkill
- figure-discussionSkill
- generate-publication-figuresSkill
- journal-formattingSkill
- neqsim-acid-gas-treatingSkill
- neqsim-advanced-control-mpc-and-virtual-sensingSkill
- neqsim-agent-handoffSkill
- neqsim-agentic-process-optimizationSkill
- neqsim-api-patternsSkill
- neqsim-autonomous-investigationSkill
- neqsim-capability-mapSkill
- neqsim-capacity-and-utilization-analysisSkill
- neqsim-capacity-increase-screeningSkill
- neqsim-ccs-hydrogenSkill
- neqsim-code-healthSkill
- neqsim-code-hygieneSkill
- neqsim-code-reviewSkill
- neqsim-column-internals-and-rate-basedSkill
- neqsim-compressor-antisurge-recycleSkill
- neqsim-consequence-analysisSkill
- neqsim-continuous-task-improvementSkill
- neqsim-controllability-operabilitySkill
- neqsim-cooling-waterSkill
- neqsim-cpa-water-boundariesSkill
- neqsim-depressurization-mdmtSkill
- neqsim-distillation-designSkill
- neqsim-document-intelligence-extractionSkill
- neqsim-dynamic-equipment-implementationSkill
- neqsim-dynamic-simulationSkill
- neqsim-electrolyte-systemsSkill
- neqsim-emulsion-separationSkill
- neqsim-energy-systems-and-electrificationSkill
- neqsim-engineering-design-packageSkill
- neqsim-eos-regressionSkill
- neqsim-equipment-cost-estimationSkill
- neqsim-exploration-strategy-selectionSkill
- neqsim-field-developmentSkill
- neqsim-field-economicsSkill
- neqsim-firewater-deluge-designSkill
- neqsim-flow-accelerated-corrosionSkill
- neqsim-flow-assuranceSkill
- neqsim-flow-assurance-study-reportSkill
- neqsim-forward-separator-trainSkill
- neqsim-future-operation-studySkill
- neqsim-heat-integrationSkill
- neqsim-hydrogen-productionSkill
- neqsim-input-validationSkill
- neqsim-integrated-production-and-lifecycleSkill
- neqsim-in-writingSkill
- neqsim-java8-rulesSkill
- neqsim-jurisdiction-regulatory-basisSkill
- neqsim-literature-searchSkill
- neqsim-lng-liquefactionSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 61
Use addDeviation(...) once per (guideWord, parameter) deviation per node, or generateGrid(...) to create empty rows for selected parameters.
- Very specific: line 283
Run runHAZOP with selected failure modes, or enable all failure modes.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
NeqSim HAZID / FMEA / ETA / FTA Skill
The four canonical hazard-identification and scenario-development techniques in one place — used together they produce auditable HAZOP / SIL / QRA documentation per IEC 61882, IEC 61508/61511, ISO 17776 and the CCPS guideline series.
When to Use
- HAZOP node walkdown — apply guidewords to design intent at every node
- FMEA / FMECA — equipment-level failure-mode tabulation with RPN scoring
- Event-tree analysis (ETA) — outcome-frequency development from initiating event
- Fault-tree analysis (FTA) — top-event decomposition, minimal cut sets, β-factor CCF
- Escalation / domino analysis — graph of adjacency between fire/explosion sources
Pairs with neqsim-process-safety (LOPA / SIL / risk matrix) and
neqsim-consequence-analysis (probit / IRPA roll-up).
Standards
- IEC 61882 — HAZOP studies — application guide
- IEC 60812 — FMEA / FMECA procedure
- IEC 61025 — fault tree analysis
- IEC 61508 / 61511 — β-factor common-cause modelling
- CCPS Guidelines for Hazard Evaluation Procedures (3rd ed.)
- ISO 17776 — major-accident hazard management
Method 1 — HAZOP Worksheet
import neqsim.process.safety.hazid.HAZOPTemplate;
HAZOPTemplate ws = new HAZOPTemplate("V-100", "HP separator pressure control node");
ws.addDeviation(HAZOPTemplate.GuideWord.MORE, HAZOPTemplate.Parameter.PRESSURE,
"PCV stuck open",
"Vessel rupture, gas release",
"PSV-101; Operator response",
"Verify PSV sizing per API 521");
String report = ws.report();The seven IEC 61882 guidewords are defined in HAZOPTemplate.GuideWord.
Use addDeviation(...) once per (guideWord, parameter) deviation per node,
or generateGrid(...) to create empty rows for selected parameters.
For STID/P&ID + plant-data + NeqSim simulation workflows, use MCP runHAZOP.
It accepts a standard runProcess JSON definition plus extracted nodes,
safeguards, evidence references, failure modes, and an optional barrier register.
It returns HAZOP rows with scenario-simulation evidence and report markdown.
To quantify a single deviation from a P&ID Safety Analyser / AI-HAZOP front-end,
use MCP runHazopScenario (neqsim.mcp.runners.HazopScenarioRunner). The
deviation→calculation auto-population is driven by
neqsim.process.safety.hazid.HazopConsequenceAutoPopulator.quantify(...), and
each HazopConsequenceFinding records a verdict, a standardReference, and a
limitBasis provenance string (default screening limit vs per-unit data-sheet
override from HazopQuantificationLimits). See
docs/safety/ai_hazop_input_format.md.
Method 2 — FMEA / FMECA
import neqsim.process.safety.hazid.FMEAWorksheet;
FMEAWorksheet f = new FMEAWorksheet("Compressor train");
f.addEntry("K-101", "Centrifugal compressor",
"Surge", "Suction valve closed too fast",
"Bearing damage, unplanned shutdown",
8, 4, 5); // Severity, Occurrence, Detection
double rpn = f.totalRPN();RPN = S × O × D (IEC 60812). Items above the company threshold (often RPN > 100
or S ≥ 9) trigger design changes. The criticalEntries(threshold) helper returns
the subset above a cut-off.
Method 3 — Event Tree (ETA)
import neqsim.process.safety.risk.eta.EventTreeAnalyzer;
EventTreeAnalyzer eta = new EventTreeAnalyzer("Gas leak", 1.0e-4); // /yr
eta.addBranch("Immediate ignition?", 0.05);
eta.addBranch("Confined?", 0.30);
eta.addBranch("Delayed ignition?", 0.10);
double fJet = eta.outcomeFrequency(new boolean[] {true, false, false});
double fVCE = eta.outcomeFrequency(new boolean[] {false, true, true});
double fFlash = eta.outcomeFrequency(new boolean[] {false, false, true});
double fSafe = eta.outcomeFrequency(new boolean[] {false, false, false});
String tree = eta.toTextTree();Branches multiply: f_outcome = f_init · Π p_branch (or 1-p) along the path. The
text-tree output is suitable for embedding in HAZOP reports.
Method 4 — Fault Tree (FTA)
import neqsim.process.safety.risk.fta.FaultTreeAnalyzer;
import neqsim.process.safety.risk.fta.FaultTreeNode;
FaultTreeNode psvA = FaultTreeNode.basic("PSV-A fails", 0.005);
FaultTreeNode psvB = FaultTreeNode.basic("PSV-B fails", 0.005);
FaultTreeNode bothFail = FaultTreeNode.and("Both PSVs fail", psvA, psvB)
.withCCF(0.10); // β-factor 10 %
FaultTreeAnalyzer fta = new FaultTreeAnalyzer();
double pTop = fta.topEventProbability(bothFail);
java.util.Set<java.util.List<String>> cuts =
fta.minimalCutSets(bothFail, /* maxCardinality */ 4);Gate types: AND, OR, VOTING (k-of-n). Common-cause is applied via
withCCF(β). Minimal cut sets are returned by brute-force enumeration up to a
user-specified cardinality (sufficient for typical < 20-basic-event trees).
β-factor common-cause semantics
The implementation uses the IEC 61508 convex-combination form:
P(top with CCF) = (1 − β) · P_independent + β · max(P_basic_i)
For redundant (AND) configurations this increases the failure probability — the dominant safety effect. For series (OR) configurations it decreases the disjunction probability because the common-mode replaces independent co-occurrence.
Method 5 — Escalation / Domino Graph
import neqsim.process.safety.escalation.EscalationGraphAnalyzer;
EscalationGraphAnalyzer esc = new EscalationGraphAnalyzer();
esc.addEquipment("V-100", 1.0e-4); // base release frequency
esc.addEquipment("V-101", 1.0e-4);
esc.addAdjacency("V-100", "V-101", 0.30); // 30 % escalation if V-100 ignites
double fEscalated = esc.escalatedFrequency("V-101");
java.util.List<String> chain =
esc.criticalChain("V-100", "V-101"); // worst-case domino pathUsed to screen plot-plan layouts before detailed CFD (KFX / FLACS) runs.
Method 6 — ISO 17776 Major-Accident-Hazard Bow-Tie
Generate a pre-populated bow-tie (threats → top event → consequences, with
prevention/mitigation barriers) for each ISO 17776 major accident hazard from
MahCatalogue / MahBowTieBuilder:
import neqsim.process.safety.hazid.MahType;
import neqsim.process.safety.hazid.MahCatalogue;
import neqsim.process.safety.hazid.MahBowTieBuilder;
import neqsim.process.safety.risk.bowtie.BowTieModel;
// One call builds a complete bow-tie with default threat freq + barrier PFD
BowTieModel bt = MahBowTieBuilder.build(MahType.TOPSIDE_HYDROCARBON_RELEASE);
bt.getThreats(); // ≥ 4 standard threats
bt.getConsequences(); // ≥ 3 standard consequences
bt.getBarriers(); // ≥ 5 prevention/mitigation barriers
// Or inspect the raw catalogue lists to tailor a custom bow-tie
MahCatalogue.threatsFor(MahType.WELL_BLOWOUT);
MahCatalogue.consequencesFor(MahType.FIRE_EXPLOSION);
MahCatalogue.barriersFor(MahType.TOXIC_RELEASE);MahType covers the standard offshore MAHs: TOPSIDE_HYDROCARBON_RELEASE,
RISER_LEAK, WELL_BLOWOUT, STRUCTURAL_COLLAPSE, DROPPED_OBJECT,
HELICOPTER_LOSS, SHIP_COLLISION, FIRE_EXPLOSION, TOXIC_RELEASE,
LOSS_OF_BUOYANCY, EXTREME_WEATHER. Defaults exposed as
MahBowTieBuilder.DEFAULT_THREAT_FREQUENCY and DEFAULT_BARRIER_PFD. Quantify
the assembled BowTieModel with the bow-tie analyzer (see
neqsim-process-safety). Verified by MahBowTieBuilderTest.
Method 7 — EI AVIFF Flow-Induced-Vibration Screening
Screen piping for flow-induced vibration (FIV) likelihood-of-failure per the
Energy Institute AVIFF guidelines with PipingFivScreening (static helpers):
import neqsim.process.safety.vibration.PipingFivScreening;
import neqsim.process.safety.vibration.PipingFivLikelihood;
import neqsim.process.safety.vibration.FivLikelihoodResult;
// screenGas(tag, rho[kg/m3], v[m/s], D[m], t[m], nBranches, pulsationFactor, supportFactor)
FivLikelihoodResult gas =
PipingFivScreening.screenGas("Compressor discharge", 80.0, 30.0, 0.3, 0.006, 2, 4.0, 2.0);
gas.getLofScore(); // dimensionless LOF
gas.getLikelihood(); // VERY_HIGH
// screenLiquid(tag, v[m/s], D[m], t[m], nBranches, supportFactor)
FivLikelihoodResult liq =
PipingFivScreening.screenLiquid("Pump discharge", 3.5, 0.15, 0.005, 1, 1.5);
PipingFivLikelihood band = PipingFivScreening.bandFor(0.7); // HIGH
String json = gas.toJson(); // contains "lofScore", "likelihood"Likelihood bands: LOW (< 0.3), MEDIUM (0.3–0.5), HIGH (0.5–1.0),
VERY_HIGH (≥ 1.0). High/very-high lines feed detailed AVIFF assessment or CFD.
Verified by PipingFivScreeningTest.
Method 8 — Deviation → Calculation Auto-Population
Turn an empty HAZOP grid into a simulation-backed worksheet: each guideword ×
parameter deviation is mapped to the NeqSim calculator that quantifies its
consequence, the governing standard, and a typical safeguard. This replaces the
"TBD" placeholders produced by generateGrid(...) or fromProcessSystem(...)
with engineered consequence and safeguard text.
import neqsim.process.safety.hazid.HAZOPTemplate;
import neqsim.process.safety.hazid.HazopConsequenceAutoPopulator;
import neqsim.process.safety.hazid.HazopConsequenceMapping;
// 1. Build a first-pass grid (or use HAZOPTemplate.fromProcessSystem(process))
HAZOPTemplate node = new HAZOPTemplate("Node-1: V-100", "HP separator");
node.generateGrid(HAZOPTemplate.Parameter.PRESSURE,
HAZOPTemplate.Parameter.FLOW, HAZOPTemplate.Parameter.TEMPERATURE);
// 2. Auto-populate consequence / safeguard / recommendation columns
HazopConsequenceAutoPopulator populator = new HazopConsequenceAutoPopulator();
HAZOPTemplate populated = populator.populate(node); // returns a NEW node
String report = populated.report();
// 3. Inspect a single mapping (e.g. for routing to the right calculator)
HazopConsequenceMapping m = populator.mappingFor(
HAZOPTemplate.GuideWord.OTHER_THAN, HAZOPTemplate.Parameter.REACTION);
m.getRecommendedCalculator(); // "RunawayReactionAnalyzer"
m.getStandardReference(); // "DIERS / API 521"
String catalogueJson = populator.catalogueToJson();The populate(...) method preserves any already-filled (non-"TBD") cells and
builds a new template (HAZOP deviation rows are immutable). The catalogue maps:
| Deviation (guideword + parameter) | NeqSim calculator | Standard | Typical safeguard |
| MORE PRESSURE (overpressure) | ReliefValveSizing, SettleOutPressureAnalyzer, GasBlowbyAnalyzer | API 520 / 521 | PSV / HIPPS |
| LESS PRESSURE (vacuum collapse) | VacuumCollapseAnalyzer | API 521 / ASME | Vacuum breaker |
| LESS TEMPERATURE (autorefrig./brittle) | MDMTCalculator, DepressurizationSimulator | ASME UCS-66 / API 521 | Low-temp trip, MDMT material |
| MORE TEMPERATURE (fire case) | TrappedLiquidFireRuptureStudy, PipeFireRuptureStudy, PfpDemandCalculator | API 521 | TSV, PFP, blowdown |
| NO / LESS FLOW (deadhead) | PumpDeadheadAnalyzer | API 610 | Min-flow recycle, low-flow trip |
| MORE FLOW (surge / erosion) | getUtilizationSnapshot surge/velocity | API 14E / 617 | Anti-surge controller |
| REVERSE FLOW (backflow / slam) | WaterHammerStudy | API 521 | Check valve, slow actuator |
| AS_WELL_AS / PART_OF COMPOSITION | phase / hydrate / separator screening (TPflash) | API 521 | Composition monitoring, inhibitor |
| OTHER_THAN REACTION (runaway) | RunawayReactionAnalyzer | DIERS / API 521 | Quench, two-phase relief, inhibitor |
These closed the previously-flagged 🟡 partial gaps in HAZOP coverage: vacuum
collapse (VacuumCollapseAnalyzer), pump deadhead / min-flow
(PumpDeadheadAnalyzer), settle-out and gas blow-by
(SettleOutPressureAnalyzer, GasBlowbyAnalyzer), and runaway reaction
(RunawayReactionAnalyzer). Verified by HazopConsequenceAutoPopulatorTest.
Workflow — From STID to Simulation-backed HAZOP
- Retrieve STID/P&ID, C&E, SRS, line-list, and operating-data documents into the task references folder.
- Extract nodes with
nodeId,designIntent,equipment,safeguards, andevidenceRefsusing the technical-document-reading and STID-retriever skills. - Build a NeqSim process JSON definition from extracted topology or existing models.
- Run
runHAZOPwith selected failure modes, or enable all failure modes. - Review generated rows, scenario results, failed simulations, and evidence references with the chaired HAZOP team.
- Pass accepted safeguards to
runBarrierRegister, LOPA, SIL, bow-tie, and QRA workflows.
Detailed user documentation: docs/safety/automated_hazop_from_stid.md.
Workflow — From HAZOP to LOPA in One Notebook
- HAZOP the node → identify deviation, cause, consequence
- FTA the cause → quantify cause frequency from basic events
- ETA the consequence → split into outcome branches
- Probit + IRPA — see
neqsim-consequence-analysis - LOPA + SIL — see
neqsim-process-safety
A reference end-to-end workflow lives in the test class
HAZOPFMEATest + EscalationGraphAnalyzerTest.
Common Pitfalls
- Guideword ≠ cause — HAZOP guidewords describe the deviation, not the cause. Every deviation can have multiple causes; document each separately.
- RPN inflation — companies vary on detection scales. Document the scale used (CCPS 1–10 vs IEC 60812 1–10) at the top of every FMEA.
- β-factor for OR gates — does not represent "more failure" the way it does for AND gates. See semantics box above.
- Cut-set explosion — limit
maxCardinalityto 4–6 for trees with > 15 basics; the enumeration isO(2^n)in basic-event count.
Verification Tests
./mvnw test -Dtest=HAZOPFMEATest,EventTreeAnalyzerTest,FaultTreeAnalyzerTest,EscalationGraphAnalyzerTest,MahBowTieBuilderTest,PipingFivScreeningTest,HazopConsequenceAutoPopulatorTest,VacuumCollapseAnalyzerTest,SettleOutPressureAnalyzerTest,GasBlowbyAnalyzerTest,PumpDeadheadAnalyzerTest,RunawayReactionAnalyzerTestSee Also
neqsim-process-safety— LOPA, SIL, bow-tie, risk matrixneqsim-consequence-analysis— fire, dispersion, probit, IRPAneqsim-depressurization-mdmt— emergency blowdown, MDMT
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

