Loading pythermogis/thermogis_classes/doublet.py +12 −13 Original line number Diff line number Diff line Loading @@ -55,9 +55,8 @@ def calculate_doublet_performance(input_data: xr.Dataset, input_data["mask"] = np.nan # Setup output_data dataset output_data = input_data.thickness_mean.copy().to_dataset(name="thickness") output_data = input_data["temperature"].copy().to_dataset(name="temperature") output_data = output_data.expand_dims({"p_value": p_values}) output_data["temperature"] = input_data["temperature"].copy() # Calculate Thickness, Permeability and Transmissivity for each P-value output_data["thickness"], output_data["permeability"], output_data["transmissivity"] = xr.apply_ufunc(generate_thickness_permeability_transmissivity_for_pvalues, Loading Loading @@ -195,11 +194,11 @@ def calculate_performance_of_single_location(mask: float, depth: float, thicknes "cophp"], output_values["pres"], output_values["flow_rate"], output_values["welld"] def instantiate_thermogis_doublet(utc_properties, rng_seed = None) -> JClass: def instantiate_thermogis_doublet(utc_properties, rng_seed: int = None) -> JClass: """ Instantiate a ThermoGIS Doublet class, with a set random seed if provided :param utc_properties: :param rng_seed: :param utc_properties: A UTCProperties instance, with different input parameters :param rng_seed: An integer to set the random number generator :return: doublet, a JPype instantiated object of the ThermoGISDoublet class """ Loading @@ -224,10 +223,10 @@ def instantiate_thermogis_doublet(utc_properties, rng_seed = None) -> JClass: return doublet def set_doublet_parameters(doublet, transmissivity_with_ntg: float, depth: float, porosity: float, ntg: float, temperature: float, utc_Properties: JClass): def set_doublet_parameters(doublet, transmissivity_with_ntg: float, depth: float, porosity: float, ntg: float, temperature: float, utc_properties: JClass): """ For a single location sets the necessary data on the doublet class, to then run a doublet simulation :param utc_Properties: :param utc_properties: :param doublet: :param transmissivity_with_ntg: :param depth: Loading @@ -236,7 +235,7 @@ def set_doublet_parameters(doublet, transmissivity_with_ntg: float, depth: float :param temperature: :return: """ if not utc_Properties.useStimulation() or transmissivity_with_ntg > utc_Properties.stimKhMax(): if not utc_properties.useStimulation() or transmissivity_with_ntg > utc_properties.stimKhMax(): doublet.setNoStimulation() doublet.doubletCalc1DData.setDepth(depth) Loading @@ -244,10 +243,10 @@ def set_doublet_parameters(doublet, transmissivity_with_ntg: float, depth: float doublet.doubletCalc1DData.setNtg(ntg) doublet.doubletCalc1DData.setReservoirTemp(temperature) if not utc_Properties.useHeatPump(): doublet.doubletCalc1DData.setInjectionTemp(np.max([temperature - utc_Properties.maxCoolingTempRange(), utc_Properties.dhReturnTemp()])) elif utc_Properties.useHeatPump() and utc_Properties.calculateCop() and not utc_Properties.hpApplicationMode(): doublet.doubletCalc1DData.setInjectionTemp(doublet.calculateInjectionTempWithHeatPump(temperature, utc_Properties.hpDirectHeatInputTemp())) if not utc_properties.useHeatPump(): doublet.doubletCalc1DData.setInjectionTemp(np.max([temperature - utc_properties.maxCoolingTempRange(), utc_properties.dhReturnTemp()])) elif utc_properties.useHeatPump() and utc_properties.calculateCop() and not utc_properties.hpApplicationMode(): doublet.doubletCalc1DData.setInjectionTemp(doublet.calculateInjectionTempWithHeatPump(temperature, utc_properties.hpDirectHeatInputTemp())) else: doublet.doubletCalc1DData.setInjectionTemp(np.max([temperature - utc_Properties.maxCoolingTempRange(), utc_Properties.hpMinimumInjectionTemperature()])) doublet.doubletCalc1DData.setInjectionTemp(np.max([temperature - utc_properties.maxCoolingTempRange(), utc_properties.hpMinimumInjectionTemperature()])) Loading
pythermogis/thermogis_classes/doublet.py +12 −13 Original line number Diff line number Diff line Loading @@ -55,9 +55,8 @@ def calculate_doublet_performance(input_data: xr.Dataset, input_data["mask"] = np.nan # Setup output_data dataset output_data = input_data.thickness_mean.copy().to_dataset(name="thickness") output_data = input_data["temperature"].copy().to_dataset(name="temperature") output_data = output_data.expand_dims({"p_value": p_values}) output_data["temperature"] = input_data["temperature"].copy() # Calculate Thickness, Permeability and Transmissivity for each P-value output_data["thickness"], output_data["permeability"], output_data["transmissivity"] = xr.apply_ufunc(generate_thickness_permeability_transmissivity_for_pvalues, Loading Loading @@ -195,11 +194,11 @@ def calculate_performance_of_single_location(mask: float, depth: float, thicknes "cophp"], output_values["pres"], output_values["flow_rate"], output_values["welld"] def instantiate_thermogis_doublet(utc_properties, rng_seed = None) -> JClass: def instantiate_thermogis_doublet(utc_properties, rng_seed: int = None) -> JClass: """ Instantiate a ThermoGIS Doublet class, with a set random seed if provided :param utc_properties: :param rng_seed: :param utc_properties: A UTCProperties instance, with different input parameters :param rng_seed: An integer to set the random number generator :return: doublet, a JPype instantiated object of the ThermoGISDoublet class """ Loading @@ -224,10 +223,10 @@ def instantiate_thermogis_doublet(utc_properties, rng_seed = None) -> JClass: return doublet def set_doublet_parameters(doublet, transmissivity_with_ntg: float, depth: float, porosity: float, ntg: float, temperature: float, utc_Properties: JClass): def set_doublet_parameters(doublet, transmissivity_with_ntg: float, depth: float, porosity: float, ntg: float, temperature: float, utc_properties: JClass): """ For a single location sets the necessary data on the doublet class, to then run a doublet simulation :param utc_Properties: :param utc_properties: :param doublet: :param transmissivity_with_ntg: :param depth: Loading @@ -236,7 +235,7 @@ def set_doublet_parameters(doublet, transmissivity_with_ntg: float, depth: float :param temperature: :return: """ if not utc_Properties.useStimulation() or transmissivity_with_ntg > utc_Properties.stimKhMax(): if not utc_properties.useStimulation() or transmissivity_with_ntg > utc_properties.stimKhMax(): doublet.setNoStimulation() doublet.doubletCalc1DData.setDepth(depth) Loading @@ -244,10 +243,10 @@ def set_doublet_parameters(doublet, transmissivity_with_ntg: float, depth: float doublet.doubletCalc1DData.setNtg(ntg) doublet.doubletCalc1DData.setReservoirTemp(temperature) if not utc_Properties.useHeatPump(): doublet.doubletCalc1DData.setInjectionTemp(np.max([temperature - utc_Properties.maxCoolingTempRange(), utc_Properties.dhReturnTemp()])) elif utc_Properties.useHeatPump() and utc_Properties.calculateCop() and not utc_Properties.hpApplicationMode(): doublet.doubletCalc1DData.setInjectionTemp(doublet.calculateInjectionTempWithHeatPump(temperature, utc_Properties.hpDirectHeatInputTemp())) if not utc_properties.useHeatPump(): doublet.doubletCalc1DData.setInjectionTemp(np.max([temperature - utc_properties.maxCoolingTempRange(), utc_properties.dhReturnTemp()])) elif utc_properties.useHeatPump() and utc_properties.calculateCop() and not utc_properties.hpApplicationMode(): doublet.doubletCalc1DData.setInjectionTemp(doublet.calculateInjectionTempWithHeatPump(temperature, utc_properties.hpDirectHeatInputTemp())) else: doublet.doubletCalc1DData.setInjectionTemp(np.max([temperature - utc_Properties.maxCoolingTempRange(), utc_Properties.hpMinimumInjectionTemperature()])) doublet.doubletCalc1DData.setInjectionTemp(np.max([temperature - utc_properties.maxCoolingTempRange(), utc_properties.hpMinimumInjectionTemperature()]))