DPsim
Loading...
Searching...
No Matches
DP_Ph1_SynchronGeneratorIter.h
1/* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2 * EONERC, RWTH Aachen University
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 *********************************************************************************/
8
9#pragma once
10
11#include <dpsim-models/Base/Base_ReducedOrderSynchronGenerator.h>
12#include <dpsim-models/Solver/MNASyncGenInterface.h>
13
14namespace CPS {
15namespace DP {
16namespace Ph1 {
20 public MNASyncGenInterface {
21public:
22private:
23protected:
25 SynchronGeneratorIter(const String &uid, const String &name,
26 Logger::Level logLevel);
27 SynchronGeneratorIter(const String &name, Logger::Level logLevel);
28
29 // #### General Functions ####
31 virtual void specificInitialization() = 0;
33 virtual void stepInPerUnit() = 0;
34 //
35 virtual void correctorStep() = 0;
37 void updateVoltage(const Matrix &leftVector);
39 bool requiresIteration();
41 Matrix parkTransform(Real theta, const Matrix &abcVector);
42
43 // ### MNA Section ###
44 void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix);
45 void mnaCompApplyRightSideVectorStamp(Matrix &rightVector);
46 void mnaCompPostStep(const Matrix &leftVector);
47 void mnaCompInitialize(Real omega, Real timeStep,
48 Attribute<Matrix>::Ptr leftVector);
49
50public:
51 virtual ~SynchronGeneratorIter();
52
54 Bool hasParameterChanged() override { return 1; };
55};
56} // namespace Ph1
57} // namespace DP
58} // namespace CPS
void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix)
Stamps system matrix.
virtual void specificInitialization()=0
Function to initialize the specific variables of each SG model.
Bool hasParameterChanged() override
Mark that parameter changes so that system matrix is updated.
virtual void stepInPerUnit()=0
Model specific step.
SynchronGeneratorIter(const String &uid, const String &name, Logger::Level logLevel)
Constructor.
String uid()
Returns unique id.