TNO Intern

Commit b41eeed4 authored by Jan Diederik van Wees's avatar Jan Diederik van Wees
Browse files

update for correct p-values expansion of temperature and nan check for input values

parent b1041507
Loading
Loading
Loading
Loading
Loading
+21 −17
Original line number Diff line number Diff line
@@ -71,27 +71,31 @@ def calculate_performance_of_single_location(mask: float, depth: float, thicknes

    Returns
    -------
    power: float
    heat_pump_power: float
    capex: float
    opex: float
    utc: float
    npv: float
    hprod: float
    cop: float
    cophp: float
    pres: float
    flow_rate: float
    welld: float
    inj_temp: float
    prd_temp: float
    power: float  geothermal power [MW]
    heat_pump_power: float  power after heat pump [MW]
    capex: float Capital expenditure  [M€]
    opex: float for first production year [M€]
    utc: float unit technical costs/levelized cost of geothermal heat [€/kWh]
    npv: float (net-present-value) [M€]
    hprod: float total energy production for firstyear [kWh]
    cop: float  system cop [-]
    cophp: float  heat pump cop[-]
    pres: float for driving loop [bar]
    flow_rate: float [m3/h]
    welld: float [m]
    inj_temp: float [C]
    prd_temp: float [C]
    """

    if np.isnan(thickness):
    if np.isnan(thickness) or np.isnan(depth) or np.isnan(porosity) or np.isnan(ntg) or np.isnan(temperature) or np.isnan(transmissivity) or np.isnan(transmissivity_with_ntg):
        return np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan

    if not np.isnan(mask):
        return 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    if np.isnan(mask):
        return np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan
        #return 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0

    if (temperature<utc_properties.minProdTemp()):
        return np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan

    # Instantiate ThermoGIS doublet
    doublet = instantiate_thermogis_doublet(utc_properties, rng_seed)