DPsim
Loading...
Searching...
No Matches
EMT_Ph3_Shunt.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/EMT/EMT_Ph3_Capacitor.h>
13#include <dpsim-models/EMT/EMT_Ph3_Resistor.h>
14#include <dpsim-models/Solver/MNAInterface.h>
15
16namespace CPS {
17namespace EMT {
18namespace Ph3 {
19
20class Shunt : public CompositePowerComp<Real>, public SharedFactory<Shunt> {
21private:
23 Matrix mConductance;
25 Matrix mSusceptance;
26
28 std::shared_ptr<Capacitor> mSubCapacitor;
30 std::shared_ptr<Resistor> mSubResistor;
31
32public:
34 Shunt(String uid, String name, Logger::Level logLevel = Logger::Level::off);
35
37 Shunt(String name, Logger::Level logLevel = Logger::Level::off)
38 : Shunt(name, name, logLevel) {}
39
40 // #### General ####
42 void setParameters(Real conductance, Real susceptance);
43 void setParameters(Matrix conductance, Matrix susceptance);
44
45 // #### MNA section ####
47 void initializeParentFromNodesAndTerminals(Real frequency) final;
50 AttributeBase::List &prevStepDependencies,
51 AttributeBase::List &attributeDependencies,
52 AttributeBase::List &modifiedAttributes) final;
54 void mnaParentPreStep(Real time, Int timeStepCount) final;
56 void mnaCompUpdateCurrent(const Matrix &leftVector) final;
58 void mnaCompUpdateVoltage(const Matrix &leftVector) final;
60 void mnaParentPostStep(Real time, Int timeStepCount,
61 Attribute<Matrix>::Ptr &leftVector) final;
63 void
64 mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
65 AttributeBase::List &attributeDependencies,
66 AttributeBase::List &modifiedAttributes,
67 Attribute<Matrix>::Ptr &leftVector) final;
68};
69} // namespace Ph3
70} // namespace EMT
71} // namespace CPS
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) final
MNA post-step operations.
void mnaCompUpdateVoltage(const Matrix &leftVector) final
Updates internal voltage variable of the component.
void mnaParentPreStep(Real time, Int timeStepCount) final
MNA pre step operations.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) final
Add MNA pre step dependencies.
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) final
add MNA post-step dependencies
void initializeParentFromNodesAndTerminals(Real frequency) final
Initializes component from power flow data.
Shunt(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and logging level.
void setParameters(Real conductance, Real susceptance)
Set shunt specific parameters.
Shunt(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
void mnaCompUpdateCurrent(const Matrix &leftVector) final
Updates internal current variable of the component.
String uid()
Returns unique id.