NREL / GEOPHIRES-X

MIT License
26 stars 21 forks source link

Fixed index problem in WellBores.py calculation of overpressure and a… #199

Closed malcolm-dsider closed 2 months ago

malcolm-dsider commented 2 months ago

…dded edge test case.

softwareengineerprogrammer commented 2 months ago

diff between outputs:

(venv) ➜  tests git:(malcolm-dsider_main) ✗ diff examples/example_overpressure.out examples/example_overpressure2.out
0a1
> 
7c8
<  GEOPHIRES Version: 3.4.25
---
>  GEOPHIRES Version: 3.4.26
9,11c10,12
<  Simulation Date: 2024-04-21
<  Simulation Time:  20:27
<  Calculation Time:      1.553 sec
---
>  Simulation Date: 2024-05-02
>  Simulation Time:  11:44
>  Calculation Time:      1.647 sec
16,17c17,18
<       Average Net Electricity Production:                     5.25 MW
<       Electricity breakeven price:                            9.35 cents/kWh
---
>       Average Net Electricity Production:                     5.38 MW
>       Electricity breakeven price:                            9.08 cents/kWh
32,36c33,37
<       Project NPV:                                           1.70 MUSD
<       Project IRR:                                           6.54 %
<       Project VIR=PI=PIR:                                    1.04
<       Project MOIC:                                          0.79
<       Project Payback Period:                               14.52 yr
---
>       Project NPV:                                           3.47 MUSD
>       Project IRR:                                           6.84 %
>       Project VIR=PI=PIR:                                    1.07
>       Project MOIC:                                          0.85
>       Project Payback Period:                               14.28 yr
70c71
<       Average reservoir pressure:                         32283.22 kPa
---
>       Average reservoir pressure:                         43350.40 kPa
90c91
<       Average Production Well Pump Pressure Drop:         -1679.9 kPa
---
>       Average Production Well Pump Pressure Drop:        -12747.1 kPa
100,101c101,102
<          Field gathering system costs:                        3.04 MUSD
<          Total surface equipment costs:                      25.72 MUSD
---
>          Field gathering system costs:                        2.77 MUSD
>          Total surface equipment costs:                      25.45 MUSD
103,104c104,105
<       Total capital costs:                                   48.48 MUSD
<       Annualized capital costs:                               2.42 MUSD
---
>       Total capital costs:                                   48.21 MUSD
>       Annualized capital costs:                               2.41 MUSD
112c113
<       Total operating and maintenance costs:                  1.43 MUSD/yr
---
>       Total operating and maintenance costs:                  1.42 MUSD/yr
123,124c124,125
<       Average Net Electricity Generation:                     5.25 MW
<       Minimum Net Electricity Generation:                     4.68 MW
---
>       Average Net Electricity Generation:                     5.38 MW
>       Minimum Net Electricity Generation:                     4.88 MW
127c128
<       Average Annual Net Electricity Generation:             41.16 GWh
---
>       Average Annual Net Electricity Generation:             42.21 GWh
129c130
<       Average Pumping Power:                                  0.84 MW
---
>       Average Pumping Power:                                  0.70 MW
147,166c148,167
<   11           1.0092                158.65               0.7259            5.3609                8.6637
<   12           1.0094                158.67               0.7613            5.3280                8.6089
<   13           1.0095                158.69               0.7966            5.2949                8.5539
<   14           1.0096                158.71               0.8320            5.2615                8.4986
<   15           1.0097                158.72               0.8674            5.2279                8.4432
<   16           1.0098                158.74               0.9027            5.1942                8.3877
<   17           1.0099                158.75               0.9381            5.1604                8.3321
<   18           1.0099                158.76               0.9735            5.1264                8.2763
<   19           1.0100                158.77               1.0089            5.0923                8.2205
<   20           1.0101                158.78               1.0443            5.0582                8.1646
<   21           1.0101                158.79               1.0796            5.0239                8.1085
<   22           1.0102                158.80               1.1150            4.9895                8.0524
<   23           1.0102                158.81               1.1504            4.9550                7.9962
<   24           1.0103                158.81               1.1858            4.9204                7.9398
<   25           1.0103                158.82               1.2212            4.8856                7.8833
<   26           1.0103                158.82               1.2566            4.8507                7.8267
<   27           1.0103                158.83               1.2920            4.8156                7.7699
<   28           1.0103                158.83               1.3274            4.7804                7.7129
<   29           1.0103                158.83               1.3628            4.7449                7.6558
<   30           1.0103                158.82               1.3982            4.7092                7.5984
---
>   11           1.0092                158.65               0.5279            5.5589                8.9837
>   12           1.0094                158.67               0.5633            5.5260                8.9287
>   13           1.0095                158.69               0.5987            5.4928                8.8736
>   14           1.0096                158.71               0.6341            5.4594                8.8183
>   15           1.0097                158.72               0.6695            5.4258                8.7628
>   16           1.0098                158.74               0.7049            5.3921                8.7072
>   17           1.0099                158.75               0.7403            5.3582                8.6515
>   18           1.0099                158.76               0.7757            5.3243                8.5957
>   19           1.0100                158.77               0.8110            5.2902                8.5398
>   20           1.0101                158.78               0.8464            5.2560                8.4839
>   21           1.0101                158.79               0.8818            5.2217                8.4278
>   22           1.0102                158.80               0.9172            5.1873                8.3716
>   23           1.0102                158.81               0.9526            5.1528                8.3154
>   24           1.0103                158.81               0.9880            5.1182                8.2590
>   25           1.0103                158.82               1.0234            5.0834                8.2025
>   26           1.0103                158.82               1.0588            5.0485                8.1459
>   27           1.0103                158.83               1.0941            5.0134                8.0891
>   28           1.0103                158.83               1.1295            4.9782                8.0322
>   29           1.0103                158.83               1.1649            4.9428                7.9750
>   30           1.0103                158.82               1.2003            4.9071                7.9177
184,204c185,205
<   10                  43.4                       487.8                282.18                   5.85
<   11                  42.1                       487.9                280.42                   6.43
<   12                  41.9                       488.0                278.67                   7.02
<   13                  41.6                       488.1                276.91                   7.60
<   14                  41.3                       488.1                275.15                   8.19
<   15                  41.1                       488.2                273.40                   8.78
<   16                  40.8                       488.3                271.64                   9.36
<   17                  40.6                       488.3                269.88                   9.95
<   18                  40.3                       488.4                268.12                  10.54
<   19                  40.0                       488.4                266.36                  11.12
<   20                  39.7                       488.5                264.61                  11.71
<   21                  39.5                       488.5                262.85                  12.30
<   22                  39.2                       488.5                261.09                  12.88
<   23                  38.9                       488.6                259.33                  13.47
<   24                  38.7                       488.6                257.57                  14.06
<   25                  38.4                       488.6                255.81                  14.64
<   26                  38.1                       488.6                254.05                  15.23
<   27                  37.8                       488.6                252.29                  15.82
<   28                  37.5                       488.6                250.53                  16.41
<   29                  37.3                       488.6                248.77                  16.99
<   30                  30.8                       407.2                247.31                  17.48
---
>   10                  44.0                       487.8                282.18                   5.85
>   11                  43.7                       487.9                280.42                   6.43
>   12                  43.4                       488.0                278.67                   7.02
>   13                  43.2                       488.1                276.91                   7.60
>   14                  42.9                       488.1                275.15                   8.19
>   15                  42.6                       488.2                273.40                   8.78
>   16                  42.4                       488.3                271.64                   9.36
>   17                  42.1                       488.3                269.88                   9.95
>   18                  41.8                       488.4                268.12                  10.54
>   19                  41.6                       488.4                266.36                  11.12
>   20                  41.3                       488.5                264.61                  11.71
>   21                  41.0                       488.5                262.85                  12.30
>   22                  40.8                       488.5                261.09                  12.88
>   23                  40.5                       488.6                259.33                  13.47
>   24                  40.2                       488.6                257.57                  14.06
>   25                  39.9                       488.6                255.81                  14.64
>   26                  39.7                       488.6                254.05                  15.23
>   27                  39.4                       488.6                252.29                  15.82
>   28                  39.1                       488.6                250.53                  16.41
>   29                  38.8                       488.6                248.77                  16.99
>   30                  32.1                       407.2                247.31                  17.48
214,243c215,282
<   1      0.00          -48.48   0.00     |    0.00     0.00         0.00    |    0.00     0.00         0.00     |    0.00     0.00         0.00     |  0.00     -48.48     -48.48
<   2      9.00           2.67   4.10     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      2.67     -45.81
<   3      9.00           2.69   8.21     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      2.69     -43.12
<   4      9.00           2.68  12.32     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      2.68     -40.44
<   5      9.00           2.66  16.40     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      2.66     -37.78
<   6      9.00           2.64  20.47     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      2.64     -35.14
<   7      9.00           2.62  24.52     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      2.62     -32.52
<   8     10.20           3.13  29.08     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      3.13     -29.39
<   9     11.40           3.64  34.15     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      3.64     -25.75
<  10     12.60           4.14  39.72     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.14     -21.60
<  11     13.80           4.57  45.71     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.57     -17.03
<  12     15.00           4.89  52.03     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.89     -12.14
<  13     15.00           4.86  58.31     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.86     -7.28
<  14     15.00           4.82  64.55     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.82     -2.47
<  15     15.00           4.78  70.76     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.78      2.31
<  16     15.00           4.74  76.92     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.74      7.04
<  17     15.00           4.70  83.04     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.70     11.74
<  18     15.00           4.66  89.12     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.66     16.40
<  19     15.00           4.62  95.17     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.62     21.01
<  20     15.00           4.58  101.17     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.58     25.59
<  21     15.00           4.54  107.13     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.54     30.12
<  22     15.00           4.49  113.05     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.49     34.62
<  23     15.00           4.45  118.93     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.45     39.07
<  24     15.00           4.41  124.77     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.41     43.49
<  25     15.00           4.37  130.57     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.37     47.86
<  26     15.00           4.33  136.33     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.33     52.19
<  27     15.00           4.29  142.04     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.29     56.48
<  28     15.00           4.25  147.72     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.25     60.73
<  29     15.00           4.21  153.35     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.21     64.93
<  30     15.00           4.16  158.94     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.43      4.16     69.10
---
>   1      0.00          -48.21   0.00     |    0.00     0.00         0.00    |    0.00     0.00         0.00     |    0.00     0.00         0.00     |  0.00     -48.21     -48.21
>   2      9.00           2.68   4.10     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      2.68     -45.54
>   3      9.00           2.69   8.21     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      2.69     -42.85
>   4      9.00           2.68  12.32     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      2.68     -40.17
>   5      9.00           2.66  16.40     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      2.66     -37.50
>   6      9.00           2.64  20.47     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      2.64     -34.86
>   7      9.00           2.62  24.52     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      2.62     -32.24
>   8     10.20           3.14  29.08     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      3.14     -29.10
>   9     11.40           3.65  34.15     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      3.65     -25.46
>  10     12.60           4.15  39.72     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.15     -21.31
>  11     13.80           4.64  45.78     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.64     -16.67
>  12     15.00           5.13  52.34     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      5.13     -11.54
>  13     15.00           5.09  58.85     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      5.09     -6.45
>  14     15.00           5.05  65.33     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      5.05     -1.39
>  15     15.00           5.01  71.76     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      5.01      3.62
>  16     15.00           4.97  78.16     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.97      8.59
>  17     15.00           4.93  84.52     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.93     13.53
>  18     15.00           4.89  90.83     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.89     18.42
>  19     15.00           4.85  97.11     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.85     23.27
>  20     15.00           4.81  103.35     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.81     28.08
>  21     15.00           4.77  109.54     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.77     32.86
>  22     15.00           4.73  115.70     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.73     37.59
>  23     15.00           4.69  121.81     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.69     42.28
>  24     15.00           4.65  127.88     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.65     46.93
>  25     15.00           4.61  133.92     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.61     51.53
>  26     15.00           4.57  139.91     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.57     56.10
>  27     15.00           4.53  145.86     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.53     60.63
>  28     15.00           4.48  151.76     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.48     65.11
>  29     15.00           4.44  157.63     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.44     69.56
>  30     15.00           4.40  163.46     |    2.50     0.00         0.00    |    2.50     0.00         0.00     |    0.00     0.00         0.00     |  1.42      4.40     73.96
> 
> 
>                             ***************************************
>                             *  RESERVOIR POWER REQUIRED PROFILES  *
>                             ***************************************
>   YEAR     PROD PUMP     INJECT PUMP     TOTAL PUMP
>              POWER          POWER           POWER
>              (MW)           (MW)            (MW)
>    1       0.0000          0.1741         0.1741
>    2       0.0000          0.2095         0.2095
>    3       0.0000          0.2448         0.2448
>    4       0.0000          0.2802         0.2802
>    5       0.0000          0.3156         0.3156
>    6       0.0000          0.3510         0.3510
>    7       0.0000          0.3864         0.3864
>    8       0.0000          0.4218         0.4218
>    9       0.0000          0.4572         0.4572
>   10       0.0000          0.4926         0.4926
>   11       0.0000          0.5279         0.5279
>   12       0.0000          0.5633         0.5633
>   13       0.0000          0.5987         0.5987
>   14       0.0000          0.6341         0.6341
>   15       0.0000          0.6695         0.6695
>   16       0.0000          0.7049         0.7049
>   17       0.0000          0.7403         0.7403
>   18       0.0000          0.7757         0.7757
>   19       0.0000          0.8110         0.8110
>   20       0.0000          0.8464         0.8464
>   21       0.0000          0.8818         0.8818
>   22       0.0000          0.9172         0.9172
>   23       0.0000          0.9526         0.9526
>   24       0.0000          0.9880         0.9880
>   25       0.0000          1.0234         1.0234
>   26       0.0000          1.0588         1.0588
>   27       0.0000          1.0941         1.0941
>   28       0.0000          1.1295         1.1295
>   29       0.0000          1.1649         1.1649
>   30       0.0000          1.2003         1.2003