Onshore Spill Simulator

Method and user guide - QGIS plugin, version 2.1.2 - Donald Annor Appiah

1. Purpose

The plugin simulates what happens to oil or fuel released on land during an onshore drilling campaign: where it flows, how far and how fast it travels, how much evaporates, how much soaks into the ground, whether it reaches the drainage network, and which communities, water points and facilities it reaches and when. Inputs are supplied as QGIS layers and parameters. Applications at an onshore site require a suitable DEM and independently checked release, surface, weather and receptor inputs.

Version 2 adds the features of temperature-dependent overland oil models such as OilFlow2D (heat transfer between the oil, the sun, the air and the ground; temperature-dependent density, viscosity and yield stress; roughness zones; barriers; recovery points and free-outflow cells; several sources), a hydrogen sulphide (H2S) dispersion model for sour-gas leakages, and a movable tanker that can be placed anywhere on the map and run with one click.

The results are intended for emergency response planning: sizing spill-response equipment and response times, placing containment, siting water-supply boreholes and camp facilities, briefing communities, and preparing the oil spill contingency section of the ERP and the ESIA. They are a screening simulation, not a forecast of a particular event.

2. How the model is built

The model was developed in nine steps. Each step corresponds to a module of the plugin (engine/ folder), so the method can be checked and changed step by step.

StepWhat is doneModule
1. TerrainA square window of the DEM is read around the spill point (default 9 km half-width plus a 6 km margin so that catchments are complete). The DEM is lightly smoothed (Gaussian, 1 cell) to remove radar and canopy speckle. Mapped rivers and streams are burned 3 m into the DEM so that the flow paths follow them.terrain.py
2. Depressions and flow pathsDepressions are filled with the priority-flood algorithm (Barnes et al., 2014). Depressions shallower than the tolerance (3 m for a 30 m global DEM, 0.2-0.5 m for a survey DTM) are treated as DEM noise; deeper ones are kept as real ponds that oil must fill before it spills over. D8 flow directions and flow accumulation give the catchment area of every cell.terrain.py
3. Drainage networkCells draining more than 1 km2 are streams. Each month has a stream flow per km2 of catchment. Dry stream beds behave as sandy ground; flowing streams carry water and the oil floats on it. The synthetic example uses zero stream discharge; supply reviewed study inputs.terrain.py, climate.py
4. Ground surfaceEvery cell is given a surface class from the layers supplied: savannah and farmland (default), compacted rig pad, laterite road, dry stream bed, open water (dugouts and ponds), lined or bunded area, woodland. The class sets roughness, surface retention and soil properties (Table 5.2). Site-plan polygons are classified from their names (pad, laterite, bund, pit, cellar ...).surfaces.py
5. ReleaseThree release types: well oil spillage (rate x duration; a share of the flow is atomised and falls downwind as droplets, the rest fills the cellar and overflows onto the pad); tank or bund failure and road tanker (fixed volume over a few minutes); continuous leak (flowline, hose). A volume can be held in the cellar or an intact bund before overflow.model.py, fallout.py
6. WeatherHourly wind is built from the monthly wind inputs (a synthetic example by default) with a diurnal cycle and a meandering direction whose spread follows the wind steadiness. Ground temperature follows the monthly normal. Storms are given as start time, duration and depth; runoff is computed with the SCS curve number.climate.py, fallout.py
7. Fate and transportEvery time step (1-60 s, limited by the Courant number) the model adds the release, evaporates, infiltrates and then moves the mobile oil (Section 3).model.py
8. Receptors and bookkeepingAt each frame the model records the thickness map, the spray deposit and the mass balance. Each receptor (town, water point, health facility, dugout, forest reserve...) receives the first time oil of 0.1 mm or more lies within 60 m of it, the maximum thickness and spray deposit, the oil soaked into the ground and the depth reached by the oil front compared with the depth to groundwater.model.py, receptors.py
9. OutputsGeoTIFFs, GeoPackage, tables, the interactive HTML player and the GIF/MP4 animation drawn from the project layers (Section 6).outputs.py, html_export.py, qgis_anim.py

3. Process equations

3.1 Overland flow

Oil moves from a cell to its lower neighbours according to the slope of the oil free surface η = z + h (ground plus oil), so oil fills hollows and spills over their lowest side. The outflow is shared among the downhill neighbours in proportion to (Δη/d)^1.1 (multiple flow direction, Freeman, 1991). Only the depth above the surface retention depth hr can move. Its speed is the lesser of the viscous thin-film (gravity-current) speed (Huppert, 1982) and the Manning speed:

u = min( ρ g hm2 S / (3 μ) , hm2/3 S1/2 / n ), hm = max(h - hr, 0)

