DPsim
EMT_Ph3_PiLine.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/Base/Base_Ph3_PiLine.h>
12 #include <dpsim-models/CompositePowerComp.h>
13 #include <dpsim-models/EMT/EMT_Ph3_Capacitor.h>
14 #include <dpsim-models/EMT/EMT_Ph3_Inductor.h>
15 #include <dpsim-models/EMT/EMT_Ph3_Resistor.h>
16 #include <dpsim-models/Solver/MNAInterface.h>
17 
18 namespace CPS {
19 namespace EMT {
20 namespace Ph3 {
25 class PiLine : public CompositePowerComp<Real>,
26  public Base::Ph3::PiLine,
27  public SharedFactory<PiLine> {
28 protected:
30  std::shared_ptr<Inductor> mSubSeriesInductor;
32  std::shared_ptr<Resistor> mSubSeriesResistor;
34  std::shared_ptr<Resistor> mSubParallelResistor0;
35  // Parallel Capacitor submodel at Terminal 0
36  std::shared_ptr<Capacitor> mSubParallelCapacitor0;
38  std::shared_ptr<Resistor> mSubParallelResistor1;
39  // Parallel capacitor submodel at Terminal 1
40  std::shared_ptr<Capacitor> mSubParallelCapacitor1;
42  std::vector<const Matrix *> mRightVectorStamps;
43 
44 public:
46  PiLine(String uid, String name, Logger::Level logLevel = Logger::Level::off);
48  PiLine(String name, Logger::Level logLevel = Logger::Level::off)
49  : PiLine(name, name, logLevel) {}
50 
51  SimPowerComp<Real>::Ptr clone(String copySuffix) override;
52 
53  // #### General ####
55  void initializeFromNodesAndTerminals(Real frequency) override;
56 
57  // #### MNA section ####
59  void mnaCompUpdateCurrent(const Matrix &leftVector) override;
61  void mnaCompUpdateVoltage(const Matrix &leftVector) override;
63  void mnaParentPreStep(Real time, Int timeStepCount) override;
65  void mnaParentPostStep(Real time, Int timeStepCount,
66  Attribute<Matrix>::Ptr &leftVector) override;
69  AttributeBase::List &prevStepDependencies,
70  AttributeBase::List &attributeDependencies,
71  AttributeBase::List &modifiedAttributes) override;
73  void
74  mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
75  AttributeBase::List &attributeDependencies,
76  AttributeBase::List &modifiedAttributes,
77  Attribute<Matrix>::Ptr &leftVector) override;
78 
79  //MNAInterface::List mnaTearGroundComponents();
80  /*void mnaTearInitialize(Real omega, Real timeStep);
81  void mnaTearApplyMatrixStamp(SparseMatrixRow& tearMatrix);
82  void mnaTearApplyVoltageStamp(Matrix& voltageVector);
83  void mnaTearPostStep(Matrix voltage, Matrix current);*/
84 };
85 } // namespace Ph3
86 } // namespace EMT
87 } // namespace CPS
Base class for composite power components.
PI-line dynamic phasor model.
PiLine(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and logging level.
SimPowerComp< Real >::Ptr clone(String copySuffix) override
DEPRECATED: Delete method.
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Updates internal voltage variable of the component.
std::shared_ptr< Resistor > mSubParallelResistor0
Parallel Resistor submodel at Terminal 0.
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
void initializeFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
PiLine(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and logging level.
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Updates internal current variable of the component.
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
std::shared_ptr< Inductor > mSubSeriesInductor
Series Inductance submodel.
std::shared_ptr< Resistor > mSubSeriesResistor
Series Resistor submodel.
std::vector< const Matrix * > mRightVectorStamps
solver
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
std::shared_ptr< Resistor > mSubParallelResistor1
Parallel resistor submodel at Terminal 1.
String uid()
Returns unique id.
Base class for all components that are transmitting power.
Definition: SimPowerComp.h:17