Package neqsim.process.processmodel.diagram


package neqsim.process.processmodel.diagram
Professional Process Flow Diagram (PFD) generation for NeqSim.

This package provides a layout intelligence layer for generating oil & gas industry-standard process flow diagrams from NeqSim process simulations.

Key Features

  • Industry-standard layout - Left-to-right flow with vertical phase stratification
  • Gravity-based positioning - Gas at top, oil in middle, water at bottom
  • Phase-aware styling - Streams colored by vapor/liquid fraction
  • Equipment semantics - Separator outlets correctly positioned
  • DEXPI integration - Import P&ID data and generate diagrams
  • Professional appearance - Industry-standard shapes and colors
  • Multiple detail levels - MINIMAL, STANDARD, DETAILED, DEBUG
  • Deterministic output - Same model always produces same diagram

Quick Start

// Create a process diagram from a ProcessSystem
ProcessDiagramExporter exporter = new ProcessDiagramExporter(processSystem);

// Configure (optional)
exporter.setTitle("Gas Processing Plant").setDetailLevel(DiagramDetailLevel.STANDARD)
    .setShowStreamValues(true);

// Export to DOT format (text)
String dot = exporter.toDOT();

// Export to SVG (requires Graphviz installed)
exporter.exportSVG(Path.of("diagram.svg"));

// Export directly from ProcessSystem
String dot = processSystem.toDOT();

DEXPI Integration

// Import DEXPI P&ID and create diagram
ProcessDiagramExporter exporter =
    DexpiDiagramBridge.importAndCreateExporter(Paths.get("plant.xml"));
exporter.exportDOT(Paths.get("diagram.dot"));

// Full round-trip: DEXPI to simulate to diagram to DEXPI
DexpiDiagramBridge.roundTrip(Paths.get("input.xml"), Paths.get("diagram.dot"),
    Paths.get("output.xml"));

Architecture

Layout Philosophy

Professional PFDs follow industry conventions:

  1. Left-to-right flow - Feed streams enter left, products exit right
  2. Vertical phase zones - Gas top, oil middle, water bottom
  3. Equipment semantics - Separators have positioned outlets by phase
  4. Stable layout - Same model produces same diagram every time
Version:
1.0
Author:
NeqSim
See Also: