# Simulating Oil Production with Monte Carlo

In this article I will build a basic oil production forecast simulation through Monte Carlo simulation, using R and Shiny.

### Introduction

Imagine you would like to understand the effects of operational measures to an existing oilfield; for example, changing maintenance cycles, implementing new safety features, or a new drilling campaign. These are complex operations and the effect on production (and hence revenue) is not easy to estimate. Back of a napkin calculations still work, of course. But what if you need something more accurate?

That is where a Monte Carlo simulation can help, as it can integrate complex situations into easily interpretative results. A good starting point is to create a baseline case – your as-is situation – to have some measure of comparison.

### Oilfield Model Idea

There are two ways to create your oilfield production model:

- 1) Take all production well data and resample from it. Done.

- 2) Build a function with various inputs that models the oilfield. Then resample from this model function.

We will discuss the second option, which applies when it is either difficult to obtain all well data, or if a quick field model is good enough to get the desired results.

#### Assumptions and Inputs

Every model works with certain assumptions, or constraints. Usually these are based on general knowledge about the oilfield, and further model ideas can be derived from them:

- It’s an old oilfield, i.e. it has been in its decline phase for several years.
- Every year there are some new wells drilled in the same field.
- New drilled wells have usually higher production rates than old wells.
- Wells below a certain production rate are not profitable and are abandoned.
- Very few wells have a high production rate (the “VIP” wells, so to speak).
- New drilled wells have a sharp decline rate after initial production starts.

Based on the above assumptions, we can make inferences about the field model function; for example, it is *unlikely* to be a uniform distribution as shown below.

It is also unlikely to be a normal distribution; most likely it is a function that represents a large number of wells in the lower production range, with a few wells in the upper range.

#### Well Production Model

I used the Beta distribution with its shape parameters to model the well distribution of the oilfield. Depending on its inputs, it is possible to model a variety of situations through a single function by varying the shape parameters.

If I choose the shape parameters as 2 and 4, the model function will simulate more wells with low production rates than high production rates – however, it will not have that many on the extremely low end.

For a field with 100 wells and a production range between 0 and 1,000 BOPD, the well distribution could look like the below plot:

Only 3 wells fall into the 700-800 BOPD range, while 8 wells are in the 0 – 100 BOPD range. The vast majority however is in the 100 – 500 BOPD range, as expected from the production distribution model function.

### Simulation Results

When running the Monte Carlo simulation to estimate the total field production, based on the selected field model, there are multiple outputs:

**Production Distribution Plot:**shows the production output range as histogram**Cumulative Distribution Plot:**shows probabilities/uncertainties for each result**Data Table:**shows result quantiles in table format with uncertainties attached

#### Production Distribution Plot

The production distribution plot is essentially a histogram of all Monte Carlo simulations; it represents how often simulation results fall into a certain range.

It shows that the *Average Field Production* is estimated at 33,290 BOPD, assuming 100 wells and the before discussed model function. This value represents the 50-50 chance value, i.e. there is a 50% probability that the field production will be higher (or lower) than that. The *dashed lines* represent the 5 and 95 percentile values.

#### Cumulative Distribution Plot

The cumulative distribution function, or CDF plot, attaches probabilities (or uncertainties) to the forecast. The y-axis shows the probability of the production forecast to fall below a certain value.

The area in light blue represents 90% of the production forecast range. The plot allows to select a forecast value based on how likely the forecast is. For example, if you would like to know the minimum expected field production, with an error probability of maximum 10%:

Go to the y-axis to the 10% marker. Draw a horizontal line to the right until you reach the CDF curve. Then go down and read the production forecast value. There is a 10% chance that the production will be below this value, and a 90% chance that the production will be above this value.

#### Data Table

The data table displays the percentile results in 5% steps. Below image shows part of it.

### Shiny Application

I built a Shiny application for the discussed simulator; you can try it out on my Application Website.

### Conclusion

Feel free to experiment with the input parameters to see how to effects the production result. If you have well production data available, try to match the field model to your data and compare the simulated production range with your actual production. If the results are very different despite matching the field model accurately, consider the following:

- My model could be faulty. It happens quite a lot with models!
- It is just the baseline model. Downtimes, none-productive time etc. are not taken into account.
- Outliers: maybe there are a couple of wells in your field that bias the result.

### Links and Resources

Application Link on my Shiny Website: Monte Carlo Oil Production Forecast

Source code to run on your own Shiny Server or R-Studio software: Source Code on Github

Beta Distribution details on Wikipedia