It seems that the heat transfer solver in pandapipes has problems with one-directional flows inside a network when the slack node for temperature values is downstream "at the end" of the flow and there is more than one branch. The following example can illustrate and reproduce the case where convergence fails, regardless of iteration steps specified:
import pandapipes as ppi
import pandapipes.plotting as ppplot
net=ppi.create_empty_network(name='net',fluid='water')
ppi.create_junctions(net,4,pn_bar=3,tfluid_k=330,geodata=[(0,0),(1,0),(2,1),(2,-1)])
ppi.create_pipes_from_parameters(net,from_junctions=[0,1,1],to_junctions=[1,2,3],length_km=[0.1,0.3,0.1],diameter_m=[0.05]*3)#,k_mm=[0.049]*3,loss_coefficient=[0.15]*3,alpha_w_per_m2k=[0]*3,sections=[5]*3)
ppi.create_sources(net,junctions=[2,3],mdot_kg_per_s=[0.02]*2)
ppi.create_ext_grid(net,junction=0,p_bar=2.5,t_k=323,type='pt')
ppplot.simple_plot(net)
ppi.pipeflow(net,mode='all')
This topology is, however, useful in many cases where e.g. district heating networks are separated for calculation purposes in feed line and reflux line (this case above representing the reflux line) and it shall be solved for a specific reflux temperature back at the heating plant (@ junction 0). Consumers wouldb e represented by sources in this case.
Whenn additional external grids as slack nodes are addes to the junctions connected to the sources and the external grid at junction 0 (heating plant) is changed to type='t' the desired result can be attained.
net=ppi.create_empty_network(name='net',fluid='water')
ppi.create_junctions(net,4,pn_bar=3,tfluid_k=330,geodata=[(0,0),(1,0),(2,1),(2,-1)])
ppi.create_pipes_from_parameters(net,from_junctions=[0,1,1],to_junctions=[1,2,3],length_km=[0.1,0.3,0.1],diameter_m=[0.05]*3)#,k_mm=[0.049]*3,loss_coefficient=[0.15]*3,alpha_w_per_m2k=[0]*3,sections=[5]*3)
ppi.create_sources(net,junctions=[2,3],mdot_kg_per_s=[0.02]*2)
ppi.create_ext_grid(net,junction=2,p_bar=3,t_k=330,type='t')
ppi.create_ext_grid(net,junction=3,p_bar=3,t_k=330,type='t')
ppi.create_ext_grid(net,junction=0,p_bar=2.5,t_k=323,type='p')
ppplot.simple_plot(net)
ppi.pipeflow(net,iter=100,mode='all')