development of emt components and reference grid in
Post on 20-Oct-2021
6 Views
Preview:
TRANSCRIPT
IN DEGREE PROJECT ELECTRICAL ENGINEERING,SECOND CYCLE, 30 CREDITS
, STOCKHOLM SWEDEN 2021
Development of EMT components and reference grid in OpenModelica
ALBA FERNÁNDEZ HORCAJUELO
KTH ROYAL INSTITUTE OF TECHNOLOGYSCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE
Development of EMT components andreference grid in OpenModelica
AUTHOR: Alba Fernández Horcajuelo
DATE: March 2021
HOST COMPANY: SuperGrid Institute
INDUSTRIAL SUPERVISOR: Laurent Chédot
ACADEMIC SUPERVISOR: Ilka Jahn
EXAMINER: Staffan Norrga
School of Electrical Engineering and Computer Science
KTH Royal Institute of Technology
ii
Abstract
Power systems simulation tools enable to study and evaluate the performance of
electrical power systems in different scenarios. This allows the development and
implementation of new solutions to the challenges electrical grids face nowadays. In
this sense, electromagnetic transient (EMT) simulation provides detailed information
on the behaviour of the different components involved in the system. Moreover, among
the wide range of existing tools, those based in Modelica language present certain
advantages for power system simulation, such as equationbased modeling and the
possibility of working in opensource environments.
This project presents the development of components and reference grid in EMT
formalism in the opensource environment OpenModelica, based on Modelica
language. With the purpose of power system simulation, electrical components have
been modeled in OpenModelica and gathered in a library for EMT simulation
The performance of the different components has been validated by comparing the
results of the EMT simulation of a 3buses reference grid in different case studies in
OpenModelica and other EMTbased software. Furthermore, the comparison has been
also established with phasor simulation in OpenModelica, enabling the evaluation of
the differences between phasor and EMT simulation.
The results show the main advantages and drawbacks of working with OpenModelica
regarding other simulation tools and the lack of information provided by the phasor
simulation, particularly in the case of a fault event. Additionally, certain difficulties
encountered when working with OpenModelica have also been identified.
Keywords
Power system simulation, EMT simulation, Modelica, OpenModelica
iii
Sammanfattning
Simulering av kraftsystem gör det möjligt att studera och utvärdera prestandan
i olika scenarion. Genom detta kan utveckling och implementering av nya
lösningar på de utmaningar som elnäten står inför framöver ske. Elektromagnetisk
transient (EMT)simulering ger detaljerad information om beteendet hos de olika
komponenterna i systemet. Bland de många befintliga verktygen innehåller de som
är baserade på Modelicaspråket dessutom vissa fördelar för kraftsystemsimulering,
såsom ekvationsbaserad modellering och möjligheten att arbeta i miljöer med öppen
källkod.
Den här uppsatsen presenterar en utveckling av komponenter och testelnät i EMT
formalism i öppen källkodsmiljö OpenModelica, baserat på programmeringsspråket
Modelica. Elektriska komponenter har modellerats i OpenModelica och samlats
i ett bibliotek för EMTsimulering. Målet är en detaljerad simulering av
elkraftsystem.
Komponenternas prestanda har validerats genom att jämföra resultatet av EMT
simuleringen av ett 3bussreferensnät i olika fallstudier i OpenModelica och annan
EMTbaserad programvara. Sedan har jämförelsen även utförts med simuleringar
i fasorformalism i OpenModelica. Den här jämförelsen har också möjliggjort
utvärderingen av skillnaderna mellan fasor och EMTsimulering.
Resultaten visar de största fördelarna och nackdelarna med att arbeta med
OpenModelica njämfört med andra simuleringsverktyg. De visar också bristen på
information om fasorsimuleringen, särskilt i fallet med ett elektriskt fel. Dessutom
har vissa svårigheter identifierats med att arbeta med OpenModelica.
Nyckelord
Kraftsystemsimulering, EMTsimulering, Modelica, OpenModelica
iv
Acknowledgements
I would like to express my gratitude to SuperGrid Institute for giving me the
opportunity to carry out this project with them. A special thank you to my supervisor,
Laurent Chédot, and to all the team fromModeling and Simulation group. It has been
a pleasure to work by their side.
I would also like to thank my academic supervisor, Ilka Jahn, for all her support and
recommendations.
And finally, thanks to my family and friends, that have always been there for me either
in person or from the distance.
v
Acronyms
DAE DiffererentialAlgebraic Equations
EMT Electromagnetic transient
HVDC HighVoltage Direct Current
IEESGO IEEE governor model
MVDC MediumVoltage Direct Current
PI Proportional Integral
SI International System
TGOV1 Turbinegovernor model
vi
Contents
1 Introduction 11.1 General context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Context of the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 About Modelica 42.1 Modelica language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.2 Reference libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Modelica Standard Library . . . . . . . . . . . . . . . . . . . . . 62.2.2 OpenIPSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2.3 ModPowerSystems . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 Developed EMT library in OpenModelica 93.1 Basic components models . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 Transmission line models . . . . . . . . . . . . . . . . . . . . . . . . . . 123.3 Transformers models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.4 Load models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.5 Generator models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5.1 ModPowerSystems generator model . . . . . . . . . . . . . . . 163.5.2 OpenIPSL generator model . . . . . . . . . . . . . . . . . . . . . 18
3.6 Control models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.6.1 Simple control models . . . . . . . . . . . . . . . . . . . . . . . . 203.6.2 Implementation of control models for comparison . . . . . . . . 23
4 Reference grid: 3buses 26
5 Validation of results 285.1 Deviation from reference values in steadystate . . . . . . . . . . . . . 28
vii
CONTENTS
5.1.1 Comparison with EMT reference . . . . . . . . . . . . . . . . . . 285.1.2 Comparison with phasor reference . . . . . . . . . . . . . . . . . 29
5.2 Response to load loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315.2.1 Comparison with EMT reference . . . . . . . . . . . . . . . . . . 315.2.2 Comparison with phasor reference . . . . . . . . . . . . . . . . . 32
5.3 Response to disconnection from the system . . . . . . . . . . . . . . . 335.3.1 Comparison with EMT reference . . . . . . . . . . . . . . . . . . 335.3.2 Comparison with phasor reference . . . . . . . . . . . . . . . . . 34
6 Conclusions 376.1 Discussion on the results . . . . . . . . . . . . . . . . . . . . . . . . . . 376.2 Identified difficulties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386.3 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
References 40
viii
Chapter 1
Introduction
1.1 General context
These days, we are living in a society in constant evolution and subject to significant
changes, where the growing of energy demand, together with the traditional energy
sources, are leading to an unsustainable situation. As a consequence, the way energy
is produced and, in particular, electricity, is changing to adapt to the increasing need,
but also to ensure sustainable development for the future.
In this context, the integration of renewable energies has gained in relevance and, at
the same time, has presented some challenges that the traditional power grid needs to
face. Some of these challenges are related to volatile electric power generation from
renewable sources that can lead to unstable situations for the system. Moreover, the
development of new technologies that enable this integration and improve the system,
such as power electronics or HighVoltage Direct Current (HVDC) links, also lead to
new scenarios.
Therefore, the study of the impact of these technologies on the power grid becomes
really important to ensure the reliable and efficient operation of the system. When
it comes to this study, especially to the reliability of the power grid, it is necessary to
develop certain tools andmethods that allow us to evaluate the behaviour of the system
in these new scenarios without any risk for its integrity.
In this light, simulations of the electrical network and especially, those that allow to
study its behaviour in detail, become indispensable to understand the dynamics of the
1
CHAPTER 1. INTRODUCTION
system and enable the development of the research in this domain. To this extent,
Electromagnetic transient (EMT) studies involve the simulation of the power systems
at a high precision level [1] [2].
Moreover, in order to boost this development and the transition into the power grid
of the future, the collaboration between different countries and stakeholders is a
key element. For this reason, there is an increasing interest in the development of
opensource tools, that would facilitate and promote this collaboration. Among these
tools, those based on the Modelica language are gaining visibility in the power grid
sector. This language, Modelica, has gained international recognition in the field of
engineering in the past few years, being one of themost used and advanced declarative
modeling languages [3].
1.2 Context of the project
This Master’s degree project has been carried out at SuperGrid Institute, as the final
stage to complete a MSc in Electric Power Engineering at KTH Royal Institute of
Technology.
SuperGrid Institute is an independent research and innovation centre dedicated
to the development of technologies for the future power transmission system,
the “supergrid”, including HVDC and MediumVoltage Direct Current (MVDC)
technologies. It presents a multidisciplinary approach providing a wide range
of services and solutions for the development of power systems, equipment and
components, thanks to its comprehensive expertise but also to advanced simulation
capabilities and test platforms.
In this framework, SuperGrid Institute presents different research programmes such
as SuperGrid Architecture and Systems, which specializes in system architecture to
allow the integration of intermittent renewable energy sources, while ensuring network
security and stability. Other programmes focus on high voltage substation equipment,
power electronics and converters, HVDC cable systems and junctions and power
storage and balancing.
This project has beendevelopedwithin the scope of Architecture andSystemsprogram,
where most of the activities are based on advanced power system simulation models
and tools, required for the research in the field of power transmission systems. Inmany
2
CHAPTER 1. INTRODUCTION
cases, such models and tools must be developed, implemented and validated to adjust
to the research process. This project in particular is framed in the research activities of
the Modeling and Simulation group, whose objective is to develop accurate simulation
models and platforms to study HVDC grids. To this extent, the simulation of HVDC
grids and hybrid ACDC grids is complicated since they are based on power electronics
converters and their control systems, which accurate modeling is complex.
1.3 Objectives
The objective of the internship proposed by SuperGrid Institute is to develop reference
models, components and grid, in the electromagnetictransient formalism, EMT, in
Modelica language, in particular, in the opensource environment OpenModelica. To
this end, reference grid models in phasor formalism and in other EMT environments
are used for comparison and validation.
To accomplish the main objective, different targets are pursued:
• Study ofModelica language anddevelopment ofmodeling skills inOpenModelica
• Study of the reference model and libraries in phasor formalism
• Study of EMT models for the different components of the reference network
• Development of the EMT model in OpenModelica according to the reference
• Validation of the new model through its comparison with the reference phasor
model and an equivalent model in developed in a different EMTbased software
• Extension of the model.
3
Chapter 2
About Modelica
The objective of this project is to develop an EMT model, components and grid, in the
opensource environment OpenModelica, based on the languageModelica. Therefore,
as a first step, it becomes necessary to provide an approximation to this language.
2.1 Modelica language
Modelica is a declarative objectoriented language for modeling physical systems with
the purpose of efficient simulation. Their main characteristics are [4][5]:
• Equationbased language, enabling acausal modeling. Components are directly
modeled by the equations that govern their physical behaviour. The model
dynamic behaviour is not described with a predetermined inputtooutput data
flow, but with a set of timevarying DiffererentialAlgebraic Equations (DAE)
and discrete equations. Since the equations do not specify a certain data flow
direction, acausal modeling gives better reuse of model components, that can be
adapted to different data flow contexts.
• Objectoriented language based on the notion of class. Objects in Modelica have
a class that defines their data and behaviour. Classes allow tomodel components
that can be reused in more complex models, providing hierarchical structuring.
• Multidomainmodeling capability enabling tomodel components corresponding
to objects from different domains such as electrical, mechanical, hydraulic or
thermodynamic for example, and its interactions. This is possible thanks to the
4
CHAPTER 2. ABOUT MODELICA
notion of connector, a specific kind of class that provides an interface between
models, even if they come from different domains.
• Continuous and discrete event modeling, allowing to introduce discrete changes
or events during the simulation of a continuous physical system. This brings the
possibility ofmodeling hybrid systems, that contain both continuous anddiscrete
parts.
These characteristics present some advantages for power systems modeling. The
declarative formulation allows to set the focus on the content of the model rather
than on the way it should be computed and problemsolving strategies [3]. On one
hand, the equationbased modeling of the power systems components present the full
implementation of the model in an understandable and usable way for power system
stakeholders, not necessarily familiarized with the solving algorithms.
On the other hand, the separation between themodeling and the solving parts facilitate
the exchange of models and ensure its flexibility. The increased complexity of power
system dynamics and the growing number of interconnections between different
power systems make necessary the collaboration between different actors in these
systems. In this context, this decoupling is interesting because it brings the possibility
to exchange predefined models, parameters and equations in a standard modeling
language [6].
Moreover, the Modelica language needs an environment to be transformed into
executable code and be able to run simulations. These environments could be
commercial, or opensource, as it is the case of OpenModelica. Opensource tools and
software present advantages compared to commercial tools when it comes to these
possibilities of sharing models and collaborating in their development.
Also, Modelica enables the graphical definition of complex networks. The use of
the graphical editor to develop simulations and connect the models for the different
components definitely stands as an advantage when it comes to the modeling
of large networks. However, the large number of equations appearing when
simulating large systems is one of the main drawbacks for this paradigm, and the
performance of full Modelica environments for solving complex power systems might
be question [6].
5
CHAPTER 2. ABOUT MODELICA
2.2 Reference libraries
When it comes to power system simulation with OpenModelica, there are several
libraries, developed by different research groups all over the world, that include
models for electrical components, from simple passive devices to complex control
schemes.
The objective of this section is to offer a review of certain parts of some of these
libraries that will be used as a reference for the development of new components in
EMT formalism.
2.2.1 Modelica Standard Library
This library is developed together withModelica language by theModelica Association,
and it provides constants, types, connectors and components models from different
fields, such as electrical, mechanics, magnetic or thermal. It also includes
interdisciplinary blocks for graphical modeling and complex math functions.
Even though it is a large library, in this project the focus will be set on the electrical
sublibrary, presented in Fig. 2.2.1, which includes components for the simulation
of electrical networks in different contexts. For EMT simulation, the components
enabling multiphase modeling stand out as an interesting reference [7].
Figure 2.2.1: Detail of Modelica Standard Library: Electrical sublibrary, multiphase
6
CHAPTER 2. ABOUT MODELICA
2.2.2 OpenIPSL
OpenIPSL stands for ”OpenInstance Power System Library” and was developed out
of the iPSL, ”iTesla Power System Library”, an opensource modeling library created
in the framework of the ”iTesla” project. This project, funded by the European
Commission, took place between 2012 and 2016 and aimed at reducing the dependency
of the power system model from the power system simulation tool. The library
was conceived to include power system components models for phasor timedomain
simulations based on reference models used in other power system tools, enabling the
comparison with them [8], [9].
When the ”iTesla” project ended, some of the developers of this library, in particular,
those attached to the SmartTS Lab from KTH, decided to continue contributing to
this development and created OpenIPSL, which not only aims at providing reference
models but also test networks compatible with OpenModelica, to use in research and
teaching [9], [10].
One of these test networks, KundurTwoAreas and its further developments, has been
used as a reference for the study of the OpenModelica environment and different
electrical components in phasor formalism. Therefore, some of the models developed
in the framework of the OpenIPSL library will be used as a reference for their
translation into EMT component models. Fig. 2.2.2 shows different parts of the
Electrical package of OpenIPSL library.
Figure 2.2.2: Detail of OpenIPSL: Electrical package
2.2.3 ModPowerSystems
ModPowerSystems is a library developed by the Institute of Automation of Complex
Power System, in the E.ON Energy Research Center from RWTH University Aachen,
7
CHAPTER 2. ABOUT MODELICA
in Germany. It includes power system models in static phasor formalism, dynamic
phasors and EMT [11],[12], providing reference models that can be used as a base for
more complex components.
As presented in Fig. 2.2.3, this library is divided into different packages for single
phase modeling or threephase modeling for each formalism, where the components
are included in different sections such as slack, loads or generation, together with some
examples modeling simple networks.
Another interesting part of this library is the Interfaces package, which includes
different connectors classes that enable to connect components models depending
on whether they are modeled in phasors or EMT, in single or threephase. Those
connectors used to interface components modeled in phasor formalism define the
electrical variables for voltage and current as complex variables, whereas those used
in EMT modeling handle voltage and current as real variables. This difference in the
way the electrical variables are defined is a good example of the reason that prevents
using components modeled with different connectors in the same network, avoiding
the reutilization of components from different libraries in the EMT development of
reference grids.
Moreover, some of the components included in this library, such as the synchronous
generator, are modeled according to the equations of [13], and stand out as useful
references for the EMT components development, since [13] is also used as a reference
for the models in other EMT software platforms [14].
Figure 2.2.3: Detail of ModPowerSystems library: Base package
8
Chapter 3
Developed EMT library inOpenModelica
A new library for EMT modeling of power systems has been developed in
OpenModelica, based on the models and reference libraries previously presented.
It has been considered more interesting to directly use the components from
the reference libraries when possible and adapt them to the requirements of
the new modeling schemes, rather than to duplicate elements that were already
developed.
The EMT library is structured according to the different sets of components needed for
power systems simulation and will be described in general terms.
3.1 Basic components models
The first step in the development of this new library is the choice of the connector
that will be used to interface the components since it includes the definition of the
electrical variables. In Modelica Standard Library, the connector used to interface
multiphase components is called Plug and enables to work with threephase voltage
and currents in International System (SI) units. This will be the connector class used
in EMT modeling.
The compatibility with the connector class allows using other components from the
Multiphase package from Modelica library, such as the models for passive elements.
These components models, in particular those for the resistor, inductor and capacitor,
9
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
will be directly extended from Modelica library in the developed library.
The second step in the development of this library is the creation of amodel that allows
setting the base values of the system regarding the base power and the frequency. This
model is called System and is definedwith the prefix inner. ThisModelica functionality
enables to refer to the parameters included in System, such as the frequency of the grid,
in a separate model by addressing the System component with the prefix outer. This
is interesting when developing models for large networks, to ensure the same system
base in all components.
Figure 3.1.1: Detail of developed EMT library: Basic package
Some other basicmodels of the developed library are the buses, included in the package
with the same name. The bus bar is used for measurement in high voltage grids and,
in the case of the simulation in OpenModelica, can be used to set the initial values of
the voltage magnitude and angle, if known from a previous load flow study. In large
networks studies, the initialization of certain voltage levels at the bus bars can become
necessary to perform the simulation.
The basic bus model includes certain functions from Modelica Standard Library that
enable to measure the voltage values to validate the results. First, the quasiRMS
function allows to obtain the RMS value of the threephase voltage of the bus. Second,
the function ToSpacePhasor, from the Machines models in Modelica Electrical
package, allows to transform the threephase voltage into phasor form according to
10
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
the following equation:
vreal
vimaginary
= 2/3 ·
1 cos(2π3) cos(4π
3)
0 sin(2π3) sin(4π
3)
·
vA
vB
vC
(3.1)
where vreal and vimaginary are the real and imaginary components of a certain variable
in phasor form, and vA, vB and vC are its value at each phase.
Finally, in order to measure the voltage angle, calculated as the arctan of the ratio
between the imaginary and the real components of the voltage, it is necessary to
perform a rotation to obtain these components in a rotatory reference, i.e. rotating at
the same angular speed of the system. As a first approach, it will be considered that the
voltage rotates at the angular speed of the system. The validity of this assumption will
depend on the system frequency, whose deviation from the referencewill beminimized
by the control models. Therefore, the real and imaginary components of the voltage
will be rotated with the function Rotator from Modelica Standard Library as: vreal′
vimaginary′
=
cos(−θ) −sin(−θ)
sin(−θ) cos(−θ)
·
vreal
vimaginary
(3.2)
being θ the product of the system angular speed by the simulation time, vreal and
vimaginary the real and imaginary components of the voltage in stationary reference
and vreal′ and vimaginary′ the real and imaginary components of the voltage in rotatory
reference.
The Buses package includes also a model for an infinite bus, slack bus or swing bus.
This component performs as a perfect voltage source, also allowing to set the voltage
magnitude and angle. It is used to balance the active and reactive power in the system
during the simulation, absorbing or emitting power according to the requirements of
the load flow. In the model developed, the estimated values of the power exchanged
by the infinite bus can be used to initialize the power and the currents flowing through
the plug connecting the bus to the system.
Finally, a model for a breaker, partially based on the breaker model from
ModPowerSystems reference library, has been also included. The breaker model
presented enables to disconnect a certain part of the system at the established time,
11
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
t1, and to reconnect at time t2. To avoid numerical problems during the simulation, it
presents a certain resistance value, both when it is open or closed, having a nonideal
behaviour.
3.2 Transmission line models
In order to model the transmission lines, the equivalent π circuit has been developed
according to [13]. Fig. 3.2.1 shows the reference for the definition of the electrical
variables, being −→v1 and −→v2 the voltage and−→i1 and
−→i2 the current in the sending and
receiving ends, called 1 and 2 respectively. P12 andQ12 are the active and reactive power
injected at the end 1 of the line and P21 and Q21 those injected at the end 2.
This nomenclature has been chosen to facilitate the comparison with the reference
library OpenIPSL regarding the power flowing in the lines, namedwith the subindices
12 and 21. However, itmight differ from the nomenclature used in [13] and inModelica
Standard library.
Figure 3.2.1: Equivalent π circuit of a transmission line
The Lines package of the library includes three developments for the line model
according to this circuit. In the first approach, shown in Fig. 3.2.2, the model has
been built using the graphical interface of OpenModelica, by dragging the passive
components to build the circuit and connecting their ends. The parameters for the
line resistance, inductance and capacitance can be modified and expressed regarding
the line length.
In the second approach, Fig. 3.2.3, the same model has been built but this time, using
the text interface, where the equations describing the behaviour of the components are
directlywritten in this interface. The behaviour of the linemodel is the same, but in this
version, the variables and equations are explicitly defined in the line model, whereas
in the previous development, each passive component was independently defined. By
12
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
Figure 3.2.2: Diagram view for π line graphically modeled in OpenModelica
defining the behaviour of the line through equations more flexibility is obtained since
it is possible to access to each variable, but on the other hand, the independence and
modularity of the circuit components are lost. This stands out as a good example of
the different ways of working with Modelica. Fig. 3.2.3 shows the graphical interface
of OpenModelica in this case. In contrast with Fig. 3.2.2, the diagram for the model
based on equations offers no information of the line layout. To have access to this
information, it would be necessary to go through the model equations, which might be
less straight forward than directly observing the diagram.
Figure 3.2.3: Diagram view for π line modeled by equations in OpenModelica
In both these models, it has only been considered the selfreactance and admittance
of the line. The third version of the line model merely presents a modification to
include also the mutual components of the reactance by redefining the dimension of
the parameters into a matrix form.
Also, the Lines package includes a simple component called LineParameters that
enables to transform the data for the parameters into the expected units, facilitating the
13
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
comparisonwith phasor grids, where all the parameters are expressed in per unit.
Moreover, in order to calculate the value for the active and reactive power injected into
the line, e.g. P12 andQ12, the threephase voltage and current variables are transformed
into phasor form, so it is possible to use their real and imaginary components. The only
objective of this transform, performed using the function ToSpacePhasor and shown
previously in equation 3.1, is to calculate the real and imaginary components of the
apparent power injected in the line, thus the active and reactive power. However,
this calculation would not provide the actual values in an unbalanced system. For
a balanced power system, the values for the active and reactive power, P and Q, are
calculated as:
2/3 · P = vreal · ireal + vimaginary · iimaginary (3.3)
2/3 ·Q = −vreal · iimaginary + vimaginary · ireal (3.4)
This way, using the variables for the voltage and current at the sending end, −→vs and−→is
respectively, it is possible to calculate the active and reactive power injected at p, P12
and Q12, and using the voltage and current at the receiving end, −→vr and−→ir , the power
injected at n, P21 and Q21, are calculated. The same procedure to calculate the active
and reactive powerwill be further used for the calculation of power injected or absorbed
from the grid in the generator or loads models respectively, thanks to the threephase
voltage and currents exchanged in the connector in these models.
3.3 Transformers models
The Transformers package include simple models from transformers, from an ideal
transformer to more complex models including a resistor and an inductor to represent
the impedance at the primary or secondary windings. In the ideal transformer, the
voltage and current arriving at the primary end of the component are respectively
multiplied or divided by the ratio between the voltage at the primary and the secondary
windings.
14
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
3.4 Load models
In theLoads package of the developed library, three basicmodels for load are included:
RL series, RC series and RLC parallel. These three models present the same scheme
where the active and reactive power absorbed by the load is used together with the
voltage at the connection point, to calculate the value of the passive component
parameters, i.e. the value for R, L and C. This is the same scheme used in the model
for ZLoad in [11].
(a) RLC load (b) RC Load (c) RL Load
Figure 3.4.1: Load models in OpenModelica
To calculate these values, the sign criteria is established so positive values for the power
means absorbed power. Therefore, the value of the active power will be always positive
but for the reactive power, it will have a positive value for the RL load and a negative
value for the RC load. In the case of the RLC load, an ifstatement is included in the
code so when the reactive power has a positive value it will behave as a parallel RL load
and otherwise, as a parallel RC.
Another important aspect presented in the load models is the initialization of the
variables for voltage and currents. The data obtained from a previous power flow
analysis, carried out with a software different than OpenModelica, enable to obtain
the expected values for the voltage magnitude and angle at the bus, i.e. at the point
where the load is connected to the system. Thanks to these data, the initial value for
the voltage at each phase can be calculated. Then, with the values from the absorbed
power at the load from the power flow analysis, the initial values of the current are
also calculated with the equations 3.3 and 3.4. The initialization of the voltage and
current variables with the data from the power flow at the connector facilitates finding
the expected solution in steadystate when running the simulation. Depending on the
model, it can be necessary to provide the correct initial values to find any solution.
15
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
Without adequate initial values, the simulation can face problems related to numerical
stability.
This package also presents amodel for RL or Z load with voltage curtailment according
to the component developed in the OpenIPSL reference library, based on the static
load model from [15]. In this case, the voltage magnitude at the connection point
is introduced in a voltage characteristic function that enables to curtail the power
demanded by the load for low voltage values. Also, it enables to set certain parameters
to define whether constant power load characteristic, constant current or constant
admittance load characteristic is used to model the behaviour of the load. This way
it is possible to compare with one of the phasor load models included in OpenIPSL,
presented in appendix A, whose behaviour will differ otherwise, particularly in case of
an event.
3.5 Generator models
There are two generators models included in the developed EMT library, based on the
existing models from ModPowerSystems reference library and OpenIPSL.
3.5.1 ModPowerSystems generator model
In the reference library ModPowerSystems [11], in the package Generation
from the section for EMTThreePhase, it is possible to find a model called
SynchronousGenerator_FullModel whose equations describe the behaviour of a
synchronous generator according to [13]. This is a complete model that calculates
the output for the generator from the mechanical power and the value of the
excitation voltage for certain operating conditions. It models the generator behaviour
under steadystate conditions, neglecting the response to transitory events and
saturation.
The variables for voltage and current in the stator of the generator are expressed in
p.u. in the rotatory reference of the rotor, therefore in the DQ reference. The different
equations to calculate the electrical variables in the generator are also in the same
reference, enabling to distinguish between those variables in the daxis and those in
the qaxis. In order to calculate the voltage and the current variables in the stator in
the threephase stationary reference of the system, the following transformation from
16
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
[13] is performed to change the reference from the twocomponents rotatory reference
to the threephase stationary reference:
vdvq
= 2/3 ·
cos(θ) cos(θ − 2π3) cos(θ + 2π
3)
− sin(θ) − sin(θ − 2π3) − sin(θ + 2π
3)
·
vA
vB
vC
(3.5)
where vd and vq are components of the voltage in DQ reference in p.u., vA, vB and vC
the voltage components in threephase reference and θ is the rotor angle in electrical
radians, i.e. the position of the rotor at each instant regarding the stationary reference.
The values of vA, vB and vC are later changed to SI units in order to be coherent with
the rest of the components of the system. The same transformation is performed for
the currents.
Regarding the parameters for this generatormodel, such as the value of the resistances
and inductances for stator and rotor, the default parameters from ModPowerSystems
are kept in the first instance, even though they can be easily modified during the
model implementation. These default parameters refers to the example 3.2 from [13],
where the p.u.values for resistances and inductances are given for a 24 kV generator of
555MVA.
As explained for the load model, it is necessary to initialize certain variables to find
a solution when many components are involved in the simulation. For this reason,
all the variables in the model are initialized with the values for voltage and generated
power obtained thanks to a previous power flow analysis. With these values and
the set of equations for the steadystate behaviour of the generator, i.e. for constant
angular speed, the initial values are calculated and used as parameters that can be
forced to be the value of the correspondent variables at the beginning of the simulation.
Nevertheless, in most cases, these initial values are used as a mere indication to help
finding the desired solution.
Aiming at using the generator from ModPowerSystems with the minimum amount
of changes possible, the SynchronousGenerator_FullModel is extended into a new
model in the developed EMT library, called BaseSyncGen, where all the variables and
parameters are kept, but it is possible to include certain outputs blocks to monitor
certain variables. Thanks to these outputs, it will be possible to use the variables from
the generator model in the control schemes.
17
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
Even though this generator model enables to simulate simple reference grids, its
simplicity prevents a reasonable comparison with the components modeled with the
phasor paradigm from the OpenIPSL library or with those developed in other EMT
environments such as [14]. On this account, a more complex model for the generator
will be presented in the following section.
3.5.2 OpenIPSL generator model
OpenIPSL library includes several models for synchronous generators, modeled
accordingly to different references, such as [16]. The main advantage of this way of
modeling is the possibility of comparing them with the original models in these other
environments. In this sense, the implementation of OpenIPSL generatormodels in the
developed EMT library not only offers the chance of comparing them with OpenIPSL
phasor components but also with the original references. However, as previously
mentioned, the connector used in OpenIPSL components only enables simulations in
the phasor paradigm. For this reason, it is necessary to adapt the generator model
to EMT.
Among the wide range of options for the generator that could be used as a reference
for this adaptation, the focus has been set in a model for roundrotor generator called
GENROU, from [16], presented in the packageMachines from the Electrical section of
OpenIPSL library. The reason for this choice is that this is the generator used in some
of the phasor reference grids later used for the comparison with EMT.
In this case, it is not possible to extend the generator model from the original library as
with ModPowerSystems generator because further changes need to be done regarding
the reference for voltage and current in the terminals of the generator. In OpenIPSL
models, the generator is connected to the system by a specific type of connector
whose information regarding voltage and currents exchanged refers to the phasor
paradigm. In the developed model in EMT, the generator will be connected to the
system by a connector type Plug. Therefore, the stator voltage and current in DQ
reference, i.e. in the rotatory reference of the rotor, not only will need to be rotated
to the system reference, as they already are in the phasor generator model but also
transformed from a twocomponents to a threephase stationary reference. This way,
to the rotation transform already performed in the original model, shown in equation
3.6, an additional transformation as the one shown in equation 3.1 will be implemented
18
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
in the code.
vreal
vimaginary
=
cos(θ − π2) −sin(θ − π
2)
sin(θ − π2) cos(θ − π
2)
·
vdvq
(3.6)
where vd and vq are the components of the stator voltage in DQ reference, vreal and
vimaginary are the real and imaginary components of the voltage expressed in phasor
form and θ in the position of the rotor in electrical radians regarding the stationary
reference of the system. The same transform will be also performed for the stator
currents.
At this point, it is necessary to mention that in the original phasor model from
OpenIPSL, the system reference is still a rotatory reference. However, for EMT
simulation, the system reference will be stationary, so it is possible to see the variation
of the electrical variables at the system frequency. This is themain difference regarding
the generator model in phasor and EMT. The rest of the equations from GENROU
model, from OpenIPSL library, have been kept unchanged in the EMT model, making
possible the comparison between the two paradigms.
These equations are those from [16], indicating the daxis and qaxis. This is
interesting because it allows observing that these diagrams are very similar to
those presented in other EMT software, as [14], facilitating the comparison of the
performance of these components with those developed in OpenModelica.
Also in the case of this generatormodel, all the variables presented in the equations are
initialized with the values calculated for the steady state solution at certain operating
conditions. Therefore, it is necessary to perform a previous power flow analysis to
know the value of the voltage angle andmagnitude and the expected active and reactive
power generated.
Regarding the parameters for this model, in the first instance, those from the example
4.1 from [13] for a 555MVA generator are introduced, except for the values to
parameterize the saturation curve, which is included in this model. Here the default
parameters from OpenIPSL are kept. Nevertheless, all these parameters can be easily
modified for each case study.
As done for the previous case, certain output blocks are included in the generator
model so the information regarding certain outcomes such as the frequency, the speed
19
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
deviation or the voltage magnitude at the generator terminal can be used for the
control.
3.6 Control models
This package refers to the control blocks used in the control of the synchronous
generator, both for frequency and excitation voltage control. As a first approach to the
control scheme of the generator simple models were developed. Then the parameters
from more complex schemes included in the library OpenIPSL were adapted for the
parameters of the generator model.
3.6.1 Simple control models
First, for the frequency control, the model Freq_Control presents a simple control
scheme with the following behaviour:
Pm = Pref +Kgain(fref − f) (3.7)
where Pm is the mechanical power provided to the generator, Pref is the reference
mechanical power input,Kgain is a constant modeling the gain of the controller, fref is
the reference frequency, generally the system frequency, and f is the actual frequency
value at the generator windings. Kgainwill set the dynamics of the frequency controller,
and as the first approach, it has been set as Pnom/30.2
, being Pnom the nominal power of the
machine inW and 0.2 a threshold for the frequency deviation. Since Pnom is expressed
in W, also the mechanical power reference should be introduced in W.
According to the equation 3.7, if the frequency of the currents in the stator of the
generator is higher than the system frequency, there will be a reduction of the
mechanical power introduced as an input to the generator regarding the reference
power, aiming at reducing the electrical speed of the current. Therefore, this simple
scheme allows stopping the frequency drop when there is a variation of the charge or
the generation in the system.
Regarding the excitation voltage control, in a first step of the development of the
library, Proportional Integral (PI) control blocks for Modelica Standard Library
were implemented by adjusting the parameters according to those of the generator.
20
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
(a) Icon view (b) Diagram view
Figure 3.6.1: Frequency control block in OpenModelica
However, the behaviour achieved by implementing this type of controller is very
limited and the response obtained differs from the expected values. For this reason,
a more specific control scheme was developed. This is the IEEE AC4A exciter control
model, from [13]. This model has been implemented in OpenModelica using certain
blocks from OpenIPSL library to model the behaviour, such as a simple lagging with
limiter.
The type AC4A exciter model represents an alternatorsupplied controlledrectifier
excitation system whose parameters have been determined according to the sample
data for the exciter and regulator from [13]. Therefore, to evaluate the response of the
generator model developed, the time constant of the controller, TA will be set in 0.04s
and the overall gain KA, in 200. Since the load compensator will not be used in this
case, the voltage at the terminal of the generator will be the input of the exciter control
model, whereas the voltage reference will be calculated as:
VR = Efd/KA (3.8)
whereVR is the voltage reference in p.u.,KA the overall gain andEfd the reference value
of the field voltage in steadystate in nonreciprocal p.u. system, for a certain operation
point [13]. The output of this scheme will be the value of the excitation voltage in non
reciprocal p.u. that will be introduced as an input for the generator, with the pertinent
adjustment of p.u. system if necessary.
The development of these simple control models enables to include both control loops,
21
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
Figure 3.6.2: AC4A control model
for the frequency and for the exciter, in the generator models previously presented.
This stands as a first step in the development of a generator model in EMT that allows
the comparison between phasor and EMT simulation in OpenModelica and also with
other EMT environment. Fig. 3.6.3 shows the complete model of a generator type
GENROU, with Freq_Control and AC4A exciter control loops. For the first loop, the
mechanical power in steadystate and the frequency of the stator currents are the
output of the generator model and the input for the control, whereas, for the second
control loop, the value of themagnitudeRMS linetoline voltage at the terminals of the
generator together with the field voltage in steadystate are the inputs for the control
model.
Figure 3.6.3: Generatormodel with simple frequency control and AC4A exciter control
22
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
3.6.2 Implementation of control models for comparison
The second step toward the comparison both with phasor and with other EMT
environments is the implementation of controlmodels that present the samebehaviour
of those in phasor or in EMT. At this point, it becomes interesting to use those control
blocks already developed in OpenIPSL library and adapt their parameters, since they
are not exclusively modeled for phasor simulation.
First, for the frequency control, the simplest steam turbine models found in OpenIPSL
library have been studied and their parameters have been adapted for the generator
model. These are the Turbinegovernor model (TGOV1) and the IEEE governor model
(IEESGO), developed according to [17]. The overall gain in both cases has been
adjusted to be Pnom/30.2
as in the simpler frequency control model. However, when
working in p.u., Pnom is considered as 1 p.u.
(a) TGOV1
(b) IEESGO
Figure 3.6.4: Steam turbine models from OpenIPSL library
Then, for the excitation voltage control, the parameters for the model Simplified
excitation system model, developed in OpenIPSL according to [16], have been
modified to represent the same behaviour as the simple model previously described.
The Simplified excitation system model is particularly useful when the excitation
system must be represented but its detailed design is not known, and it has been
23
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
already implemented in some phasor grid designs in OpenIPSL reference.
Figure 3.6.5: Simplified excitation system model
Finally, an additional exciter control model has been developed to be able to compare
with other EMT environments. In this case, the software used for this comparison will
be Hypersim, which allows to simulate complex grid models in EMT formalism [14],
[18]. The proposed control scheme is similar to the one shown in Fig. 3.6.2 and the
parameters have been modified to represent the same behaviour, but its design allows
a direct comparison with the generator in Hypersim [14], which include an internal
excitation voltage control with the same scheme.
Figure 3.6.6: Exciter control adapted from Hypersim
The implementation of these control models together with the developed generator
model allows having different options and combination for the simulation of EMT
grids. Regarding the comparisonwith the phasormodel, the generation scheme shown
in Fig. 3.6.7a stands out as the most interesting, whereas for the comparison with
other EMT software, the one in Fig. 3.6.7b will be generally preferred. However,
24
CHAPTER 3. DEVELOPED EMT LIBRARY IN OPENMODELICA
the parameters in both cases have been modified to represent the same behaviour,
therefore the solution of the simulation in steadystate will be the same.
(a) IEESGO and simplified excitation system control
(b) TGOV1 and exciter adapted from Hypersim control
Figure 3.6.7: Generator model with different control combinations
25
Chapter 4
Reference grid: 3buses
The case study used to evaluate the performance of the developed components is a
simple grid with 3 buses and 3 transmission lines connecting one generator and one
RLC Load to an infinite bus as seen in Fig. 4.0.1. The utilization of this case study
is motivated by its simplicity, since it allows observing the behaviour of most of the
component developed, interacting in a simple grid.
In this case, system base power has been set in 100MVA and the system frequency to
50Hz. The base voltage at the transmission level is 138 kV, whereas for the generator,
connected to bus 2 through an ideal transformer, it is 24 kV. Table 4.0.1 shows voltage
magnitude and angle at each bus together with the power exchanged with the grid in
this bus, obtained from a power flow analysis performed in Hypersim. These values
are used to initialize the different components. Notice that positive values for active
and reactive power stand for the power injected in the bus.
Table 4.0.1: Power flow data for 3buses case study
BUS V[pu] angle[°] P[MW] Q[MVar]
1 1 0 308 81
2 1.05 2.07 200 267
3 0.98 8.79 500 100
Table 4.0.2 present data for reactances of the lines, modeled according to the π
equivalent with zero value for the shunt admittance. The values for R and X are the
same for lines 12 and 13 and differs in the case of line 13. Since the data for the
reactances are presented in per unit, a small block called LineParameters has been
26
CHAPTER 4. REFERENCE GRID: 3BUSES
included in the model to calculate the values in SI units by using the base values for
voltage and power. Table 4.0.2 also shows the power injected at each end of the line,
where P12 and Q12 stand for the power injected at one end of the line whereas P21 and
Q21 for the power injected at the opposite end. For example, for line 23, P12 is the
power injected into the end connected to bus 2 flowing towards bus 3 and P21 is the
power injected into the end connected to 3, flowing towards 2. Notice that the naming
convention 12 has also been used for the name of line 12.
Table 4.0.2: Lines reactances and power exchanged
LINE 12 13 23
R [pu] 0.0047 0.0062 0.0047
X [pu] 0.0474 0.0632 0.0474
P12 [MW] 69 239 268
P21 [MW] 68 236 264
Q12 [MVAr] 111 29 148
Q21 [MVAr] 119 7 107
Figure 4.0.1: 3buses grid in OpenModelica
27
Chapter 5
Validation of results
To validate the performance of the models for the different components developed in
OpenModelica, a comparison with the phasor reference grid in this environment and
with other EMTbased environments will be performed. First, the comparison will be
established for steadystate values, where the deviation between certain variables and
the original power flow values used for their initialization will be measured. Second,
the response to fault events will be also studied.
5.1 Deviation from reference values in steadystate
First step in the validation of the components developed in OpenModelica will be
the comparison of the solution reached in steadystate with other EMT simulation
environments and with phasor simulation. The achievement of the same values in
steadystate in the EMT simulation in OpenModelica will allow to verify the proper
behaviour of the different components.
5.1.1 Comparison with EMT reference
The 3buses case study shown in Fig. 4.0.1 will be simulated in Hypersim and
OpenModelica. The control schemes used for the generator will be those of Fig. 3.6.7b
and the parameters, shown in B.1, will be the same in both cases to validate the results.
Once the simulation reaches the steadystate values, these will be gathered and the
error between themwill be calculated according to equation 5.1, whereXHypersim are the
values obtained in Hypersim, used as a reference, and XEMT1 are the values obtained
28
CHAPTER 5. VALIDATION OF RESULTS
from simulation with OpenModelica. These reference values are used to initialize the
different components in the OpenModelica simulation, therefore, the error obtained
allows to measure the final deviation from the desired solution.
errorX [%] =XHypersim −XEMT1
XHypersim
· 100 (5.1)
Table 5.1.1: Deviation from Hypersim in steadystate for 3buses case study in EMT
BUS errorV [%] errorangle[%] errorP [%] errorQ[%]
1 0 0 0.66 1.33
2 0.02 1.21 0 0.07
3 0.04 0.47 0.33 0.33
In order to validate the behaviour of the model, Fig. 5.1.1 presents the values for phase
A of the threephase current flowing into each of the lines of the grid. The similarities
for the values in a certain instant of the EMT simulation allow validating the behaviour
of the developed components in a steadystate.
Figure 5.1.1: Comparison between Hypersim and OpenModelica of currents flowinginto the lines in steadystate for 3buses reference grid
5.1.2 Comparison with phasor reference
In this section, a similar comparison has been established to compare the performance
in EMT of the 3buses reference grid with the phasor simulation in OpenModelica.
29
CHAPTER 5. VALIDATION OF RESULTS
To be able to compare with the phasor model of the reference grid, the model from
Fig. 4.0.1 has been simplified by removing the transformer between the generator and
bus 2. This change ismotivated by the absence of the transformer in the phasor version
of the grid, where all the variables are expressed in per unit formalism. Also, for this
comparison, the generator model has been changed and the control blocks shown in
Fig. 3.6.7a have been used, also with the default parameters.
Once the simulation of the 3buses reference grid in phasor formalism and in EMT in
OpenModelica has reached the steadystate, the values obtained are evaluated. With
this purpose, the error between these values has been calculated as:
errorX [%] =Xphasor −XEMT2
Xphasor
· 100 (5.2)
where Xphasor are the values from the phasor simulation and XETM2 the values from
the EMT simulation, which slightly differ fromXETM1 because of the different control
blocks employed. The results are shown in table 5.1.2.
Table 5.1.2: Deviation from phasor simulation in in steadystate for 3buses EMTsimulation in OpenModelica
BUS errorV [%] errorangle[%] errorP [%] errorQ[%]
1 0 0 0.30 0.41
2 0.01 0.52 0 0.25
3 0 0.22 0.18 0.01
In this case, due to the difficulty of comparing voltage and current expressed in phasor
and EMT formalism, table 4.0.1 shows the deviation in the power injected into the lines
in the EMT simulation regarding the flow in the phasor simulation.
Table 5.1.3: Deviation in power injected into the lines in steadystate for 3buses casestudy in EMT in OpenModelica
Line errorP12[%] errorP21[%] errorQ12[%] errorQ21[%]
12 0.57 0.57 0.29 0.32
13 0.21 0.21 0.03 2.18
23 0.14 0.14 0.19 0.16
The low values obtained for the errors, both in tables 5.1.2 and 5.1.3 allow to validate
the performance of the EMT simulation. In the case of the power injected into the lines,
30
CHAPTER 5. VALIDATION OF RESULTS
since the error values presented in table 5.1.3 are kept constant at both ends of the line
for the active power, these results could lead to think that the main differences found
between the phasor and the EMT solution come from the behaviour of the inductive
part of the transmission line, since there is a slight difference in the consumption of
reactive power in the lines. This difference ismore noticeable in the case of the reactive
power injected in line13 flowing from bus 3 to 1, Q31, since the calculated values stand
for the relative error. The magnitude of the deviation in absolute terms for Q31 does
not represent a significant deviation regarding other lines, but due to the low value
expected for Q31, of 7.62MVAr in the phasor simulation, the value obtained for the
error is significantly higher in this case.
5.2 Response to load loss
Aiming at evaluating the behaviour of the developed components in case of load loss,
the reference grid from Fig. 4.0.1 is modified to introduce a fault event. The RLC load
connected to bus 3 is split into two parallel RLC loads and half of the original active
and reactive power is demanded to each. After 10 sec of simulation, the second load is
disconnected, thus the values of the total load connected to bus 3 are halved.
5.2.1 Comparison with EMT reference
For the comparison with the EMT reference, the simulation is performed in Hypersim
and OpenModelica, where the generator from Fig. 3.6.7b is used keeping the same
parameters as in section 5.1.1. Fig. 5.2.1 shows the comparison of the results obtained
for phase A of the threephase current flowing into the lines when the event occurs.
The choice of showing the currents flowing into the lines is motivated by the need of
studying the response to the event at different parts of the system, not to be influenced
by the behaviour of any component in particular. At this point, it has been assumed that
if the power flowing into the lines is the same both in Hypersim and in OpenModelica
simulations, it is because the components connected at the ends of these lines present
a similar behaviour when the fault occurs.
Nevertheless, these results allow observing that even though the control schemes and
the parameters used in both simulations are the same, there are still some differences
in the response to the event. It seems that the response obtained from Hypersim
31
CHAPTER 5. VALIDATION OF RESULTS
Figure 5.2.1: Comparison of current flowing into the lines in Hypersim andOpenModelica when the fault occurs
simulation is slower than the response from OpenModelica. However, there are major
difficulties when it comes to find the source of these differences due to the lack of
information from the models and the variables obtained from Hypersim since the
modeling paradigm is not as accessible as in OpenModelica.
5.2.2 Comparison with phasor reference
The same simulation is now performed with the phasor model, where the same
modifications have been implemented in the load. In this case, to compare between the
simulation in phasor and EMT in OpenModelica, the generator model from Fig. 3.6.7a
is utilized. The parameters for the control blocks are those presented in B.1.
The objective of this comparison is to observe the differences in the information
obtained from the phasor and the EMT simulation of OpenModelica, not only to
validate the developed components. For this reason, Fig. 5.2.2 presents the values,
both in phasor and in EMT formalism of the current flowing into the remaining load
when the fault occurs.
Results show the transient behaviour for the EMT simulation. The values
reached during the event are not noticeable in the phasor simulation, which might
hinder the detection of the fault by protection systems when simulating in phasor
formalism.
32
CHAPTER 5. VALIDATION OF RESULTS
Figure 5.2.2: Comparison of the current into the the remaining load in phasor and inEMT simulation in OpenModelica when the fault occurs
5.3 Response to disconnection from the system
A third case study has been implemented to validate the results. In this case, the
response in EMT of the 3buses reference grid when the infinite bus is disconnected
will be evaluated to study the response to fault events.
5.3.1 Comparison with EMT reference
First, the comparison will be established between Hypersim and OpenModelica. The
grid from Fig. 4.0.1 will be modified to include a breaker between the infinite bus and
bus 1, that will open after 10 sec of simulation. The disconnection of the infinite bus
represents a more severe fault since not only larger values of exchanged power will be
affected, but also the reference for the system frequency will be lost. For this reason,
the value for the controller gain, R, will be set in 0.005, to ensure the restoration of the
steadystate after the event. Except for this, the default parameters will be used with
the generator from Fig. 3.6.7b.
Fig. 5.3.1 shows the comparison between the results obtained with Hypersim and
OpenModelica simulation, in EMT formalism. As in section 5.2.1, the values of the
power flowing into the lines allow validating the response to the event in different parts
of the system. In this case, the response to the event in Hypersim is also noticeable,
33
CHAPTER 5. VALIDATION OF RESULTS
especially in line 12, presenting the higher power flow of the lines connected to the
affected bus.
Figure 5.3.1: Comparison of current flowing into the lines in Hypersim andOpenModelica when the fault occurs
5.3.2 Comparison with phasor reference
The response to the same situation in phasor and EMT has been also compared in
OpenModelica. The breaker has been implemented in the phasor reference grid,
between the infinite bus and bus 1 and it will open after 10 sec of simulation. The
generatormodel will be the one presented in Fig. 3.6.7a with default parameters except
forK1, set in 200 because of the reasons previously stated.
The differences in the transient behaviour between phasor and in EMT are presented
in Fig. 5.3.2, which shows the value of the voltage at bus 1 at the moment of the event.
Regarding the previous fault simulated, where the total load connected to the system
was halved, it can be observed that the peak reached in this case is more pronounced
due to the increased severity of the faulty event. However, the normal behaviour of the
voltage is rapidly restored and a new steadystate is achieved after a few seconds.
Moreover, since the generatormodel and the parameters for the controller are the same
both in phasor and in EMT, the frequency drop when the system frequency reference
from the infinite bus is lost will be the same, and the system frequency will be restored
to the same value. Fig. 5.3.3 presents the value of the frequency in the grid before and
34
CHAPTER 5. VALIDATION OF RESULTS
Figure 5.3.2: Comparison of voltage at the bus connected to the infinite bus in phasorand in EMT simulation in OpenModelica when the fault occurs
after the event, computed in the terminals of the generator.
Figure 5.3.3: Comparison of frequency drop in phasor and in EMT simulation in 3buses reference grid when the infinite bus is disconnected
Itmight be interesting to observe how the change in the system frequency can affect the
results provided by the phasor simulation. As mentioned in section 3.5.2, the values
for steadystate voltage and currents in OpenIPSL phasor models are expressed in a
rotatory reference, rotating at the theoretical angular speed of the system. When the
35
CHAPTER 5. VALIDATION OF RESULTS
system frequency changes, a difference might appear between the rotating speed of
the variables in the system and the rotating reference in which they are expressed.
The voltage and currents in the system in phasor formalism, are no longer a constant,
but they vary according to the difference between the original frequency and the value
reached after the event. One of the consequences of this circumstance is that the
values calculated for the voltage phase at the buses are no longer reliable. In contrast,
the results obtained from the EMT simulation are not affected by this change in the
rotating reference of the system since they are expressed in a stationary reference and
the angular speed leading their variation is computed considering this reference. The
frequency drop only emphasizes the need for the development ofmeasuring techniques
andmodels for the phase voltage at the buses. In the presented case studies, the system
frequency value was assumed constant for the approximated measure. In this case,
since the frequency value presents a certain variation, this assumption of constant
frequency used to compute the angle when measuring might induce certain error in
the results.
Fig. 5.3.4 presents the values for the real and imaginary components of the voltage at
the buses in the phasor simulation of the 3buses reference grid when the infinite bus
is disconnected after 10 sec of simulation. The mentioned variation can be observed
after the event.
Figure 5.3.4: Real and imaginary components of the voltage at the buses in phasorsimulation of 3buses reference grid
36
Chapter 6
Conclusions
6.1 Discussion on the results
After evaluating the results obtained from the simulation of the reference grids
built with the components developed in EMT formalism in OpenModelica, some
conclusions can be drawn:
• The results obtained from the comparison of the same reference grids simulated
in other EMT software, Hypersim in this case, allow the validation of the
behaviour of the developed components in OpenModelica.
• Unlike other software, the development of components in OpenModelica enable
to have access to the equations that model the behaviour of the system,
facilitating its understanding. The main difficulties when building components
and grids for comparison is to reproduce the models used by other software,
whose code is not as accessible as in OpenModelica. This can be an obstacle to
direct comparison of results.
• The values obtained from the power flow analysis, performed in an environment
different fromOpenModelica, have a significant impact on the results, since they
are used for the initialization of the simulation.
• The simulation in EMT formalism enable to obtain more information on the
transient performance regarding the simulation in phasor formalism, being
particularly interesting in the case of an event. To this extent, the components
created in the scope of the EMT library developed in OpenModelica can be
37
CHAPTER 6. CONCLUSIONS
implemented to study the behaviour of the system in faulty situations with a
satisfactory outcome.
• Also, for steadystate simulation, the simulation in EMT provides more
information on the behaviour of the model. The lack of information procured
in phasor formalism might present some difficulties when creating models for
comparison. This is due to the large number of simplifications encountered
in the phasor models, which might become inconvenient specially when trying
to reproduce the same model in other EMT environments different from
OpenModelica.
• The direct comparison with the simulation of the reference grids developed in
phasor presents certain difficultieswhen it comes to the validation of results since
the outcome is presented in a different formalism.
6.2 Identified difficulties
As previously discussed, one of the main drawbacks of working with OpenModelica
is that the results from the simulations are highly dependable on the values used
for initialization. This circumstance, together with the lack of tools to perform a
power flow analysis directly in OpenModelica, bring up the need of using the support
of other environments. This stands as a major difficulty found when working with
OpenModelica.
The development of models in OpenModelica has also been influenced by the lack
of references available when it comes to specific errors than can appear during the
compilation and simulation process. In this sense, the identification of the source of
these errors can become problematic and in some cases, such identification stands also
as an outcome of this project, regarding future OpenModelica users.
Additionally, working with OpenModelica, either to create new components or to build
new models with the existing libraries present certain challenges associated with the
opensource paradigm. The opensource platform enables the exchange of models and
facilitates access to numerous resources. But at the same time, it can hinder the dayto
day development due to compatibility issues when combining resources at a different
stage of development. This has been other of the main difficulties found.
38
CHAPTER 6. CONCLUSIONS
In conclusion, OpenModelica stands as an interesting tool for power system simulation
and there is certainly room for the development of models in EMT. However, it needs
the support of solid references in other environments and, in thewriter’s opinion, there
is a long way to go andmuch development to do before its use can be generalized.
6.3 Future work
In the short term, it would be interesting to work in the development of components
that facilitate the comparison with phasor models, such as voltage angle measurement
devices in EMT. Also, the creation of different transmission linemodels based on other
theoretical developments could probably improve the validation of the results.
Finally, the development of interfaces that allow to include components and controls
for the integration of HVDC grids in the existing EMT reference grid could be definitely
the next step in the research presented in this project.
39
Bibliography
[1] Haddadi, Aboutaleb and Mahseredjian, J. “Power system test cases for EMT
type simulation studies”. In: CIGRE, Paris, France, Tech. Rep. CIGRE WG C 4
(2018), pp. 1–142.
[2] Mahseredjian, Jean,Dinavahi, Venkata, andMartinez, JuanA. “Simulation tools
for electromagnetic transients in power systems: Overview and challenges”. In:
IEEE Transactions on Power Delivery 24.3 (2009), pp. 1657–1669.
[3] Masoom, Alireza, OuldBachir, Tarek, Mahseredjian, Jean, Guironnet, Adrien,
andDing, Ni. “Simulation of electromagnetic transients withModelica, accuracy
and performance assessment for transmission line models”. In: Electric Power
Systems Research 189 (2020), p. 106799. ISSN: 03787796.
[4] Fritzson, Peter and Engelson, Vadim. “Modelica—A unified objectoriented
language for system modeling and simulation”. In: European Conference on
ObjectOriented Programming. Springer. 1998, pp. 67–90.
[5] Fritzson, Peter and Bunus, Peter. “Modelicaa general objectoriented language
for continuous and discreteevent system modeling and simulation”. In:
Proceedings 35th Annual Simulation Symposium. SS 2002. IEEE. 2002,
pp. 365–380.
[6] Guironnet, Adrien, Saugier, Marianne, Petitrenaud, Sébastien, Xavier, Florent,
and Panciatici, Patrick. “Towards an opensource solution using Modelica for
timedomain simulation of power systems”. In: 2018 IEEE PES Innovative
Smart Grid Technologies Conference Europe (ISGTEurope). IEEE. 2018,
pp. 1–6.
[7] Modelica Standard Library. User’s Guide. Modelica Association. 2018. URL:
https://doc.modelica.org/om/Modelica.html.
40
BIBLIOGRAPHY
[8] Zhang, Mengjia, Baudette, Maxime, Lavenius, Jan, Løvlund, Stig, and Vanfretti,
Luigi. “Modelica implementation and softwaretosoftware validation of power
system component models commonly used by nordic TSOs for dynamic
simulations”. In: Proceedings of the 56th Conference on Simulation and
Modelling (SIMS 56), October, 79, 2015, Linköping University, Sweden. 119.
Linköping University Electronic Press. 2015, pp. 105–112. URL: https://www.
diva-portal.org/smash/get/diva2:970541/FULLTEXT01.pdf#page=105.
[9] Winkler, Dietmar. “Electrical power system modelling in modelica–comparing
opensource library options”. In: (2017). URL: https : / / openarchive .
usn . no / usn - xmlui / bitstream / handle / 11250 / 2466981 /
2017WinklerElectricalpower.pdf?sequence=2&isAllowed=y.
[10] Baudette, Maxime, Castro, Marcelo, Rabuzin, Tin, Lavenius, Jan, Bogodorova,
Tetiana, andVanfretti, Luigi. “OpenIPSL: Openinstance power system library—
update 1.5 to “iTesla power systems library (iPSL): Amodelica library for phasor
timedomain simulations””. In: SoftwareX 7 (2018), pp. 34–36. URL: https:
//www.sciencedirect.com/science/article/pii/S2352711018300050.
[11] URL: https://www.fein-aachen.org/en/projects/modpowersystems/.
[12] Mirz, Markus, Netze, Linus, and Monti, Antonello. “A multilevel approach to
power system modelica models”. In: 2016 IEEE 17th workshop on control and
modeling for power electronics (COMPEL). IEEE. 2016, pp. 1–7.
[13] Kundur, P. Power System Stability And Control. EPRI power system
engineering series. McGrawHill, 1994. ISBN: 9780070635159.
[14] Hypersim Reference Guide Manual. OpalRT Technology, HydroQuebec. URL:
https://www.opal-rt.com/systems-hypersim/.
[15] PSSE™ 30 Users Manual. Siemens Industry, Inc. Aug. 2004.
[16] PSSE 33.9 Program Application Guide. Siemens Industry, Inc. May 2016.
[17] Dynamic Models for TurbineGovernors in Power System Studies. Tech. rep.
Jan. 2013.
[18] URL: https://www.opal-rt.com/systems-hypersim/.
[19] PSSE 33.10 Program Operation Manual. Siemens Industry, Inc. Apr. 2017.
41
Appendix Contents
A PSSE load model 43
B Generator control parameters 47B.1 Turbinegovernor control default parameters . . . . . . . . . . . . . . . 47B.2 Exciter system control default parameters . . . . . . . . . . . . . . . . . 47
C Reference grid: Kundur twoareas 49C.1 Description of the grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49C.2 Study of the deviation from reference values in steadystate . . . . . . 50
C.2.1 Comparison with EMT reference . . . . . . . . . . . . . . . . . . 50C.2.2 Comparison with phasor reference . . . . . . . . . . . . . . . . . 51
42
Appendix A
PSSE load model
In order to be able to compare with the phasor models developed with OpenIPSL,
one of the load models have been studied and adapted to EMT in particular the static
load model PSSE Load found within the models of OpenIPSL library, as part of the
OpenIPSL.Electrical.Loads.PSSE library. As suggested by its name, the loads classes
here gathered, aremodelled according to the static loadmodel developed by PSSE [19].
PSSE main load model is based on the polynomial or ZIP model, that describes the
voltage dependency of the model by a second order polynomial equation [13]:
SZIP = S0 · (sZ · V2
V02 + sI ·
V
V0
+ sP ) (A.1)
In this model, the power is obtained from the composition of constant impedance,
constant current and constant power components, being sZ , sI , and sP the coefficients
that define the proportion of each component, V the bus voltage and V0 and S0 the
voltage and the apparent power at initial conditions respectively. Thisway ofmodelling
the load according to these three components, responds to the need to represent the
load as an aggregate of constant power, constant current and constant impedance
characteristics for higher accuracy of the modelling.
Similarly, in PSSE, each load can be a composition of loads with three different
characteristics, being these constant power load characteristic, constant current load
characteristic and constant admittance load characteristic. The constant power load
characteristic assumes a constant value for the load power for voltage values over a
43
APPENDIX A. PSSE LOADMODEL
certain parameter, PQBRAK, whose default value is generally set at 0.7 p.u. [19]. For
voltages below this value, the constant power load component switches to elliptical
currentvoltage characteristic.
Figure A.0.1: Constant Power Load Characteristic [19]
Likewise, the constant current load characteristic considers a constant value for
the current for voltage values above 0.5 p.u, assuming an elliptical currentvoltage
characteristic for voltage values under this threshold. As for the constant admittance
load characteristic, the value of the admittance is considered as constant regardless the
value of the voltage.
Based on these considerations, it is possible to model the load as:
S = SY · V 2 +KI · SI · V +KP · SP (A.2)
WhereSY ,SI andSP are the load components associated to the impedance, current and
power respectively, V is the bus voltage andKI andKP are two coefficients depending
on the voltage value. According to the load characteristics previously presented, KI
will be equal to 1 when the voltage is higher than 0.5 p.u., whereas KP will be 1 when
the voltage is over PQBRAK. Below these values, these coefficients are adjusted to the
correspondent elliptical currentvoltage characteristic.
44
APPENDIX A. PSSE LOADMODEL
Figure A.0.2: Constant Current Load Characteristic [19]
According to the PSSE model presented, each load component is built from the initial
constant power, current or admittance load in addition to a certain load transfer
occurred when the power flow is established, due to the voltage dependency of the
load [15]. This transfer is presented as a conversion process in PSSE where constant
power load is reassigned as constant current or constant admittance load.
Therefore, being Sp the consumption of original constant power load, Si the
consumption of original constant current load, Sy the consumption of original constant
shunt admittance load, a the load transfer fraction for constant current load, b the
load transfer fraction for constant shunt admittance load, it is possible to express the
different load components as:
SP = Sp · (1− a− b) (A.3)
SI = Si + a · Sp
V0
(A.4)
SY = Sy + b · Sp
V02 (A.5)
Equations (A.3)(A.5) can be combined with equation A.2 to obtain the value of the
load, S, as a function of the bus voltage, V, the initial value of the bus voltage, V0,
45
APPENDIX A. PSSE LOADMODEL
Figure A.0.3: Reallocation of constant power load [15]
and the data for Sp, Si, Sy. In the case of the reference model, KundurTwoAreas, the
consumption of original constant current load, Si, and the consumption of original
constant shunt admittance load, Sy, can be set to 0, whereas the values for Sp and V0
can be obtained from the power flow previously performed. The rest of the parameters
present in the equations are established in the model.
46
Appendix B
Generator control parameters
B.1 Turbinegovernor control default parameters
Tables B.1.1 and B.1.2 present the parameters for TGOV1 and IEESGO control blocks
used for the comparison with Hypersim and phasor simulation respectively.
Parameter Description Value
R Governor gain, 1/R [pu] 0.6
Dt Speed drop [pu] 1
T1 Control time constant [s] 0.12
T2 Control time constant [s] 0
T3 Control time constant [s] 0
VMAX Max. valve position [pu] 1
VMIN Min. valve position [pu] 0
Table B.1.1: TGOV1
B.2 Exciter system control default parameters
Tables B.2.1 and B.2.2 show the parameters for the exciter control adapted from
Hypersim and the simplified excitation system model used for the comparison with
Hypersim and phasor simulation respectively.
47
APPENDIX B. GENERATOR CONTROL PARAMETERS
Parameter Description Value
K1 Governor gain, 1/pu regulation 1.667
K2 Fraction [pu] 0
K3 Fraction [pu] 0
T1 Controller lag [s] 0
T2 Controller lead compensation [s] 0
T3 Governor lag [s] 0
T4 Control time constant [s] 0.12
T5 Reheater delay [s] 0
T6 Turbine delay [s] 0
PMAX Upper power limit [pu] 10
PMIN Lower power limit [pu] 10
Table B.1.2: IEESGO
Parameter Description Value
Kr Voltage measurement gain [pu] 1
Tr Voltage measurement time constant [s] 0
Ka Voltage regulator gain [pu] 200
Ta Voltage regulator time constant [s] 8
Kf Damping filter feedback gain [pu] 0
Tf Damping filter feedback time constant [s] 1
VMAX Max. limit for excitation voltage [pu] 5.64
VMIN Min. limit for excitation voltage [pu] 4.53
Table B.2.1: Exciter control adapted from Hypersim
Parameter Description Value
K Governor gain [pu] 200
T Lag time constant [s] 0.04
T1 Control time constant [s] 1
T2 Control time constant [s] 12
VMAX Max. limit for excitation voltage [pu] 5.64
VMIN Min. limit for excitation voltage [pu] 4.53
Table B.2.2: Simplified excitation system
48
Appendix C
Reference grid: Kundur twoareas
C.1 Description of the grid
In this chapter a second reference grid, more complex the the 3buses reference, is
presented. This second case study is the simple twoareas system presented in the Fig.
E12.8 from [13]. This model has been previously developed in phasor formalism in
the scope of OpenIPSL, thus using the components included in this library. Regarding
the system from [13], the phasor model presents some simplifications, mostly derived
from the development of all the components in per unit formalism. Table C.1.1 shows
the power flow data used in the phasor model for initialization. For the value of power
exchanged at each bus, positive values stand for power injected into the grid at the
bus.
To be able to compare the Kundur twoareas system in phasor and in EMT in
OpenModelica, an equivalent model is implemented in this environment using the
components from the developed EMT library. This model, shown in figure Fig. C.1.1
presents the same simplifications than the phasor version and the parameters have
been kept unchanged, but calculated in SI units.
Figure C.1.1: EMT Kundur twoareas reference grid in OpenModelica
49
APPENDIX C. REFERENCE GRID: KUNDUR TWOAREAS
Table C.1.1: Power flow data for Kundur Two Areas reference grid
BUS V[pu] angle[°] P[MW] Q[MVar]
1 1.03 20.27 700 185.03
2 1.01 10.51 700 234.61
3 1.03 6.8 719.09 176.03
4 1.01 16.99 700 202.08
5 1.01 13.78
6 0.98 3.71
7 0.96 4.69 967 84.7
8 0.95 18.51
9 0.97 32.15 1767 230.2
10 0.98 23.71
11 1.01 13.41
The main difference between Kundur twoareas model in phasor and in EMT are load
components, since in the EMT version these aremodeled as RLC load but in the phasor
version, a more complex model is used, presented in appendix A.
C.2 Study of the deviation from reference values in
steadystate
C.2.1 Comparison with EMT reference
As presented for the 3buses reference grid, a comparison will be established between
Kundur twoareas reference grid simulated in Hypersim and in OpenModelica. In
order to validate the results, the grid will be implemented in Hypersim with the same
simplifications, data and parameters than the model in OpenModelica. The generator
scheme from Fig.3.6.7b will be used for the four generators in the model, keeping the
default values for all the parameters except for the governor gain, R, that will be set
in 0.005. The choice of a stronger response for the frequency controller is motivated
by the lack of infinite bus in this case study. The deviation of the values of the EMT
simulation in OpenModelica in steadystate regarding the power flow values from
Hypersim are computed using equation 5.1 and shown in table C.2.1.
50
APPENDIX C. REFERENCE GRID: KUNDUR TWOAREAS
Table C.2.1: Error in steadystate values for Kundur twoareas reference grid EMTsimulation in OpenModelica
BUS errorV [%] errorangle[%] errorP [%] errorQ[%]
1 0.12 0.21 1.19 1.26
2 0.24 1.24 1.45 4.15
3 0.16 6.54 1.13 1.13
4 0.30 3.24 1.50 4.76
5 0.19 0.78
6 0.10 5.16
7 0.08 7.19 0.78 0.78
8 0.05 2.81
9 0.11 2.21 0.83 0.83
10 0.13 2.60
11 0.15 4.03
Figure C.2.1: Comparison between Hypersim and OpenModelica of currents flowinginto the lines in steadystate for Kundur twoareas reference grid
C.2.2 Comparison with phasor reference
The deviation between the values obtained in steadystate in phasor and EMT
simulation has been also computed for Kundur twoareas reference grid. In this case,
the generator control presented in 3.6.7a has been implemented for all the generators
in the system, both for the phasor simulation and for the EMT. The default parameters
have been kept unchanged except for the controller gain,K_1, that has been set to 200
51
APPENDIX C. REFERENCE GRID: KUNDUR TWOAREAS
for the reason stated in section 5.1.1. Once the simulation reaches the steadystate, the
error in computed according to equation 5.2.
Table C.2.2: Deviation from phasor simulation in in steadystate for Kundur twoareasEMT simulation in OpenModelica
BUS errorV [%] errorangle[%] errorP [%] errorQ[%]
1 0.01 2.35 1.12 2.14
2 0.70 5.74 0.69 4.69
3 0.72 6.94 1.02 2.56
4 0.75 3.52 0.43 6.06
5 0.13 3.94
6 0.31 17.03
7 0.14 14.43 0.78 0.78
8 0.33 3.69
9 0.28 1.97 0.83 0.83
10 0.49 2.61
11 0.63 3.94
It can be observed that the error values obtained from the comparison between phasor
and EMT simulation in steadystate, are higher for Kundur twoareas reference grid
than for the 3buses reference grid. These differences can be due to several reasons.
First, Kundur twoareas reference grid is larger than the 3buses grid and more
components have been implemented. If the behaviour of any of this components
slightly differs from the expected, the error can be propagated and become noticeable
in different parts of the system.
Second, Kundur twoareas grid does not include a component for infinite bus, thus
the system frequency is not externally set. Even if the turbinegovernor gain has been
strengthen, there is a slight deviation from the system reference frequency, whereas
in the 3buses case there was not such deviation. Therefore, the measurement of the
voltage angle in the buses might present some error, as shown in table C.2.2. The
values for the error in the angle in buses 6 and 7 are the highest, being for 3 and 4
also significant. These values are higher for these buses because the error computed
in table C.2.2 is the relative error, but when calculating the absolute deviation it can
be observed that the deviation in the voltage angle at the buses is always around 0.6°.
This deviation is more noticeable in the case of low values for the angles, as in buses 6
and 7, where the expected value for the angles is 3.71° and 4.69° respectively.
52
www.kth.se
TRITA-EECS-EX-2021:109
top related