Skip to content

Commit

Permalink
Cartesian Grid support
Browse files Browse the repository at this point in the history
Support Cartesian grid now.
  • Loading branch information
BinWang0213 committed Feb 5, 2019
1 parent fe0ec1d commit f5f3df7
Show file tree
Hide file tree
Showing 6 changed files with 622 additions and 13 deletions.
76 changes: 76 additions & 0 deletions ExampleData/Cart2D.DATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

RUNSPEC =====================================================================

TITLE
validation

START
1 'JAN' 2000 /

FIELD

FMTIN

UNIFIN

FMTOUT

UNIFOUT


WATER


DIMENS
50 50 1 /

EQLDIMS
1 100 10 1 1 /

REGDIMS
1 1 0 10 /

TABDIMS
1 1 16 12 1 12 20 1 /

WELLDIMS
3 2 2 3 /

TRACERS
0 1 0 0/

GRID ===============================================================

GRIDFILE
1 1 /

INIT


DX
2500*20
/

DY
2500*20
/

DZ
2500*6
/

TOPS
2500*1000
/

PORO
2500*0.3 /

PERMX
2500*300 /

PERMY
2500*300 /

PERMZ
2500*50 /
84 changes: 84 additions & 0 deletions ExampleData/Cart2D_Fault.GRDECL
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
GRID

DIMENS
15 8 1 /

TOPS
9310 9352 9342 12*9342
9340 9318 9318 9338 9322 4*9322 9315 9309 9308 9308 2*9308
9340 9321 9317 9325 9325 9315 9302 9300 9300 9298 9298 9295 9298 9302 9308
9342 9320 9320 9310 9315 9317 9310 9280 9298 9290 9290 9294 9292 9300 9300
9340 9340 9335 9320 9295 9295 9298 9290 9294 9297 9295 9291 3*9291
5*9290 9290 9290 9286 9295 9288 5*9288
7*9296 9296 9298 9282 9295 4*9295
7*9310 9310 9288 9279 5*9279 /

DX
294.12 382.35 500 794.12 470.58 323.53 352.94 588.24 617.65 441.17 426.47 426.47 441.17 352.94 411.76
294.12 382.35 500 794.12 470.58 323.53 352.94 588.24 617.65 441.17 426.47 426.47 441.17 352.94 411.76
294.12 382.35 500 794.12 470.58 323.53 352.94 588.24 617.65 441.17 426.47 426.47 441.17 352.94 411.76
294.12 382.35 500 794.12 470.58 323.53 352.94 588.24 617.65 441.17 426.47 426.47 441.17 352.94 411.76
294.12 382.35 500 794.12 470.58 323.53 352.94 588.24 617.65 441.17 426.47 426.47 441.17 352.94 411.76
294.12 382.35 500 794.12 470.58 323.53 352.94 588.24 617.65 441.17 426.47 426.47 441.17 352.94 411.76
294.12 382.35 500 794.12 470.58 323.53 352.94 588.24 617.65 441.17 426.47 426.47 441.17 352.94 411.76
294.12 382.35 500 794.12 470.58 323.53 352.94 588.24 617.65 441.17 426.47 426.47 441.17 352.94 411.76 /

DY
15*500
15*205.88
15*382.35
15*529.41
15*441.17
15*441.17
15*441.17
15*352.94 /

DZ
5 12 11 12*11
10 10 32 14 1 4*1 4 5.5 2 3*2
10 42 40 28 18 15 13 12 12 15 13 8 10 5 3
12 36 33 40 34 34 33 32 27 24 22 17 17 5 5
7 7 6 24 42 42 40 30 18 10 8 5.5 3*5.5
5*5 5 7 12 10 3 5*3
8*6 13 6 24 4*24
8*0 5 4 5*4 /

