Skip to content
Stable.genkey@modelscript/olga 13 diagnostic rules
Parser WASM GLR
Diagnostics 13 rules
DAE Arena Lowering
Simulation Native Solvers
Projections Modelica
Live ExampleDeepwaterSubseaTieback.genkey

OLGA Deepwater Multiphase Flowline & Steel Catenary Riser

Transient gas-condensate-water flow assurance deck modeling seabed terrain slugging, riser base lift, topside choke, and separator.

Playground
Source (8 lines)
1! OLGA Deepwater Subsea Tieback & Riser Flow Assurance Case
2CASE TITLE = "Deepwater Subsea Tieback & Catenary Riser"
3OPTIONS DTSTART = 0.05, TEND = 3600.0
4BRANCH LABEL = "SEABED_FLOWLINE", DIAMETER = 0.3048, ROUGHNESS = 4.5E-5
5GEOMETRY X = (0.0, 3000.0, 6500.0, 8200.0), Y = (-1150.0, -1180.0, -1120.0, -45.0)
6SOURCE LABEL = "WELLHEAD_A", BRANCH = "SEABED_FLOWLINE", MASSFLOW = 42.5, TEMPERATURE = 358.15, WATERCUT = 0.22
7VALVE LABEL = "TOPSIDE_CHOKE", BRANCH = "SEABED_FLOWLINE", OPENING = 0.68, CD = 0.84
8BOUNDARY NODE = "SEPARATOR_IN", TYPE = PRESSURE, PRESSURE = 35.0E5, TEMPERATURE = 308.15
OLGA Multiphase Flowline & Riser Schematic
Deepwater Subsea Tieback & Catenary Riser — Flowline Schematic SUBSEA WELL P: 180 bar CHOKE SLUG CATCHER & SEPARATOR P: 32 bar
Drag to pan · Click % to reset

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 ​

FormatExtensionDescription
OLGA XML GUI Project.opi, .xmlComplete graphical network model defining wells, pipes, chokes, separator terminals, and operational controllers.
Legacy Keyword Deck.key, .genkeyStandard industrial keyword decks specifying flowpath geometry, branch connections, boundary conditions, and valve schedules.
PVT Flash Tables.tabCompositional and black-oil tabular fluid files for bilinear interpolation of fluid densities, gas-liquid ratios, and viscosities.
Simulation Trends.tplHigh-frequency time-series trend files containing arbitrary multi-axis channel catalogs (P, T, αL, QL, UG, etc.).
Spatial Profiles.pplSpatial profile snapshots along pipeline coordinate X with multi-variable channels, flow regime decoding, and time scrubbing.

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:

Rendering diagram...

1. Tier 1: Native In-WASM Drift-Flux Solver ​

  • Zero Intermediate Allocations: Lowers directly into ModelScript's DAEBuilder linear 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 (Si,SG,SL) and Andritsos-Hanratty wave friction enhancement.
    • Pal & Rhodes (1989) Emulsion Inversion: Captures apparent viscosity peaks during water breakthrough (WCinv≈42%).
    • Lagrangian Slug Tracker: Propagates discrete moving slug bodies, resolving slug length distributions (Ls,mean,Ls,95) and riser-base severe cyclic slugging.
    • Dynamic Pipeline Scraper Pig (OlgaPig): Solves pig motion ODEs (Mdv/dt=ΔP⋅A−Ffriction−Mgsin⁡θ) and liquid slug sweep volume accumulation.

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:

bash
# 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.sysml

Flow Assurance Verification & Lint Rules ​

ModelScript includes automated pre-flight linter diagnostics and limit verifications:

13 rules8 error5 warning Run with msx olga lint

