Skip to content

deterministic doublet

Deterministic Doublet Performance Calculations

This is a simple example of how to use the calculate_doublet_performance function from the pythermogis package to run a deterministic (without uncertainty quantification) doublet simulation.

xarray is at the heart of data handling in pythermogis

The calculate_doublet_performance function expects an xarray Dataset as input, which contains the necessary reservoir properties. The output is also an xarray Dataset, which contains the results of the doublet simulation. for more information on how to use xarray, see the xarray documentation.

πŸ§ͺ Basic Example

This example demonstrates how to run a deterministic doublet simulation using the calculate_doublet_performance function for a single location. The outcomes are deterministic, meaning there is no stochastic sampling or probabilities associated with this simulation, the results are printed to the console.

from pythermogis import calculate_doublet_performance
import xarray as xr

input_data = xr.Dataset({
    "thickness": 300,
    "ntg": 0.5,
    "porosity": 0.5,
    "depth": 2000,
    "permeability": 300,
})

results = calculate_doublet_performance(input_data)
print(results)

🌍 2D Grid Example

This example demonstrates how to run a deterministic doublet simulation using the calculate_doublet_performance function for a user defined 2-d grid of locations. The outcomes are deterministic, meaning there is no stochastic sampling or probabilities associated with this simulation, the results are printed to the console.

from pythermogis import calculate_doublet_performance
import xarray as xr
import numpy as np

input_data = xr.Dataset({
    "thickness": (("x", "y"), np.array([[300, 300], [200, 200]])),
    "ntg": (("x", "y"), np.array([[0.5, 0.5], [0.25, 0.25]])),
    "porosity": (("x", "y"), np.array([[0.5, 0.5], [0.75, 0.7]])),
    "depth": (("x", "y"), np.array([[5000, 5000], [4500, 4500]])),
    "permeability": (("x", "y"), np.array([[300, 300], [450, 450]])),
}, coords={"x": [0, 1], "y": [10, 20]})

results = calculate_doublet_performance(input_data)
print(results)

πŸ—ΊοΈ Reading Raster Grids with pygridsio

This example demonstrates how to read raster grids using the pygridsio package and run a deterministic doublet simulation using the calculate_doublet_performance function.

Example Input Data

Example input data for some of these examples is available in the /resources/example_data directory

from pythermogis import calculate_doublet_performance
from pygridsio import read_grid
import numpy as np

input_grids = read_grid("thickness.zmap").to_dataset(name="thickness")
input_grids["ntg"] = read_grid("ntg.zmap")
input_grids["porosity"] = read_grid("porosity.zmap")
input_grids["depth"] = read_grid("top_depth.zmap")
input_grids["mask"] = read_grid("hydrocarbons.zmap")
input_grids["permeability"] = np.exp(read_grid("ln_perm.zmap")) # convert to natural space permeability

results = calculate_doublet_performance(input_grids)
print(results)
x, y = 125e3, 525e3  # define location
results_loc = results.sel(x=x, y=y, method="nearest")
print(results_loc)

Selecting values from a dataset

You get the results for a specific location by using xarray function sel to select the desired location from the results Dataset, see here for more details.