TNO Intern

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

adding benchmark values and setting up a doublet test

parent e7c9eed0
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
import numpy as np


def calculate_performance(doublet, input_params: dict, hydrocarbons: float, depth: float, thickness: float, porosity: float, ntg: float, temperature: float, transmissivity: float, transmissivity_with_ntg: float) -> dict:
    if hydrocarbons == 0.0:
        output_values = {"flow_rate": 0.0, "cop": 0.0, "power": 0.0}
        return output_values

    set_doublet_parameters(doublet, transmissivity_with_ntg, depth, porosity, ntg, temperature, input_params["use_stimulation"], input_params["stimKhMax"], input_params["surface_temperature"],
                           input_params["return_temperature"], input_params["use_heat_pump"], input_params["max_cooling_temperature_range"], input_params["hp_minimum_injection_temperature"])

    doublet.calculateDoubletPerformance(-99999.0, thickness, transmissivity)

    # get values from doublet
    output_values = {"flow_rate": doublet.doubletCalc1DData.getFlowrate(), "cop": doublet.doubletCalc1DData.getCop(), "power": doublet.doubletCalc1DData.getHpP()}

    # Reset doublet variables
    doublet.setProjectVariables(False, 0.0)

    return output_values

def set_doublet_parameters(doublet, transmissivity_with_ntg, depth, porosity, ntg, temperature, useStimulation, stimKhMax, surface_temperature, return_temperature, use_heat_pump, max_cooling_temperature_range,
                           hp_minimum_injection_temperature):
    if not useStimulation or transmissivity_with_ntg > stimKhMax:
        doublet.setNoStimulation()

    doublet.doubletCalc1DData.setDepth(depth)
    doublet.doubletCalc1DData.setPorosity(porosity)
    doublet.doubletCalc1DData.setNtg(ntg)
    doublet.doubletCalc1DData.setSurfaceTemperature(surface_temperature)
    doublet.doubletCalc1DData.setReservoirTemp(temperature)
    doublet.doubletCalc1DData.setUseHeatPump(use_heat_pump)

    if use_heat_pump:
        injectionTemp = np.max([temperature - max_cooling_temperature_range, hp_minimum_injection_temperature])
    else:
        injectionTemp = np.max([temperature - max_cooling_temperature_range, return_temperature])

    doublet.doubletCalc1DData.setInjectionTemp(injectionTemp)
    doublet.doubletCalc1DData.setDhReturnTemp(return_temperature)

def get_doublet_output(doublet):
    flowr = doublet.doubletCalc1DData.getFlowrate()
    cop = doublet.doubletCalc1DData.getCop()
    power = doublet.doubletCalc1DData.getHpP()
    return flowr, cop, power
+326 −0

File added.

Preview size limit exceeded, changes collapsed.

+14 −0
Original line number Diff line number Diff line
!
!     ZIMS FILE NAME :  simplified_hydrocarbon.zmap
!     FORMATTED FILE CREATION DATE: 13/03/2024
!     FORMATTED FILE CREATION TIME: 14:37:05
!     COORDINATE REFERENCE SYSTEM:   Amersfoort * EPSG-Nld / RD New [28992,1672]
!
@Grid HEADER, GRID, 5
 15, 1e+30,  , 1 , 1
   3,  3,  10.0,  30.0,  10.0,  30.0
   10.0,  0.0,  0.0    
@
  0.000          1e+30          1e+30        
  1e+30          1e+30          1e+30        
  1e+30          1e+30          1e+30        
+14 −0
Original line number Diff line number Diff line
!
!     ZIMS FILE NAME :  simplified_permeability.zmap
!     FORMATTED FILE CREATION DATE: 13/03/2024
!     FORMATTED FILE CREATION TIME: 14:37:05
!     COORDINATE REFERENCE SYSTEM:   Amersfoort * EPSG-Nld / RD New [28992,1672]
!
@Grid HEADER, GRID, 5
 15, 1e+30,  , 1 , 1
   3,  3,  10.0,  30.0,  10.0,  30.0
   10.0,  0.0,  0.0    
@
  100.000        400.000        700.000      
  200.000        500.000        800.000      
  300.000        600.000        900.000      
+14 −0
Original line number Diff line number Diff line
!
!     ZIMS FILE NAME :  simplified_permeability_ln_sd.zmap
!     FORMATTED FILE CREATION DATE: 13/03/2024
!     FORMATTED FILE CREATION TIME: 14:37:05
!     COORDINATE REFERENCE SYSTEM:   Amersfoort * EPSG-Nld / RD New [28992,1672]
!
@Grid HEADER, GRID, 5
 15, 1e+30,  , 1 , 1
   3,  3,  10.0,  30.0,  10.0,  30.0
   10.0,  0.0,  0.0    
@
  0.30000        0.30000        0.30000      
  0.30000        0.30000        0.30000      
  0.30000        0.30000        0.30000      
Loading