Loading src/pythermogis/thermogis_classes/doublet.py +2 −2 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ def calculate_performance_of_single_location(mask: float, depth: float, thicknes if not np.isnan(mask) or temperature < utc_properties.minProdTemp(): return (mask_value,) * 14 use_java_backend = True use_java_backend = False if use_java_backend: doublet = instantiate_thermogis_doublet(utc_properties, rng_seed) JavaDoubletInput = JClass("thermogis.calc.utc.doublet.records.DoubletInput") Loading Loading @@ -149,7 +149,7 @@ def calculate_performance_of_single_location(mask: float, depth: float, thicknes props = UTCConfiguration(segment_length=1) # Create a minimal valid DoubletInput input_data = DoubletInput( unknown_input_value=-999.0, unknown_input_value=-9999.0, thickness=thickness, transmissivity=transmissivity, transmissivity_with_ntg=transmissivity_with_ntg, Loading src/pythermogis/workflow/utc/doubletcalc.py +4 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ def doubletcalc( drawdown_pressure: float, well_distance: float, injection_temp: float, ) -> Doublet1DResults: ) -> Doublet1DResults | None: aquifer = Aquifer( permeability=input.permeability, porosity=input.porosity, Loading Loading @@ -102,6 +102,9 @@ def doubletcalc( ) doublet.simulate() if not doublet.simulation_success: return None return Doublet1DResults( geothermal_powers=doublet.geothermal_power, cop=doublet.cop, Loading src/pythermogis/workflow/utc/well_distance.py +6 −6 Original line number Diff line number Diff line import numpy as np from pythermogis.workflow.utc.doublet_utils import calc_lifetime from pythermogis.workflow.utc.flow import calculate_volumetric_flow Loading @@ -10,13 +12,13 @@ def optimize_well_distance( dist_min = props.optim_dist_well_dist_min dist_max = props.optim_dist_well_dist_max well_distance = 0.5 * (dist_min + dist_max) well_distance = np.mean([dist_min, dist_max]) for iter_count in range(1000): if abs(dist_max - dist_min) <= 10.0: break return well_distance well_distance = 0.5 * (dist_min + dist_max) well_distance = np.mean([dist_min, dist_max]) # --- Compute flow for this distance --- results = calculate_volumetric_flow( Loading @@ -27,15 +29,13 @@ def optimize_well_distance( injection_temp=injection_temp, ) flowrate = min(results.flowrate, props.max_flow) # --- Compute lifetime for this distance --- lifetime = calc_lifetime( well_distance=well_distance, thickness=input.thickness * input.ntg, delta_temp_fraction=props.optim_dist_cooling_fraction, porosity=input.porosity, flowrate=flowrate, flowrate=min(results.flowrate, props.max_flow), depth=input.depth, reservoir_temp=input.temperature, salinity_surface=props.salinity_surface, Loading tests/test_doublet_speed.py +2 −2 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ import shutil from os import path from unittest.case import TestCase from pygridsio import read_grid, resample_grid, plot_grid from pygridsio import read_grid, resample_grid from pythermogis import * Loading Loading @@ -34,7 +34,7 @@ class PyThermoGIS(TestCase): print(f"Python calculation took {time_elapsed:.1f} seconds.") def read_input_grids(self): new_cellsize=20e3 # in m new_cellsize=5e3 # in m input_grids = resample_grid(read_grid(self.test_files_out_path / "ROSL_ROSLU__thick.zmap"), new_cellsize=new_cellsize).to_dataset(name="thickness_mean") input_grids["thickness_sd"] = resample_grid(read_grid(self.test_files_out_path / "ROSL_ROSLU__thick_sd.zmap"), new_cellsize=new_cellsize) input_grids["ntg"] = resample_grid(read_grid(self.test_files_out_path / "ROSL_ROSLU__ntg.zmap"), new_cellsize=new_cellsize) Loading Loading
src/pythermogis/thermogis_classes/doublet.py +2 −2 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ def calculate_performance_of_single_location(mask: float, depth: float, thicknes if not np.isnan(mask) or temperature < utc_properties.minProdTemp(): return (mask_value,) * 14 use_java_backend = True use_java_backend = False if use_java_backend: doublet = instantiate_thermogis_doublet(utc_properties, rng_seed) JavaDoubletInput = JClass("thermogis.calc.utc.doublet.records.DoubletInput") Loading Loading @@ -149,7 +149,7 @@ def calculate_performance_of_single_location(mask: float, depth: float, thicknes props = UTCConfiguration(segment_length=1) # Create a minimal valid DoubletInput input_data = DoubletInput( unknown_input_value=-999.0, unknown_input_value=-9999.0, thickness=thickness, transmissivity=transmissivity, transmissivity_with_ntg=transmissivity_with_ntg, Loading
src/pythermogis/workflow/utc/doubletcalc.py +4 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ def doubletcalc( drawdown_pressure: float, well_distance: float, injection_temp: float, ) -> Doublet1DResults: ) -> Doublet1DResults | None: aquifer = Aquifer( permeability=input.permeability, porosity=input.porosity, Loading Loading @@ -102,6 +102,9 @@ def doubletcalc( ) doublet.simulate() if not doublet.simulation_success: return None return Doublet1DResults( geothermal_powers=doublet.geothermal_power, cop=doublet.cop, Loading
src/pythermogis/workflow/utc/well_distance.py +6 −6 Original line number Diff line number Diff line import numpy as np from pythermogis.workflow.utc.doublet_utils import calc_lifetime from pythermogis.workflow.utc.flow import calculate_volumetric_flow Loading @@ -10,13 +12,13 @@ def optimize_well_distance( dist_min = props.optim_dist_well_dist_min dist_max = props.optim_dist_well_dist_max well_distance = 0.5 * (dist_min + dist_max) well_distance = np.mean([dist_min, dist_max]) for iter_count in range(1000): if abs(dist_max - dist_min) <= 10.0: break return well_distance well_distance = 0.5 * (dist_min + dist_max) well_distance = np.mean([dist_min, dist_max]) # --- Compute flow for this distance --- results = calculate_volumetric_flow( Loading @@ -27,15 +29,13 @@ def optimize_well_distance( injection_temp=injection_temp, ) flowrate = min(results.flowrate, props.max_flow) # --- Compute lifetime for this distance --- lifetime = calc_lifetime( well_distance=well_distance, thickness=input.thickness * input.ntg, delta_temp_fraction=props.optim_dist_cooling_fraction, porosity=input.porosity, flowrate=flowrate, flowrate=min(results.flowrate, props.max_flow), depth=input.depth, reservoir_temp=input.temperature, salinity_surface=props.salinity_surface, Loading
tests/test_doublet_speed.py +2 −2 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ import shutil from os import path from unittest.case import TestCase from pygridsio import read_grid, resample_grid, plot_grid from pygridsio import read_grid, resample_grid from pythermogis import * Loading Loading @@ -34,7 +34,7 @@ class PyThermoGIS(TestCase): print(f"Python calculation took {time_elapsed:.1f} seconds.") def read_input_grids(self): new_cellsize=20e3 # in m new_cellsize=5e3 # in m input_grids = resample_grid(read_grid(self.test_files_out_path / "ROSL_ROSLU__thick.zmap"), new_cellsize=new_cellsize).to_dataset(name="thickness_mean") input_grids["thickness_sd"] = resample_grid(read_grid(self.test_files_out_path / "ROSL_ROSLU__thick_sd.zmap"), new_cellsize=new_cellsize) input_grids["ntg"] = resample_grid(read_grid(self.test_files_out_path / "ROSL_ROSLU__ntg.zmap"), new_cellsize=new_cellsize) Loading