DPsim
Loading...
Searching...
No Matches
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/MNATearInterface.h>
17
18namespace CPS {
19namespace EMT {
20namespace Ph3 {
25class PiLine : public CompositePowerComp<Real>,
26 public MNATearInterface,
27 public Base::Ph3::PiLine,
28 public SharedFactory<PiLine> {
29protected:
31 std::shared_ptr<Inductor> mSubSeriesInductor;
33 std::shared_ptr<Resistor> mSubSeriesResistor;
35 std::shared_ptr<Resistor> mSubParallelResistor0;
36 // Parallel Capacitor submodel at Terminal 0
37 std::shared_ptr<Capacitor> mSubParallelCapacitor0;
39 std::shared_ptr<Resistor> mSubParallelResistor1;
40 // Parallel capacitor submodel at Terminal 1
41 std::shared_ptr<Capacitor> mSubParallelCapacitor1;
43 std::vector<const Matrix *> mRightVectorStamps;
44
45public:
47 PiLine(String uid, String name, Logger::Level logLevel = Logger::Level::off);
49 PiLine(String name, Logger::Level logLevel = Logger::Level::off)
50 : PiLine(name, name, logLevel) {}
51
52 SimPowerComp<Real>::Ptr clone(String copySuffix) override;
53
54 // #### General ####
56 void initializeFromNodesAndTerminals(Real frequency) override;
57
58 // #### MNA section ####
60 void mnaCompUpdateCurrent(const Matrix &leftVector) override;
62 void mnaCompUpdateVoltage(const Matrix &leftVector) override;
64 void mnaParentPreStep(Real time, Int timeStepCount) override;
66 void mnaParentPostStep(Real time, Int timeStepCount,
67 Attribute<Matrix>::Ptr &leftVector) override;
70 AttributeBase::List &prevStepDependencies,
71 AttributeBase::List &attributeDependencies,
72 AttributeBase::List &modifiedAttributes) override;
74 void
75 mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
76 AttributeBase::List &attributeDependencies,
77 AttributeBase::List &modifiedAttributes,
78 Attribute<Matrix>::Ptr &leftVector) override;
79
80 MNAInterface::List mnaTearGroundComponents() override;
81 void mnaTearInitialize(Real omega, Real timeStep) override;
82 void mnaTearApplyMatrixStamp(SparseMatrixRow &tearMatrix) override;
83 void mnaTearApplyVoltageStamp(Matrix &voltageVector) override;
84 void mnaTearPostStep(MatrixComp voltage, MatrixComp current) override;
85};
86} // namespace Ph3
87} // namespace EMT
88} // namespace CPS
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
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.