neqsim-depressurization-mdmt
Calculates emergency depressurization and minimum design metal temperatures for process safety.
Install
mkdir -p .claude/skills/neqsim-depressurization-mdmt && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10663" && unzip -o skill.zip -d .claude/skills/neqsim-depressurization-mdmt && rm skill.zipInstalls to .claude/skills/neqsim-depressurization-mdmt
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Emergency depressurization (blowdown) per API 521 §5.20 and minimum design metal temperature (MDMT) assessment per ASME UCS-66 / API 579 / EN 13445 — VU-flash transient inventory model, time-to-target-pressure, low-temperature embrittlement screening, and integration with PSV/flare loads. USE WHEN: a task requires sizing a blowdown valve, generating a P-vs-time curve for a vessel under fire / depressurization, checking MDMT against blowdown end-temperature, providing source terms for relief and flare networks, or distinguishing blowdown from trapped-liquid fire rupture screening. Anchors on neqsim.process.safety.depressurization.DepressurizationSimulator and neqsim.process.safety.mdmt.MDMTCalculator.Key capabilities
- →Simulate blowdown transients
- →Screen for MDMT
- →Size blowdown valves
- →Generate flare source terms
How it works
Uses transient inventory models to simulate blowdown and screen for low-temperature embrittlement.
Inputs & outputs
When to use neqsim-depressurization-mdmt
- →Size blowdown valve
- →Generate P vs T curve
- →Check MDMT for vessel
- →Model flare load
About this skill
NeqSim Depressurization & MDMT Skill
Transient blowdown / depressurization for inventory release on fire or controlled emergency, plus the minimum design metal temperature (MDMT) check that drives material selection. The two are linked: blowdown end-temperatures (often −80 to −120 °C for hydrocarbon gas) usually drive MDMT, which in turn drives whether LTCS, low-temperature carbon-Mn, 3.5 % Ni or 9 % Ni / 304L is required.
When to Use
- Sizing a blowdown / depressurization valve to reach 50 % pressure in 15 min (API 521 §5.20 fire case) or 7 bar in some operator standards
- Generating P(t), T(t), m(t) curves for the relief / flare load case
- Screening MDMT against end-of-blowdown vessel-wall temperature
- Producing source terms for the flare network (
neqsim-relief-flare-network) - Distinguishing depressurization cases from blocked-in liquid fire rupture cases,
where
neqsim-trapped-liquid-fire-ruptureis the primary workflow
Distinct from neqsim-relief-flare-network (steady-state PSV sizing) and
neqsim-dynamic-simulation (continuous-process transients) — this skill is the
specific blowdown + MDMT pair.
Standards
- API 521 7th ed. — Pressure-relieving and depressuring systems (§5.20 blowdown)
- API STD 520 — PSV sizing, used for choke check at the BDV
- ASME UCS-66 / UCS-66.1 — MDMT impact-test exemption curves (carbon steel)
- ASME UHA-51 — austenitic stainless steel low-temperature service
- API 579 / FFS-1 §3 — fitness-for-service, MDMT for in-service vessels
- EN 13445-2 Annex B — European MDMT and impact-test approach
- NORSOK L-002 — piping system design (low-temperature operation)
Method 1 — Blowdown Simulation (VU-flash)
import neqsim.thermo.system.SystemSrkEos;
import neqsim.thermo.system.SystemInterface;
import neqsim.process.safety.depressurization.DepressurizationSimulator;
SystemInterface gas = new SystemSrkEos(273.15 + 50.0, 100.0);
gas.addComponent("methane", 0.92);
gas.addComponent("ethane", 0.05);
gas.addComponent("propane", 0.03);
gas.setMixingRule("classic");
gas.setTotalNumberOfMoles(5000.0); // mol — representative of vessel inventory
DepressurizationSimulator sim = new DepressurizationSimulator(gas);
sim.setVesselVolume(50.0); // m³
sim.setOrificeArea(5.0e-4); // m² — BDV equivalent area
sim.setBackPressure(1.5); // bara — flare KO drum
sim.setHeatInput(0.0); // adiabatic; > 0 for fire case
sim.run(900.0, 1.0); // 15 min, 1 s timestep
double[] t = sim.timeSeries();
double[] p = sim.pressureSeries();
double[] T = sim.temperatureSeries();
double[] m = sim.massFlowSeries();
double pEnd = p[p.length - 1];
double tEnd = T[T.length - 1];
double t50 = sim.timeToPressure(50.0); // s, time to 50 bar
The simulator uses the U–V flash (ops.VUflash(V, U)) at every step — internal
energy decreases by h_out · ṁ · Δt and volume is held constant by the vessel,
so each step is a fully consistent thermodynamic state. Joule-Thomson cooling
across the BDV is captured via an isenthalpic flash to the back pressure for the
exit-temperature output.
Fire case
sim.setHeatInput(60_000.0); // W — API 521 fire heat input
API 521 fire heat input on uninsulated vessels:
Q = 43.2 · F · A^0.82 [W]
with environment factor F (= 1.0 for un-insulated, 0.30 for fireproof insulation, 0.075 for water-spray) and wetted area A in m². The simulator accepts the value directly so any of the API 521, NFPA 30 or NORSOK correlations can be used upstream.
Method 2 — BDV Sizing Iteration
Typical workflow:
- Start from a target such as 50 % of design pressure in 15 min (API 521), 7 bar in 15 min, or the relevant company/project criterion from the private basis.
- Guess BDV
Cd · A, runsim.run(...), readsim.timeToPressure(target). - Iterate area until target is met without choking the flare header.
- Verify the minimum T(t) is above the vessel MDMT.
A reference iteration loop is available as
DepressurizationSimulator.sizeForTargetPressure(targetBar, targetTimeS).
Method 3 — MDMT Assessment
import neqsim.process.safety.mdmt.MDMTCalculator;
MDMTCalculator mdmt = new MDMTCalculator();
mdmt.setMaterial("SA-516-70N"); // normalised CMn, common for CS vessels
mdmt.setThicknessMM(50.0);
mdmt.setStressRatio(0.35); // operating / allowable stress ratio
double mdmtC = mdmt.computeUCS66(); // °C — ASME UCS-66 + UCS-66.1 reduction
The calculator implements:
- UCS-66 Curve A / B / C / D lookup vs material specification
- UCS-66.1 stress-ratio reduction (lower stress → lower MDMT)
- API 579 §3 Fitness-for-Service path for in-service vessels with crack reassessment factors
- EN 13445-2 Annex B alternative if requested
Pass / fail check
double bdvEndTemp = sim.minTemperatureC(); // °C from blowdown sim
boolean acceptable = bdvEndTemp >= mdmtC;
if (!acceptable) {
// Either: thicker vessel, lower stress ratio, LTCS / 3.5%Ni material,
// slower BDV, or accept impact testing per UG-84.
}
Many company practices add a 5-10 °C margin between blowdown end-temperature and MDMT. Record the actual project or operator margin in the private task basis instead of hard-coding it in public guidance.
Method 4 — Source Term to Flare Network
double[] mdot = sim.massFlowSeries();
double[] T = sim.temperatureSeries();
double[] P = sim.pressureSeries();
// Pass to ReliefValveSizing peak-load aggregator or to
// FlareStack.estimateRadiationHeatFlux at peak ṁ.
double mdotPeak = sim.peakMassFlow();
This is the standard handoff between the depressurization model and the flare
network sizing skill (neqsim-relief-flare-network).
Method 4b — Separators with Live Liquid: Vapour-Only Withdrawal (MANDATORY CHECK)
A blowdown valve is mounted on top of the vessel, so a separator, scrubber or knock-out drum holding live liquid discharges vapour while the liquid flashes and feeds more vapour into the release. Discharging the bulk composition instead drains heavy liquid through the orifice: it understates the flare load and overstates the cooling, and the mass balance still closes, so nothing fails.
DepressurizationSimulator handles this from NeqSim 3.20 onward:
import neqsim.process.safety.depressurization.DepressurizationSimulator.WithdrawalMode;
DepressurizationSimulator sim = new DepressurizationSimulator(fluid, V, dOrifice, Cd, pBack);
sim.setWithdrawalMode(WithdrawalMode.AUTO); // default
DepressurizationResult res = sim.run();
boolean twoPhase = res.vapourWithdrawalUsed; // true when a step discharged vapour
- AUTO (default) discharges vapour whenever the inventory is multiphase and is identical to BULK for a single-phase inventory, so a dry-gas segment is unaffected.
- VAPOUR forces it; BULK restores the legacy behaviour for comparison.
- On a real first-stage separator the flash gas from the oil holdup can be a third of the
total flare load. Operator flare reports often quote
vapour fraction = 1.00for such a segment, which means the liquid contribution is not in the approved basis either — say so rather than silently matching their number. run()removes moles from the fluid you passed in (no clone). Record the component moles beforerun(); start minus end is the per-component composition sent to flare, which is what flare CO2 needs: $m_{CO_2} = 44.01,(\eta \sum_i n_{C,i} N_i + N_{CO_2})$ with $\eta \approx 0.98$ combustion efficiency. Clone first if you need the start state later.- A pip-installed
neqsimolder than 3.20 has nosetWithdrawalMode(AttributeError); load the workspace classes throughdevtools/neqsim_dev_setup.pyinstead.
Cross-check the transient against a decomposed inventory
For a deliverable, back the transient with a path-independent inventory calculation: flare load = (gas-space inventory − gas remaining at the flare back pressure) + (vapour formed when the liquid holdup is flashed to the back pressure). Each term is a single TP flash of a stream that exists in the process documentation, so every number is traceable. Expect the transient to give slightly more, because continuous stripping of light ends drives further vaporisation.
If you write your own withdrawal loop, three traps
// TRAP 1 — phase identification. Below roughly 20 bara NeqSim may label the OIL phase
// GAS for a rich hydrocarbon mixture. Selecting the vapour with getPhase(i).getType() then
// strips LIQUID out of the vessel, and the mass balance still closes, so nothing throws.
// Use the helper, which selects by lowest density and returns -1 when no phase is vapour:
int iVap = DepressurizationSimulator.vapourPhaseIndex(fluid);
// TRAP 2 — assert the removed stream is actually vapour. A hydrocarbon blowdown stream
// should stay well under ~45 g/mol. Check it EVERY step; this is what catches trap 1.
// TRAP 3 — component moles. phase.getComponent(n).getNumberOfMolesInPhase() is not
// reliably phase-local. Use the phase total against the phase mole fraction:
double dnTotal = fraction * fluid.getPhase(iVap).getNumberOfMolesInPhase();
double dnComponent = dnTotal * fluid.getPhase(iVap).getComponent(name).getx();
Remove at most about a quarter of the vapour phase per step. Emptying most of the vapour space in one step makes the constant-volume flash swing, because the liquid flashes back to refill it.
Pseudo-component naming: addTBPfraction("C6gas", ...) is stored as C6gas_PC. Never put
+ in a TBP name, and resolve the internal name from getComponentNames() by prefix before
calling addComponent(name, -moles).
Report both CO2 numbers
For an emissions answer, separate the CO2 already in the gas (typically 1–3 mol%, so a few hundred kg) from the CO2 produced by burning the release (roughly 2.7 kg CO2 per kg hydrocarbon, so tonnes). The combustion term is two orders of magnitude larger and is the one tha
Content truncated.
When not to use it
- →Steady-state PSV sizing
- →Continuous process transients
Prerequisites
Limitations
- →Requires representative composition
- →Sensitive to JT coefficient
How it compares
Provides specific blowdown and MDMT assessment instead of general process simulation.
Compared to similar skills
neqsim-depressurization-mdmt side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| neqsim-depressurization-mdmt (this skill) | 0 | 3mo | Review | Advanced |
| azure-monitor-query-java | 0 | 5mo | Review | Intermediate |
| common-technical-practices | 2 | 4mo | No flags | Intermediate |
| azure-ai-anomalydetector-java | 0 | 5mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by equinor
View all by equinor →You might also like
azure-monitor-query-java
microsoft
Azure Monitor Query SDK for Java. Execute Kusto queries against Log Analytics workspaces and query metrics from Azure resources. Triggers: "LogsQueryClient java", "MetricsQueryClient java", "kusto query java", "log analytics java", "azure monitor query java". Note: This package is deprecated. Migrate to azure-monitor-query-logs and azure-monitor-query-metrics.
common-technical-practices
TencentBlueKing
通用技术实践指南,涵盖 AOP 切面、分布式锁、重试机制、参数校验、性能监控、定时任务、审计日志等后端开发中的常见技术实践。当用户需要实现横切关注点、处理并发控制、配置重试策略、添加性能监控或实现审计功能时使用。
azure-ai-anomalydetector-java
microsoft
Build anomaly detection applications with Azure AI Anomaly Detector SDK for Java. Use when implementing univariate/multivariate anomaly detection, time-series analysis, or AI-powered monitoring.
azure-monitor-ingestion-java
anubhavg-icpl
|. Use when you need help with azure monitor ingestion java.
arthas
alibaba
arthas 诊断 java应用,jvm问题 skill
agent-performance-benchmarker
ruvnet
Agent skill for performance-benchmarker - invoke with $agent-performance-benchmarker