@@ -118,8 +118,27 @@ class NaturalGeoH2PerformanceModel(GeoH2SubsurfacePerformanceBaseClass):
118118 Hourly wellhead gas production profile from natural accumulations,
119119 covering one simulated year (8760 hours), in kg/h.
120120
121+ wellhead_gas_out (ndarray):
122+ Hourly wellhead gas production profile used for downstream modeling, in kg/h.
123+
121124 max_wellhead_gas (float):
122125 Maximum wellhead gas output over the system lifetime, in kg/h.
126+
127+ rated_hydrogen_production (float):
128+ Rated hydrogen production at the wellhead, in kg/h.
129+
130+ total_wellhead_gas_produced (float):
131+ Total mass of gas produced at the wellhead over the simulation period, in kg/year.
132+
133+ total_hydrogen_produced (float):
134+ Total mass of hydrogen produced at the wellhead over the simulation period, in kg/year.
135+
136+ annual_hydrogen_produced (list):
137+ List of total hydrogen produced for each year of the simulation, in kg/year.
138+
139+ capacity_factor (list):
140+ List of capacity factors for each year of the simulation, calculated as the ratio
141+ of annual hydrogen production to the maximum hydrogen production of the well.
123142 """
124143
125144 def setup (self ):
@@ -229,40 +248,42 @@ def compute(self, inputs, outputs):
229248 h2_mw = 2.016
230249 x_h2 = wh_h2_conc / 100
231250 w_h2 = x_h2 * h2_mw / (x_h2 * h2_mw + (1 - x_h2 ) * balance_mw )
232- avg_h2_flow = w_h2 * wh_flow_profile
251+ h2_flow = w_h2 * wh_flow_profile
252+
253+ # calculate the yearly capacity factors and add to dict
254+ yearly_h2_cf = []
255+ yearly_h2 = []
256+ # for each 8760 in the flow profile, calculate the capacity factor for
257+ # that year and add to array
258+ for year in range (self .options ["plant_config" ]["plant" ]["plant_life" ]):
259+ start_idx = year * 8760
260+ end_idx = start_idx + 8760
261+ max_h2_produced = ramp_up_flow * w_h2 * 8760
262+ yearly_h2_produced = np .sum (h2_flow [start_idx :end_idx ])
263+ yearly_h2 .append (yearly_h2_produced )
264+ yearly_h2_cf .append (yearly_h2_produced / max_h2_produced )
233265
234266 # Parse outputs
235267 outputs ["wellhead_h2_concentration_mass" ] = w_h2 * 100
236268 outputs ["wellhead_h2_concentration_mol" ] = wh_h2_conc
237269 outputs ["lifetime_wellhead_flow" ] = np .average (wh_flow_profile )
238- # fill "wellhead_gas_out_natural" with first year profile from wh_flow_profile
239- # updated to average value over 8760 until simulation length handling is improved
240- # commented code on lines 240 to 246 have the original intended functionality
241- outputs ["wellhead_gas_out_natural" ] = np .full (
242- n_timesteps , np .average (wh_flow_profile )
243- ) # wh_flow_profile[:n_timesteps]
244- outputs ["wellhead_gas_out" ] = np .full (
245- n_timesteps , np .average (wh_flow_profile )
246- ) # wh_flow_profile[:n_timesteps]
247- outputs ["hydrogen_out" ] = np .full (
248- n_timesteps , np .average (avg_h2_flow )
249- ) # avg_h2_flow[:n_timesteps]
270+ # use lifetime average because H2I is unable to handle multiyear
271+ # commodity_out. Noted in issue #475.
272+ outputs ["wellhead_gas_out_natural" ] = np .full (n_timesteps , np .average (wh_flow_profile ))
273+ outputs ["wellhead_gas_out" ] = np .full (n_timesteps , np .average (wh_flow_profile ))
274+ outputs ["hydrogen_out" ] = np .full (n_timesteps , np .average (h2_flow ))
275+
250276 outputs ["max_wellhead_gas" ] = ramp_up_flow
251- # this is lifetime flow which decreases over time
252- outputs ["total_wellhead_gas_produced" ] = (
253- np .average (wh_flow_profile ) * n_timesteps
254- ) # np.sum(wh_flow_profile)
255- outputs ["total_hydrogen_produced" ] = (
256- np .average (avg_h2_flow ) * n_timesteps
257- ) # np.sum(avg_h2_flow)
258-
259- outputs ["annual_hydrogen_produced" ] = (
260- outputs ["total_hydrogen_produced" ] / self .fraction_of_year_simulated
261- )
262277 outputs ["rated_hydrogen_production" ] = ramp_up_flow * w_h2
263- outputs ["capacity_factor" ] = outputs ["total_hydrogen_produced" ] / (
264- outputs ["rated_hydrogen_production" ] * self .n_timesteps
265- )
278+ # total is amount produced over simulation, which is a single year
279+ # for now so lifetime average is more accurate for model
280+ outputs ["total_wellhead_gas_produced" ] = np .average (wh_flow_profile ) * n_timesteps
281+ outputs ["total_hydrogen_produced" ] = np .average (h2_flow ) * n_timesteps
282+
283+ # output array of hydrogen produced and capacity factors
284+ # for each year of the simulation
285+ outputs ["annual_hydrogen_produced" ] = yearly_h2
286+ outputs ["capacity_factor" ] = yearly_h2_cf
266287
267288 def arps_decline_curve_fit (self , t , qi , Di , b ):
268289 """Arps decline curve model based on Arps (1945)
0 commit comments