TNO Intern

Commit ca8a35ed authored by Hen Brett's avatar Hen Brett 🐔
Browse files

Testing performance

parent 8ca48b51
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
from dataclasses import dataclass
import timeit

import numpy as np

from pythermogis.workflow.utc.utc_properties import UTCConfiguration
from pythermogis.workflow.utc.doublet_utils import calculate_injection_temp_with_heat_pump, \
    calc_lifetime
@@ -53,7 +56,7 @@ def calculate_doublet_performance(props: UTCConfiguration, input: DoubletInput,
    timer = timeit.default_timer()
    # determine initial well distance
    well_distance = (
        (props.optim_dist_well_dist_min + props.optim_dist_well_dist_max) / 2
        np.mean([props.optim_dist_well_dist_min + props.optim_dist_well_dist_max])
        if props.optim_well_dist
        else props.default_well_distance
    )
+9 −12
Original line number Diff line number Diff line

import timeit
from dataclasses import dataclass
from pythermogis.workflow.utc.flow import calculate_volumetric_flow

from pythermogis.workflow.utc.economics import calculate_economics
from utils.timer import print_time
from pythermogis.workflow.utc.flow import calculate_volumetric_flow


def calculate_max_pressure(
@@ -155,7 +154,6 @@ def optimize_pressure(
        iter_count = 0
        pres_min = 0.0
        pres_max = drawdown_pressure

        while iter_count < 1000 and abs(pres_max - pres_min) > pres_tol:
            iter_count += 1
            pres = 0.5 * (pres_min + pres_max)
@@ -177,7 +175,6 @@ def optimize_pressure(
        # Final adjustment if flow still too high
        if flow_results.flowrate > props.max_flow:
            drawdown_pressure -= pres_tol

            flow_results = calculate_volumetric_flow(
                props=props,
                input_data=input,
@@ -185,10 +182,10 @@ def optimize_pressure(
                well_distance=well_distance,
                injection_temp=injection_temp,
            )

    if flow_results is None or flow_results.flowrate > props.max_flow:
        return None


    cop = (
        (flow_results.heat_power_per_doublet + flow_results.hp_elec_consumption) /
        (flow_results.heat_power_per_doublet / flow_results.cop + flow_results.hp_elec_consumption)