Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The simulation of Buildings.Fluid.FixedResistances.BuriedPipes.Examples.DiscretizedBuriedPipe get stuck in omc due to the coarse sampling of the output #4062

Open
AndreaBartolini opened this issue Nov 25, 2024 · 3 comments

Comments

@AndreaBartolini
Copy link
Contributor

The simulation of the model model Buildings.Fluid.FixedResistances.BuriedPipes.Examples.DiscretizedBuriedPipe get stuck under omc leading the CI to abort it after the timeout of 400s.
The problem is related to the Number of Intervals used to integrate the model. By using the default (500) the integrator got stuck, by increasing the Number of Intervals to 50000 the simulation finished successfully.
The simulation time spans over 6.3072e+07s, so 500 samples seems to be very coarse taking into account that omc uses it in some way in order to decide the integration step variation.
The suggestion is to calculate the Number of Intervals according to the simulation total time.

See also OpenModelica/OpenModelica#13195 (comment)

@mwetter
Copy link
Member

mwetter commented Nov 25, 2024

Changing in the model

-    experiment(StopTime=63072000, Tolerance=1e-06),
+    experiment(
+      StopTime=63072000,
+      Tolerance=1e-06,
+      Interval=1200),

causes the model to simulate with OMC. However, it takes in OMC 218 seconds, and in Dymola 0.5 seconds.

I think changing this will hide some other underlying issue. The log is

/tmp/OpenModelica_mwetter/OMEdit/Buildings.Fluid.FixedResistances.BuriedPipes.Examples.DiscretizedBuriedPipe/DiscretizedBuriedPipe -port=40957 -logFormat=xmltcp -override=startTime=0,stopTime=6.3072e+07,stepSize=1200,tolerance=1e-06,solver=dassl,outputFormat=mat,variableFilter=.* -r=/tmp/OpenModelica_mwetter/OMEdit/Buildings.Fluid.FixedResistances.BuriedPipes.Examples.DiscretizedBuriedPipe/DiscretizedBuriedPipe_res.mat -w -lv=LOG_STDOUT,LOG_ASSERT,LOG_STATS -inputPath=/tmp/OpenModelica_mwetter/OMEdit/Buildings.Fluid.FixedResistances.BuriedPipes.Examples.DiscretizedBuriedPipe -outputPath=/tmp/OpenModelica_mwetter/OMEdit/Buildings.Fluid.FixedResistances.BuriedPipes.Examples.DiscretizedBuriedPipe
The initialization finished successfully without homotopy method.
### STATISTICS ###
timer
   0.0771149s          reading init.xml
   0.0070814s          reading info.xml
 0.000419871s [  0.0%] pre-initialization
 0.000861066s [  0.0%] initialization
  0.00358939s [  0.0%] steps
     18.9225s [  8.7%] solver (excl. callbacks)
    0.198738s [  0.1%] creating output-file
       54.55s [ 25.0%] event-handling
    0.441069s [  0.2%] overhead
      143.97s [ 66.0%] simulation
     218.087s [100.0%] total
events
    1 state events
    0 time events
solver: dassl
2437653 steps taken
3690852 calls of functionODE
492100 evaluations of jacobian
244916 error test failures
    0 convergence test failures
39.1602s time of jacobian evaluation
The simulation finished successfully.

whereas Dymola (with dassl) has

Integration terminated successfully at T = 63072000
   CPU-time for integration                : 0.51 seconds
   CPU-time for one grid interval          : 1.02 milliseconds
   CPU-time for initialization             : 0.00117 seconds
   Number of result points                 : 502
   Number of grid points                   : 501
   Number of accepted steps                : 7554
   Number of f-evaluations (dynamics)      : 21450
   Number of crossing function evaluations : 8055
   Number of Jacobian-evaluations          : 1930
   Number of model time events             : 0
   Number of input time events             : 0
   Number of state events                  : 0
   Number of step events                   : 0
   Minimum integration stepsize            : 31.5
   Maximum integration stepsize            : 4.32e+04
   Maximum integration order               : 3
Calling terminal section
... "dsfinal.txt" creating (final states)

@AndreaBartolini : I can make the change to the library, but first like to double check if this simulation performance issue is dealt with otherwise as well.

@mwetter mwetter added this to the Release 11.1.0 milestone Nov 25, 2024
@AndreaBartolini
Copy link
Contributor Author

@casella, can you add some comment/idea?

@casella
Copy link
Contributor

casella commented Nov 27, 2024

Given the reported analysis, it is clear that OMC has some issues with this model, which is otherwise well-behaved, according to the Dymola results. Hence, we shouldn't sweep the dirt under the rug 😃

@AndreaBartolini can you please report @mwetter's results into the original ticket? Then, we can continue the analysis to figure out why OMC is taking such small steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants