DPsim
Loading...
Searching...
No Matches
SP_Ph1_SynchronGenerator.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/MNASimPowerComp.h>
12#include <dpsim-models/Solver/PFSolverInterfaceBus.h>
13
14namespace CPS {
15
16namespace SP {
17namespace Ph1 {
18
19class SynchronGenerator : public SimPowerComp<Complex>,
20 public SharedFactory<SynchronGenerator>,
21 public PFSolverInterfaceBus {
22private:
24 Real mBaseVoltage;
26 Real mBaseApparentPower;
27
28public:
30 const Attribute<Real>::Ptr mSetPointActivePower;
32 const Attribute<Real>::Ptr mSetPointReactivePower;
34 const Attribute<Real>::Ptr mSetPointVoltage;
36 const Attribute<Real>::Ptr mSetPointActivePowerPerUnit;
38 const Attribute<Real>::Ptr mSetPointReactivePowerPerUnit;
40 const Attribute<Real>::Ptr mSetPointVoltagePerUnit;
41
43 SynchronGenerator(String uid, String name,
44 Logger::Level logLevel = Logger::Level::off);
46 SynchronGenerator(String name, Logger::Level logLevel = Logger::Level::off)
47 : SynchronGenerator(name, name, logLevel) {}
48
49 void setParameters(Real ratedApparentPower, Real ratedVoltage,
50 Real setPointActivePower, Real setPointVoltage,
51 PowerflowBusType powerflowBusType,
52 Real setPointReactivepower = 0);
53 // #### Powerflow section ####
54 Real getBaseVoltage() const;
56 void setBaseVoltage(Real baseVoltage);
58 void calculatePerUnitParameters(Real baseApparentPower, Real baseOmega);
60 void modifyPowerFlowBusType(PowerflowBusType powerflowBusType) override;
62 void updateReactivePowerInjection(Complex powerInj);
64 void updatePowerInjection(Complex powerInj);
66 Complex getApparentPower() const;
67};
68} // namespace Ph1
69} // namespace SP
70} // namespace CPS
String uid()
Returns unique id.
const Attribute< Real >::Ptr mSetPointReactivePower
Reactive power set point of the machine [VAr].
void modifyPowerFlowBusType(PowerflowBusType powerflowBusType) override
Modify powerflow bus type.
SynchronGenerator(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and logging level.
const Attribute< Real >::Ptr mSetPointReactivePowerPerUnit
Reactive power set point of the machine [pu].
Complex getApparentPower() const
Get Apparent power of Powerflow solution.
void setBaseVoltage(Real baseVoltage)
Set base voltage.
void calculatePerUnitParameters(Real baseApparentPower, Real baseOmega)
Initializes component from power flow data.
const Attribute< Real >::Ptr mSetPointActivePower
Active power set point of the machine [W].
SynchronGenerator(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and logging level.
void updateReactivePowerInjection(Complex powerInj)
Update reactive power injection (PV Bus)
void setParameters(Real ratedApparentPower, Real ratedVoltage, Real setPointActivePower, Real setPointVoltage, PowerflowBusType powerflowBusType, Real setPointReactivepower=0)
Setter for synchronous generator parameters.
const Attribute< Real >::Ptr mSetPointVoltagePerUnit
Voltage set point of the machine [pu].
void updatePowerInjection(Complex powerInj)
Update active & reactive power injection (VD bus)
const Attribute< Real >::Ptr mSetPointVoltage
Voltage set point of the machine [V].
const Attribute< Real >::Ptr mSetPointActivePowerPerUnit
Active power set point of the machine [pu].
SimPowerComp(String uid, String name, Logger::Level logLevel=Logger::Level::off)