TNO Intern

Commit b7c671c0 authored by Florian Knappers's avatar Florian Knappers
Browse files

setup some tests

parent 253e669d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ def doubletcalc(
    return Doublet1DResults( # TODO: check these values. Not sure what conversions should or shouldnt be done
        geothermal_powers=doublet.geothermal_power,
        cop=doublet.cop,
        flowrate=-doublet.volume_flow_pump * 3600,
        flowrate=doublet.volume_flow_pump * 3600,
        pump_power_required=doublet.pump_power * 1e-6,
        production_temp=doublet.nodes['prod_top'].temperature,
        heat_power_produced=[doublet.geothermal_power] * props.econ_lifetime_years,
+30 −0
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.flow import calculate_volumetric_flow

import numpy as np

def test_calculate_volumetric_flow():
    props = UTCConfiguration()

    input_data = DoubletInput(
        unknown_input_value=-999.0,
        thickness=100.0,
        transmissivity=17500.0,
        transmissivity_with_ntg=0.0,
        ntg=1.0,
        depth=2000,
        porosity=0.0,
        temperature=50.0,
    )

    flow_results = calculate_volumetric_flow(props, input_data, 600000, 1550, 40)

    assert np.isclose(flow_results.hp_cop, 3.0, rtol=0.000001)
    assert np.isclose(flow_results.hp_added_power, 0.0, rtol=0.000001)
    assert np.isclose(flow_results.heat_power_per_doublet, 0.027926914290870505, rtol=0.000001)
    assert np.isclose(flow_results.cop, 5.396068601571214, rtol=0.000001)
    assert np.isclose(flow_results.flowrate, 18.631507399806665, rtol=0.000001)
    assert np.isclose(flow_results.pump_power_required, 5.175418689587975, rtol=0.000001)
    assert np.isclose(flow_results.production_temp, 41.36211427733413, rtol=0.000001)
    assert np.isclose(flow_results.heat_power_produced[0], 0.027926914290870505, rtol=0.000001)
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -36,5 +36,8 @@ def test_calculate_doublet_performance():
    assert np.isclose(result.welld, 1159.17968, rtol=0.001)
    assert np.isclose(result.power, 8.636903762817383, rtol=0.001)
    assert np.isclose(result.cop, 13.627557754516602, rtol=0.001)
    assert np.isclose(result.var_opex, -7.510325908660889, rtol=0.001)
    assert np.isclose(result.fixed_opex, -11.227973937988281, rtol=0.001)


+28 −0
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

def test_doubletcalc():
    props = UTCConfiguration()

    input_data = DoubletInput(
        unknown_input_value=-999.0,
        thickness=100.0,
        transmissivity=17500.0,
        transmissivity_with_ntg=0.0,
        ntg=1.0,
        depth=2000,
        porosity=0.0,
        temperature=50.0,
    )

    results = doubletcalc(props, input_data, 600000, 1550, 40)

    assert np.isclose(results.geothermal_powers, 0.027926914290870505, rtol=0.000001)
    assert np.isclose(results.cop, 5.396068601571214, rtol=0.000001)
    assert np.isclose(results.flowrate, 18.631507399806665, rtol=0.000001)
    assert np.isclose(results.pump_power_required, 5.175418689587975, rtol=0.000001)
    assert np.isclose(results.production_temp, 41.36211427733413, rtol=0.000001)
    assert np.isclose(results.heat_power_produced, 0.027926914290870505, rtol=0.000001)
 No newline at end of file
+23 −0
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.well_distance import optimize_well_distance

import numpy as np

def test_well_distance_optimizer():
    props = UTCConfiguration()

    input_data = DoubletInput(
        unknown_input_value=-999.0,
        thickness=100.0,
        transmissivity=17500.0,
        transmissivity_with_ntg=0.0,
        ntg=1.0,
        depth=2000,
        porosity=0.0,
        temperature=50.0,
    )

    well_distace = optimize_well_distance(props, input_data, 6000000, 40)

    assert np.isclose(well_distace, 1011.9140625, rtol=0.000001)
 No newline at end of file