0

I try to simulate a district heating system with around 200 consumers. It was possible to simulate 115 with no errors, but increasing the consumer number to 230 gives me the error message:

The following error was detected at time: 0
The maximum number of delays (= 2000) is reached.
No more delay memory is available

FixInitials:Init

I am using CVODE with a tolerance of 1e-6.

What does this mean?

Rob
  • 26,989
  • 16
  • 82
  • 98
Phil
  • 624
  • 7
  • 19

1 Answers1

0

According to my tests, you cannot use more than 2000 delay blocks in a single model (I used with Modelica.Blocks.Nonlinear.FixedDelay). Is your consumer model relying on delay blocks? In this case it would make sense that you reach this limit.

I don't know a way to change this limit, my guess is that it is hard-coded somewhere. Therefore you will likely need to change your model to use fewer delays if that is possible.

A short note: I used a very simple test model and it gave me pretty bad performance when using something in the range of 1000 delay blocks. So I guess the performance aspect was the reason for this limit. Therefore it could make sense to re-work the model anyway - at least performance-wise...

Markus A.
  • 6,300
  • 10
  • 26
  • Is spatialDistribution() a delay? Besides this one i can't really think of any part that uses a delay. I calculated the spatialdistribution usage per customer and its 6. This means 200 consumer should be below 2000 delay blocks. – Phil Jun 19 '18 at 10:55
  • Good question, I have no idea how spatialDistribution() is implemented and if it relies on delays. Guess we need to wait for somebody else then... – Markus A. Jun 19 '18 at 11:17
  • I can narrow it down a little bit now! Recently i got the same error message for 80 consumers when i did not have a proper initalization (Had a wrong temperature in one of my pipes). Fixing this error removed the delay error message and it started simulating. This would mean it could possibly have something to do with initialization issues. – Phil Jun 27 '18 at 09:02
  • The function spatialDistribution internally uses one delay-buffer. However, running out of delay-buffers during initialization should no longer happen - in order to investigate this an actual model would needed. – Hans Olsson Jul 03 '18 at 08:16
  • I solved the issue completly now. The model was connected to a volume model and this together did not work properly. Removing the volume made it possible to simulate f.e 201 consumers. – Phil Jul 05 '18 at 11:43