Heat requirement package

BDEW Standard Load Profile heat demand calculation module.

Implements BDEW methodology for commercial and public buildings with temperature-dependent profiles and weekday variations.

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

districtheatingsim.heat_requirement.heat_requirement_BDEW.get_resource_path(relative_path: str) str[source]

Get absolute resource path for development and PyInstaller.

Parameters:

relative_path (str) – Relative path from package root

Returns:

Absolute path to resource file

Return type:

str

Note

Automatically detects PyInstaller frozen state and adjusts paths.

districtheatingsim.heat_requirement.heat_requirement_BDEW.generate_year_months_days_weekdays(year: int) Tuple[ndarray, ndarray, ndarray, ndarray][source]

Generate temporal arrays for BDEW calculations.

Parameters:

year (int) – Target year

Returns:

Tuple of (days_of_year, months, days, weekdays) with weekday 1=Monday, 7=Sunday

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]

Note

Handles leap years automatically. Weekdays use ISO numbering.

districtheatingsim.heat_requirement.heat_requirement_BDEW.calculate_daily_averages(temperature: ndarray) ndarray[source]

Calculate daily average temperatures from hourly data.

Parameters:

temperature (np.ndarray) – Hourly temperature [°C] for complete year (8760/8784 hours)

Returns:

Daily average temperatures [°C]

Return type:

np.ndarray

Raises:

ValueError – If temperature array not divisible by 24

Note

Used for BDEW sigmoid function temperature dependencies.

districtheatingsim.heat_requirement.heat_requirement_BDEW.calculate_hourly_intervals(year: int) ndarray[source]

Generate hourly datetime intervals for full year.

Parameters:

year (int) – Target year

Returns:

Hourly datetime64 intervals (8760 or 8784 for leap year)

Return type:

np.ndarray

districtheatingsim.heat_requirement.heat_requirement_BDEW.get_coefficients(profiletype: str, subtype: str, daily_data: DataFrame) Tuple[float, float, float, float, float, float, float, float][source]

Extract BDEW profile coefficients for load calculation.

Parameters:
  • profiletype (str) – BDEW building type (GKO, GHA, GMK, GBD, GBH, GWA, GGA, GBA, GGB, GPD, GMF, GHD)

  • subtype (str) – Building subtype for detailed classification

  • daily_data (pd.DataFrame) – BDEW daily coefficients DataFrame

Returns:

Tuple of (A, B, C, D, mH, bH, mW, bW) sigmoid and linear coefficients

Return type:

Tuple[float, float, float, float, float, float, float, float]

Raises:

Note

Sigmoid: h_T = A/(1+(B/(T-40))^C) + mH*T + bH. DHW: mW*T + bW + D

districtheatingsim.heat_requirement.heat_requirement_BDEW.get_weekday_factor(daily_weekdays: ndarray, profiletype: str, subtype: str, daily_data: DataFrame) ndarray[source]

Extract weekday-specific load factors from BDEW data.

Parameters:
  • daily_weekdays (np.ndarray) – Weekday numbers (1=Monday to 7=Sunday) for each day

  • profiletype (str) – BDEW building type

  • subtype (str) – Building subtype

  • daily_data (pd.DataFrame) – BDEW coefficients DataFrame with weekday columns ‘1’-‘7’

Returns:

Weekday factors for each day (typically 0.5-1.5)

Return type:

np.ndarray

Raises:

Note

Accounts for different operation patterns: offices high Mon-Fri, schools minimal weekends.

districtheatingsim.heat_requirement.heat_requirement_BDEW.calculate(JWB_kWh: float, profiletype: str, subtype: str, TRY_file_path: str, year: int, real_ww_share: float | None = None) Tuple[ndarray, ndarray, ndarray, ndarray, ndarray][source]

Calculate heat demand profiles using BDEW Standard Load Profile methodology.

Parameters:
  • JWB_kWh (float) – Annual heat demand [kWh/a]

  • profiletype (str) – BDEW building type (GKO, GHA, GMK, etc.)

  • subtype (str) – Building subtype

  • TRY_file_path (str) – Path to Test Reference Year weather data

  • year (int) – Calculation year

  • real_ww_share (Optional[float]) – Optional DHW share override (0-1)

Returns:

Tuple of (time_steps, total_heat_kW, heating_kW, dhw_kW, temperatures)

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]

Raises:

Note

Combines sigmoid temperature function, weekday factors, and hourly patterns.

VDI 4655 heat and electricity demand profile calculation module.

Implements VDI 4655 standard for residential buildings with quarter-hourly profiles based on occupancy patterns and meteorological data.

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

districtheatingsim.heat_requirement.heat_requirement_VDI4655.generate_year_months_days_weekdays(year: int) Tuple[ndarray, ndarray, ndarray, ndarray][source]

Generate temporal arrays for VDI 4655 day-type classification.

Parameters:

year (int) – Target year

Returns:

Tuple of (days_of_year, months, days, weekdays) with ISO weekdays 1=Monday, 7=Sunday

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]

Note

Used for workday/weekend/holiday classification in VDI 4655.

districtheatingsim.heat_requirement.heat_requirement_VDI4655.calculate_daily_averages(temperature: ndarray, cloud_cover: ndarray) Tuple[ndarray, ndarray][source]

Calculate daily averages from hourly meteorological data for VDI 4655 day-type classification.

Parameters:
  • temperature (np.ndarray) – Hourly temperature [°C] (8760 or 8784 hours)

  • cloud_cover (np.ndarray) – Hourly cloud cover [0-8 oktas] (8760 or 8784 hours)

Returns:

Tuple of (daily_avg_temperature, daily_avg_cloud_cover)

Return type:

Tuple[np.ndarray, np.ndarray]

Raises:

Note

Seasons: W (<5°C), Ü (5-15°C), S (>15°C). Cloud: H (<4 oktas), B (≥4 oktas), X (summer).

districtheatingsim.heat_requirement.heat_requirement_VDI4655.calculate_quarter_hourly_intervals(year: int) ndarray[source]

Generate quarter-hourly datetime intervals for VDI 4655 load profiles.

Parameters:

year (int) – Target year

Returns:

Quarter-hourly datetime64[15m] intervals (35,040 or 35,136 for leap year)

Return type:

np.ndarray

Note

15-minute resolution matches VDI 4655 standard for district heating analysis.

districtheatingsim.heat_requirement.heat_requirement_VDI4655.quarter_hourly_data(data: ndarray) ndarray[source]

Expand daily data to quarter-hourly resolution.

Parameters:

data (np.ndarray) – Daily values to expand

Returns:

Quarter-hourly array with each daily value replicated 96 times

Return type:

np.ndarray

Note

Each daily value → 96 quarter-hourly intervals (24h × 4 quarters/h).

districtheatingsim.heat_requirement.heat_requirement_VDI4655.standardized_quarter_hourly_profile(year: int, building_type: str, days_of_year: ndarray, type_days: ndarray) Tuple[ndarray, ndarray, ndarray, ndarray][source]

Generate standardized VDI 4655 quarter-hourly load profiles.

Parameters:
  • year (int) – Target year

  • building_type (str) – VDI 4655 type (EFH, MFH, B)

  • days_of_year (np.ndarray) – Daily datetime64 array

  • type_days (np.ndarray) – Day-type classifications (e.g., WWH, SWX)

Returns:

Tuple of (intervals, electricity, heating, hot_water) normalized profiles [0-2]

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]

Raises:

Note

Day-type format: {Season}{DayType}{Cloud} - W/Ü/S + W/S + H/B/X.

districtheatingsim.heat_requirement.heat_requirement_VDI4655.calculation_load_profile(TRY: str, building_type: str, number_people_household: int, YEU_electricity_kWh: float, YEU_heating_kWh: float, YEU_hot_water_kWh: float, holidays: ndarray, climate_zone: str = '9', year: int = 2019) Tuple[ndarray, ndarray, ndarray, ndarray, ndarray][source]

Calculate comprehensive VDI 4655 load profiles.

Parameters:
  • TRY (str) – Path to Test Reference Year data

  • building_type (str) – VDI 4655 type (EFH, MFH, B)

  • number_people_household (int) – Number of occupants

  • YEU_electricity_kWh (float) – Annual electricity [kWh/a]

  • YEU_heating_kWh (float) – Annual heating [kWh/a]

  • YEU_hot_water_kWh (float) – Annual DHW [kWh/a]

  • holidays (np.ndarray) – Holiday dates array

  • climate_zone (str) – German climate zone 1-15 (default “9”)

  • year (int) – Target year (default 2019)

Returns:

Tuple of (intervals, electricity, heating, dhw, temperature) in kWh per 15min

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]

Raises:

Note

Implements complete VDI 4655 workflow with day-type classification and energy balance normalization.

districtheatingsim.heat_requirement.heat_requirement_VDI4655.calculate(YEU_heating_kWh: float, YEU_hot_water_kWh: float, YEU_electricity_kWh: float, building_type: str, number_people_household: int, year: int, climate_zone: str, TRY: str, holidays: ndarray) Tuple[ndarray, ndarray, ndarray, ndarray, ndarray, ndarray][source]

Calculate VDI 4655 building energy demand profiles.

Parameters:
  • YEU_heating_kWh (float) – Annual heating [kWh/a]

  • YEU_hot_water_kWh (float) – Annual DHW [kWh/a]

  • YEU_electricity_kWh (float) – Annual electricity [kWh/a]

  • building_type (str) – VDI 4655 type (EFH, MFH, B)

  • number_people_household (int) – Number of occupants

  • year (int) – Target year

  • climate_zone (str) – German climate zone 1-15

  • TRY (str) – Path to Test Reference Year data

  • holidays (np.ndarray) – Holiday dates array

Returns:

Tuple of (time, total_heat_kW, heating_kW, dhw_kW, temperature, electricity_kW)

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]

Raises:

Note

Returns quarter-hourly power [kW]. Energy [kWh] × 4 = Power [kW] for 15-min intervals.

Heat demand profile generation from CSV building data.

Integrates VDI 4655 and BDEW calculation methods for batch processing of building portfolios with temperature curves for district heating design.

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

districtheatingsim.heat_requirement.heat_requirement_calculation_csv.generate_profiles_from_csv(data: DataFrame, TRY: str, calc_method: str) Tuple[ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray][source]

Generate heat demand profiles from CSV building data.

Parameters:
  • data (pd.DataFrame) – Building data (Wärmebedarf, Gebäudetyp, Subtyp, WW_Anteil, Normaußentemperatur, VLT_max, RLT_max, Steigung_Heizkurve)

  • TRY (str) – Path to Test Reference Year weather data file

  • calc_method (str) – Calculation method (‘Datensatz’, ‘VDI4655’, or ‘BDEW’)

Returns:

Tuple of (time_steps, total_heat_W, heating_heat_W, warmwater_heat_W, max_heat_W, supply_temp, return_temp, air_temp)

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]

Raises:

Note

‘Datensatz’ mode auto-selects VDI4655 for residential (EFH/MFH), BDEW for commercial buildings.

districtheatingsim.heat_requirement.heat_requirement_calculation_csv.calculate_temperature_curves(data: DataFrame, hourly_air_temperatures: ndarray) Tuple[ndarray, ndarray][source]

Calculate supply and return temperature curves for district heating systems.

Parameters:
  • data (pd.DataFrame) – Building data (VLT_max, RLT_max, Steigung_Heizkurve, Normaußentemperatur)

  • hourly_air_temperatures (np.ndarray) – Hourly outdoor temperature [°C]

Returns:

Tuple of (supply_temperature_curve, return_temperature_curve)

Return type:

Tuple[np.ndarray, np.ndarray]

Note

Weather-compensated curves: T_supply = T_max + slope × (T_outdoor - T_design)