where ρ and μ are the oil density and viscosity, S the free-surface slope and n the Manning roughness (Engman, 1986). On sloping natural ground the oil runs in narrow threads, so only the rivulet width (default 6 m of a 30 m cell) holds retained oil and soaks it up; on flat ground and on pads the whole cell is wetted.

3.2 Evaporation

Fingas (2004) generic equations (t in minutes, T in °C, %D = mass % distilled at 180 °C):

crude oils: %Ev = [0.165 (%D) + 0.045 (T - 15)] ln(t)
diesel and light products: %Ev = [0.0254 (%D) + 0.01 (T - 15)] √t

The equations are applied cell by cell with the pseudo-time method, so parcels of different age that mix are weighted by mass. Evaporation stops at the product's evaporable limit. Viscosity rises with the evaporated fraction Fe: μ = μ0 exp(C Fe) (Mackay et al., 1980), C = 10 for crude oils and 1 for distillates. In heat-transfer mode the evaporation coefficient is evaluated with the local oil temperature, so warm oil evaporates faster (Section 3.7).

3.3 Infiltration and groundwater

Green-Ampt infiltration (Green and Ampt, 1911) with parameters for oil: the hydraulic conductivity is scaled by (ρo/ρw)(μw/μo) and reduced by the water already in the pores; the capillary suction is scaled by the ratio of surface tensions (about 0.4, Leverett scaling). The depth reached by the oil front is the infiltrated volume divided by the oil the soil can retain, Sor φ (default 0.10 x porosity, i.e. about 40 L/m3 for silty soils, consistent with CONCAWE 3/79). Where this depth reaches the depth to groundwater the cell is flagged.

3.4 Well spray ("oil rain")

Droplets (log-normal, median 250 µm) are released at an effective height H (default 40 m: derrick height plus jet rise), carried at the wind speed at that height (power law, exponent 0.14) and settle at their terminal velocity (Atlas et al., 1973 for drops above 0.1 mm, Stokes law below). Each size lands at x = u(H) H / vt downwind, spread by the wind meander and by the range of release heights. The deposit is recomputed every hour as the wind changes.

3.5 Rain wash-off

Storm runoff is calculated with the SCS curve number (USDA-NRCS, 1986). While runoff lasts, half of the retention depth is flushed and the oil is carried at half of the kinematic sheet-flow speed of the runoff, which grows with the upstream catchment area. Stream discharge also rises with the storm.

3.6 Streams

In a flowing stream the oil floats and moves down the D8 path at the surface speed of the water, u = 1.1 × 0.7 Q0.1 (hydraulic geometry, Leopold and Maddock, 1953), where Q is the stream discharge. Oil is lost to the banks at an exponential rate (default 15% per km) and stays there as stranded oil, where it continues to weather. Oil that reaches the edge of the model area is counted as having left it.

3.7 Heat transfer and temperature-dependent rheology (OilFlow2D-type)

With Heat-transfer mode ticked, every cell carries an oil temperature T as well as a thickness. Heat moves with the oil (the heat content h T is transported with the volume), and each time step the temperature of the layer is advanced with the energy balance used by temperature-dependent overland oil models (Garcia et al., 2023; Echeverribar et al., 2023):

ρ cp h dT/dt = (1 - a) S + ε σ (εa Ta4 - T4) - hc (T - Ta) - hg (T - Tg)

The balance is linearised about the current temperature and integrated exactly over the step, so it is stable for any thickness. The oil properties then follow the temperature:

density: ρ(T) = ρref + kρ (T - Tref) (kρ about -0.65 kg/m3K)
viscosity: μ(T, Fe) = μref exp[B (1/T - 1/Tref)] exp(C Fe) (Andrade form x Mackay weathering)
yield stress: τy(T) = τpp 10(Tpp - T)/ΔT10 (zero above Tpp + 2ΔT10)

The oil moves as a Bingham film: where the driving stress τb = ρ g hm S is below the yield stress it does not move; above it the laminar speed is reduced by 1 - 1.5 r + 0.5 r3, r = τy/τb. A waxy crude therefore spreads while hot, gels as it cools at night, and moves again when the afternoon sun warms it - the behaviour shown by OilFlow2D for high pour point oils. In flowing streams gelled oil is carried as floating lumps. With heat transfer off, the properties are fixed at the mean air temperature (constant-property mode, as in the basic OilFlow2D module).

3.8 Control features

3.9 H2S dispersion from a sour-gas leakage

The gas phase of a well spillage is modelled separately with a Gaussian puff model (engine/h2s.py).

Not modelled: ignition of the release (an ignited leak burns H2S to SO2), dense-gas slumping, building and rig-structure wakes, and calm winds below 1 m/s.

4. Default parameters

4.1 Products (oils.py)

