0

I have modelled a dynamic Rankine cycle on Dymola 2022 using the ThermoSysPro library. Since I want to be able to start the simulations from any given state, I made sure to output all the states' values. Then using parameters, I set the initial value of each state. For instance, for a pressure:

parameter Modelica.Units.SI.Pressure P0 = 10e5 "Initial pressure";
Modelica.Units.SI.Pressure P(start=P0, fixed=true) "Pressure";

or

parameter Modelica.Units.SI.Pressure P0 = 10e5 "Initial pressure";
Modelica.Units.SI.Pressure P "Pressure";

initial equation 
P = P0;

(By the way, is there a difference between these two definitions?)

Doing this for all my states, I can retrieve the states' values at the end of a simulation and modify my initialisation parameters accordingly. Starting a new simulation from this new point works like a charm.

Next step is to export this model as FMU in order to interact with a control & monitoring model. So the export is performed with cosimulation FMI 2.0 using Dymola solvers (DASSL in particular). Then I load the FMU in Dymola, apply the same commands as the non-FMU model, with the default initial parameters. The simulation has no issue starting and gives identical results.

Then, that's where it gets tricky, I am unable to start the simulation from any other state, unless the parameters are close from the default ones. When I set initial parameters to a completely different operating point, the initialisation algorithm starts with nil values for pressures or enthalpies in vapour properties functions, which causes the initialisation to miserably fail.

So far, I have tried to prevent the vapour properties functions from using nil values, using minimum values, I also provided much more start values (guess values), but that is both time consuming and inelegant.

I would expect the initialisation process to behave the same way it does for the non-FMU model. If necessary, I could try to code a minimal non-working example, but without guarantee.

Clement44
  • 13
  • 4
  • When you exported the FMU are you using the same Dymola flags, for example is Evaluate=false in both cases? If you are always going to be continuing simulations from a previous simulated states you could try use the get and set FMU states feature see: https://stackoverflow.com/questions/62787491/how-to-export-fmu-with-steady-state – user2024223 Apr 06 '23 at 06:35
  • If Dymola flags are applicable to the whole Dymola session, then yes I am. It turns out that Evaluate=true in both cases. What do you have in mind? Because the FMU model can start with slightly different initialisation parameters and it actually starts from these values. Regarding the get and set FMU states features, last I checked, Simulink did not contain this feature (this is the tool the FMU will be integrated in the end). – Clement44 Apr 07 '23 at 15:22

0 Answers0