How to configure MSL Fluid Example ThreeTanks central code for Medium using just GUI?

28 Views Asked by At

I am interested in convenient and user friendly parametrisation of components and here are different ways to do that.

One rather established way is what you have in MSL/Fluid/Examples/Tanks/ThreeTanks. Here you have at the top of the code a central declaration of what Medium is for the components in the application example by

replaceable package Medium = Modelica.Media.Wateer.ConstantPropertyLiquidWater
   constrainedby Modelica.Media.Interfaces.PartialMedium;

Then all components in the example application use this Medium. Thus we avoid the procedure to set the Medium for each individual component.

I struggle with if it is possible to introduce these lines of code using the GUI, rather than just editing the code.

My first idea is to package the lines of code in a partial model Application and then drag that in

partial model Application
   import Modelica.Media.Interfaces.PartialMedium;
   replaceable package Medium = PartialMedium;
      constrainedby PartialMedium;
end Applications;

And then in the application example code have

 import ...Application;
 extends Application(
    redeclare package Medium=Modelica.Media.Water.ConstantPropertyLiquidWater);

But when I drag in Application I get warnings and "Application" is treated as a replaceable class and not what I want.

Is here a GUI solution?

0

There are 0 best solutions below