DPsim
Loading...
Searching...
No Matches
DP_Ph1_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/DP/DP_Ph1_Capacitor.h>
13#include <dpsim-models/DP/DP_Ph1_Resistor.h>
14
15namespace CPS {
16namespace DP {
17namespace Ph1 {
18
19class Shunt : public CompositePowerComp<Complex>, public SharedFactory<Shunt> {
20public:
22 const Attribute<Real>::Ptr mConductance;
24 const Attribute<Real>::Ptr mSusceptance;
25
27 std::shared_ptr<Capacitor> mSubCapacitor;
29 std::shared_ptr<Resistor> mSubResistor;
30
31public:
33 Shunt(String uid, String name, Logger::Level logLevel = Logger::Level::off);
34
36 Shunt(String name, Logger::Level logLevel = Logger::Level::off)
37 : Shunt(name, name, logLevel) {}
38
39 // #### General ####
41 void setParameters(Real conductance, Real susceptance);
42
43 // #### MNA section ####
45 void initializeParentFromNodesAndTerminals(Real frequency);
48 AttributeBase::List &prevStepDependencies,
49 AttributeBase::List &attributeDependencies,
50 AttributeBase::List &modifiedAttributes) final;
52 void mnaParentPreStep(Real time, Int timeStepCount) final;
54 void mnaCompUpdateCurrent(const Matrix &leftVector) final;
56 void mnaCompUpdateVoltage(const Matrix &leftVector) final;
58 void mnaParentPostStep(Real time, Int timeStepCount,
59 Attribute<Matrix>::Ptr &leftVector) final;
61 void
62 mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
63 AttributeBase::List &attributeDependencies,
64 AttributeBase::List &modifiedAttributes,
65 Attribute<Matrix>::Ptr &leftVector) final;
66};
67} // namespace Ph1
68} // namespace DP
69} // namespace CPS
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
void mnaCompUpdateCurrent(const Matrix &leftVector) final
Updates internal current variable of the component.
const Attribute< Real >::Ptr mConductance
Conductance [S].
void mnaParentPreStep(Real time, Int timeStepCount) final
MNA pre step operations.
const Attribute< Real >::Ptr mSusceptance
Susceptance [S].
void mnaCompUpdateVoltage(const Matrix &leftVector) final
Updates internal voltage variable of the component.
std::shared_ptr< Resistor > mSubResistor
Resistor between terminal and ground.
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.
std::shared_ptr< Capacitor > mSubCapacitor
Capacitor between terminal and ground.
void initializeParentFromNodesAndTerminals(Real frequency)
Initializes component from power flow data.
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) final
MNA post-step operations.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) final
Add MNA pre step dependencies.
Shunt(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and logging level.
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) final
add MNA post-step dependencies
String uid()
Returns unique id.