title: How can I encapsulate models of the fluid library of openmodelica?
body: <p>Problem and Motivation:
  the models of the fluid library in openmodelica are very elaborated, with a lot of parameters one has to set correctly to get the model running with acceptable results.
  I want to set up an environment for daily engineering calculations, for mechanical and process engineers - no simulation experts.
  So the components of my library must be pre-configured and the users shouldn't be forced to edit the code behind the graphical model (eg redeclaration of the Medium).</p>
  
  <p>Idea:
  drop the fluid models in own models, configure them properly, redeclare the Medium and provide fluid connectors.</p>
  
  <pre><code>model flowEncapsulateFluid1
  inner Modelica.Fluid.System system;
  replaceable package Medium =  Modelica.Media.Water.ConstantPropertyLiquidWater                           constrainedby
  Modelica.Media.Interfaces.PartialMedium "Medium in the component"
    annotation (choicesAllMatching = true);
  
  model myStaticPipe
  Modelica.Fluid.Pipes.StaticPipe pipe(redeclare package Medium = Medium, allowFlowReversal = true, height_ab = 2, length = 2, diameter = 0.1);
  Modelica.Fluid.Interfaces.FluidPort_a port_a;
  Modelica.Fluid.Interfaces.FluidPort_b port_b;
  equation
  connect(pipe.port_b, port_b);
  connect(port_a, pipe.port_a);
  
  model myTank1
  Modelica.Fluid.Vessels.OpenTank tank1(crossArea = 1, 
  redeclare package  Medium = Medium, use_portsData = true, height = 12,
  level_start = 8, nPorts = 6, 
  portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData 
  (diameter = 0.1)});
  Modelica.Fluid.Interfaces.FluidPort_a port_a 
  (redeclare package Medium = Medium);
  Modelica.Fluid.Interfaces.FluidPort_a port_a1 
  (redeclare package Medium = Medium);
  Modelica.Fluid.Interfaces.FluidPort_a port_a2 
  (redeclare package Medium = Medium);
  Modelica.Fluid.Interfaces.FluidPort_a port_a3 
  (redeclare package Medium = Medium) ;
  Modelica.Fluid.Interfaces.FluidPort_a port_a4 
  (redeclare package Medium = Medium) ;
  Modelica.Fluid.Interfaces.FluidPort_b port_b 
  (redeclare package Medium = Medium);
  
  equation
  connect(tank1.ports[6], port_b);
  connect(port_a4, tank1.ports[5]);
  connect(port_a3, tank1.ports[4]);
  connect(port_a2, tank1.ports[3]);
  connect(port_a1, tank1.ports[2]);
  connect(port_a, tank1.ports[1]);
  end myTank1;
  
  package UnitTests
  
  model Test1
  flowEncapsulateFluid1.myTank1 myTank11;
  myStaticPipe myStaticPipe1;
  myTank1 myTank12;
  equation
  connect(myStaticPipe1.port_b, myTank12.ports_b);
    connect(myTank11.ports_b, myStaticPipe1.port_a);
  
  end Test1;
  
  end UnitTests;
  annotation(
  uses(Modelica(version = "3.2.2")));
  end flowEncapsulateFluid1;
  </code></pre>
  
  <p>I get the message "No corresponding 'inner' declaration found for component .Modelica.Fluid.System tank1.system declared as 'outer '.
    The existing 'inner' components are:
      There are no 'inner' components defined in the model in any of the parent scopes of 'outer' component's scope: Modelica.Fluid.Vessels.OpenTank$tank1.
    Check if you have not misspelled the 'outer' component name.
    Please declare an 'inner' component with the same name in the top scope.
    Continuing flattening by only considering the 'outer' component declaration."</p>
  
  <p>I don't know how to interpret the message. Any help would be welcome.</p>
  
  <p>Furthermore I would appreciate, if some one could provide me advices or links for this project.</p>
  
  <p>Many thanks in advance.</p>