{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "oil_reservoir_drive_notebook.ipynb", "provenance": [], "collapsed_sections": [], "toc_visible": true, "authorship_tag": "ABX9TyPLce2+kiPgiSJH0TVelK53", "include_colab_link": true }, "kernelspec": { "name": "python3", "display_name": "Python 3" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" }, "source": [ "" ] }, { "cell_type": "code", "metadata": { "id": "pimZYJ_NnOEH", "colab_type": "code", "colab": {} }, "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import pandas as pd" ], "execution_count": 1, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "r6DhGxygxNXx", "colab_type": "code", "colab": { "base_uri": "https://localhost:8080/", "height": 138 }, "outputId": "730a5bcc-5ea8-4a9b-fb65-c09a51260e5e" }, "source": [ "!git clone https://github.com/yohanesnuwara/pyreservoir" ], "execution_count": 2, "outputs": [ { "output_type": "stream", "text": [ "Cloning into 'pyreservoir'...\n", "remote: Enumerating objects: 139, done.\u001b[K\n", "remote: Counting objects: 100% (139/139), done.\u001b[K\n", "remote: Compressing objects: 100% (139/139), done.\u001b[K\n", "remote: Total 373 (delta 73), reused 0 (delta 0), pack-reused 234\u001b[K\n", "Receiving objects: 100% (373/373), 475.72 KiB | 683.00 KiB/s, done.\n", "Resolving deltas: 100% (195/195), done.\n" ], "name": "stdout" } ] }, { "cell_type": "code", "metadata": { "id": "iaBVJ1oyjtbJ", "colab_type": "code", "colab": {} }, "source": [ "import sys\n", "\n", "sys.path.append('/content/pyreservoir/pvt')\n", "from pvtlab import linear_interpolate\n", "\n", "sys.path.append('/content/pyreservoir/matbal')\n", "from aquifer import schilthuis, veh, fetkovich\n", "\n", "sys.path.append('/content/pyreservoir/matbal')\n", "from drives import saturated_nonvolatile_totaloil, energy_plot" ], "execution_count": 3, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "LHZh3KHvhkQK", "colab_type": "text" }, "source": [ "### Part 1. Processing Production and PVT Data" ] }, { "cell_type": "code", "metadata": { "id": "c9b87GRCWxX7", "colab_type": "code", "colab": { "base_uri": "https://localhost:8080/", "height": 349 }, "outputId": "0d0d1828-0766-4b00-c3da-f08cc11eabcb" }, "source": [ "# load production data\n", "columns = ['date', 'p', 'Np', 'Wp', 'Wi', 'Wp-Wi', 'Gp']\n", "df = pd.read_csv('/content/pyreservoir/data/conroe_proddata.csv', names=columns)\n", "\n", "# load PVT data\n", "columns = ['p', 'Bg', 'Bt']\n", "pvt = pd.read_csv('/content/pyreservoir/data/conroe_pvtdata.csv', names=columns)\n", "\n", "# define variables in PVT data\n", "p, Bg, Bt = pvt['p'].values, pvt['Bg'].values, pvt['Bt'].values\n", "\n", "# define variables in production data\n", "p1 = df['p'].values\n", "\n", "# interpolate Bg and Bt from PVT to production data\n", "Bg_interpolated = linear_interpolate(p, p1, Bg)\n", "Bt_interpolated = linear_interpolate(p, p1, Bt)\n", "\n", "# add the interpolated Bg and Bt data into production dataframe\n", "df['Bg'] = Bg_interpolated\n", "df['Bt'] = Bt_interpolated\n", "\n", "# convert time column to datetime\n", "df['date'] = pd.to_datetime(df['date'], format='%d %B %Y')\n", "\n", "# define input variables\n", "t = df['date'].values\n", "p = df['p'].values\n", "Np = df['Np'].values\n", "Wp = df['Wp'].values\n", "Wi = df['Wi'].values\n", "Gp = df['Gp'].values * 1E+3 # convert to SCF \n", "Bg = df['Bg'].values * (1 / 1E+3) # convert to RB/SCF\n", "Bt = df['Bt'].values\n", "Bw = np.full(len(df), 1) # Water FVF is made constant, 1 RB/STB\n", "\n", "df.head(10)" ], "execution_count": 4, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", " | date | \n", "p | \n", "Np | \n", "Wp | \n", "Wi | \n", "Wp-Wi | \n", "Gp | \n", "Bg | \n", "Bt | \n", "
---|---|---|---|---|---|---|---|---|---|
0 | \n", "1932-01-01 | \n", "2180.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "1.187000 | \n", "1.205000 | \n", "
1 | \n", "1932-07-01 | \n", "2177.0 | \n", "1341096.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "3330412.0 | \n", "1.188875 | \n", "1.205563 | \n", "
2 | \n", "1933-01-01 | \n", "2170.0 | \n", "2681691.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "6412824.0 | \n", "1.193250 | \n", "1.206875 | \n", "
3 | \n", "1933-07-01 | \n", "2148.0 | \n", "9784770.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "14900678.0 | \n", "1.206469 | \n", "1.211265 | \n", "
4 | \n", "1934-01-01 | \n", "2125.0 | \n", "23440301.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "24295374.0 | \n", "1.220082 | \n", "1.215959 | \n", "
5 | \n", "1934-07-01 | \n", "2110.0 | \n", "32325186.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "30585954.0 | \n", "1.229000 | \n", "1.219100 | \n", "
6 | \n", "1935-01-01 | \n", "2103.0 | \n", "39819896.0 | \n", "71470.0 | \n", "0.0 | \n", "71470.0 | \n", "35940966.0 | \n", "1.233200 | \n", "1.220640 | \n", "
7 | \n", "1935-07-01 | \n", "2105.0 | \n", "47414017.0 | \n", "143243.0 | \n", "0.0 | \n", "143243.0 | \n", "41313677.0 | \n", "1.232000 | \n", "1.220200 | \n", "
8 | \n", "1936-01-01 | \n", "2096.0 | \n", "54185666.0 | \n", "188180.0 | \n", "0.0 | \n", "188180.0 | \n", "46221132.0 | \n", "1.237400 | \n", "1.222180 | \n", "
9 | \n", "1936-07-01 | \n", "2089.0 | \n", "61129694.0 | \n", "346001.0 | \n", "0.0 | \n", "346001.0 | \n", "50923634.0 | \n", "1.241600 | \n", "1.223720 | \n", "