Loading src/pythermogis/workflow/utc/doubletcalc.py +7 −4 Original line number Diff line number Diff line import math from dataclasses import dataclass from pythermogis.workflow.utc.utc_properties import UTCConfiguration from numba import njit from pydoubletcalc import Aquifer, Doublet, Well, WellPipeSegment from pythermogis.workflow.utc.water import get_salinity from pythermogis.workflow.utc.rock import get_geothermal_gradient from numba import njit from pythermogis.workflow.utc.utc_properties import UTCConfiguration from pythermogis.workflow.utc.water import get_salinity INCH_SI = 0.0254 @dataclass Loading Loading @@ -96,7 +99,7 @@ def doubletcalc( well_distance=well_distance, cooling_fraction=0.1, yearly_operating_hours=props.load_hours, pressure_balance_tolerance=1e-2, pressure_balance_tolerance=1e-1, viscosity_mode=props.viscosity_mode, heat_exchanger_exit_temperature=injection_temp, ) Loading tests/utc/test_doublet.py +1 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ def test_calculate_doublet_performance_precise(): assert np.isclose(result.var_opex, -7.510325908660889, rtol=rtol) assert np.isclose(result.fixed_opex, -11.227973937988281, rtol=rtol) @pytest.skip("This is for timing performance and comparing to the Java code, not needed to run on the pipeline") def test_calculate_doublet_performance_approximate(): # Arrange: instantiate default UTCConfiguration props = UTCConfiguration( Loading Loading @@ -81,7 +82,6 @@ def test_calculate_doublet_performance_approximate(): print(f"{n_sims} simulations took: {time_elapsed:.1f} seconds\n" f"{n_sims/time_elapsed:.1f} simulations per second") # Assert rtol = 0.01 # accurate to 1% assert np.isclose(result.flow, 227.2757568359375, rtol=rtol) Loading tests/utc/test_doubletcalc.py +8 −6 Original line number Diff line number Diff line from pythermogis.workflow.utc.utc_properties import UTCConfiguration from pythermogis.workflow.utc.doublet import DoubletInput from pythermogis.workflow.utc.doubletcalc import doubletcalc import numpy as np import timeit from utils.timer import print_time import numpy as np import pytest from pythermogis.workflow.utc.doublet import DoubletInput from pythermogis.workflow.utc.doubletcalc import doubletcalc from pythermogis.workflow.utc.utc_properties import UTCConfiguration def test_doubletcalc(): Loading @@ -30,7 +31,7 @@ def test_doubletcalc(): assert np.isclose(results.production_temp, 41.36211427733413, rtol=0.01) assert np.isclose(results.heat_power_produced[0], 0.027926914290870505, rtol=0.01) @pytest.skip("This is for timing performance and comparing to the Java code, not needed to run on the pipeline") def test_doubletcalc_performance(): props = UTCConfiguration(segment_length=1) Loading @@ -48,6 +49,7 @@ def test_doubletcalc_performance(): nsims = 10000 # one iteration to warm up the JIT compiled functions doubletcalc(props, input_data, 600000, 1550, 40) start = timeit.default_timer() for _ in range(nsims): results = doubletcalc(props, input_data, 600000, 1550, 40) Loading Loading
src/pythermogis/workflow/utc/doubletcalc.py +7 −4 Original line number Diff line number Diff line import math from dataclasses import dataclass from pythermogis.workflow.utc.utc_properties import UTCConfiguration from numba import njit from pydoubletcalc import Aquifer, Doublet, Well, WellPipeSegment from pythermogis.workflow.utc.water import get_salinity from pythermogis.workflow.utc.rock import get_geothermal_gradient from numba import njit from pythermogis.workflow.utc.utc_properties import UTCConfiguration from pythermogis.workflow.utc.water import get_salinity INCH_SI = 0.0254 @dataclass Loading Loading @@ -96,7 +99,7 @@ def doubletcalc( well_distance=well_distance, cooling_fraction=0.1, yearly_operating_hours=props.load_hours, pressure_balance_tolerance=1e-2, pressure_balance_tolerance=1e-1, viscosity_mode=props.viscosity_mode, heat_exchanger_exit_temperature=injection_temp, ) Loading
tests/utc/test_doublet.py +1 −1 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ def test_calculate_doublet_performance_precise(): assert np.isclose(result.var_opex, -7.510325908660889, rtol=rtol) assert np.isclose(result.fixed_opex, -11.227973937988281, rtol=rtol) @pytest.skip("This is for timing performance and comparing to the Java code, not needed to run on the pipeline") def test_calculate_doublet_performance_approximate(): # Arrange: instantiate default UTCConfiguration props = UTCConfiguration( Loading Loading @@ -81,7 +82,6 @@ def test_calculate_doublet_performance_approximate(): print(f"{n_sims} simulations took: {time_elapsed:.1f} seconds\n" f"{n_sims/time_elapsed:.1f} simulations per second") # Assert rtol = 0.01 # accurate to 1% assert np.isclose(result.flow, 227.2757568359375, rtol=rtol) Loading
tests/utc/test_doubletcalc.py +8 −6 Original line number Diff line number Diff line from pythermogis.workflow.utc.utc_properties import UTCConfiguration from pythermogis.workflow.utc.doublet import DoubletInput from pythermogis.workflow.utc.doubletcalc import doubletcalc import numpy as np import timeit from utils.timer import print_time import numpy as np import pytest from pythermogis.workflow.utc.doublet import DoubletInput from pythermogis.workflow.utc.doubletcalc import doubletcalc from pythermogis.workflow.utc.utc_properties import UTCConfiguration def test_doubletcalc(): Loading @@ -30,7 +31,7 @@ def test_doubletcalc(): assert np.isclose(results.production_temp, 41.36211427733413, rtol=0.01) assert np.isclose(results.heat_power_produced[0], 0.027926914290870505, rtol=0.01) @pytest.skip("This is for timing performance and comparing to the Java code, not needed to run on the pipeline") def test_doubletcalc_performance(): props = UTCConfiguration(segment_length=1) Loading @@ -48,6 +49,7 @@ def test_doubletcalc_performance(): nsims = 10000 # one iteration to warm up the JIT compiled functions doubletcalc(props, input_data, 600000, 1550, 40) start = timeit.default_timer() for _ in range(nsims): results = doubletcalc(props, input_data, 600000, 1550, 40) Loading