Dear all,
I am trying to export an .fmu fIle out of an .idf file and simulate it (using FMPy python lib) for quiet some time, but I guess I probably did something wrong, hope you can make me aware of the right way to do it.
What I did so far:
- Made a model in SketchUp & OpenStudio (simulation + outputs worked)
- took the in.idf file and edited in IDF Editor. Added External Interface Import, Export, following this Tutorial:
https://bigladdersoftware.com/epx/docs/8-3/external-interfaces-application-guide/fmu-examples.html
The fmu generation worked lately, but i am not sure if it's correct, that in the ModelDescribtion.xml the Output is "unknown".
Currently I am facing the error, when trying to simulate:
from fmpy import *
*
filename = "..path/to/fmu.fmu"
result = simulate_fmu(filename)
simulate_fmu(filename)
[ERROR] fmi2Instantiate: Failed to parse the model description
description
and the ModelDescribtion.xml part:
<modelvariables>
<scalarvariable
<ModelVariables>
<!-- Note valueReferences are (1, 2, 3...) for causality="input" (to E+). -->
<!-- Note valueReferences are (100001, 100002, 100003...) for "output" (from E+). -->
<!-- Note the order of valueReferences should match the order of elements in file 'variables.cfg'. -->
<!-- Index for next variable is '1'. -->
<ScalarVariable
name="Q"
valuereference="1" valueReference="1"
variability="continuous"
causality="input" causality="input"
description="IDF line 10719">
<real <Real start="0"/>
</scalarvariable>
<scalarvariable </ScalarVariable>
<!-- Index for next variable is '2'. -->
<ScalarVariable name="TRooMea"
valuereference="100001" valueReference="100001"
variability="continuous"
causality="output" causality="output"
description="IDF line 10711">
<real/>
</scalarvariable>
</modelvariables>
<modelstructure>
<outputs>
<unknown <Real/>
</ScalarVariable>
</ModelVariables>
<!-- ModelStructure details for co-simulation. -->
<ModelStructure>
<!-- Outputs variables of the FMU. -->
<Outputs>
<Unknown index="2"/>
</outputs>
</modelstructure></Outputs>
</ModelStructure>
idf file snippet about external interface:
!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE
=========== ===========
ExternalInterface,
FunctionalMockupUnitExport; !- Name of External
Interface Interface
! --------- ExternalInterface,
! --------- FunctionalMockupUnitImport; !- Name of External
Interface Interface
!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT
=========== ===========
ExternalInterface:FunctionalMockupUnitImport,
MeanAir.fmu, !- FMU File Name
0, !- FMU Timeout {ms}
0; !- FMU
LoggingOn LoggingOn
!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:FROM:VARIABLE
=========== ===========
ExternalInterface:FunctionalMockupUnitImport:From:Variable,
THERMAL ZONE 1, !- Output:Variable Index Key Name
Zone Mean Air Temperature , !- Output:Variable Name
MeanAir.fmu, !- FMU File Name
Model_AC40, !- FMU Instance Name
TMeanAir; !- FMU Variable
Name Name
!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITIMPORT:TO:SCHEDULE
=========== ===========
ExternalInterface:FunctionalMockupUnitImport:To:Schedule,
FMU_OthEquSen_Zone1, !- Name
Thermal Zone 1 Thermostat Schedule Type Limits, !- Schedule Type Limits Names
MeanAir.fmu, !- FMU File Name
Model_AC40, !- FMU Instance Name
QSensible, !- FMU Variable Name
0; !- Initial
Value Value
!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:FROM:VARIABLE
=========== ===========
ExternalInterface:FunctionalMockupUnitExport:From:Variable,
THERMAL ZONE 1, !- Output:Variable Index Key Name
Zone Mean Air Temperature, !- Output:Variable Name
TRooMea; !- FMU Variable
Name Name
!- =========== ALL OBJECTS IN CLASS: EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:TO:SCHEDULE
=========== ===========
ExternalInterface:FunctionalMockupUnitExport:To:Schedule,
FMU_OthEquSen_Zone1, !- Schedule Name
Thermal Zone 1 Thermostat Schedule Type Limits, !- Schedule Type Limits Names
Q, !- FMU Variable Name
0; !- Initial
ValueValue
I would highly appreciate if you can check my files and tell me whats wrong and has to be changed.
Thx in advance!!
Burns