Skip to main content

PPFG data source requirements

The starting point for this research is the Subsurface Essentials dashboard in DWP, where we use OSDU (also Excel / OpenWorks) to retrieve ppfg data.

Authentication

When fetching data from OSDU, an access token is needed for authentication. Variables needed for getting the access token and refresh token are the following Azure Client Credentials:

  • clientId (OSDU_AZURE_CLIENT_ID)
  • clientSecret (OSDU_AZURE_SECRET)
  • scope (OSDU_AZURE_SCOPE)
  • tokenEndpoint (OSDU_AUTH_TOKEN_URL)

These are stored in the environment variables on your computer (in the Java microservice microservice-log-transfer they are retrieved by System.getEnv(“VARIABLE_NAME”)). The values can be found in LastPass under env variables. The Postman collection OSDU R3 API Modified.postman_collection.json can be found in LastPass, where we can generate an access token using the Azure Client Credentials mentioned above, under Auth -> Azure Client Credentials (POST). The access token that is generated here, can be used in the other requests that are found in the collection, e.g. for getting OSDU Wellbore data or OSDU WellLog data.

Fetching curves

When importing ppfg data from OSDU, we first retrieve well logs using the following api call from the dwp-log-transfer-repo (osdu-import.service.ts:searchByWellboreId()):

  • external/logTransfer/api/log-curve-transfer/v1/osdu/welllog/search/wellboreid/${wellboreId}

This leads to the following implementation in microservice-log-transfer (MicroserviceLogTransferImpl.java:wellLogSearch()). This returns an array of strings with well log-ids, and the selected well log id can be set.

osdu-import.service.ts:getWellLogData() uses the selected well log id, to do the following api call:

  • external/logTransfer/api/log-curve-transfer/v1/osdu/welllog/get/${wellLogId}

This leads to the following implementation in microservice-log-transfer (MicroserviceLogTransferImpl.java:getFullWellLog() -> OsduPpfgServiceImpl.java:getWellLog()).

This uses the following OSDU http request:

  • {{ OSDU_URL }}{{ OSDU_WELLLOG_ENDPOINT }}{{ OSDU_DATA_PARTITION_ID }}:work-product-component--WellLog:{{ wellLogId }}

using a bearer token-header and data-partition-id-header for the http request.

When the well log is retrieved, we can retrieve the well log data, which sets the wellLogPoints (data for the curves). The getWellLogData()-method retrieves these wellLogPoints using the following OSDU http request:

  • {{ OSDU_URL }}{{ OSDU_WELLLOG_ENDPOINT }}{{ OSDU_DATA_PARTITION_ID }}:work-product-component--WellLog:wellLog.getWelllogId().split("--WellLog:")[1]

Pore pressure (PP), fracture gradient (FG), horizontal stress (SHmin) and depth (TVD + MD) are mapped to specific columns that we get from the curve specifications (WellLogCurveSpec) from the http request above. These are the columns we get as of now: curve-columns

Primary curves are marked with a star in DWP. For pore pressure and fracture gradient, these are found in EDM in the tables CD_PORE_PRESSURE and CD_FRAC_GRADIENT. For horizontal stress, these are found in Postgres in the table dwp_horizontal_stress_revisions.

Secondary curves are the other curves that are not marked with a star. These are found in EDM in the table dwp_scenario_revisions.

Douglas-Peucker compression

Compressing a curve using the Douglas-Peucker algorithm creates a similar curve with fewer points. If the Douglas-Peucker algorithm is used, it will give a satisfactory result for the critical barrier depth calculation if the error in the data is low. Low error is a requirement from Aker BP, so the Douglas-Peucker can be used together with the critical barrier depth calculator.

Microservice type selection

Node.js will be most suitable framework for the backend, as it is the framework that the developers working on this plugin are most comfortable with.

Connecting...