CATIA-Systems / FMIKit-Simulink

Import and export Functional Mock-up Units with Simulink
Other
161 stars 54 forks source link

Can this tool export an FMU that supports restart ? #410

Closed zzlonggg closed 1 year ago

zzlonggg commented 1 year ago

I need a fmu that supports restart, can this tool export a fmu that supports resart and if so how should I do it?

AS6SL0M2SJV_KV2}`B0_22V

t-sommer commented 1 year ago

Can you provide steps to reproduce the problem?

zzlonggg commented 1 year ago

I am using FMU in conjunction with fluent to do some research in CFD. In MATLAB/Simulink :

  1. FMIKit.initialize()
  2. select solver: fixed-step(0.001)
  3. sysetm target file : grtfmi.tlc
  4. built a FMU model The model is shown in Figure 1 LS$F)~)IOJI{U6@3{%ASB_3 Figure 1

In ANSYS\Fluent: The ANSYS\Fluent is shown in Figure 2 N@$_%B _F}J0ABZTHO}9IY6 Figure 2 1.run the script like

/file/set-tui-version "21.2"
(cx-gui-do cx-activate-item "MenuBar*ReadSubMenu*xianxing")
(cx-gui-do cx-activate-item "MenuBar*ImportSubMenu*FMU ...")
(cx-gui-do cx-activate-item "Import FMU File*Table1*Frame1(FMU Input File)*PushButton2(Import)")
(cx-gui-do cx-set-file-dialog-entries "Select File" '( "Deal.fmu") "FMU Files (*.fmu )")

When I import the fmu model, it gives a warning that the model does not support restart If the FMU does not support restart, when the CFD needs to be restarted after an interruption, it needs to reinitialise the solution and run the calculation from scratch. In fact, CFD is a very time consuming task and it would be very costly to re-initialize after every interruption, so I needed FMU support for restarting

t-sommer commented 1 year ago

I assume "reset" refers to the FMI capability flag canGetAndSetFMUstate that is currently not supported.

t-sommer commented 1 year ago

@zzlonggg, can you give b8db9443a5bf779467cf386002e457ed480aa082 a try? It adds an experimental implementation of the get/set FMU state functions.