DPsim
Loading...
Searching...
No Matches
DP_Ph1_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_Ph1_PiLine.h>
12#include <dpsim-models/CompositePowerComp.h>
13#include <dpsim-models/DP/DP_Ph1_Inductor.h>
14#include <dpsim-models/DP/DP_Ph1_Resistor.h>
15#include <dpsim-models/Solver/MNAInterface.h>
16
17namespace CPS {
18namespace DP {
19namespace Ph1 {
20
21class RxLine : public CompositePowerComp<Complex>,
22 public Base::Ph1::PiLine,
23 public SharedFactory<RxLine> {
24protected:
26 std::shared_ptr<Inductor> mSubInductor;
28 std::shared_ptr<Resistor> mSubResistor;
30 std::shared_ptr<Resistor> mInitialResistor;
31
32public:
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<Complex>::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 void mnaParentAddPreStepDependencies(
49 AttributeBase::List &prevStepDependencies,
50 AttributeBase::List &attributeDependencies,
51 AttributeBase::List &modifiedAttributes) override;
52 void
53 mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies,
54 AttributeBase::List &attributeDependencies,
55 AttributeBase::List &modifiedAttributes,
56 Attribute<Matrix>::Ptr &leftVector) override;
57
59 void mnaParentPreStep(Real time, Int timeStepCount) override;
60 void mnaParentPostStep(Real time, Int timeStepCount,
61 Attribute<Matrix>::Ptr &leftVector) override;
62};
63} // namespace Ph1
64} // namespace DP
65} // namespace CPS
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
void initializeFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
RxLine(String name, Logger::Level logLevel=Logger::Level::off)
Defines name, component parameters and logging level.
std::shared_ptr< Resistor > mSubResistor
Resistor submodel.
SimPowerComp< Complex >::Ptr clone(String name) override
DEPRECATED: Delete method.
std::shared_ptr< Inductor > mSubInductor
Inductance submodel.
std::shared_ptr< Resistor > mInitialResistor
Inductor end to ground resistor to facilitate initialization.
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre and post step operations.
RxLine(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name, logging level.
String uid()
Returns unique id.