topotherm.precalculation_hydraulic ================================== .. py:module:: topotherm.precalculation_hydraulic .. autoapi-nested-parse:: This module contains functions for the thermo-hydraulic precalculation of the district heating network. Functions --------- - ``determine_feed_line_temp`` : Calculates the supply temperature of the grid according to the outdoor temperature with a linear interpolation between the turning points. - ``max_flow_velocity`` : Calculates the maximal flow velocity in the pipe. - ``mass_flow`` : Calculates the maximal mass flow in the pipe. - ``pipe_capacity`` : Calculates the maximal heat flow in the pipe. - ``capacity_to_diameter`` : Calculates the diameter of the pipe according to the heat flow. - ``thermal_resistance`` : Calculates the thermal resistance of the pipe. - ``heat_loss_pipe`` : Calculates the heat loss of the pipe. - ``regression_thermal_capacity`` : Calculates the regression factors for the linearization of the thermal capacity of the pipes. - ``regression_heat_losses`` : Calculates the regression factors for the linearization of the heat losses of the pipes. Functions --------- .. autoapisummary:: topotherm.precalculation_hydraulic.determine_feed_line_temp topotherm.precalculation_hydraulic.max_flow_velocity topotherm.precalculation_hydraulic.mass_flow topotherm.precalculation_hydraulic.pipe_power topotherm.precalculation_hydraulic.capacity_to_diameter topotherm.precalculation_hydraulic.thermal_resistance topotherm.precalculation_hydraulic.heat_loss_pipe topotherm.precalculation_hydraulic.regression_thermal_capacity topotherm.precalculation_hydraulic.regression_heat_losses Module Contents --------------- .. py:function:: determine_feed_line_temp(ambient_temperature, temp_sup_high, temp_sup_low, temp_turn_high, temp_turn_low) Calculate the supply temperature of the grid according to the outdoor temperature using linear interpolation between the threshold points. :param ambient_temperature: Ambient temperature (°C). :type ambient_temperature: float :param temp_sup_high: Supply temperature high threshold (°C). :type temp_sup_high: float :param temp_sup_low: Supply temperature low threshold (°C). :type temp_sup_low: float :param temp_turn_high: Threshold for high temperature (°C). :type temp_turn_high: float :param temp_turn_low: Threshold for low temperature (°C). :type temp_turn_low: float :returns: Supply temperature of the grid (°C). :rtype: float .. rubric:: Examples >>> determine_feed_line_temp(0, 90, 60, 10, -10) 75.0 >>> determine_feed_line_temp(-15, 90, 60, 10, -10) 90.0 >>> determine_feed_line_temp(20, 90, 60, 10, -10) 60.0 .. py:function:: max_flow_velocity(vel_init, diameter, roughness, max_spec_pressure_loss, water_parameters) Calculate the maximal flow velocity in a pipe based on the maximal specific pressure loss. All inputs must be non-negative real numbers. :param vel_init: Initial velocity (m/s). :type vel_init: float :param diameter: Diameter of the pipe (m). :type diameter: float :param roughness: Roughness of the pipe (m). :type roughness: float :param max_spec_pressure_loss: Maximal specific pressure loss (Pa/m). :type max_spec_pressure_loss: float :param water_parameters: Water parameters instance. :type water_parameters: Settings :returns: Maximal flow velocity (m/s). :rtype: float .. py:function:: mass_flow(velocity, diameter, density_water) Calculate the maximal mass flow in the pipe. :param velocity: Velocity in the pipe (m/s). :type velocity: float :param diameter: Diameter of the pipe (m). :type diameter: float :param density_water: Density of water (kg/m³). :type density_water: float :returns: Maximal mass flow (kg/s). :rtype: float .. py:function:: pipe_power(mass_flow, temperature_supply, temperature_return, cp_water) Calculate the maximal heat flow in the pipe. :param mass_flow: Mass flow in the pipe (kg/s). :type mass_flow: float :param temperature_supply: Supply temperature (°C or K). :type temperature_supply: float :param temperature_return: Return temperature (°C or K). :type temperature_return: float :param cp_water: Specific heat capacity of water (J/kg·K). :type cp_water: float :returns: Heat flow in the pipe (W). :rtype: float .. rubric:: Examples >>> pipe_capacity(mass_flow=2.0, ... temperature_supply=80, ... temperature_return=60, ... cp_water=4180) 167200.0 .. py:function:: capacity_to_diameter(thermal_power, temperature_supply, temperature_return, cp_water) Calculate the diameter of the pipe according to the heat flow. :param thermal_power: Heat power in the pipe (W). :type thermal_power: float :param temperature_supply: Supply temperature (°C or K). :type temperature_supply: float :param temperature_return: Return temperature (°C or K). :type temperature_return: float :param cp_water: Specific heat capacity of water (J/kg·K). :type cp_water: float :returns: Diameter of the pipe (m). :rtype: float .. py:function:: thermal_resistance(diameter, diameter_ratio, depth, settings) Calculate the thermal resistance of a pipe. .. rubric:: References Planungshandbuch Fernwärme Version 1.3 (2021). :param diameter: Diameter of the pipe (m). :type diameter: float :param diameter_ratio: Outer diameter divided by inner diameter (-). :type diameter_ratio: float :param depth: Depth below ground level (m). :type depth: float :param settings: Settings instance. :type settings: Settings :returns: Thermal resistance of the pipe (m·K/W). :rtype: float .. py:function:: heat_loss_pipe(temperature_in, thermal_resistance_pipe, ambient_temperature) Calculate the heat loss of a pipe. :param temperature_in: Temperature in the pipe (°C or K). :type temperature_in: float :param thermal_resistance_pipe: Thermal resistance of the pipe (m·K/W). :type thermal_resistance_pipe: float :param ambient_temperature: Ambient temperature (°C or K). :type ambient_temperature: float :returns: Heat loss of the pipe (W). :rtype: float .. py:function:: regression_thermal_capacity(settings) Calculate the regression factors for the linearization of the thermal capacity of the pipes. This is the first step in the thermo-hydraulic precalculation of the district heating network. :param settings: Regression settings instance. :type settings: RegressionSettings :returns: Regression factors for the linearization (€/m). :rtype: dict .. py:function:: regression_heat_losses(settings, thermal_capacity) Calculate the regression factors for the linearization of the heat losses of the pipes, based on the calculated thermal capacities (see ``regression_thermal_capacity``). :param settings: Settings instance. :type settings: Settings :param thermal_capacity: Thermal capacity regression factors. :type thermal_capacity: dict :returns: Regression factors for the linearization of the heat losses of the pipes. :rtype: dict