DPsim
Loading...
Searching...
No Matches
DP_Ph1_SVC.h
Go to the documentation of this file.
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
17
18namespace CPS {
19namespace DP {
20namespace Ph1 {
29class SVC : public CompositePowerComp<Complex>,
30 public Base::Ph1::SVC,
32 public SharedFactory<SVC> {
33protected:
35 std::shared_ptr<DP::Ph1::Inductor> mSubInductor;
36 std::shared_ptr<DP::Ph1::Switch> mSubInductorSwitch;
38 std::shared_ptr<DP::Ph1::Capacitor> mSubCapacitor;
39 std::shared_ptr<DP::Ph1::Switch> mSubCapacitorSwitch;
40
43
44 // has state changed? (allow this only once)
45 // could be redundant with internal status of switch element (mnaIsClosed)
50
52
53 // values of PT1 for measurement of voltage at PCC
54 Real mTm = 0.01;
55 Real mKm = 1;
58
59 // variables for protection
64
65public:
68
70 SVC(String uid, String name, Logger::Level logLevel = Logger::Level::off);
72 SVC(String name, Logger::Level logLevel = Logger::Level::off)
73 : SVC(name, name, logLevel) {}
74
75 // #### General ####
77 void createSubComponents() override;
79 void initializeParentFromNodesAndTerminals(Real frequency) override;
80
81 // #### MNA section ####
83 void mnaCompUpdateVoltage(const Matrix &leftVector) override;
85 void mnaCompUpdateCurrent(const Matrix &leftVector) override;
87 void mnaParentPreStep(Real time, Int timeStepCount) override;
89 void mnaParentPostStep(Real time, Int timeStepCount,
90 Attribute<Matrix>::Ptr &leftVector) override;
93 AttributeBase::List &prevStepDependencies,
94 AttributeBase::List &attributeDependencies,
95 AttributeBase::List &modifiedAttributes) override;
97 void
99 AttributeBase::List &attributeDependencies,
100 AttributeBase::List &modifiedAttributes,
101 Attribute<Matrix>::Ptr &leftVector) override;
102
103 // #### Variable component interface ####
104 Bool hasParameterChanged() override { return mValueChange; }
105
106 // #### Tearing methods ####
108 void setSwitchState();
109
110 void updateSusceptance();
112 // check protection function
113 void checkProtection(Real time);
114};
115} // namespace Ph1
116} // namespace DP
117} // namespace CPS
std::vector< Ptr > List
Definition Attribute.h:123
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:250
Static VAR compensator (SVC)
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
void initializeParentFromNodesAndTerminals(Real frequency) override
Initializes states from power flow data (parent-specific part).
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations (parent-specific)
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Update interface current from MNA system results.
const Attribute< Real >::Ptr mVpcc
Definition DP_Ph1_SVC.h:66
void createSubComponents() override
Constructs subcomponents; idempotent.
std::shared_ptr< DP::Ph1::Capacitor > mSubCapacitor
Internal capacitor.
Definition DP_Ph1_SVC.h:38
std::shared_ptr< DP::Ph1::Switch > mSubCapacitorSwitch
Definition DP_Ph1_SVC.h:39
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Update interface voltage from MNA system results.
const Attribute< Real >::Ptr mVmeasPrev
Definition DP_Ph1_SVC.h:67
void mechanicalModelUpdateSusceptance(Real time)
void checkProtection(Real time)
std::shared_ptr< DP::Ph1::Inductor > mSubInductor
Internal inductor.
Definition DP_Ph1_SVC.h:35
Bool hasParameterChanged() override
Returns true if one of the element paramters has changed.
Definition DP_Ph1_SVC.h:104
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
add MNA post step dependencies (parent-specific)
SVC(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and log level.
Definition DP_Ph1_SVC.h:72
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre step operations (parent-specific)
std::shared_ptr< DP::Ph1::Switch > mSubInductorSwitch
Definition DP_Ph1_SVC.h:36
SVC(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and log level.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
add MNA pre step dependencies (parent-specific)
String uid()
Returns unique id.
spdlog::level::level_enum Level
Definition Logger.h:33
MNA interface to be used by elements that require recomputing of the system matrix.
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
Definition Definitions.h:81
std::string String
Definition Definitions.h:65
double Real
Definition Definitions.h:62
int Int
Definition Definitions.h:61
bool Bool
Definition Definitions.h:64