Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spawn FMU cannot be reset and initialized #3172

Closed
lambtt opened this issue Nov 30, 2022 · 4 comments
Closed

Spawn FMU cannot be reset and initialized #3172

lambtt opened this issue Nov 30, 2022 · 4 comments

Comments

@lambtt
Copy link

lambtt commented Nov 30, 2022

Describe the bug
Model: The model with Spawn.
I exported the model by Dymola 2023 to FMU (Co-simulation, 64-bit).
I could run this FMU in Python for a whole day.
I could also run this FMU in a timestep and then continue it for another.
But I could not run this FMU at the same timestep by reset () and initialize ().
The console will report "Writing tabular output file results using HTML format.", and then no reaction anymore.

I test the model without Spawn in the same framework. The FMU could be simulated in the same timestep by reset () and initialize().
I'm wondering if that's because EnergyPlus's FMU doesn't be initialized even though I give commands "FMU.reset ()" and "FMU. initialize()" to the total FMU for the model with Spawn.

I tried to manually load the EnergyPlus's FMU generated by Spawn.exe in this process and initialize it. But it doesn't work.
Maybe they are two different instances from the same EnergyPlus FMU.

Expected behavior
The expected behavior is the model could be run again during the same timestep for optimization control like MPC.

Screenshots
If applicable, add screenshots to help explain your problem.
The FMU setting.

Snipaste_2022-11-29_18-38-21

The model with Spawn can not be reset and initialized by initialize() or enter_initialization_mode() and exit_initialization_mode().

image
image
The model without Spawn can be reset and initialized by initialize().

Snipaste_2022-11-29_18-36-17

Version

  • Modelica Buildings Library: [9.0.0]
  • Modelica simulation environment: Dymola 2023
  • Operating system: Windows 10

Additional context
Add any other context about the problem here.

@lambtt
Copy link
Author

lambtt commented Nov 30, 2022

@mingzhe37

@lambtt
Copy link
Author

lambtt commented Nov 30, 2022

I'm wondering if this is related to issue #2956 .

@mwetter
Copy link
Member

mwetter commented Nov 30, 2022

Because the EnergyPlus binaries do not allow saving and reinitializing the state, Modelica models with the Spawn coupling can't be used in such a workflow. If you need this capability, you will need to model the envelope in Modelica.

@mwetter mwetter closed this as completed Nov 30, 2022
@lambtt
Copy link
Author

lambtt commented Nov 30, 2022

Because the EnergyPlus binaries do not allow saving and reinitializing the state, Modelica models with the Spawn coupling can't be used in such a workflow. If you need this capability, you will need to model the envelope in Modelica.

Thank you for your attention, Michael!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants