OMSimulator icon indicating copy to clipboard operation
OMSimulator copied to clipboard

Unit mismatch error although units are the same

Open larsviktorlarsson opened this issue 10 months ago • 2 comments

I have an .ssp with a SystemStructure.ssd file that has an .fmu with unit = "" on all outputs in its ModelDescription file. When I add unit to one of these connectors in SystemStructure.ssd: <ssd:Connector name="pLin.in.y" kind="output" description=""> <ssc:Real unit="bar"/> </ssd:Connector>

and connect this connector to another connector in the .ssd with the same unit:

<ssd:Connector name="pLin" kind="input" description="Input load pressure"> <ssc:Real unit="bar"/> </ssd:Connector>

<ssd:Connection endConnector="pLin" endElement="valve_model" startConnector="pLin.in.y" startElement="interface_model"/>

I get error:

error: [addConnection] Unit mismatch in connection: interface_model.pLin.in.y -> valve_model.pLin error: [importFromSnapshot] Failed to import ssd:Connection

If I instead have

<ssd:Connector name="pLin.in.y" kind="output" description=""> <ssc:Real unit=""/> </ssd:Connector>

I get no error.

Should not the units in the ssd override the units in the FMU?

Also, the fmu for valve_model has units on all connectors.

My ssp as zip: ParkerSimPack.zip

Running OMiImulator python api, version 'OMSimulator v2.1.3-win-notlm'

larsviktorlarsson avatar Feb 14 '25 13:02 larsviktorlarsson