DPsim
DP_Ph1_SynchronGeneratorIdeal.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/CompositePowerComp.h>
12 #include <dpsim-models/DP/DP_Ph1_VoltageSource.h>
13 #include <dpsim-models/Solver/MNAInterface.h>
14 
15 namespace CPS {
16 namespace DP {
17 namespace Ph1 {
20  public SharedFactory<SynchronGeneratorIdeal> {
21 private:
23  std::shared_ptr<DP::Ph1::VoltageSource> mSubVoltageSource;
24 
25 public:
30  SynchronGeneratorIdeal(String uid, String name,
31  Logger::Level logLevel = Logger::Level::off);
33  SynchronGeneratorIdeal(String name,
34  Logger::Level logLevel = Logger::Level::off);
35 
36  SimPowerComp<Complex>::Ptr clone(String name) override;
37 
38  // #### General ####
40  void initializeFromNodesAndTerminals(Real frequency) override;
41 
42  // #### MNA section ####
44  void mnaParentPreStep(Real time, Int timeStepCount) override;
46  void mnaParentPostStep(Real time, Int timeStepCount,
47  Attribute<Matrix>::Ptr &leftVector) override;
50  AttributeBase::List &prevStepDependencies,
51  AttributeBase::List &attributeDependencies,
52  AttributeBase::List &modifiedAttributes) override;
54  void
55  mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
56  AttributeBase::List &attributeDependencies,
57  AttributeBase::List &modifiedAttributes,
58  Attribute<Matrix>::Ptr &leftVector) override;
60  void mnaCompUpdateCurrent(const Matrix &leftVector) override;
62  void mnaCompUpdateVoltage(const Matrix &leftVector) override;
63 };
64 } // namespace Ph1
65 } // namespace DP
66 } // namespace CPS
Base class for composite power components.
Ideal voltage source representing a synchronous generator.
SynchronGeneratorIdeal(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
void initializeFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Updates voltage across component.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
SimPowerComp< Complex >::Ptr clone(String name) override
Returns a modified copy of the component with the given suffix added to the name and without.
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Updates current through the component.
String uid()
Returns unique id.
Base class for all components that are transmitting power.
Definition: SimPowerComp.h:17