Update README.md
Browse files
README.md
CHANGED
|
@@ -13,4 +13,52 @@ tags:
|
|
| 13 |
- Gas
|
| 14 |
- Bottomhole_Pressure
|
| 15 |
- BHP
|
| 16 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
- Gas
|
| 14 |
- Bottomhole_Pressure
|
| 15 |
- BHP
|
| 16 |
+
---
|
| 17 |
+
# Bottom Hole Pressure (BHP) Prediction Model
|
| 18 |
+
|
| 19 |
+
This project implements a machine learning model to predict Bottom Hole Pressure (BHP) in oil wells based on various well parameters.
|
| 20 |
+
|
| 21 |
+
## Features Used
|
| 22 |
+
- **Qo**: Oil production rate (STB/day)
|
| 23 |
+
- **GOR**: Gas-Oil Ratio (scf/STB)
|
| 24 |
+
- **THT**: Tubing Head Temperature (°F)
|
| 25 |
+
- **Pwh**: Wellhead Pressure (psi)
|
| 26 |
+
- **WCT**: Water Cut (%)
|
| 27 |
+
- **Depth**: Well depth (ft)
|
| 28 |
+
|
| 29 |
+
## Derived Features
|
| 30 |
+
The model uses these engineered features:
|
| 31 |
+
- **Fluid gradient**: `(WCT/100)*0.433 + (1-(WCT/100))*0.273`
|
| 32 |
+
- **Ph (Hydrostatic Pressure)**: `Fluid gradient * Depth`
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
## Author
|
| 36 |
+
Kwadwo Fosu Adom
|
| 37 |
+
## Model Usage
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
import pickle
|
| 43 |
+
import pandas as pd
|
| 44 |
+
|
| 45 |
+
# Load your test data
|
| 46 |
+
test_df = pd.read_csv('your_test_data.csv') # or other source
|
| 47 |
+
|
| 48 |
+
# Calculate derived features
|
| 49 |
+
test_df['Fluid gradient'] = (test_df['WCT']/100)*0.433 + (1-(test_df['WCT']/100))*0.273
|
| 50 |
+
test_df['Ph'] = test_df['Fluid gradient'] * test_df['Depth']
|
| 51 |
+
|
| 52 |
+
# Features to scale (must match training)
|
| 53 |
+
scaled_features = ['Qo', 'GOR', 'THT', 'Pwh(psi)', 'Ph', 'Depth']
|
| 54 |
+
|
| 55 |
+
# Load model and scaler
|
| 56 |
+
with open('modelBIGDATA5US1P57.pkl', 'rb') as file:
|
| 57 |
+
saved_data = pickle.load(file)
|
| 58 |
+
model = saved_data['model']
|
| 59 |
+
scaler = saved_data['scaler']
|
| 60 |
+
|
| 61 |
+
# Make predictions
|
| 62 |
+
X_test_scaled = scaler.transform(test_df[scaled_features])
|
| 63 |
+
test_df['Predicted_BHP'] = model.predict(X_test_scaled)
|
| 64 |
+
|