DPsim
EMT_Ph3_RXLoad.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/CompositePowerComp.h>
12 #include <dpsim-models/EMT/EMT_Ph3_Capacitor.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 {
23 class RXLoad : public CompositePowerComp<Real>, public SharedFactory<RXLoad> {
24 protected:
26  MatrixComp mPower;
28  Matrix mResistance;
30  Matrix mReactance;
32  Matrix mInductance;
34  Matrix mCapacitance;
36  Bool initPowerFromTerminal = true;
38  std::shared_ptr<EMT::Ph3::Inductor> mSubInductor;
40  std::shared_ptr<EMT::Ph3::Capacitor> mSubCapacitor;
42  std::shared_ptr<EMT::Ph3::Resistor> mSubResistor;
43 
44 public:
52  RXLoad(String uid, String name, Logger::Level logLevel = Logger::Level::off);
54  RXLoad(String name, Logger::Level logLevel = Logger::Level::off);
56  RXLoad(String name, Matrix activePower, Matrix reactivePower, Real volt,
57  Logger::Level logLevel = Logger::Level::off);
58 
59  // #### General ####
61  void setParameters(Matrix activePower, Matrix reactivePower, Real volt);
63  void initializeFromNodesAndTerminals(Real frequency) override;
64 
65  // #### MNA section ####
66  void mnaCompUpdateCurrent(const Matrix &leftVector) override;
67  void mnaCompUpdateVoltage(const Matrix &leftVector) override;
68 
70  void mnaParentPreStep(Real time, Int timeStepCount) override;
71  void mnaParentPostStep(Real time, Int timeStepCount,
72  Attribute<Matrix>::Ptr &leftVector) override;
73 
74  void mnaParentAddPreStepDependencies(
75  AttributeBase::List &prevStepDependencies,
76  AttributeBase::List &attributeDependencies,
77  AttributeBase::List &modifiedAttributes) override;
78  void
79  mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
80  AttributeBase::List &attributeDependencies,
81  AttributeBase::List &modifiedAttributes,
82  Attribute<Matrix>::Ptr &leftVector) override;
83 };
84 } // namespace Ph3
85 } // namespace EMT
86 } // namespace CPS
Base class for composite power components.
TODO: currently modelled as an impedance, which obviously doesn't have a constant power characteristi...
const Attribute< Matrix >::Ptr mActivePower
Active power [Watt].
RXLoad(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name and logging level.
std::shared_ptr< EMT::Ph3::Resistor > mSubResistor
Internal resistance.
MatrixComp mPower
Power [Watt].
std::shared_ptr< EMT::Ph3::Inductor > mSubInductor
Internal inductor.
std::shared_ptr< EMT::Ph3::Capacitor > mSubCapacitor
Internal capacitor.
Matrix mResistance
Resistance [Ohm].
Matrix mReactance
Reactance [Ohm].
const Attribute< Real >::Ptr mNomVoltage
Nominal voltage [V].
void initializeFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre and post step operations.
Matrix mCapacitance
Capacitance [F].
const Attribute< Matrix >::Ptr mReactivePower
Reactive power [VAr].
Matrix mInductance
Inductance [H].
String uid()
Returns unique id.