General

General

I try to run a Functional Mock-up Interface (FMI) Co-simulation in CFX. When I run the simulation, CFX seems to pass zero to the FMU instead of the correctly evaluated expression result for the FMU input variables. What could be the reason for this and how can I correct the behavior?

    • FAQFAQ
      Participant

      If your FMU has the property canGetAndSetFMUstate = true which means that during a transient run the FMU can be called at each coefficient loop iteration and not just once per time step, CFX 2019 R1 and older versions will not call the FMU correctly. This is due to a defect which is fixed in 2019 R2. As a workaround in versions where the defect is not yet fixed, you can add the following option to the CCL of the Functional Mockup Unit Instance User Function to make sure that the FMU will be called and the inputs and outputs are updated and transferred correctly: Coupling Location = Start of Coefficient Loop This modification is not possible directly in the User Function GUI in CFX-Pre, but must be done in the Command Editor (right-click on the User Function in CFX-Pre -> Edit in Command Editor). The complete CCL of the Functional Mockup Unit Instance User Function will then look like this: FUNCTION: MyFMUModel Coupling Location = Start of Coefficient Loop FMU File Name = D:mypathMyFMUMOdel.fmu Option = Functional Mockup Unit Instance ARGUMENT VALUE: InputA Expression Value = myInputExpression Value Name = InputA END RESULT VALUE: OutputA Value Name = OutputA END END