DPsim
SP_Ph1_PVNode.cpp
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 #include <dpsim-models/SP/SP_Ph1_PVNode.h>
10 
11 using namespace CPS;
12 
13 SP::Ph1::PVNode::PVNode(String uid, String name, Logger::Level logLevel)
14  : SimPowerComp<Complex>(uid, name, logLevel),
15  mPowerSetPoint(mAttributes->create<Real>("P_set")),
16  mVoltageSetPoint(mAttributes->create<Real>("V_set")),
17  mVoltagePerUnit(mAttributes->create<Real>("V_set_pu")) {}
18 
19 SP::Ph1::PVNode::PVNode(String uid, String name, Real power, Real vSetPoint,
20  Real maxQ, Real ratedU, Real ratedS,
21  Logger::Level logLevel)
22  : PVNode(uid, name, logLevel) {
23 
24  **mPowerSetPoint = power;
25  **mVoltageSetPoint = vSetPoint;
26 
27  **mVoltagePerUnit = vSetPoint / ratedU;
28 
29  SPDLOG_LOGGER_INFO(mSLog, "Create PV node for {} P={}, V={}", name,
30  **mPowerSetPoint, **mVoltageSetPoint);
31 }
Base class for all components that are transmitting power.
Definition: SimPowerComp.h:17