DPsim
DP_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/Definitions.h>
13 #include <dpsim-models/Logger.h>
14 #include <dpsim-models/MNASimPowerComp.h>
15 #include <dpsim-models/Solver/MNAInterface.h>
16 
17 namespace CPS {
18 namespace DP {
19 namespace Ph3 {
21 class Resistor : public MNASimPowerComp<Complex>,
22  public Base::Ph3::Resistor,
23  public SharedFactory<Resistor> {
24 
25 public:
27  Resistor(String uid, String name,
28  Logger::Level logLevel = Logger::Level::off);
30  Resistor(String name, Logger::Level logLevel = Logger::Level::off)
31  : Resistor(name, name, logLevel) {}
32 
33  SimPowerComp<Complex>::Ptr clone(String name) override;
34 
35  // #### General ####
37  void initializeFromNodesAndTerminals(Real frequency) override;
38  // #### MNA section ####
40  void mnaCompInitialize(Real omega, Real timeStep,
41  Attribute<Matrix>::Ptr leftVector) override;
43  void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override;
45  void mnaCompUpdateVoltage(const Matrix &leftVector) override;
47  void mnaCompUpdateCurrent(const Matrix &leftVector) override;
48 
50  void
51  mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
52  AttributeBase::List &attributeDependencies,
53  AttributeBase::List &modifiedAttributes,
54  Attribute<Matrix>::Ptr &leftVector) override;
55  void mnaCompPostStep(Real time, Int timeStepCount,
56  Attribute<Matrix>::Ptr &leftVector) override;
57 };
58 } // namespace Ph3
59 } // namespace DP
60 } // namespace CPS
SimPowerComp< Complex >::Ptr clone(String name) override
Returns a modified copy of the component with the given suffix added to the name and without.
void initializeFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
void mnaCompApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
Stamps system matrix.
Resistor(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and logging level.
Resistor(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and logging level.
void mnaCompAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
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