topotherm.postprocessing
Postprocessing of the results from the optimization. This includes the calculation of the diameter and mass flow of the pipes, and the elimination of unused pipes and nodes.
Functions
calc_diam_and_velocity: Calculate pipe diameter and velocity depending on the mass flow and pipe power.sts: Postprocessing for the single time step model.to_networkx_graph: Export the postprocessed, optimal district as a NetworkX graph.mts: Postprocessing for the multiple time step model.
Functions
|
Equations for calculating the diameter and velocity of a pipe based on |
|
Calculate mass flow, diameter, and velocity for each pipe given the |
|
Postprocessing for the single time step model. This includes the |
|
Postprocessing for the multiple time step model. This includes the |
|
Convert incidence matrices to a directed NetworkX graph. |
|
Export the postprocessed, optimal district as pandas DataFrames. |
Module Contents
- topotherm.postprocessing.diameter_and_velocity(v, mass_lin, settings)[source]
Equations for calculating the diameter and velocity of a pipe based on mass flow and power of the pipes
- Parameters:
- Returns:
Tuple containing:
velocityfloatCalculated velocity of the pipe (m/s).
diameterfloatCalculated diameter of the pipe (m).
- Return type:
- topotherm.postprocessing.calculate_hydraulics(power, settings)[source]
Calculate mass flow, diameter, and velocity for each pipe given the installed thermal power and the supply/return temperatures from
settings.- Parameters:
power (np.ndarray) – Installed thermal power for each pipe.
settings (Settings) – Settings object containing temperature setpoints and water properties.
- Returns:
Tuple containing:
mass_flownp.ndarrayMass flow for each pipe (kg/s).
diameternp.ndarrayPipe diameter (m).
velocitynp.ndarrayFlow velocity (m/s).
- Return type:
tuple of np.ndarray
- topotherm.postprocessing.sts(model, matrices, settings)[source]
Postprocessing for the single time step model. This includes the calculation of the diameter and velocity of the pipes and the elimination of unused pipes and nodes.
- topotherm.postprocessing.mts(model, matrices, settings)[source]
Postprocessing for the multiple time step model. This includes the calculation of the diameter and velocity of the pipes and the elimination of unused pipes and nodes.
- topotherm.postprocessing.to_networkx_graph(matrices)[source]
Convert incidence matrices to a directed NetworkX graph. Includes the nodes and edges of the district, their length, and, if available, installed diameter, and power.
- Parameters:
matrices (dict) – Dictionary containing the incidence matrices as output by
topotherm.postprocessing.stsor as input to the model.- Returns:
NetworkX directed graph.
- Return type:
nx.DiGraph
- topotherm.postprocessing.to_dataframe(matrices_optimal, matrices_init)[source]
Export the postprocessed, optimal district as pandas DataFrames. Includes the nodes and edges of the district, their length, installed diameter, and power.
- Parameters:
- Returns:
nodes (pd.DataFrame) – DataFrame of nodes.
edges (pd.DataFrame) – DataFrame of edges.
- Return type:
Tuple[pandas.DataFrame, pandas.DataFrame]