PORO
19.2 19.4 19.7 12*0
19.2 19.51 20.0 20.5 21.0 4*0 21.2 20.5 20.0 3*0
19.1 19.5 20.2 20.75 21.2 21.5 21.55 22.2 22.2 21.4 21.0 20.5 20.4 22.25 20.0
18.8 19.5 20.4 21.25 21.54 22.23 22.50 22.7 23.0 22.0 21.6 21.3 20.5 20.4 19.9
0 19.0 20.0 21.0 22.0 22.5 23.0 24.0 23.5 22.5 22.1 21.6 3*0
5*0 22.3 22.7 24.0 23.3 21.8 5*0
7*0 23.8 23.1 22.0 21.7 4*0
7*0 23.0 22.5 21.8 5*0 /

PERMX
272 275 261 12*261
273 276 273 260 248 4*248 260 270 278 3*278
270 279 284 270 265 267 268 271 270 272 275 285 285 277 273
261 275 298 288 280 278 275 285 275 285 300 288 270 265 260
255 261 275 286 290 282 275 290 280 276 279 270 3*260
6*270 267 281 296 275 5*265
8*279 283 275 5*265
8*257 270 268 5*260 /

PERMY
217.6 220 208.8 12*245
218.4 220.8 220 208 5*198.4 208 216 4*222.4
216 223.2 168.4 220 265 213.6 214.4 216.8 216 217.6 220.8 228 228 221.8 218.4
208.8 220 238.4 230.4 224 222.4 220 228 220 228 240 230.4 216 212 208
204 208.8 220 228.8 232 225.6 220 232 224 220.8 223.2 216 3*208
6*216 213.6 224.8 236.8 6*220
8*223.2 226.4 220 5*212
8*205.6 216 214.4 5*208 /

PERMZ
0.1 0.1 0.1 12*0.1
15*0.1
0.1 10*1 4*0.1
0.1 11*1 3*0.1
0.1 10*1 4*0.1
5*0.1 10*1
7*0.1 8*1
15*0.1 /
131 changes: 131 additions & 0 deletions Example_Builder.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"from GRDECL2VTK import *"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" Grid Type=Cartesian Grid\n",
" Grid Dimension(NX,NY,NZ): (50 x 50 x 15)\n",
" NumOfGrids=37500\n",
"[Geometry] Converting GRDECL to Paraview Hexahedron mesh data....\n",
" NumOfPoints 300000\n",
" NumOfCells 37500\n",
" .....Done!\n",
"[Output] Writing \"Results\\Cart3D.vtu\" Paraview file....Done!\n",
"NPSL file [Results\\Cart3D_permx.txt] successfully genetrated, pelase use NPSL to load it!\n",
"NPSL file [Results\\Cart3D_permy.txt] successfully genetrated, pelase use NPSL to load it!\n",
"NPSL file [Results\\Cart3D_permz.txt] successfully genetrated, pelase use NPSL to load it!\n",
"NPSL file [Results\\Cart3D_poro.txt] successfully genetrated, pelase use NPSL to load it!\n"
]
}
],
"source": [
"#Model=GeologyModel(filename='./ExampleData/Cart2D.DATA')\n",
"#Model=GeologyModel(filename='./ExampleData/Cart2D_Fault.GRDECL')\n",
"Model=GeologyModel()\n",
"Model.fname='Cart3D'\n",
"Model.buildCartGrid(physDims=[50.0,50.0,10.0],gridDims=[50,50,15])\n",
"\n",
"Model.UpdateCellData(varname=\"PERMX\",val=200)\n",
"Model.UpdateCellData(varname=\"PERMY\",val=200)\n",
"Model.UpdateCellData(varname=\"PERMZ\",val=10)\n",
"\n",
"Model.UpdateCellData(varname=\"PERMX\",val=50,nx_range=(10,15),ny_range=(10,15))\n",
"\n",
"\n",
"Model.GRDECL2VTK()\n",
"Model.Write2VTU()\n",
"Model.WriteNPSL()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([1., 1., 1., 1., 6., 6., 6., 6.])"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Model.GRDECL_Data.TOPS"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"a,b,c=[1,2,3]\n",
"a,b,c=np.zeros((3,10))"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([1., 1., 1.])"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.ones(3)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit f5f3df7

Please sign in to comment.