Skip to the content.

Engineering simulator foundations

NeqSim can execute a coordinated engineering simulation before compiling DEXPI and discipline deliverables. The API is split into four layers so process physics, project rules, safety evidence, and document serialization remain separate:

  1. isolated and deterministic multi-case process simulation;
  2. typed calculation results with readiness, provenance, method versions, and uncertainty;
  3. coupled steady PSV, transient blowdown, flare-header, and flare-capacity evaluation;
  4. dynamic initiating-event, control, ESD, and SIS response testing.

These calculations produce proposed or screening engineering. They do not establish credible scenarios, infer a SIL target, approve an SRS, select a vendor, or make a package fit for construction.

Run an isolated case envelope

EngineeringCaseRunner deep-copies the base ProcessSystem for every case. It can run the copies concurrently, but orders results by case priority and ID so sequential and parallel runs produce the same result fingerprint.

EngineeringCaseSet cases = new EngineeringCaseSet("export-envelope")
    .addCase(normalCase)
    .addCase(maximumRateCase)
    .addMetric(EngineeringMetric.equipmentPressure("20-KA-001"))
    .addMetric(EngineeringMetric.equipmentTemperature("20-KA-001"));

EngineeringCaseRunReport report = EngineeringCaseRunner.run(
    process,
    cases,
    EngineeringCaseRunOptions.builder().parallelism(2).requireConvergence(true).build());

The report contains separate definition and result SHA-256 fingerprints, convergence status for every case, isolated metric failures, acceptance-limit verdicts, and the governing case for each metric. The base process is not modified. Every configurator must record its controlled scalar inputs on the EngineeringDesignCase; a Java callback alone is not a sufficient auditable design basis.

Implement typed calculations

Implement EngineeringCalculationModule<I, O> for new discipline calculations. assess must report missing critical inputs before physics is run. calculate returns EngineeringCalculationResult<O> with:

A result with readiness blockers cannot be marked calculated. Calculated status still does not grant engineering approval.

Couple relief, blowdown, and flare loads

CoupledReliefBlowdownFlareCalculation accepts project-defined OverpressureProtectionStudy objects grouped by simultaneous event and a governed DynamicBlowdownFlareStudyDataSource. It evaluates:

CoupledReliefBlowdownFlareInput input =
    CoupledReliefBlowdownFlareInput.builder("flare-envelope-A")
        .addReliefStudy(separatorReliefStudy, "FIRE-ZONE-20", separatorRelievingGas)
        .addReliefStudy(scrubberReliefStudy, "FIRE-ZONE-20", scrubberRelievingGas)
        .dynamicStudy(dynamicFlareStudy)
        .scenarioSelectionReviewed(true)
        .addEvidenceReference("HAZOP-20-REV-A")
        .build();

EngineeringCalculationResult<CoupledReliefBlowdownFlareResult> result =
    new CoupledReliefBlowdownFlareCalculation().calculate(input, context);

Use addReliefScenario(study, scenarioName, event, startSeconds, endSeconds, relievingGas) to schedule a specific credible contingency. Use scheduleBlowdown(sourceId, event, startSeconds, endSeconds) to assign a BDV profile to the same initiating event. An end time of null uses the complete simulated BDV history. The timeline combines discharges within each event. Distinct event names represent mutually exclusive cases. Existing unscheduled BDVs form a separate simultaneous blowdown case. An untimed PSV study contributes its maximum credible load from time zero. The optional relieving-gas composition supplies the thermal basis for the PSV. Each protected item can be registered once per event.

Each accepted BDV interval uses the decrease in vessel inventory divided by elapsed time. A release includes its start and excludes its end. Consequently a PSV opening between BDV samples immediately contributes to that interval, and two windows that touch at an endpoint do not overlap. Read getDisposalCases() for the first time of peak mass flow, its contributing sources in kg/s, and separate mass, molar, heat and header Mach checks. Each check reports WITHIN_LIMIT, EXCEEDED or NOT_EVALUATED. A missing limit or demand basis leaves overall acceptance unresolved. The combined mass is the released load upstream of any knockout drum. Molar and combustion screens use the specified relieving gas and fixed BDV composition. For a fractionating BDV, the source constituents bound the maximum molar flow and combustion duty. Gas-tip mass, moles and duty may decrease in a knockout drum. Unless the combined stream is a single known component above its critical temperature at the specified header state, the gross load sets an upper bound. An upper bound above a tip limit requires downstream phase-separation assessment and reports NOT_EVALUATED. Each case reports the peak released mass separately from the gas-tip bounds. The header check uses the configured ideal-gas header state.

Concurrency and credibility must come from the project hazard review. NeqSim compares and aggregates the supplied cases; it does not decide that they are credible or simultaneous.

Verify dynamic protection response

DynamicSafetyScenarioRunner copies and initializes the process, applies an initiating event at a controlled time, activates logic created against equipment in that copy, runs the transient process, and records scalar acceptance criteria. Logic factories are used because an ESD action must point to copied valves, compressors, and controllers—not objects in the live base model.

Each DynamicScenarioCriterion defines an observed quantity, engineering unit, acceptance range, response deadline, and whether it is mandatory. The result includes complete time histories, first time satisfied, final logic states, simulation errors, and an overall pass/fail verdict.

Use this for response verification such as:

The framework verifies the supplied dynamic model. Sensor failure data, certified device architecture, SIL target, independence, systematic capability, final trip set points, and lifecycle approval remain IEC 61511 project inputs.

Run all configured layers from an engineering project

Attach executable cases, coupled safety studies, and dynamic scenarios to EngineeringProject, then run:

EngineeringSimulationResult simulation = EngineeringSimulationRunner.run(
    project,
    EngineeringCaseRunOptions.builder().parallelism(4).build());

SimulationEngineeringDesignRunner includes this coordinated result in coordinatedEngineeringSimulation, allowing the existing DEXPI exporter, engineering calculations, coverage matrices, evidence registers, and approval workflow to carry the simulator evidence in the same governed package.

The executed four-foundations notebook demonstrates all layers and plots the dynamic ESD response.

Verification checklist