Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-02041// Views: AA-02041// Created: 2021-10-05 08:14:51// Last Updated: 2023-04-06 16:44:45
HowTo
How to create a GenUnit out of Single Components in Dymola

Dymola is a software tool that allows you to create FMUs for GenUnits used afterwards with ePHASORSIM.


Requirements:

  • It is required to generate a FMU with Dymola once you run the FMU for Linux 64bit OS, like opallinux3
  • A description of a GenUnit can be found here.
  • You must follow this workflow once a GenUnit has Single Components, which can't be imported directly from PSSe, Powerfactory or Cyme. However, they already exist in the Opal-RT library.
  • Contact Opal-RT support to receive the Opal-RT library.
  • A list of all Single Components can be found here.
  • If you made sure that your desired Single Components exist in the Opal RT library, you can follow this workflow to create your own GenUnit in Dymola.
  • If you would like to create your own Single Component follow this link.
  • If you want to know how to install Dymola follow this KB.
  • Check if following environmental variables are present on your windows machine:
    PYTHONPATH c:\opal-rt\rt-lab\2021.2\common\python
    RTLAB_ROOT C:\OPAL-RT\RT-LAB\2021.2

     

  • NOTE: No additional installation on your opallinus3 target is required

 

Opening and loading of libraries
 As a first step load the Single Component library of Opal-RT called OpalRT_Dev.mo

After successfully importing the library you may see this in the Package Browser


Next to it Opal-RT proved as well already configured GenUnits in a library called package.mo
The premade GenUnits serve as good examples on how to configure your GenUnit.

Create your package:


Right click on your new package and create your model, in this example a single machine GENSAE is created


 
Adding single components of a GenUnit
 Now you can drag and drop out of the Opal-RT single component library your blocks.
If you can see names on the components your library imports have been successful.



Required Single Components
Every GenUnit requires one incoming pin in green and one outgoing pin in red.
Add Power Pin to the GenUnit following the naming convention and connect it to the Power Pin of the current injector component. 
This pin is the point of connection between FMU and the rest of the network
.


The incoming pin must be named TRIP and the outgoing pin must be named bus0


NOTE: These Pins can be later accessed with the Pins Excel Sheet.


Additional Information
 Every Genunit has two representations in Dymola
  1. Representation as graphic
  2. Representation as cod
You can switch between both views in the menuband

The Code is is ordered as follows:
  1. class:
    parameter Real varablename= value;
  2. Followed by the blocks of the OpalRT library
  3. Followed by the connections between the blocks
  4. And will be closed as shown here:

 

Creating parameters
Double click on the block in the schematic.
Now the Parameter section of the blocks must be filled with the parameters written in the FMUGlossary.csv
The first picture below is showing a screenshot of Dymola, with defined parameters for GENSAE and the second picture below is showing the corresponding entry in the FMUGlossary.csv
This excel sheet can be found here: C:\OPAL-RT\RT-LAB\20XX.X\FMUCreator\resources\FMUGlossary




Only by drag and dropping blocks into your schematic, the parameters are not fully defined.

To complete the creation of parameters one has to write them in the code and assign them the data format "Real".
Additionally one more parameter has to be created.
Define partType parameter with value 1 and data type Real as a global variable as marked yellow in the picture below.
Repeat the creation of parameters for every single component in your whole GenUnit as marked blue in the picture below.
If that's done, no other definition of partType has to be done in the icon representation of the blocks like marked in green in the picture above.
This example is showing GENSAE. Other premade GenUnits in the package.mo library will serve as templates for other single components.
The values assigned to every parameter are dummy values.

Connecting Single Components
As a Genunit contains usually more than one Single Component continue and add all required Single Components.
The next step is to connect the Single Components.
How to connect these single component properly is described in the ePHASORSIM section of OPAL-RT wiki.

NOTE: At this step it is recommend to have a look in the package.mo premade GenUnits to get an idea how the single component are correctly connected.

 

Connecting vector signals
 Once you start connecting the inputs and outputs in Dymola

You may face the issue that the vector size of these IOs are not the same.
One graphical I/O in Dymola can be a vector and have more than one entry.
In this case you have to select the correct entry.

To do so, you can right click on each block, open it in a new tab and read ist code.


Here it will be written which entry of a vector is corresponding to which variable.

Moving the mouse over an input/output of an block will give you the vector size.

 

Compilation
 To make sure your FMU is ready to compile use the "Check" option.


A common setting to be flagged in the command window is:
Advanced.CheckPackageRestriction:=false;
To resolve this, navigate to Simulation in the bottom right:

And type the command in the command window:



Your goal is that no error and/or warning should appear.


The compilation is not done with Dymola!
To compile your GenUnit use the FMUCreator while following this KB:

NOTE: An RT-LAB instance (Metacontroller) must be open, when you are trying to compile an FMU.