Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack bus in EPF equivalent to a pair Reference bus + Generator in Dynamic simulation #132

Open
AndreaBartolini opened this issue Feb 22, 2024 · 10 comments
Milestone

Comments

@AndreaBartolini
Copy link
Member

Is common practice in the PF calculation to substitute a powerful node with a slack node, in order to avoid the iterative balancing of the network. In this scenario the slack node represents a generator big enough to supply the same power that is supplied by the slack node in the PF.

From the PowerGrids point of view this means that the EPF should substitute a generator (choosen by the user) with a SlackBus (instead of a PVBus) and the ReferenceBus with a BusPF (insted of a SlackBus).

This behavior can be implemented in different ways, herebelow two possibilities:

  1. to make replaceable the EPF component in both the generator and the ReferenceBus (default remains PVBus and SlackBus respectively), by this way the user can choose the EPF behaviour by selecting the EPF component in the parameters dialog,

  2. to double the generator and the ReferenceBus models, by changing the EPF component, by this way the user can choose the EPF behaviour during the model building, by selecting the proper components in the library.

The first way is the most simple to be implemented and avoids the replication of the models in the library, but from the user point of view is a more bit complicated to be learned and probably less intuitive.

The second way is probably more simple from the user point of view but less efficient from both the coding and the code maintenance point of view.

Personally I prefer the first way, I await comments before starting with the implementation...

@max-privato and @casella, can you provide comments and or suggestions?

@ceraolo
Copy link

ceraolo commented Feb 22, 2024

It seems that solution 1 is to be preferred.
If I unserstand well the user has just to tell the library what the PF behaviour is expected from the generator, either PV or slack, right? If it is so, it does not seem particularly complicated to be learned.

@casella
Copy link
Member

casella commented Feb 22, 2024

I agree I prefer solution 1.

Andrea also mentioned another possible solution at some point, namely the reference bus only setting the phase of the voltage. Was that dismissed?

@ceraolo
Copy link

ceraolo commented Feb 22, 2024

Using a p-theta node would not have significant usages, IMO.

@AndreaBartolini
Copy link
Member Author

AndreaBartolini commented Feb 23, 2024

I agree I prefer solution 1.

Andrea also mentioned another possible solution at some point, namely the reference bus only setting the phase of the voltage. Was that dismissed?

Yes, because it doesn't match the request (I undesrtood the point only after a call with @ceraolo ).
The point is to substitute a generator with a slack node in the PF, and then to transfer both the active and the reactive power supplied by the slack node to the generator in the dynamic model, in order to initialize the simulation.

This can be achived only by embed the slack node in the generator as EPF component, if the slack node is outside the generator it is no possible to use its power to automatically initialize the generator (at least with the current implementation of the EPF).

@AndreaBartolini
Copy link
Member Author

The proposed solution actually does not work under OpenModelica because OMEdit does not updates the parameters pop-up window when a replaceable model is redeclared.
See issue #12037

@AndreaBartolini
Copy link
Member Author

Implemented by PR #138 (please see the PR comments)

@AndreaBartolini
Copy link
Member Author

some additional features implemented by PR #140

@AndreaBartolini
Copy link
Member Author

some additional features implemented in PR #142

@AndreaBartolini
Copy link
Member Author

Info (in italian) for Doc Update:

ho fatto diventare replaceable i componenti PF nel reference node, nella equivalent grid e nel generatore, i componenti di rimpiazzo consigliati (annotation choice) sono il bus generico PF per i primi due e lo slack bus per il generatore. In questo modo si può spostare lo slack node sul nodo di un generatore (come chiedeva Massimo).

Il punto è poi come chiudere il cerchio, e qui si aprono mille possibilità. Se hai un controllo sul generatore con gli offset che calcolano all'indietro i set point per mantenere il PF dovresti essere già a posto (oggettivamente non ho provato), quello che ho provato a fare è stato mettere due offset attaccati direttamente al generatore (PmPu e ifPu) ed aggiungere due paia di equazioni iniziali attivabili tramite due flag.

Il primo paio è nel generatore e impone che la potenza attiva e reattiva del generatore siano quelle dello slack node PF che sta nel suo nodo, ma questo tendenzialmente sbilancia la rete e quindi alla fine il refrence node deve compensare (e questo non piace agli elettrici come Massimo perché lo slack node è stato spostato dal reference node).

Il secondo paio è nel reference node, se si attivano queste due gli offset sono ricalcolati in modo da rendere nulle le potenze attiva e reattiva del reference node, che è meglio digeribile dagli elettrici come Massimo. Di questo c'è un esempio nel test: PowerGrids.Electrical.Test.SynchronousMachine4WindingsPF.

@casella casella reopened this Apr 6, 2024
@casella
Copy link
Member

casella commented Apr 6, 2024

@ceraolo suggests that a fairly standard practice in grid modelling is to connect the slack node to a strong generator, so the configuration made possible by this ticket should be the reference one for systems that are not connected to an infinite grid.

The currently implemented solution is not particularly user-friendly, as it requires to redeclare the EPF model of the generator to slack node and the EPF model of the ReferenceBus to Bus. This is not particularly intuitive and potentially error-prone, because one needs to understand redeclaration, and do them right. From an end-user perspective, the EPF should preferably "just work" with as minimal intervention as possible.

We came up with a different solution, that would just require to set a Boolean parameter slackPF in the slack generator and connected ReferenceBus. The idea is to modify OnePortAC to have two conditionally instantiated EPF components: componentPF, which is the same as in the current design and slackBusPF, which is just an instance of the SlackBus PF component. If slackEPF = false the first component is activated, otherwise the second is. BTW, the modification is just a couple more lines of code in one base class, so it is really no big deal.

By default, all components (including SynchronousMachine) will have slackPF = false, while ReferenceBus will have slackPF = true. slackPF will be declared as final for all components except generators and reference buses.

If you connect a generator to a reference bus, then you'll need to switch slackPF = true in the machine model and slackPF = false in the reference bus model. This is much easier to explain to a newbie than explaining that one needs to redeclare (what the hell does that mean?) some embedded model to another type.

@ceraolo is this OK for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants