enex_analysis.dhw

Domestic Hot Water (DHW) load modeling.

Functions

build_dhw_usage_ratio(entries, t_array)

Build schedule ratio array from schedule entries for each timestep.

calc_cold_water_temp(df, target_date_str)

Calculate mains water temperature using EnergyPlus algorithm.

calc_total_water_use_from_schedule(schedule, ...)

Calculate total daily water use from a schedule.

make_dhw_schedule_from_Annex_42_profile(...)

Generate DHW schedule list from flow profile data.

enex_analysis.dhw.make_dhw_schedule_from_Annex_42_profile(flow_rate_array, df_time_step, simulation_time_step)[source]

Generate DHW schedule list from flow profile data.

This function implements the logic to convert a flow profile (L/min) into a schedule list with specified time step.

Parameters:
  • flow_rate_array (np.ndarray) – Array of flow rates [L/min]. Data should represent 24 hours.

  • df_time_step (int) – Time step of the input flow_rate_array [min].

  • simulation_time_step (int) – Target time step for the simulation schedule [s].

Returns:

List of tuples (start_time, end_time, fraction).

Return type:

list[tuple[str, str, float]]

enex_analysis.dhw.calc_total_water_use_from_schedule(schedule, peak_load_m3s, info=True, info_unit='L')[source]

Calculate total daily water use from a schedule.

Parameters:
  • schedule (list[tuple[str, str, float]]) – Schedule list. Each item is (start_str, end_str, ratio) format.

  • peak_load_m3s (float) – Peak load water flow rate [m3/s].

  • info (bool, optional) – Flag to print info. Default is True.

  • info_unit (str, optional) – Unit to print info. Default is ‘L’.

Returns:

Total daily water usage [m3].

Return type:

float

enex_analysis.dhw.calc_cold_water_temp(df, target_date_str)[source]

Calculate mains water temperature using EnergyPlus algorithm.

Uses monthly average outdoor air temperature to estimate the water mains temperature based on the algorithm from Hendron et al. (2004).

References

Hendron, R., Anderson, R., Judkoff, R., Christensen, C., Eastment, M., & Norton, P. (2004). Building America Performance Analysis Procedures for Energy-Efficient Residential Buildings. National Renewable Energy Laboratory (NREL). https://doi.org/10.2172/15011400

Parameters:
  • df (pd.DataFrame) – DataFrame with monthly average temperatures. Must have ‘month’ and ‘T_avg’ columns.

  • target_date_str (str) – Target date string in ‘YYYY-MM-DD’ format.

Returns:

Calculated cold water temperature [degC].

Return type:

float

enex_analysis.dhw.build_dhw_usage_ratio(entries, t_array)[source]

Build schedule ratio array from schedule entries for each timestep.

Parameters:
  • entries (list[tuple[str, str, float]]) – Schedule entry list. Each item is (start_str, end_str, frac) format.

  • t_array (np.ndarray) – Array of time seconds from start of day.

Returns:

Array of fractions corresponding to t_array.

Return type:

np.ndarray