ProductDensity (kg/m3)Viscosity (mPa.s)Pour point (°C)%D at 180 °CMax evaporation
Light crude (API ~35)8508-925 (ln)40%
Waxy crude (API ~32, sensitivity case)86012 at 40 °C2718 (ln)30%
Medium crude (API ~25)90060-315 (ln)28%
Heavy / waxy crude (API ~18)9501500244 (ln)10%
Gas condensate (API ~50)7801-3055 (ln)80%
Rig diesel (AGO)8403.5-1510 (sqrt)60%
Mineral base oil (OBM)8002.5-202 (sqrt)20%

Temperature dependence (all products): Andrade constant B 1,500-6,500 K, density change -0.65 kg/m3 per °C, specific heat 2,000 J/kgK, yield stress 1-5 Pa at the pour point rising tenfold every 4-5 °C of cooling.

These are generic product-class defaults, not measurements of a particular reservoir fluid. Replace the values with suitable product assay data when available.

4.2 Surface classes (model.py)

ClassManning nRetention (mm)Kwater (m/s)Suction (m)Porosity
Savannah / farmland0.2562 x 10-60.110.40
Rig pad (compacted laterite)0.0321 x 10-70.210.30
Laterite road0.0322 x 10-70.210.30
Stream bed (dry)0.0531 x 10-50.050.38
Open water0.0200--
Lined / bunded area0.0210--
Woodland / forest reserve0.40105 x 10-60.090.45

Soil suction values follow Rawls et al. (1983) for sandy loam to clay loam; retention depths are indicative holding capacities of 2-10 L/m2 for compacted to vegetated ground.

4.3 Monthly climate defaults (climate.py)

Synthetic example only. No station observations or regional climate profile are bundled. All twelve months use invented, constant values: mean temperature 20 C, maximum 25 C, humidity 50%, wind u = 3 m/s and v = 0 m/s, cloud fraction 0.5, no rain or stream discharge, soil water saturation 0.5, and groundwater depth 5 m. These are demonstration inputs, not an environmental assessment. Supply reviewed weather, hydrology, soil and groundwater values for the study area using the wind CSV, Processing overrides and explicit storm inputs. Numerical results will differ from releases with other defaults.

5. Running the plugin

  1. Install: Plugins > Manage and Install Plugins > Install from ZIP, choose onshore_spill_sim.zip. The tool appears under Plugins > Onshore Spill Simulator, on the toolbar and in the Processing Toolbox.
  2. Open a project with a DEM in a projected CRS (metres). Arrange and style the layers the way the animation should look; only the layers that are switched on are drawn.
  3. Run Simulate onshore spill. Set the DEM, click the spill point on the map, choose the release type, the product and the release size, the month, the start time and any storms (e.g. 24,3,50; 54,2,25).
  4. Add the ground layers (pads, site plan, roads, dugouts, woodland), the mapped rivers and the receptor layers.
  5. Choose an output folder and run. The log shows each stage. Runtime depends on the grid size, simulated duration, output settings and available computing resources.
  6. To redraw the animation after restyling the map or changing the extent, run Render animation from a finished run and select the *_run.json file.

Advanced settings (expand Advanced parameters): spray share, release height and droplet size; model area; cell size; DEM smoothing and depression tolerance; stream threshold; snapping the spill point onto a stream (use it for road crossings); temperature, stream flow, soil wetness and depth to groundwater overrides; curve number; rivulet width; bank stranding; animation size and speed. Heat-transfer settings (source temperature, cloud, humidity) and the control layers (roughness zones, barriers, recovery points) are in the main form.

5.0 Simulation panel (set up, run and play inside QGIS)

Click Simulation panel on the toolbar (green play button) or in Plugins > Onshore Spill Simulator. The panel docks on the right of the map and works with the study project; it reads 00_Config/model_inputs.json, so a run made in the panel uses the same DEM, ground layers, rivers and receptors as the reference scenarios.

  1. Set up and run. Choose the hazard (oil well spillage, H2S leakage, rig diesel tank, road tanker, continuous leak) and the location (wellhead, rig fuel storage, stream crossing, or Pick a point on the map). Set the date and time the release starts. The season box underneath updates with the date: season name, mean and afternoon temperature, humidity, monthly rain and rain days, the resultant wind and its steadiness, stream flow, soil wetness and groundwater depth for that month (synthetic example values unless overridden), with notes on what this means for oil and gas. Typical for the month fills in the storms expected over the run (mean number of rain days in the period, each at the mean rain-day depth, as a late-afternoon storm). Adjust the release figures and press Run simulation. The model runs in the background; the map stays usable.
  2. Play. When the run ends the panel switches to Play. The result is added to the Animation player group at the top of the Layers panel and stepped through frame by frame with the slider, the play / pause buttons and the speed list. Any earlier run in 04_Outputs can be chosen from the list. For oil runs the oil temperature and the yield stress of gelled oil can be shown instead of the thickness. Subtitles describe each frame: the clock and date, whether the release is still running, the wind and rain or the atmospheric stability, the oil temperature and gelled volume, how far the oil or gas has reached and in which direction, the receptors reached and the nearest settlement. Make GIF / MP4 from this map draws the animation from the layers that are switched on, including an online basemap such as Google Hybrid; Open the HTML page opens the interactive page of the run.
  3. Settlements. Lists the settlements around a well within a chosen radius with their distance, direction and district, and how each is affected in the run being played (oil arrival time, or the H2S hazard class and peak concentration). Rows within 1 km are shaded red and within 2 km orange. Add a settlement lets a compound or village be clicked on the map (with the Google Hybrid basemap on); it is saved in the settlements_digitised layer and used as a receptor in every later run.

