DPsim
EMT_Ph3_SeriesResistor.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_Ph1_Resistor.h>
12 #include <dpsim-models/MNASimPowerComp.h>
13 #include <dpsim-models/Solver/MNAInterface.h>
14 
15 namespace CPS {
16 namespace EMT {
17 namespace Ph3 {
22 class SeriesResistor : public MNASimPowerComp<Real>,
23  public Base::Ph1::Resistor,
24  public SharedFactory<SeriesResistor> {
25 
26 public:
28  SeriesResistor(String uid, String name,
29  Logger::Level logLevel = Logger::Level::off);
31  SeriesResistor(String name, Logger::Level logLevel = Logger::Level::off)
32  : SeriesResistor(name, name, logLevel) {}
33 
34  // #### General ####
36  SimPowerComp<Real>::Ptr clone(String name) override;
38  void initializeFromNodesAndTerminals(Real frequency) override;
39 
40  // #### MNA section ####
42  void mnaCompInitialize(Real omega, Real timeStep,
43  Attribute<Matrix>::Ptr leftVector) override;
45  void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override;
47  void mnaCompUpdateVoltage(const Matrix &leftVector) override;
49  void mnaCompUpdateCurrent(const Matrix &leftVector) override;
50 
51  void mnaCompPostStep(Real time, Int timeStepCount,
52  Attribute<Matrix>::Ptr &leftVector) override;
53 
55  void
56  mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
57  AttributeBase::List &attributeDependencies,
58  AttributeBase::List &modifiedAttributes,
59  Attribute<Matrix>::Ptr &leftVector) override;
60 };
61 } // namespace Ph3
62 } // namespace EMT
63 } // namespace CPS
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Update interface voltage from MNA system results.
void mnaCompInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
Initializes MNA specific variables.
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
SimPowerComp< Real >::Ptr clone(String name) override
Return new instance with the same parameters.
SeriesResistor(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and log level.
void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
Stamps system matrix.
void initializeFromNodesAndTerminals(Real frequency) override
Initializes states from power flow data.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Update interface voltage from MNA system results.
SeriesResistor(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and log level.
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