OLGA Multiphase Flow Assurance
ModelScript provides first-class, polyglot support for OLGA (High-Fidelity Dynamic Multiphase Flow Simulation). Engineers can author, simulate, lint, formally verify, and co-simulate multiphase production flowlines, deepwater catenary risers, and slug catchers directly within ModelScript's unified digital thread.
Supported File Formats
| Format | Extension | Description |
|---|---|---|
| OLGA XML GUI Project | .opi, .xml | Complete graphical network model defining wells, pipes, chokes, separator terminals, and operational controllers. |
| Legacy Keyword Deck | .key, .genkey | Standard industrial keyword decks specifying flowpath geometry, branch connections, boundary conditions, and valve schedules. |
| PVT Flash Tables | .tab | Compositional and black-oil tabular fluid files for bilinear interpolation of fluid densities, gas-liquid ratios, and viscosities. |
| Simulation Trends | .tpl | High-frequency time-series trend files containing arbitrary multi-axis channel catalogs ( |
| Spatial Profiles | .ppl | Spatial profile snapshots along pipeline coordinate |
3-Tier Execution Architecture
ModelScript implements a 3-tier operational execution framework, accommodating headless cloud workflows, system-level co-simulation, and ground-truth industrial verification:
1. Tier 1: Native In-WASM Drift-Flux Solver
- Zero Intermediate Allocations: Lowers directly into ModelScript's
DAEBuilderlinear memory arena. - Transient Hydrodynamics: Solves staggered-grid mass, momentum, and energy balances coupled with Zuber-Findlay drift-flux gas-liquid slip.
- Mechanistic Physics:
- Taitel-Dukler (1976) & Barnea (1987) Flow Regime Map: Exact geometric wetted perimeters (
) and Andritsos-Hanratty wave friction enhancement. - Pal & Rhodes (1989) Emulsion Inversion: Captures apparent viscosity peaks during water breakthrough (
). - Lagrangian Slug Tracker: Propagates discrete moving slug bodies, resolving slug length distributions (
) and riser-base severe cyclic slugging. - Dynamic Pipeline Scraper Pig (
OlgaPig): Solves pig motion ODEs () and liquid slug sweep volume accumulation.
- Taitel-Dukler (1976) & Barnea (1987) Flow Regime Map: Exact geometric wetted perimeters (
2. Tier 2: FMI 2.0/3.0 & SSP Co-Simulation
Exposes standard FMI input and output ports via OlgaCoSimParticipant in @modelscript/exchange:
- Input Ports:
choke.opening,wellhead.mass_rate,separator.pressure,ambient.temperature. - Output Ports:
inlet.pressure,arrival.temperature,arrival.liquid_holdup,arrival.liquid_rate,slug.surge_volume,hydrate.subcooling,maop.margin,slug.mean_length,slug.frequency,pig.position.
3. Tier 3: Industrial OLGA Engine Orchestration
Automates invocation of local Schlumberger OLGA executable engines (olga.exe / olga-cli), dynamically ingesting binary .tpl trajectories into ModelScript's data structures for verification.
Command Line Interface (msx olga)
ModelScript CLI provides headless subcommands for flowline engineering:
# Run 1D transient simulation and export trajectory to CSV
msx olga simulate subsea_tieback.opi --duration=3600 --out=trajectory.csv
# Pre-flight flow assurance diagnostic check
msx olga lint deepwater_riser.key
# Verify formal flow assurance limits (MAOP, Hydrate Margin, Slug Catcher Capacity)
msx olga verify flowline.genkey --maop=250 --margin=3.0 --capacity=150.0
# Generate standalone SVG bathymetry elevation profile
msx olga diagram subsea_tieback.opi --view=profile --out=bathymetry.svg
# Convert legacy keyword deck to modern XML or SysML v2 operating procedures
msx olga convert input.key --to=opi --out=project.opi
msx olga convert input.opi --to=sysml2 --out=procedures.sysmlFlow Assurance Verification & Lint Rules
ModelScript includes automated pre-flight linter diagnostics and limit verifications:
13 rules8 error5 warning Run with msx olga lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M7001 | cfl-condition-violation | error | Simulation timestep maxDt (<maxDt> s) violates convective/acoustic CFL stability limit (<value> s). |
M7002 | invalid-pipe-dimensions | error | Pipe section '<sectionId>' has invalid geometry: <reason>. |
M7003 | missing-boundary-condition | error | Flowpath '<flowpath>' has no defined <missing> boundary condition. |
M7004 | steep-elevation-warning | warning | Pipe section '<sectionId>' has steep inclination (<value>\xB0), risking hydrodynamic slugging. |
M7005 | fully-closed-choke-hazard | error | Choke valve '<chokeName>' is fully closed (opening = 0) with no active bypass route. |
M7006 | severe-slugging-hazard | warning | Severe slugging geometry detected on flowpath '<flowpath>' (seabed dip to steep riser). |
M7007 | pig-stuck-hazard | error | Pig '<pigName>' required differential pressure (<value> bar) exceeds maximum available (<value> bar). |
M7008 | pvt-table-missing-or-invalid | error | PVT fluid table validation error: <detail>. |
M7009 | wax-deposition-risk | warning | Fluid temperature (<value>\xB0C) on flowpath '<flowpath>' drops below Wax Appearance Temperature (<value>\xB0C). |
M7010 | sand-erosion-or-dropout-hazard | warning | Sand transport issue on section '<sectionId>': <reason>. |
M7011 | sour-service-metallurgy-violation | error | H2S partial pressure (<value> bar) on flowpath '<flowpath>' violates NACE MR0175 material limit (<value> bar). |
M7012 | asphaltene-precipitation-hazard | warning | Operating pressure (<value> bar) on flowpath '<flowpath>' enters Asphaltene Onset Pressure envelope (<value> bar). |
M7013 | heatexchanger-parameter-violation | error | Heat exchanger '<hxName>' parameter violation: <detail>. |
Generated from languages/olga/src/errors.ts. All languages →
Dual-View SVG Visualization
ModelScript renders dual-view vector diagrams for every OLGA network:
- Topological P&ID Schematic: Wells, manifolds, choke valves, flowpath pipes, and topside slug catchers.
- Pipeline Elevation Bathymetry
: - High-contrast seabed-to-platform elevation profile.
- In-situ liquid holdup (
) segment color heatmaps. - Active discrete slug bubbles highlighted along the flowline path.
- Real-time scraper pig marker displaying traveling velocity and differential drive pressure.
- Hydrate subcooling margin callout (
).
SysML v2 Operating Procedure Integration
OLGA models can be formally projected into SysML v2 packages (@modelscript/olga
package Subsea_Tieback_System {
import ScalarValues::*;
part def FlowlineAssembly {
attribute totalLength: Length = 4450.0 [m];
attribute maopRating: Pressure = 250.0 [bar];
}
state def SubseaFlowlineOperatingProcedure {
entry; then SteadyProduction;
state SteadyProduction {
doc /* Continuous production at nominal design rates */
}
accept ESD_Trip_Signal then EmergencyShutIn;
accept Turndown_Command then LowTurndown;
state EmergencyShutIn {
doc /* Choke closed; cooldown clock active */
}
accept Depressurize_Command when wallTemperature > 18.0 [degC] then ControlledBlowdown;
accept Cooldown_Timeout when shutInDurationHours >= 8.0 [hr] then ChemicalInhibitionFlushing;
state ControlledBlowdown;
state ChemicalInhibitionFlushing;
}
}State Checkpointing & Zero-Discontinuity Warm Restart
Long-duration or multi-stage pipeline flow assurance operations can be snapshot to disk and resumed with zero trajectory discontinuity:
# Snapshot simulation state at completion
msx olga simulate subsea_tieback.opi --duration=3600 --checkpoint-out=t3600.rst
# Resume simulation from t=3600s
msx olga simulate subsea_tieback.opi --duration=7200 --restart=t3600.rst --out=second_stage.csvThe .rst snapshot encapsulates complete distributed states across the spatial grid:
- Cell pressure
, temperature , phase holdups ( ), and velocities ( ) - Active Lagrangian slug states (tail/front positions, slug lengths, propagation velocities)
- Scraper pig position, speed, and accumulated swept liquid volume
- Machinery operating states and closed-loop controller integral accumulators
Autonomous Field History Matching & Parameter Calibration
Calibrate flowline simulation models to match production SCADA telemetry and test separator observations using bounded Nelder-Mead simplex optimization:
msx olga tune subsea_tieback.opi field_telemetry.csv \
--tune=roughness,choke-cd,heat-transfer \
--max-evals=150 \
--out=calibrated_model.opi \
--report=tuning_report.mdThe optimizer automatically estimates:
- Effective pipe hydraulic roughness (
) - Overall ambient heat transfer coefficient (
) - Choke discharge coefficients (
) - Well productivity index (PI) / reservoir inflow rates
Outputs comprehensive statistical goodness-of-fit metrics (.opi / .genkey models.
Native In-WASM Cubic Equation of State (PR78 & SRK)
ModelScript includes a native WebAssembly cubic equation of state solver executing directly in linear memory with zero intermediate AST wrapper overhead.
Governing Thermodynamic Formulations
The general two-parameter cubic EOS takes the form:
| EOS Model | Temperature Correction | ||||
|---|---|---|---|---|---|
| Peng-Robinson (1978) | |||||
| Soave-Redlich-Kwong (SRK) |
Van der Waals Mixing Rules with Binary Interaction ( )
For multicomponent reservoir and hydrocarbon fluids:
Rachford-Rice Vapor-Liquid Equilibrium (VLE) Flash
Isothermal-isobaric flash equilibrium is determined by solving the objective function for vapor fraction
Accelerated by successive substitution initialized via Wilson's heuristic
Dense Fluid Transport Properties
- Lohrenz-Bray-Clark (LBC) Viscosity: Computes high-pressure gas and liquid dynamic viscosities from reduced mixture densities
: - Macleod-Sugden Parachor Surface Tension: Evaluates gas-liquid interfacial tension
from parachors :
Command Line EOS Flash & Grid Synthesis
# Evaluate multi-component P-T flash and trace saturation envelope
msx olga flash --comp="C1:0.75,C2:0.10,C3:0.08,nC4:0.04,C7:0.03" \
--p=55.0 --t=295.15 --model=pr --envelope --out=flash_summary.csv
# Synthesize a 2D tabular PVT file (.tab) for 1D drift-flux simulation
msx olga flash --comp="C1:0.80,C2:0.10,C3:0.06,C7:0.04" \
--model=srk --out=reservoir_fluid.tabActive Topside Anti-Slug Closed-Loop Feedback Control
Topside choke throttling stabilizes severe cyclic slugging in deepwater catenary risers by dynamically manipulating backpressure using high-frequency subsea pressure transmitter measurements.
Mathematical Architecture
- Subsea PT Feedback Error:
- Washout High-Pass Filter: Isolates oscillatory slug resonance from slow reservoir depletion:
- Gain-Scheduled PI Control: Compensates for non-linear choke valve flow characteristics:
- Physical Actuator Slew-Rate Constraints: Clamps valve motion rate to realistic hydraulic actuator speeds:
- Slug Catcher Surge Override: Emergency high-liquid override closes choke if topside separator approaches liquid carryover capacity (
).
CLI Anti-Slug Simulation
msx olga simulate subsea_catenary_riser.opi \
--duration=3600 \
--anti-slug \
--slug-setpoint=52.0 \
--slug-kp=1.5e-6 \
--slug-ti=30.0 \
--slug-washout=20.0 \
--slug-choke=0.50 \
--out=stabilized_trajectory.csvCoupled Multi-Branch Gathering Network Transient Solver
Simultaneously models converging multi-well subsea gathering manifolds, shared export lines, and platform separators with dynamic acoustic relaxation:
Governing Manifold Dynamic Balances
- Dynamic Junction Mass Continuity:
- Mixture Thermal Energy Accumulation:
- Acoustic Pressure Relaxation:
Well Trip & Flowline Shut-In Redistribution
# Simulate 2-well gathering network with emergency Well 1 trip at t=20s
msx olga network gathering_manifold.opi \
--duration=120 \
--dt=0.5 \
--junction-vol=8.0 \
--trip="WELL_1:20" \
--out=network_transient.csvFlow Assurance CI/CD Safety Gate & 3D Bathymetry Survey
Automated Pull Request Safety Gate (msx olga gate)
Integrates flow assurance validation directly into automated GitHub Actions / GitLab CI pipelines:
msx olga gate subsea_tieback.opi \
--max-surge=85.0 \
--min-hydrate-margin=3.0 \
--max-wax="2mm" \
--max-corrosion="0.1mm/yr" \
--out-report=audit_gate_report.mdGenerates a markdown audit report detailing compliance matrices and exits with non-zero status upon constraint violations.
3D Seabed Bathymetry Survey Ingestion (msx olga survey)
Ingests ROV/multibeam sonar seabed bathymetry CSV survey logs (
msx olga survey bathymetry_survey.csv \
--diameter=0.254 \
--roughness=4.5e-5 \
--out=flowline_model.opiComprehensive CLI Subcommand Reference Matrix
| Subcommand | Purpose | Key Arguments | Generated Artifacts |
|---|---|---|---|
simulate | 1D transient drift-flux simulation | --duration, --dt, --restart, --checkpoint-out, --anti-slug | Trajectory CSV/JSON, .rst state snapshots |
flash | Native Cubic EOS (PR78/SRK) flash | --comp, --p, --t, --model, --envelope, --out | Terminal state summary, CSV, .tab 2D grid |
network | Coupled multi-branch gathering solver | --duration, --dt, --junction-vol, --trip, --out | Composite multi-branch trajectory CSV |
gate | Automated CI/CD safety gate audit | --max-surge, --min-hydrate-margin, --max-wax, --max-corrosion | Markdown compliance report, CI exit codes |
survey | 3D seabed bathymetry survey ingestion | <survey.csv>, --diameter, --roughness, --out | Geometrically resolved .opi / .genkey |
tune | History matching parameter calibration | <model>, <telemetry.csv>, --tune, --max-evals | Calibrated model .opi, Markdown fit report |
lint | Pre-flight flow assurance diagnostics | <model>, --severity | Diagnostic listings (M7001–M7008) |
verify | Formal design limit verification | --maop, --margin, --capacity, --min-vel | Verification summary, constraint headroom |
diagram | Vector SVG visualization | --view=profile|schematic|pvt|wellbore|slug|bathy | Standalone publication-ready SVG files |
convert | Model format translation | --to=genkey|opi|sysml2, --out | Translated model files, SysML v2 packages |
trend | Ingest high-frequency .tpl trend files | <file.tpl>, --channels | Channel catalogs, time-series metrics |
profile | Ingest spatial .ppl snapshot profiles | <file.ppl>, --out | Elevation SVG snapshots, holdup heatmaps |
cosim | Multi-rate FMI/SSP co-simulation | <subsea.opi>, <topside.opi>, --macro-step | Synchronized boundary trajectory CSV |
fmu | Standalone FMI 2.0/3.0 FMU packaging | <model>, --fmi-version=2.0|3.0|both, --out | Portable binary .fmu zip archive |