5.1 Movable tanker

  1. Click Place a movable tanker and simulate (orange truck on the toolbar), then click the map where the tanker loses its load - a road, a stream crossing, a laydown area.
  2. A small form asks for the product, the volume lost, the time to empty, the month, the start time, any storm and whether to snap the point onto a stream. The point is added to the Movable tanker layer.
  3. The model inputs (DEM, ground layers, rivers, receptors, output folder) are read from 00_Config/project_config.json beside the project file, so the Processing form opens already filled in - press Run, or tick Run straight away in the form. Results go to 04_Outputs/Tanker_Runs/<name>, are added to the project and the HTML player opens.
  4. To run several positions later: move or add points in the Movable tanker layer with the editing tools (fields name, volume_m3, product, release_min, month, start, storms, snap_m), then run Simulate spills at movable tanker points; each point becomes a run.
  5. Every HTML player also has a Sandbox tanker button: drag the orange marker anywhere within 6 km of the source and the page traces the downhill path, the distance to the first watercourse, an indicative travel time and the receptors within 120 m of the path. It is a quick screening aid; use the QGIS tool for volumes and timing.

5.2 H2S release

Run Simulate H2S leakage at a well: click the well, enter the gas rate and H2S content, choose the release mode, the month and start time, the receptor layers and the planned H2S zone radius to compare with.

6. Outputs

FileContent
*_animation.htmlStand-alone interactive player: map with the project layers, oil and spray frames, time slider, wind, rain, mass balance chart and receptor list; extra animated layers (oil temperature, yield stress and, for well spillages, the H2S plume of the same well and season); H2S exposure badges on the receptors; a scenario switcher; the sandbox tanker. Opens in any browser without internet (satellite and street basemaps need a connection).
*_animation.gif / .mp4Animation drawn from the visible QGIS layers with title, clock, legend, wind, rain, zoom inset, scale bar and north arrow. PNG frames are kept in *_animation/.
*_thickness_timeseries_mm.tifSurface oil thickness, one band per frame (band description = time).
*_fallout_timeseries_mm.tifCumulative spray deposit, one band per frame (well spillages).
*_max_thickness_mm.tif, *_arrival_time_h.tif, *_final_thickness_mm.tifMaximum thickness, first arrival time (0.1 mm), thickness at the end.
*_infiltrated_L_per_m2.tif, *_penetration_depth_m.tifOil soaked into the ground and the depth reached by the oil front.
*_results.gpkgoil_footprint, arrival_isochrones, spray_fallout, groundwater_concern, receptor_impacts, spill_source, drainage_network_dem.
*_mass_balance.csv, *_receptors.csv, *_results.xlsxMass balance at every frame; receptor table sorted by arrival time; scenario record.
*_oil_temperature_timeseries_C.tif, *_viscosity_timeseries_mPas.tif, *_yield_stress_timeseries_Pa.tifHeat-transfer runs: oil temperature, viscosity and yield stress, one band per frame; also the highest and lowest values over the run (*_oil_temp_max_C.tif, *_oil_temp_min_C.tif, *_viscosity_max_mPas.tif, *_yield_stress_max_Pa.tif).
*_h2s_ppm_timeseries.tif, *_h2s_max_10min_ppm.tif, *_h2s_max_60min_ppm.tif, *_h2s_time_to_AEGL2_h.tifH2S runs: concentration frames, worst concentrations and time to AEGL-2.
*_h2s_results.gpkg, *_h2s_receptors.csv, *_h2s_timeseries.csv, *_h2s_results.xlsx, *_h2s_animation.htmlH2S threshold zones, planned zone, release point and receptor exposure; distance to each threshold at every frame; HTML player.
*_run.json, *_summary.jsonRun record used to redraw the animation, and the key results.

7. Using the results

8. Calibration and limitations

9. References