oemof / tespy

Thermal Engineering Systems in Python (TESPy). This package provides a powerful simulation toolkit for thermal engineering plants such as power plants, district heating systems or heat pumps.
https://tespy.readthedocs.io
MIT License
256 stars 80 forks source link

Networks with small massflow do not converge #314

Closed stianchris closed 2 years ago

stianchris commented 2 years ago

I opened a similar issue some years ago, but did not further work on it. It was closed by that time. The issue still exists: In networks with very small mass-flows (or other parameters, that are very small), newton-raphson does not converge. A possible solution would be to check for parameters, that are below a specific limit and in such cases, switch the calculation to a different unit for this parameter. In the example: switch the unit of the massflow to g/s. This needs to be done internally and not just in the unit-definition in the setup of the network. Any ideas, how this could be realized?

I added an example of a solar roof tile collector: tespy_issue.zip Briefly explained (schematical drawing is included): a number of solar air collectors is connected in series (in the example there are 2 solar roof tiles) and a fan is used to draw air through them. In between them, leakages (represented with valves and sources) are present, which will also draw air at ambient temperature. The mass flow at the leakages, especially of the first ones is very low. As exemplifying initialization it is set to 0.0001 kg/s (this low mass flow is normally only reached in longer series of collectors). Two example-files are attached: one (test_srt) where first the zeta value of the valve is calculated in the design, with the given mass flow and then the mass flow should be calculated in off-design with the zeta value. For the low initial mass flow, the offdesign calculation does not converge, although all assumptions stay the same. The second test-file (test_srt_wo_srt) shows the same calculations, while zeta remains the value to be calculated and the initial leaking mass flow stays the same. This one converges without problems.