9#include <dpsim-models/DP/DP_Ph1_SynchronGeneratorIdeal.h>
14 Logger::Level logLevel)
17 setVirtualNodeNumber(1);
24 Logger::Level logLevel)
28 return SynchronGeneratorIdeal::make(name,
mLogLevel);
36 mSubVoltageSource = DP::Ph1::VoltageSource::make(**
mName +
"_src",
mLogLevel);
37 mSubVoltageSource->mVoltageRef->setReference(
mVoltageRef);
38 mSubVoltageSource->connect({SimNode::GND,
node(0)});
44 MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT,
45 MNA_SUBCOMP_TASK_ORDER::TASK_BEFORE_PARENT,
true);
50 SPDLOG_LOGGER_INFO(
mSLog,
51 "\n--- Initialization from powerflow ---"
52 "\nVoltage across: {:s}"
54 "\nTerminal 0 voltage: {:s}"
55 "\n--- Initialization from powerflow finished ---",
58 Logger::phasorToString(initialSingleVoltage(0)));
62 AttributeBase::List &prevStepDependencies,
63 AttributeBase::List &attributeDependencies,
64 AttributeBase::List &modifiedAttributes) {
76 AttributeBase::List &prevStepDependencies,
77 AttributeBase::List &attributeDependencies,
78 AttributeBase::List &modifiedAttributes,
79 Attribute<Matrix>::Ptr &leftVector) {
80 attributeDependencies.push_back(leftVector);
86 Real time, Int timeStepCount, Attribute<Matrix>::Ptr &leftVector) {
92 const Matrix &leftvector) {
97 const Matrix &leftVector) {
void addMNASubComponent(typename SimPowerComp< Complex >::Ptr subc, MNA_SUBCOMP_TASK_ORDER preStepOrder, MNA_SUBCOMP_TASK_ORDER postStepOrder, Bool contributeToRightVector)
void mnaCompApplyRightSideVectorStamp(Matrix &rightVector) override
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
const Attribute< Complex >::Ptr mVoltageRef
True after createSubComponents() runs; prevents double-construction.
SynchronGeneratorIdeal(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
void createSubComponents() override
Constructs and registers MNA subcomponents; idempotent.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Updates voltage across component.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
Add MNA pre step dependencies.
void initializeParentFromNodesAndTerminals(Real frequency) override
Initializes component from power flow data.
void mnaParentPreStep(Real time, Int timeStepCount) override
MNA pre step operations.
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 mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
MNA post step operations.
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
Add MNA post step dependencies.
void mnaCompUpdateCurrent(const Matrix &leftVector) override
Updates current through the component.
const Attribute< String >::Ptr mName
Human readable name.
String uid()
Returns unique id.
AttributeList::Ptr mAttributes
Attribute List.
Attribute< Matrix >::Ptr mRightVector
const Attribute< MatrixVar< Complex > >::Ptr mIntfCurrent
SimNode< Complex >::Ptr node(UInt index)
const Attribute< MatrixVar< Complex > >::Ptr mIntfVoltage
SimNode< Complex >::List mVirtualNodes
std::vector< std::shared_ptr< SimPowerComp< Complex > > > mSubComponents
Logger::Level mLogLevel
Component logger control for internal variables.
Logger::Log mSLog
Component logger.