@@ -70,27 +70,27 @@ def __init__(self, model: Model):
7070 ErrMessage = "Assume no horizontal injection well" ,
7171 ToolTipText = "Number of cells assumed as horizontal injection wells"
7272 )
73- self .hrz_inj_ID1 = self .ParameterDict [self .hrz_inj_ID1 .Name ] = strParameter (
73+ self .hrz_inj1 = self .ParameterDict [self .hrz_inj1 .Name ] = strParameter (
7474 "Horizontal Injection Well Cell ID 1" ,
7575 DefaultValue = 'A3R23' ,
7676 UnitType = Units .NONE ,
7777 )
78- self .hrz_inj_ID2 = self .ParameterDict [self .hrz_inj_ID2 .Name ] = strParameter (
78+ self .hrz_inj2 = self .ParameterDict [self .hrz_inj2 .Name ] = strParameter (
7979 "Horizontal Injection Well Cell ID 2" ,
8080 DefaultValue = 'A3S23' ,
8181 UnitType = Units .NONE ,
8282 )
83- self .hrz_inj_ID3 = self .ParameterDict [self .hrz_inj_ID3 .Name ] = strParameter (
83+ self .hrz_inj3 = self .ParameterDict [self .hrz_inj3 .Name ] = strParameter (
8484 "Horizontal Injection Well Cell ID 3" ,
8585 DefaultValue = 'A3T23' ,
8686 UnitType = Units .NONE ,
8787 )
88- self .hrz_inj_ID4 = self .ParameterDict [self .hrz_inj_ID4 .Name ] = strParameter (
88+ self .hrz_inj4 = self .ParameterDict [self .hrz_inj4 .Name ] = strParameter (
8989 "Horizontal Injection Well Cell ID 4" ,
9090 DefaultValue = 'A3U23' ,
9191 UnitType = Units .NONE ,
9292 )
93- self .hrz_inj_ID5 = self .ParameterDict [self .hrz_inj_ID5 .Name ] = strParameter (
93+ self .hrz_inj5 = self .ParameterDict [self .hrz_inj5 .Name ] = strParameter (
9494 "Horizontal Injection Well Cell ID 5" ,
9595 DefaultValue = 'A3V23' ,
9696 UnitType = Units .NONE ,
@@ -104,27 +104,27 @@ def __init__(self, model: Model):
104104 ErrMessage = "Assume no horizontal production well" ,
105105 ToolTipText = "Number of cells assumed as horizontal production wells"
106106 )
107- self .hrz_prod_ID1 = self .ParameterDict [self .hrz_prod_ID1 .Name ] = strParameter (
107+ self .hrz_prod1 = self .ParameterDict [self .hrz_prod1 .Name ] = strParameter (
108108 "Horizontal Production Well Cell ID 1" ,
109109 DefaultValue = 'A3R28' ,
110110 UnitType = Units .NONE ,
111111 )
112- self .hrz_prod_ID2 = self .ParameterDict [self .hrz_prod_ID2 .Name ] = strParameter (
112+ self .hrz_prod2 = self .ParameterDict [self .hrz_prod2 .Name ] = strParameter (
113113 "Horizontal Production Well Cell ID 2" ,
114114 DefaultValue = 'A3S28' ,
115115 UnitType = Units .NONE ,
116116 )
117- self .hrz_prod_ID3 = self .ParameterDict [self .hrz_prod_ID3 .Name ] = strParameter (
117+ self .hrz_prod3 = self .ParameterDict [self .hrz_prod3 .Name ] = strParameter (
118118 "Horizontal Production Well Cell ID 3" ,
119119 DefaultValue = 'A3T28' ,
120120 UnitType = Units .NONE ,
121121 )
122- self .hrz_prod_ID4 = self .ParameterDict [self .hrz_prod_ID4 .Name ] = strParameter (
122+ self .hrz_prod4 = self .ParameterDict [self .hrz_prod4 .Name ] = strParameter (
123123 "Horizontal Production Well Cell ID 4" ,
124124 DefaultValue = 'A3U28' ,
125125 UnitType = Units .NONE ,
126126 )
127- self .hrz_prod_ID5 = self .ParameterDict [self .hrz_prod_ID5 .Name ] = strParameter (
127+ self .hrz_prod5 = self .ParameterDict [self .hrz_prod5 .Name ] = strParameter (
128128 "Horizontal Production Well Cell ID 5" ,
129129 DefaultValue = 'A3V28' ,
130130 UnitType = Units .NONE ,
@@ -223,6 +223,20 @@ def Calculate(self, model:Model):
223223 injection_cell_id = str (self .injection_cell .value )
224224 production_cell_id = str (self .production_cell .value )
225225
226+ """ Horizontal Well Cell IDs"""
227+ num_injwellcells = int (self .numhinjcell .value )
228+ num_prodwellcells = int (self .numhprodcell .value )
229+ hrz_inj_id1 = str (self .hrz_inj1 .value )
230+ hrz_inj_id2 = str (self .hrz_inj2 .value )
231+ hrz_inj_id3 = str (self .hrz_inj3 .value )
232+ hrz_inj_id4 = str (self .hrz_inj4 .value )
233+ hrz_inj_id5 = str (self .hrz_inj5 .value )
234+ hrz_prod_id1 = str (self .hrz_prod1 .value )
235+ hrz_prod_id2 = str (self .hrz_prod2 .value )
236+ hrz_prod_id3 = str (self .hrz_prod3 .value )
237+ hrz_prod_id4 = str (self .hrz_prod4 .value )
238+ hrz_prod_id5 = str (self .hrz_prod5 .value )
239+
226240 if not os .path .exists (os .path .join (os .getcwd (), path_to_exe )):
227241 model .logger .critical ('TOUGH2 executable file does not exist in current working directory. \
228242 GEOPHIRES will abort simulation.' )
@@ -244,7 +258,9 @@ def Calculate(self, model:Model):
244258 DeltaXgrid = 10000 / 50
245259 DeltaYgrid = reservoirwidth / 50
246260 DeltaZgrid = reservoirthickness / 5
247- flowrate = model .wellbores .prodwellflowrate .value
261+
262+ flowrate_inj = model .wellbores .prodwellflowrate .value / (num_injwellcells + 1 )
263+ flowrate_prod = model .wellbores .prodwellflowrate .value / (num_prodwellcells + 1 )
248264 print ('Reservoir parameters passed to TOUGH from Reservoir.py \n ' )
249265 print ("Initial Temperature = " , initialtemp )
250266 print ("Rock Density = " , rockdensity )
@@ -297,19 +313,54 @@ def Calculate(self, model:Model):
297313 f .write ('\n ' )
298314 f .write ('\n ' )
299315 f .write ('GENER----1----*----2----*----3----*----4----*----5----*----6----*----7----*----8\n ' )
300- f .write ('%s 012 1 COM1 %9.3f %9.1f \n ' % (injection_cell_id , flowrate , injenthalpy ))
301- f .write ('%s 021 1 MASS %9.3f \n ' % (production_cell_id , - flowrate ))
316+ f .write ('%s 012 1 COM1 %9.3f %9.1f \n ' % (injection_cell_id , flowrate_inj , injenthalpy ))
317+ f .write ('%s 012 1 COM1 %9.3f %9.1f \n ' % (hrz_inj_id1 , flowrate_inj , injenthalpy ))
318+ f .write ('%s 012 1 COM1 %9.3f %9.1f \n ' % (hrz_inj_id2 , flowrate_inj , injenthalpy ))
319+ f .write ('%s 012 1 COM1 %9.3f %9.1f \n ' % (hrz_inj_id3 , flowrate_inj , injenthalpy ))
320+ f .write ('%s 012 1 COM1 %9.3f %9.1f \n ' % (hrz_inj_id4 , flowrate_inj , injenthalpy ))
321+ f .write ('%s 012 1 COM1 %9.3f %9.1f \n ' % (hrz_inj_id5 , flowrate_inj , injenthalpy ))
322+ f .write ('%s 021 1 MASS %9.3f \n ' % (production_cell_id , - flowrate_prod ))
323+ f .write ('%s 021 1 MASS %9.3f \n ' % (hrz_prod_id1 , - flowrate_prod ))
324+ f .write ('%s 021 1 MASS %9.3f \n ' % (hrz_prod_id2 , - flowrate_prod ))
325+ f .write ('%s 021 1 MASS %9.3f \n ' % (hrz_prod_id3 , - flowrate_prod ))
326+ f .write ('%s 021 1 MASS %9.3f \n ' % (hrz_prod_id4 , - flowrate_prod ))
327+ f .write ('%s 021 1 MASS %9.3f \n ' % (hrz_prod_id5 , - flowrate_prod ))
302328 f .write ('\n ' )
303329 f .write ('INCON----1----*----2----*----3----*----4----*----5----*----6----*----7----*----8\n ' )
304330 f .write ('\n ' )
305331 f .write ('FOFT ----1----*----2----*----3----*----4----*----5----*----6----*----7----*----8\n ' )
306332 f .write (f'{ injection_cell_id } \n ' )
333+ f .write (f'{ hrz_inj_id1 } \n ' )
334+ f .write (f'{ hrz_inj_id2 } \n ' )
335+ f .write (f'{ hrz_inj_id3 } \n ' )
336+ f .write (f'{ hrz_inj_id4 } \n ' )
337+ f .write (f'{ hrz_inj_id5 } \n ' )
307338 f .write (f'{ production_cell_id } \n ' )
339+ f .write (f'{ hrz_prod_id1 } \n ' )
340+ f .write (f'{ hrz_prod_id2 } \n ' )
341+ f .write (f'{ hrz_prod_id3 } \n ' )
342+ f .write (f'{ hrz_prod_id4 } \n ' )
343+ f .write (f'{ hrz_prod_id5 } \n ' )
308344 f .write ('\n ' )
309345 f .write ('GOFT ----1----*----2----*----3----*----4----*----5----*----6----*----7----*----8\n ' )
310346 f .write (f'{ injection_cell_id } 012\n ' )
347+ f .write (f'{ hrz_inj_id1 } 012\n ' )
348+ f .write (f'{ hrz_inj_id2 } 012\n ' )
349+ f .write (f'{ hrz_inj_id3 } 012\n ' )
350+ f .write (f'{ hrz_inj_id4 } 012\n ' )
351+ f .write (f'{ hrz_inj_id5 } 012\n ' )
311352 f .write (f'{ production_cell_id } 021\n ' )
353+ f .write (f'{ hrz_prod_id1 } 021\n ' )
354+ f .write (f'{ hrz_prod_id2 } 021\n ' )
355+ f .write (f'{ hrz_prod_id3 } 021\n ' )
356+ f .write (f'{ hrz_prod_id4 } 021\n ' )
357+ f .write (f'{ hrz_prod_id5 } 021\n ' )
312358 f .write ('\n ' )
359+ # f.write('TIMES----1----*----2----*----3----*----4----*----5----*----6----*----7----*----8\n')
360+ # f.write('10 \n')
361+ # f.write('2.0000E+013.6000E+038.6400E+042.6784E+061.5898E+073.1536E+071.5768E+083.1536E+08\n')
362+ # f.write('6.3072E+089.4610E+08\n')
363+ # f.write('\n')
313364 f .write ('ENDCY\n ' )
314365 f .close ()
315366 print ("GEOPHIRES will run TOUGH2 simulation with built-in Doublet model ..." )
@@ -354,21 +405,74 @@ def Calculate(self, model:Model):
354405 # Read FOFT and GOFT files to calculate Productivity Index (PI) and Injectivity Index (II)
355406 import pandas as pd
356407
357- df = pd .read_csv (f'FOFT_{ production_cell_id } .csv' )
358- dfG = pd .read_csv (f'GOFT_{ production_cell_id } ___021.csv' )
359- ef = pd .read_csv (f'FOFT_{ injection_cell_id .replace (" " , "_" )} .csv' )
360- efG = pd .read_csv (f'GOFT_{ injection_cell_id .replace (" " , "_" )} ___012.csv' )
361-
362- P0_production_well = df [' PRES' ].iloc [0 ]
363- Pf_production_well = df [' PRES' ].iloc [- 1 ]
364- P0_injection_well = ef [' PRES' ].iloc [0 ]
365- Pf_injection_well = ef [' PRES' ].iloc [- 1 ]
366- fr0_production_well = dfG [' GEN' ].iloc [0 ]
367- fr0_injection_well = efG [' GEN' ].iloc [0 ]
368-
369-
370- tough3_PI = fr0_production_well / ((Pf_production_well - P0_production_well ) / 100000 )
371- tough3_II = fr0_injection_well / ((Pf_injection_well - P0_injection_well ) / 100000 )
408+ df_0v = pd .read_csv (f'FOFT_{ production_cell_id } .csv' )
409+ df_fv = pd .read_csv (f'FOFT_{ production_cell_id } .csv' )
410+ # dfG_0 = pd.read_csv(f'GOFT_{production_cell_id}___021.csv')
411+ df_01 = pd .read_csv (f'FOFT_{ hrz_prod_id1 } .csv' )
412+ df_f1 = pd .read_csv (f'FOFT_{ hrz_prod_id1 } .csv' )
413+ df_02 = pd .read_csv (f'FOFT_{ hrz_prod_id2 } .csv' )
414+ df_f2 = pd .read_csv (f'FOFT_{ hrz_prod_id2 } .csv' )
415+ df_03 = pd .read_csv (f'FOFT_{ hrz_prod_id3 } .csv' )
416+ df_f3 = pd .read_csv (f'FOFT_{ hrz_prod_id3 } .csv' )
417+ df_04 = pd .read_csv (f'FOFT_{ hrz_prod_id4 } .csv' )
418+ df_f4 = pd .read_csv (f'FOFT_{ hrz_prod_id4 } .csv' )
419+ df_05 = pd .read_csv (f'FOFT_{ hrz_prod_id5 } .csv' )
420+ df_f5 = pd .read_csv (f'FOFT_{ hrz_prod_id5 } .csv' )
421+
422+ ef_0v = pd .read_csv (f'FOFT_{ injection_cell_id .replace (" " , "_" )} .csv' )
423+ ef_fv = pd .read_csv (f'FOFT_{ injection_cell_id .replace (" " , "_" )} .csv' )
424+ # efG_0 = pd.read_csv(f'GOFT_{injection_cell_id.replace(" ", "_")}___012.csv')
425+ ef_01 = pd .read_csv (f'FOFT_{ hrz_inj_id1 .replace (" " , "_" )} .csv' )
426+ ef_f1 = pd .read_csv (f'FOFT_{ hrz_inj_id1 .replace (" " , "_" )} .csv' )
427+ ef_02 = pd .read_csv (f'FOFT_{ hrz_inj_id2 .replace (" " , "_" )} .csv' )
428+ ef_f2 = pd .read_csv (f'FOFT_{ hrz_inj_id2 .replace (" " , "_" )} .csv' )
429+ ef_03 = pd .read_csv (f'FOFT_{ hrz_inj_id3 .replace (" " , "_" )} .csv' )
430+ ef_f3 = pd .read_csv (f'FOFT_{ hrz_inj_id3 .replace (" " , "_" )} .csv' )
431+ ef_04 = pd .read_csv (f'FOFT_{ hrz_inj_id4 .replace (" " , "_" )} .csv' )
432+ ef_f4 = pd .read_csv (f'FOFT_{ hrz_inj_id4 .replace (" " , "_" )} .csv' )
433+ ef_05 = pd .read_csv (f'FOFT_{ hrz_inj_id5 .replace (" " , "_" )} .csv' )
434+ ef_f5 = pd .read_csv (f'FOFT_{ hrz_inj_id5 .replace (" " , "_" )} .csv' )
435+
436+ P0v_production_well = df_0v [' PRES' ].iloc [0 ]
437+ Pfv_production_well = df_fv [' PRES' ].iloc [- 1 ]
438+ P0v_injection_well = ef_0v [' PRES' ].iloc [0 ]
439+ Pfv_injection_well = ef_fv [' PRES' ].iloc [- 1 ]
440+ P01_production_well = df_01 [' PRES' ].iloc [0 ]
441+ Pf1_production_well = df_f1 [' PRES' ].iloc [- 1 ]
442+ P01_injection_well = ef_01 [' PRES' ].iloc [0 ]
443+ Pf1_injection_well = ef_f1 [' PRES' ].iloc [- 1 ]
444+ P02_production_well = df_02 [' PRES' ].iloc [0 ]
445+ Pf2_production_well = df_f2 [' PRES' ].iloc [- 1 ]
446+ P02_injection_well = ef_02 [' PRES' ].iloc [0 ]
447+ Pf2_injection_well = ef_f2 [' PRES' ].iloc [- 1 ]
448+ P03_production_well = df_03 [' PRES' ].iloc [0 ]
449+ Pf3_production_well = df_f3 [' PRES' ].iloc [- 1 ]
450+ P03_injection_well = ef_03 [' PRES' ].iloc [0 ]
451+ Pf3_injection_well = ef_f3 [' PRES' ].iloc [- 1 ]
452+ P04_production_well = df_04 [' PRES' ].iloc [0 ]
453+ Pf4_production_well = df_f4 [' PRES' ].iloc [- 1 ]
454+ P04_injection_well = ef_04 [' PRES' ].iloc [0 ]
455+ Pf4_injection_well = ef_f4 [' PRES' ].iloc [- 1 ]
456+ P05_production_well = df_05 [' PRES' ].iloc [0 ]
457+ Pf5_production_well = df_f5 [' PRES' ].iloc [- 1 ]
458+ P05_injection_well = ef_05 [' PRES' ].iloc [0 ]
459+ Pf5_injection_well = ef_f5 [' PRES' ].iloc [- 1 ]
460+
461+ fr0_production_well = - model .wellbores .prodwellflowrate .value
462+ fr0_injection_well = model .wellbores .prodwellflowrate .value
463+
464+ tough3_PI = fr0_production_well / (((Pfv_production_well - P0v_production_well ) +
465+ (Pf1_production_well - P01_production_well ) +
466+ (Pf2_production_well - P02_production_well ) +
467+ (Pf3_production_well - P03_production_well ) +
468+ (Pf4_production_well - P04_production_well ) +
469+ (Pf5_production_well - P05_production_well )) / 100000 )
470+ tough3_II = fr0_injection_well / (((Pfv_injection_well - P0v_injection_well ) +
471+ (Pf1_injection_well - P01_injection_well ) +
472+ (Pf2_injection_well - P02_injection_well ) +
473+ (Pf3_injection_well - P03_injection_well ) +
474+ (Pf4_injection_well - P04_injection_well ) +
475+ (Pf5_injection_well - P05_injection_well )) / 100000 )
372476
373477 print ("TOUGH PI = " , tough3_PI )
374478 print ("TOUGH II = " , tough3_II )
0 commit comments