Search code examples
modelicadymola

Split model Dymola


I'm having a problem when I use the "Split model" option. What I want to do is basically hide these 10 water volumes:enter image description here.

I select the tanks then I click on button for splitting with these options: enter image description here

Final result is just what I want:

enter image description here

When I check the entire model to verify if everything is ok, these errors come out:

enter image description here

I've tried several things such as modifying the text part of the splitted model with no positive results, here's the original NOT modified

enter image description here

Can you please explain to me what kind of error it is? How can I resolve it? Thank you.

Edit: I'm using TIL library

Edit after Markus' answer: in the split model is it necessary to declare the type of liquid and change the portArray definition. I copied these lines of code and everything worked!

parameter TILMedia.LiquidTypes.BaseLiquid           liquidType = sim.liquidType1
"Liquid type" annotation (Dialog(tab="SIM",group="SIM"),choices(
choice=sim.liquidType1 "Liquid 1 as defined in SIM",
choice=sim.liquidType2 "Liquid 2 as defined in SIM",
choice=sim.liquidType3 "Liquid 3 as defined in SIM"));

replaceable package MediaConfiguration =
TIL.Utilities.MediaConfiguration
constrainedby TIL.Utilities.Internals.PartialMediaConfiguration
"Media and State Type Configuration" annotation (choicesAllMatching, Dialog(
    tab="SIM", group="Media Configuration"));
protected 
outer TIL.SystemInformationManager sim "System information manager";

and

public 
TIL.Connectors.LiquidPort portArray(
final liquidType=liquidType) ;
TIL.Connectors.LiquidPort portArray1(
final liquidType=liquidType) ;

Solution

  • The issue seems to result from the vectorization of the connectors, that seems to get lost when using "split model". A bit difficult without the actual model, but:

    Have you tried to modify the last two connect statements in str3000 to:

    connect(portArray, colume.portArray[1])
    connect(portArray1, colume.portArray[2])
    

    Additionally on the top level of the model, it seems you have connections to vectors of str3000.portArray. Try to remove them as they seem to be wrong, as you have two non-vector ports. There should be something like connect(str3000.portArray[1], ...) and connect(str3000.portArray1[2], ...), which should likely be changed to connect(str3000.portArray, ...) and connect(str3000.portArray1, ...).