To generate a Modelica model directly from the modeling tool


  1. Right-click the Block TestCaseHumidifier::HumidifierSystem and select Tools > Export to Modelica. Please see Generating a simulation file file for more information. 
  2. Now make sure the OpenModelica Connection Editor (OMEdit) is installed:
    1. For Windows: https://openmodelica.org/download/download-windows
    2. For Mac: https://openmodelica.org/download/download-mac
  3. Launch OMEdit. Go to File > Open Model/Library File(s). Select the generated Modelica file in the directory it has been saved in. It should be called EnvironmentModel.mo.



  4. An EnvironmentModel model will show up in the Libraries window. Double-click it. A tab called EnvironmentModel should open up in the main OpenModelica window. Make sure it is in text view (by selecting the ‘note’ symbol under the EnvironmentModel tab, as shown in the image below).



  5. Check that the model works by going to Simulation > Check Model. A Check Model pop-up box will show up and report whether the model is ready for simulation. Press OK.




  6. To setup the simulation run for the model, go to Simulation > Simulation Setup. Make sure the Start Time is 0 and the Stop Time is at 3600 seconds. Press the Simulate button.



  7. Once the Simulate button is pressed, a pop-up window EnvironmentModel Simulation Output will run until the simulation results are completed (indicated by a progress bar). OpenModelica will load up the Plotting Perspective (the Perspectives tab is in the bottom-right corner of the image below) where the main window displays an empty graph, and a Variable Browser shows up on the right.



  8. To see the input and output of the EnvironmentModel, variables from the Variable Browser must be chosen. Selecting EnvironmentModel > _Environment > room > humidity_out will display the humidity level of the room over time on the plotting window.