Skip to content

Commit

Permalink
Small changes to make Economics calculation cleaer and more correct; …
Browse files Browse the repository at this point in the history
…fixed bug in HTML output
  • Loading branch information
malcolm-dsider committed May 2, 2024
1 parent fc58cfe commit 6a7bec7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/geophires_x/Economics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2332,20 +2332,21 @@ def Calculate(self, model: Model) -> None:
vert_depth_km = model.reserv.InputDepth.quantity().to('km').magnitude
model.wellbores.injection_reservoir_depth.value = vert_depth_km

tot, vert, horiz = calculate_total_drilling_lengths_m(model.wellbores.Configuration.value,
tot_m, tot_vert_m, tot_horiz_m = calculate_total_drilling_lengths_m(model.wellbores.Configuration.value,
model.wellbores.numnonverticalsections.value,
model.wellbores.Nonvertical_length.value / 1000.0,
vert_depth_km,
model.wellbores.nprod.value,
model.wellbores.ninj.value)

else:
tot = vert = model.reserv.depth.quantity().to('km').magnitude
horiz = 0.0
tot_m = tot_vert_m = model.reserv.depth.quantity().to('km').magnitude
tot_horiz_m = 0.0
if not model.wellbores.injection_reservoir_depth.Provided:
model.wellbores.injection_reservoir_depth.value = model.reserv.depth.quantity().to('km').magnitude
else:
model.wellbores.injection_reservoir_depth.value = model.wellbores.injection_reservoir_depth.quantity().to('km').magnitude

self.cost_one_production_well.value = calculate_cost_of_one_vertical_well(model, model.reserv.depth.quantity().to('m').magnitude,
self.wellcorrelation.value,
self.Vertical_drilling_cost_per_m.value,
Expand All @@ -2362,12 +2363,13 @@ def Calculate(self, model: Model) -> None:
self.injection_well_cost_adjustment_factor.value)

if hasattr(model.wellbores, 'numnonverticalsections') and model.wellbores.numnonverticalsections.Provided:
cost_nonvertical_section = calculate_cost_of_non_vertical_section(model, horiz, self.wellcorrelation.value,
cost_nonvertical_section = calculate_cost_of_non_vertical_section(model, tot_horiz_m,
self.wellcorrelation.value,
self.Nonvertical_drilling_cost_per_m.value,
model.wellbores.numnonverticalsections.value,
self.per_injection_well_cost.Name,
model.wellbores.NonverticalsCased.value,
1.0)
self.production_well_cost_adjustment_factor.value)
else:
cost_nonvertical_section = 0.0
# cost of the well field
Expand Down
2 changes: 1 addition & 1 deletion src/geophires_x/GeoPHIRESUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def InsertImagesIntoHTML(html_path: str, short_names: set, full_names: set) -> N
insert_string = ''
for _ in range(len(full_names)):
name_to_use = short_names.pop()
insert_string = insert_string + f'<img src="{name_to_use}.png" alt="{name_to_use}">\n<br>'
insert_string = insert_string + f'<img src="{name_to_use}" alt="{name_to_use}">\n<br>'

match_string = '</body>'
with open(html_path, 'r+', encoding='UTF-8') as html_file:
Expand Down

0 comments on commit 6a7bec7

Please sign in to comment.