CodeRuleSeverityMessage
M7001cfl-condition-violationerrorSimulation timestep maxDt (<maxDt> s) violates convective/acoustic CFL stability limit (<value> s).
M7002invalid-pipe-dimensionserrorPipe section '<sectionId>' has invalid geometry: <reason>.
M7003missing-boundary-conditionerrorFlowpath '<flowpath>' has no defined <missing> boundary condition.
M7004steep-elevation-warningwarningPipe section '<sectionId>' has steep inclination (<value>\xB0), risking hydrodynamic slugging.
M7005fully-closed-choke-hazarderrorChoke valve '<chokeName>' is fully closed (opening = 0) with no active bypass route.
M7006severe-slugging-hazardwarningSevere slugging geometry detected on flowpath '<flowpath>' (seabed dip to steep riser).
M7007pig-stuck-hazarderrorPig '<pigName>' required differential pressure (<value> bar) exceeds maximum available (<value> bar).
M7008pvt-table-missing-or-invaliderrorPVT fluid table validation error: <detail>.
M7009wax-deposition-riskwarningFluid temperature (<value>\xB0C) on flowpath '<flowpath>' drops below Wax Appearance Temperature (<value>\xB0C).
M7010sand-erosion-or-dropout-hazardwarningSand transport issue on section '<sectionId>': <reason>.
M7011sour-service-metallurgy-violationerrorH2S partial pressure (<value> bar) on flowpath '<flowpath>' violates NACE MR0175 material limit (<value> bar).
M7012asphaltene-precipitation-hazardwarningOperating pressure (<value> bar) on flowpath '<flowpath>' enters Asphaltene Onset Pressure envelope (<value> bar).
M7013heatexchanger-parameter-violationerrorHeat 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:

  1. Topological P&ID Schematic: Wells, manifolds, choke valves, flowpath pipes, and topside slug catchers.
  2. Pipeline Elevation Bathymetry Z(X):
    • High-contrast seabed-to-platform elevation profile.
    • In-situ liquid holdup (αL) 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 (Tfluid−Thyd).

SysML v2 Operating Procedure Integration ​

OLGA models can be formally projected into SysML v2 packages (@modelscript/olga → SysML v2):

sysml
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:

bash
# 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.csv

The .rst snapshot encapsulates complete distributed states across the spatial grid:

  • Cell pressure P, temperature T, phase holdups (αL,αG), and velocities (uL,uG)
  • 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:

bash
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.md

The optimizer automatically estimates:

  • Effective pipe hydraulic roughness (ϵ)
  • Overall ambient heat transfer coefficient (Uambient)
  • Choke discharge coefficients (Cd)
  • Well productivity index (PI) / reservoir inflow rates

Outputs comprehensive statistical goodness-of-fit metrics (R2, RMSE in bar and Kelvin) and ready-to-run calibrated .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:

P=RTv−b−a(T)v2+ubv+wb2
EOS ModeluwΩaΩbTemperature Correction α(Tr,ω)
Peng-Robinson (1978)2−10.457240.07780[1+m(1−Tr)]2, with m=0.37464+1.54226ω−0.26992ω2
Soave-Redlich-Kwong (SRK)100.427480.08664[1+m(1−Tr)]2, with m=0.480+1.574ω−0.176ω2

Van der Waals Mixing Rules with Binary Interaction (kij) ​

For multicomponent reservoir and hydrocarbon fluids:

a=∑i=1N∑j=1Nzizjaiaj(1−kij),b=∑i=1Nzibi

Rachford-Rice Vapor-Liquid Equilibrium (VLE) Flash ​

Isothermal-isobaric flash equilibrium is determined by solving the objective function for vapor fraction β=V/F:

∑i=1Nzi(Ki−1)1+β(Ki−1)=0,where Ki=yixi=ϕiLϕiV

Accelerated by successive substitution initialized via Wilson's heuristic K-value correlations and accelerated by Cardano analytical cubic root solving.

Dense Fluid Transport Properties ​

  • Lohrenz-Bray-Clark (LBC) Viscosity: Computes high-pressure gas and liquid dynamic viscosities from reduced mixture densities ρr=ρ/ρc:[(μ−μ0)ξ+10−4]1/4=a0+a1ρr+a2ρr2+a3ρr3+a4ρr4
  • Macleod-Sugden Parachor Surface Tension: Evaluates gas-liquid interfacial tension σ from parachors Pi:σ=[∑i=1NPi(xiρLML−yiρGMG)]4

Command Line EOS Flash & Grid Synthesis ​

bash
# 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.tab

Active 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.

Rendering diagram...

Mathematical Architecture ​

  1. Subsea PT Feedback Error: e(t)=Psp−Pinlet(t)
  2. Washout High-Pass Filter: Isolates oscillatory slug resonance from slow reservoir depletion:τwdefdt+ef=τwdedt
  3. Gain-Scheduled PI Control: Compensates for non-linear choke valve flow characteristics:Kp(Z)=Kp0⋅[1+γ(1−Z)]Z(t)=Zbaseline+Kp(Z)[ef(t)+1τi∫0tef(τ)dτ]
  4. Physical Actuator Slew-Rate Constraints: Clamps valve motion rate to realistic hydraulic actuator speeds:|dZdt|≤Rmax(e.g. 5%/s)
  5. Slug Catcher Surge Override: Emergency high-liquid override closes choke if topside separator approaches liquid carryover capacity (Vsurge>0.8Vcap).

CLI Anti-Slug Simulation ​

bash
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.csv

Coupled Multi-Branch Gathering Network Transient Solver ​

Simultaneously models converging multi-well subsea gathering manifolds, shared export lines, and platform separators with dynamic acoustic relaxation:

Rendering diagram...

Governing Manifold Dynamic Balances ​

  1. Dynamic Junction Mass Continuity:VJd(ρLαL)Jdt=∑inm˙L,in−∑outm˙L,outVJd(ρGαG)Jdt=∑inm˙G,in−∑outm˙G,out
  2. Mixture Thermal Energy Accumulation:d(mu)Jdt=∑in(m˙inhin)−∑out(m˙outhJ)
  3. Acoustic Pressure Relaxation:dPJdt=cm2VJ(∑m˙in−∑m˙out)

Well Trip & Flowline Shut-In Redistribution ​

bash
# 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.csv

Flow 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:

bash
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.md

Generates 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 (Easting,Northing,Depth) and computes 3D pipeline curvature, span lengths, and dogleg severity:

bash
msx olga survey bathymetry_survey.csv \
  --diameter=0.254 \
  --roughness=4.5e-5 \
  --out=flowline_model.opi

Comprehensive CLI Subcommand Reference Matrix ​

SubcommandPurposeKey ArgumentsGenerated Artifacts
simulate1D transient drift-flux simulation--duration, --dt, --restart, --checkpoint-out, --anti-slugTrajectory CSV/JSON, .rst state snapshots
flashNative Cubic EOS (PR78/SRK) flash--comp, --p, --t, --model, --envelope, --outTerminal state summary, CSV, .tab 2D grid
networkCoupled multi-branch gathering solver--duration, --dt, --junction-vol, --trip, --outComposite multi-branch trajectory CSV
gateAutomated CI/CD safety gate audit--max-surge, --min-hydrate-margin, --max-wax, --max-corrosionMarkdown compliance report, CI exit codes
survey3D seabed bathymetry survey ingestion<survey.csv>, --diameter, --roughness, --outGeometrically resolved .opi / .genkey
tuneHistory matching parameter calibration<model>, <telemetry.csv>, --tune, --max-evalsCalibrated model .opi, Markdown fit report
lintPre-flight flow assurance diagnostics<model>, --severityDiagnostic listings (M7001–M7008)
verifyFormal design limit verification--maop, --margin, --capacity, --min-velVerification summary, constraint headroom
diagramVector SVG visualization--view=profile|schematic|pvt|wellbore|slug|bathyStandalone publication-ready SVG files
convertModel format translation--to=genkey|opi|sysml2, --outTranslated model files, SysML v2 packages
trendIngest high-frequency .tpl trend files<file.tpl>, --channelsChannel catalogs, time-series metrics
profileIngest spatial .ppl snapshot profiles<file.ppl>, --outElevation SVG snapshots, holdup heatmaps
cosimMulti-rate FMI/SSP co-simulation<subsea.opi>, <topside.opi>, --macro-stepSynchronized boundary trajectory CSV
fmuStandalone FMI 2.0/3.0 FMU packaging<model>, --fmi-version=2.0|3.0|both, --outPortable binary .fmu zip archive

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy