I'm trying to create a model in OpenModelica which contains several other components (pipes, reservoirs). Currently I'm modifying a pipe in the Modelica.Fluid-library using a staggered grid, and need to determine the smallest step size dx in the entire model.
Is it possible to do the following?
- Calculate dx_1 in pipe 1 and dx_2 in pipe 2.
- Send dx_1 and dx_2 to an array in a global model (similar to Modelica.Fluid.System).
- Determine the smallest dx = min(dx_1, dx_2) and send back to both pipe 1 and pipe 2.
I have calculated both dx_1 in pipe 1 and dx_2 in pipe 2, and created an array in a data storage model similar to Fluid.System. I am, however, struggling with sending the step sizes to the data storage model, and sending them back again after determining the smallest dx.
Is this even possible? How would one go about to do so?