DPsim
EMT_Ph3_RxLine.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_Inductor.h>
14 #include <dpsim-models/EMT/EMT_Ph3_Resistor.h>
15 #include <dpsim-models/Solver/MNAInterface.h>
16 
17 namespace CPS {
18 namespace EMT {
19 namespace Ph3 {
20 
21 class RxLine : public CompositePowerComp<Real>,
22  public Base::Ph3::PiLine,
23  public SharedFactory<RxLine> {
24 protected:
26  std::shared_ptr<Inductor> mSubInductor;
28  std::shared_ptr<Resistor> mSubResistor;
30  std::shared_ptr<Resistor> mInitialResistor;
31 
32 public:
34  RxLine(String uid, String name, Logger::Level logLevel = Logger::Level::off);
36  RxLine(String name, Logger::Level logLevel = Logger::Level::off)
37  : RxLine(name, name, logLevel) {}
38 
39  SimPowerComp<Real>::Ptr clone(String name) override;
40 
41  // #### General ####
43  void initializeFromNodesAndTerminals(Real frequency) override;
44 
45  // #### MNA section ####
46  void mnaCompUpdateVoltage(const Matrix &leftVector) override;
47  void mnaCompUpdateCurrent(const Matrix &leftVector) override;
48 
49  void mnaParentAddPreStepDependencies(
50  AttributeBase::List &prevStepDependencies,
51  AttributeBase::List &attributeDependencies,
52  AttributeBase::List &modifiedAttributes) override;
53  void
54  mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
55  AttributeBase::List &attributeDependencies,
56  AttributeBase::List &modifiedAttributes,
57  Attribute<Matrix>::Ptr &leftVector) override;
58 
60  void mnaParentPreStep(Real time, Int timeStepCount) override;
61  void mnaParentPostStep(Real time, Int timeStepCount,
62  Attribute<Matrix>::Ptr &leftVector) override;
63 };
64 } // namespace Ph3
65 } // namespace EMT
66 } // namespace CPS
Base class for composite power components.
std::shared_ptr< Resistor > mSubResistor
Resistor submodel.
std::shared_ptr< Inductor > mSubInductor
Inductance submodel.
RxLine(String name, Logger::Level logLevel=Logger::Level::off)
Defines name, component parameters and logging level.
RxLine(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name, logging level.
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre and post step operations.
SimPowerComp< Real >::Ptr clone(String name) override
DEPRECATED: Delete method.
std::shared_ptr< Resistor > mInitialResistor
Inductor end to ground resistor to facilitate initialization.
void initializeFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
String uid()
Returns unique id.
Base class for all components that are transmitting power.
Definition: SimPowerComp.h:17