arbrandt / OPGEE

Oil Production Greenhouse Gas Emissions Estimator
18 stars 5 forks source link

Fraction of gas reinjection removes gas from export even when gas reinjection turned off #230

Closed qlangfitt closed 4 years ago

qlangfitt commented 4 years ago

This is kind of a broader question of how OPGEE handles incongruous inputs, but I think in the vast majority of cases and the intent is for OPGEE to disregard specifications under "Production practices" when dictated by inputs under "Production methods". Of course, this should be a non-issue since the user shouldn't be inputting a natural gas reinjection fraction while also specifying no natural gas reinjection, but I think it's still important to apply a consistent treatment to poor inputs.

In the case of natural gas reinjection, the model correctly turns off energy use from the natural gas reinjection compressor when Natural_gas_reinjection_01=0, but Gas Partition B still sends the gas to reinjection, thereby reducing the amount of gas exported and the denominator of the CI calculation. Suggest only diverting gas to reinjection on Gas Partition B if gas reinjection (or gas flooding w/ NG) is turned on.

arbrandt commented 4 years ago

Fixed. Now the fraction of gas reinjected is multiplied by max(Natural_gas_reinjection_01,Gas_flooding_01), which is 1 if either of those are turned on and 0 if neither are turned on. You are correct that there should be more error logic to control for user issues.

qlangfitt commented 4 years ago

Two issues with the implemented solution:

  1. Need to also implement the ON/OFF trigger for stream 45 (Gas Exported) on Gas Partition B as well.

  2. The trigger needs to account for whether natural gas is the flood gas for gas flooding (rather than N2 or CO2).

arbrandt commented 4 years ago

Fixed. Code changed to: =MAX(Natural_gas_reinjection_01,Gas_flooding_01IF(Flood_gas_type=1,1,0))Fraction_remaining_gas_inj*E16

Such that the second term in max is only ==1 if gas flooding is turned on AND flood gas type =1. Also, stream 45 is now computed by difference. This ensures mass balance in the process sheet and implicitly includes the on/off trigger on both 46 and 45.