.PowerGrids.UsersGuide.NamingConventions

Information

This section contains the naming and style guidelines for the PowerGrids library development. If you want to contribute to the library, please make sure you follow them strictly, to ensure a consistent style throughout the whole library.

When writing a Modelica model, please respect the general Modelica conventions and follow the recommendations below.

Please always use the English language for the code and comments.

Electrical conventions

For currents and powers, the receptor convention is normally followed, i.e. the value is positive when entering the device. Variables following the opposite generator conventions are available on the component ports; they are marked explicitly with Gen in their name.

Naming conventions

Generalities

Use package namespaces as much as possible to avoid naming conflicts. Do not duplicate parent namespaces in the children model names.

Please follow the Modelica naming conventions.

In addition to this, please follow the additional naming conventions bellow:

Exceptions for physical variables

There are some exceptions for the physical variables. Please refer to the list below:

Types conventions

Preferably use the types defined in the PowerGrids.Types package, or possibly locally redefined types with ad-hoc nominal attributes. For other units, please use Modelica.SIunits types. Use the appropriate unit for PerUnit variables. Avoid using plain Real variables that lack dimensional information and prevent automatic dimension checking on physical equations.

Model structure conventions

Generalities

Respect the following order while writing or updating a model:

Comments conventions

Comments should start with a capital letter.

Model implementation


Generated at 2024-11-22T19:25:38Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos