thermal_simulation

Generic functions needed for the thermal simulations.

solve_thermal(net: Network, fluid: Fluid, soil: Soil, error_threshold: float = 1e-06, max_iters: int = 100, damping_factor: float = 1, decreasing: bool = False, adaptive: bool = False, verbose: int = 1, mass_flow_min: float = 1e-16, ts_id: int = None, **kwargs) dict[source]

Runs a thermal simulation of the Network object. The method is based on solving the heat balance at each node of the network using the Newton-Raphson method.

The function returns a dictionary with the results of the simulation and details on the convergence of each Newton step. Temperatures and heat losses of the input Network are also modified in place with the results of the simulation.

Parameters:
  • net (Network) – Network to be simulated.

  • fluid (Fluid) – Working fluid to be used.

  • soil (Soil) – Soil object to be used in the simulation.

  • error_threshold (float, optional) – Error threshold for the solver in Wh. The default is 1e-6.

  • max_iters (int, optional) – Maximum number of iterations for the solver. The default is 100.

  • damping_factor (float, optional) – Damping factor for the Newton iterations. The default is 1.

  • decreasing (bool, optional) – Whether to reduce the damping factor at each Newton iteration. The default is False.

  • adaptive (bool, optional) – Whether to reduce the damping factor on plateau. The default is True.

  • verbose (int, optional) – Controls the verbosity of the simulation. The default is 1.

  • mass_flow_min (float, optional) – Mass flow (kg/s) used to approximate 0. The default is 1e-16.

  • ts_id (int, optional) – Specifies the ID of the current time-step. The default is None.

  • **kwargs – Arbitrary keyword arguments.

Returns:

Dictionary with the simulation results.

Return type:

dict