DPsim
EMT_Ph3_Resistor.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_Resistor.h>
12 #include <dpsim-models/MNASimPowerComp.h>
13 #include <dpsim-models/Solver/MNAInterface.h>
14 namespace CPS {
15 namespace EMT {
16 namespace Ph3 {
18 class Resistor : public MNASimPowerComp<Real>,
19  public Base::Ph3::Resistor,
20  public SharedFactory<Resistor> {
21 protected:
22 public:
24  Resistor(String uid, String name,
25  Logger::Level logLevel = Logger::Level::off);
27  Resistor(String name, Logger::Level logLevel = Logger::Level::off)
28  : Resistor(name, name, logLevel) {}
29 
30  // #### General ####
32  SimPowerComp<Real>::Ptr clone(String name);
34  void initializeFromNodesAndTerminals(Real frequency);
37 
38  // #### MNA section ####
40  void mnaCompInitialize(Real omega, Real timeStep,
41  Attribute<Matrix>::Ptr leftSideVector);
43  void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix);
45  void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) {}
47  void mnaCompUpdateVoltage(const Matrix &leftVector);
49  void mnaCompUpdateCurrent(const Matrix &leftVector);
51  void mnaCompPostStep(Real time, Int timeStepCount,
52  Attribute<Matrix>::Ptr &leftVector);
54  void
55  mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
56  AttributeBase::List &attributeDependencies,
57  AttributeBase::List &modifiedAttributes,
58  Attribute<Matrix>::Ptr &leftVector);
59 };
60 } // namespace Ph3
61 } // namespace EMT
62 } // namespace CPS
void initializeFromNodesAndTerminals(Real frequency)
Initializes component from power flow data.
void mnaCompUpdateCurrent(const Matrix &leftVector)
Update interface current from MNA system result.
void enableBackShift()
enable DP to EMT bach transformation
Resistor(String name, Logger::Level logLevel=Logger::Level::off)
Defines name, component parameters and logging level.
void mnaCompInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftSideVector)
Initializes internal variables of the component.
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector)
add MNA pre and post step dependencies
void mnaCompUpdateVoltage(const Matrix &leftVector)
Update interface voltage from MNA system result.
void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix)
Stamps system matrix.
SimPowerComp< Real >::Ptr clone(String name)
Returns a modified copy of the component with the given suffix added to the name and without.
void mnaCompPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector)
MNA pre and post step operations.
Resistor(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
void mnaCompApplyRightSideVectorStamp(Matrix &rightVector)
Stamps right side (source) vector.
String uid()
Returns unique id.
Base class for all MNA components that are transmitting power.
Base class for all components that are transmitting power.
Definition: SimPowerComp.h:17