DPsim
Loading...
Searching...
No Matches
DP_Ph3_NetworkInjection.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, EONERC, RWTH Aachen University
2// SPDX-License-Identifier: MPL-2.0
3
4#pragma once
5
9
10namespace CPS {
11namespace DP {
12namespace Ph3 {
18class NetworkInjection : public CompositePowerComp<Complex>,
19 public SharedFactory<NetworkInjection> {
20private:
21 // ### Electrical Subcomponents ###
23 std::shared_ptr<DP::Ph3::VoltageSource> mSubVoltageSource;
24
25 // #### solver ####
27 std::vector<const Matrix *> mRightVectorStamps;
28
29public:
32
35 Logger::Level loglevel = Logger::Level::off);
37 NetworkInjection(String name, Logger::Level logLevel = Logger::Level::off)
38 : NetworkInjection(name, name, logLevel) {}
39
41
42 // #### General ####
44 void initializeParentFromNodesAndTerminals(Real frequency) override;
46 void setParameters(MatrixComp voltageRef, Real srcFreq = 0.0);
47
48 // #### MNA Section ####
50 void mnaParentApplyRightSideVectorStamp(Matrix &rightVector) override;
52 void mnaCompUpdateCurrent(const Matrix &leftVector) override;
54 void mnaCompUpdateVoltage(const Matrix &leftVector) override;
56 void mnaParentPreStep(Real time, Int timeStepCount) override;
58 void mnaParentPostStep(Real time, Int timeStepCount,
59 Attribute<Matrix>::Ptr &leftVector) override;
62 AttributeBase::List &prevStepDependencies,
63 AttributeBase::List &attributeDependencies,
64 AttributeBase::List &modifiedAttributes) override;
66 void
68 AttributeBase::List &attributeDependencies,
69 AttributeBase::List &modifiedAttributes,
70 Attribute<Matrix>::Ptr &leftVector) override;
71};
72} // namespace Ph3
73} // namespace DP
74} // namespace CPS
std::vector< Ptr > List
Definition Attribute.h:123
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:250
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
NetworkInjection(String uid, String name, Logger::Level loglevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
void mnaParentApplyRightSideVectorStamp(Matrix &rightVector) override
Stamps right side (source) vector.
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 mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
NetworkInjection(String name, Logger::Level logLevel=Logger::Level::off)
Defines name, component parameters and logging level.
void initializeParentFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
const CPS::Attribute< MatrixComp >::Ptr mVoltageRef
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Returns current through the component.
void setParameters(MatrixComp voltageRef, Real srcFreq=0.0)
Setter for reference voltage parameters.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Updates voltage across component.
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
const CPS::Attribute< Real >::Ptr mSrcFreq
String uid()
Returns unique id.
spdlog::level::level_enum Level
Definition Logger.h:33
std::shared_ptr< SimPowerComp< VarType > > Ptr
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
Definition Definitions.h:81
std::string String
Definition Definitions.h:65
double Real
Definition Definitions.h:62
int Int
Definition Definitions.h:61
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > MatrixComp
Dense matrix for complex numbers.
Definition Definitions.h:84