Use case · Data Analysis

Data, read with code you can check

Queries, scripts and dashboards are all code, kept as plain text files in the project. A brief that would take a day of clicking becomes a few hundred lines the agent writes, runs, fixes and runs again in minutes, and runs again next month on the new data.

Query over a summary
A query over the simulation summary: simulated and observed oil rate by well.

Briefs it takes

Give it the job, the way you'd brief a colleague

“Here is the production data for the field. Do decline-curve analysis for each well, aggregate the forecasts by field, and give me P10, P50 and P90 remaining reserves.”

data cleaning · 12 decline models · AIC/BIC model selection · Monte Carlo

“Compare simulated and observed oil rate for every producer, and list the wells that miss history by more than 10%.”

SQL over summary files · joins with spreadsheets

“Build me a dashboard of field production by month that updates when new data lands in the folder.”

queries as table sources · pickers · tables and charts

The process

The agent does each step. You check it.

Every step leaves a file in the project folder, and every file opens in a viewer built for checking it. How the agent works →

  1. 1

    Query

    Agent

    Writes SQL over the files in the project: simulator output, logs, CSV, Excel and Parquet.

    You check

    The result table, and the query behind it.

  2. 2

    Analyse

    Agent

    Takes it further in a script: decline fits, aggregates, P10/P50/P90.

    You check

    The fits, well by well.

  3. 3

    Show

    Agent

    Builds a dashboard over the queries and scripts.

    You check

    The tables and charts, bound to the same data.

  4. 4

    Rerun

    Agent

    Runs the same code on next month's data or the next field.

    You check

    That the numbers moved the way the data did.

Features behind it

What makes each step possible

SQL over production histories, summary files, logs, CSV, Excel and Parquet, joined in one statement.

Production workbooks read as tables, and results written back as workbooks.

Decline fits, field roll-ups and P10/P50/P90, taken further than SQL goes.

The decline models, model selection and Monte Carlo behind the analysis.

Dashboards →.dashboard

Field production by month, kept current when new data lands in the folder.

Every feature →

The agent works fastest and most reliably in code. That's why every computation, every table and every chart in Barrel Brain is a file the agent wrote.

Code is also what makes the work checkable. A chart in a spreadsheet hides how it was made. A script, a query or a dashboard shows every step. It can be reviewed, rerun on new data and reused on the next field.

Queries · Analyse

SQL over every file in the project

A query treats the workspace as a database. Simulator output, well logs, seismic headers, CSV, Parquet, Excel and SQLite are all tables, and one statement can join them. It's how the agent pulls a hundred cases into one table, and how you check the table it pulled.

  • eclipse_summary Rates and totals by step
  • eclipse_grid Cell properties from EGRID and INIT
  • eclipse_restart Pressures and saturations per report step
  • eclipse_deck Keywords, sections and includes
  • las · segy Log curves and seismic traces
  • xlsx · sqlite · csv Everything else in the folder
oil-by-well.querySQL
-- Oil rate per producer, one row per well and date.
UNPIVOT (
    SELECT date, COLUMNS('^WOPR:')
    FROM eclipse_summary('KESTREL.SMSPEC',
                         vectors := ['WOPR:*'])
)
ON COLUMNS('^WOPR:')
INTO NAME vector VALUE oil_rate
ORDER BY vector, date;

-- Join simulator output with a spreadsheet.
SELECT w.well, w.field, sum(p.oil) AS oil
FROM 'production.csv' p
JOIN 'wells.parquet' w USING (well)
GROUP BY ALL ORDER BY oil DESC;
A query over the Excel workbook: cumulative oil and latest water cut by producer

Scripts · Compute

Short code that you can read

When the agent computes something, it writes a short C# script that reads from the workspace and calls the PE library. You can open it, read it and run it again. The Scripting API Explorer lists the whole surface, so nobody guesses what's available.

  • Domain Decks, grids, summaries, wells, seismic, studies
  • Engineering The 17 calculation domains
  • Deliverables Excel, Word, PowerPoint
  • Application Files, processes, terminal
engineering_decline_rates.scriptC#
using Team76.Engineering.DCA;

public class S : ICalcScript
{
    public ScriptResult Run(ICalcContext ctx)
    {
        // Turn a 15%/yr nominal decline into the
        // rates a forecast uses.
        double nominal = 0.15;

        return ctx.Result()
            .Set("effectiveAnnual",
                 DeclineRateConversions.NominalToEffective(nominal))
            .Set("nominalMonthly",
                 DeclineRateConversions.AnnualToMonthly(nominal));
    }
}

Dashboards · Show

Results that stay current when the data changes

A dashboard is a page of sections, sliders, pickers, tables and charts, fed by queries, scripts and workspace files. When a file it read changes, for example after a new simulation run, it renders again. What you show your team is never a stale screenshot.

  • Data Queries, scripts and files as table sources
  • Pickers Well, vector and file pickers bound to the data
  • Table · Chart Bound to the same data
  • Office Word reports, PowerPoint decks, Excel workbooks
decline.dashboardmarkup + C#
<Section Title="Decline">
  <Slider Label="Initial rate" @bind-Value="Qi"
          Min="100" Max="2000" Unit="bbl/d" />
  <Slider Label="Decline" @bind-Value="D"
          Min="0.05" Max="0.5" Unit="1/yr" />
</Section>

<Section Title="Forecast">
  <Table Rows="Rows" Columns="Year, Rate:bbl/d" />
</Section>

@code {
  double Qi = 1000, D = 0.2;
  record Row(int Year, double Rate);

  // Exponential decline: q(t) = qi · exp(−D t)
  IReadOnlyList<Row> Rows => Enumerable.Range(0, 6)
    .Select(t => new Row(t, Qi * Math.Exp(-D * t)))
    .ToList();
}