Skip to content

wellcast.datasets

datasets

Synthetic production data for examples, tests and the demo app.

make_synthetic_field simulates daily surface measurements for a small oil field. The model is deliberately simple but physically consistent, so the analysis modules can be checked against known ground truth:

  • Liquid potential follows an Arps hyperbolic decline in calendar time and is scaled by the choke opening.
  • Bottomhole pressure follows a linear IPR, pwf = pr - q_liquid / J, and reservoir pressure falls linearly with cumulative liquid withdrawal.
  • Wellhead pressure follows the Gilbert (1954) choke equation.
  • The producing GOR equals the solution GOR above the bubble point and rises once reservoir pressure drops below it.
  • Water cut grows exponentially towards a plateau after breakthrough.
  • Shut-ins show zero rates and an exponential pressure build-up.
  • An injector loses injectivity at a known date (visible on a Hall plot).
  • Sensor anomalies are injected and labelled.

No third-party data is bundled with wellcast; all examples use this generator.

SyntheticField dataclass

SyntheticField(production: DataFrame, labels: DataFrame, wells: DataFrame)

Output of make_synthetic_field.

Attributes:

Name Type Description
production DataFrame

Measurements in the canonical schema (see wellcast.io), indexed by date and sorted by well and date.

labels DataFrame

Ground truth aligned row by row with production: well, shut_in, anomaly, anomaly_type (empty string when none) and water_breakthrough.

wells DataFrame

True parameters per well, indexed by well name.

make_synthetic_field

make_synthetic_field(n_wells: int = 5, years: int = 5, freq: str = 'D', seed: int = 42, *, n_injectors: int = 1) -> SyntheticField

Simulate a small oil field with known ground truth.

Parameters:

Name Type Description Default
n_wells int

Number of producers, named P-01, P-02 and so on. Default 5.

5
years int

Length of the simulated period in years, starting 2020-01-01. Default 5.

5
freq str

Output frequency as a pandas offset alias. Data are simulated daily and averaged (labels: any) to coarser frequencies. Default "D".

'D'
seed int

Seed of the random generator; equal seeds give identical output. Default 42.

42
n_injectors int

Number of water injectors, named I-01 and so on. Default 1.

1

Returns:

Type Description
SyntheticField

Production data, row-aligned labels and true well parameters.

Raises:

Type Description
DataValidationError

If n_wells < 1, n_injectors < 0 or years < 1.

Notes

Units follow the canonical schema: bbl/d for liquids, Mscf/d for gas, psi for pressure, degF for temperature and 64ths of an inch for the choke. See the module docstring for the physical model.

Examples:

>>> from wellcast.datasets import make_synthetic_field
>>> field = make_synthetic_field(n_wells=2, years=1, n_injectors=0)
>>> sorted(field.production["well"].unique())
['P-01', 'P-02']
>>> field.labels.index.equals(field.production.index)
True