Skip to content

Commit

Permalink
Merge pull request #372 from FZJ-IEK3-VSA/more_prep_for_building_sizer_5
Browse files Browse the repository at this point in the history
Refs/heads/more prep for building sizer 5
  • Loading branch information
k-rieck authored Nov 13, 2024
2 parents b5ed7b3 + 407340f commit 411486c
Show file tree
Hide file tree
Showing 19 changed files with 945 additions and 345 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ def get_default_config_for_household_district_heating(cls):
)
return household_config

@classmethod
def get_default_config_for_household_pellet(cls):
"""Get default ModularHouseholdConfig."""
energy_system_config_ = system_config.EnergySystemConfig.get_default_config_for_energy_system_pellet_heating()
archetype_config_ = archetype_config.ArcheTypeConfig()
household_config = ModularHouseholdConfig(
energy_system_config_=energy_system_config_, archetype_config_=archetype_config_
)
return household_config

def get_hash(self):
"""Generate a hash for ModularHouseholdConfig."""
household_config = ModularHouseholdConfig(
Expand Down
6 changes: 6 additions & 0 deletions hisim/building_sizer_utils/interface_configs/system_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ def get_default_config_for_energy_system_district_heating(cls):
"""Get default energy system config."""
energy_system_config = EnergySystemConfig(heating_system=HeatingSystems.DISTRICT_HEATING, share_of_maximum_pv_potential=1.0)
return energy_system_config

@classmethod
def get_default_config_for_energy_system_pellet_heating(cls):
"""Get default energy system config."""
energy_system_config = EnergySystemConfig(heating_system=HeatingSystems.PELLET_HEATING, share_of_maximum_pv_potential=1.0)
return energy_system_config
3 changes: 2 additions & 1 deletion hisim/components/advanced_heat_pump_hplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ def get_cost_opex(self, all_outputs: List, postprocessing_results: pd.DataFrame,
output.component_name == self.component_name
and output.load_type == LoadTypes.ELECTRICITY
and output.field_name == self.ElectricalInputPower
and output.unit == Units.WATT
): # Todo: check component name from system_setups: find another way of using only heatpump-outputs
self.config.consumption_in_kwh = round(
sum(postprocessing_results.iloc[:, index])
Expand Down Expand Up @@ -694,7 +695,7 @@ def get_component_kpi_entries(self, all_outputs: List, postprocessing_results: p
number_of_heat_pump_cycles = self.get_heatpump_cycles(
output=output, index=index, postprocessing_results=postprocessing_results
)
if output.field_name == self.ThermalOutputPower and output.load_type == LoadTypes.HEATING:
if output.field_name == self.ThermalOutputPower and output.load_type == LoadTypes.HEATING and output.unit == Units.WATT:
# take only output values for heating
heating_output_power_values_in_watt = postprocessing_results.iloc[:, index].loc[
postprocessing_results.iloc[:, index] > 0.0
Expand Down
4 changes: 2 additions & 2 deletions hisim/components/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ def get_properties_for_energy_carrier(cls, energy_carrier: LoadTypes) -> "Physic
# higher heating value of pellets unknown -> set to lower heating value
return PhysicsConfig(
density_in_kg_per_m3=650,
lower_heating_value_in_joule_per_m3=11.7 * 1e3,
higher_heating_value_in_joule_per_m3=11.7 * 1e3,
lower_heating_value_in_joule_per_m3=11.7 * 1e9,
higher_heating_value_in_joule_per_m3=11.7 * 1e9,
specific_heat_capacity_in_joule_per_kg_per_kelvin=2500,
)
if energy_carrier == LoadTypes.WATER:
Expand Down
4 changes: 2 additions & 2 deletions hisim/components/electricity_meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,11 @@ def get_cost_opex(

for index, output in enumerate(all_outputs):
if output.component_name == self.component_name:
if output.field_name == self.ElectricityToGrid:
if output.field_name == self.ElectricityToGrid and output.unit == lt.Units.WATT_HOUR:
# Todo: check component name from system_setups: find another way of using the correct outputs
total_energy_to_grid_in_kwh = round(postprocessing_results.iloc[:, index].sum() * 1e-3, 2)

elif output.field_name == self.ElectricityFromGrid:
elif output.field_name == self.ElectricityFromGrid and output.unit == lt.Units.WATT_HOUR:
total_energy_from_grid_in_kwh = round(postprocessing_results.iloc[:, index].sum() * 1e-3, 2)

emissions_and_cost_factors = EmissionFactorsAndCostsForFuelsConfig.get_values_for_year(
Expand Down
2 changes: 1 addition & 1 deletion hisim/components/gas_meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def get_component_kpi_entries(
total_energy_from_grid_in_kwh: Optional[float] = None
list_of_kpi_entries: List[KpiEntry] = []
for index, output in enumerate(all_outputs):
if output.component_name == self.component_name and output.load_type == lt.LoadTypes.GAS:
if output.component_name == self.component_name and output.load_type == lt.LoadTypes.GAS and output.unit == lt.Units.WATT_HOUR:
if output.field_name == self.GasFromGrid:
total_energy_from_grid_in_kwh = round(postprocessing_results.iloc[:, index].sum() * 1e-3, 1)
break
Expand Down
Loading

0 comments on commit 411486c

Please sign in to comment.