Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
395 changes: 206 additions & 189 deletions CGMES_2.4.13_18DEC2013/ACDCConverter.cpp

Large diffs are not rendered by default.

83 changes: 60 additions & 23 deletions CGMES_2.4.13_18DEC2013/ACDCConverter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,73 @@ namespace CIMPP
class ACDCConverterDCTerminal;
class Terminal;

/*
A unit with valves for three phases, together with unit control equipment, essential protective and switching devices, DC storage capacitors, phase reactors and auxiliaries, if any, used for conversion.
*/
/** \brief A unit with valves for three phases, together with unit control equipment, essential protective and switching devices, DC storage capacitors, phase reactors and auxiliaries, if any, used for conversion. */
class ACDCConverter : public ConductingEquipment
{
public:
/* constructor initialising all attributes to null */
ACDCConverter();
~ACDCConverter() override;

std::list<CIMPP::ACDCConverterDCTerminal*> DCTerminals; /* Default: 0 */
CIMPP::Terminal* PccTerminal; /* All converters` DC sides linked to this point of common coupling terminal. Default: 0 */
CIMPP::ApparentPower baseS; /* Base apparent power of the converter pole. Default: nullptr */
CIMPP::CurrentFlow idc; /* Converter DC current, also called Id. Converter state variable, result from power flow. Default: nullptr */
CIMPP::ActivePower idleLoss; /* Active power loss in pole at no power transfer. Converter configuration data used in power flow. Default: nullptr */
CIMPP::Voltage maxUdc; /* The maximum voltage on the DC side at which the converter should operate. Converter configuration data used in power flow. Default: nullptr */
CIMPP::Voltage minUdc; /* Min allowed converter DC voltage. Converter configuration data used in power flow. Default: nullptr */
CIMPP::Voltage nomUdc; /* The nominal voltage on the DC side at which the converter is designed to operate. Converter configuration data used in power flow. Default: nullptr */
CIMPP::Integer numberOfValves; /* Number of valves in the converter. Used in loss calculations. Default: 0 */
CIMPP::ActivePower p; /* Active power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */
CIMPP::ActivePower poleLossP; /* The active power loss at a DC Pole = idleLoss + switchingLoss*|Idc| + resitiveLoss*Idc^2 For lossless operation Pdc=Pac For rectifier operation with losses Pdc=Pac-lossP For inverter operation with losses Pdc=Pac+lossP Converter state variable used in power flow. Default: nullptr */
CIMPP::ReactivePower q; /* Reactive power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */
CIMPP::Voltage ratedUdc; /* Rated converter DC voltage, also called UdN. Converter configuration data used in power flow. Default: nullptr */
CIMPP::Simple_Float resistiveLoss; /* Converter configuration data used in power flow. Refer to poleLossP. Default: nullptr */
CIMPP::PU switchingLoss; /* Switching losses, relative to the base apparent power `baseS`. Refer to poleLossP. Default: nullptr */
CIMPP::ActivePower targetPpcc; /* Real power injection target in AC grid, at point of common coupling. Default: nullptr */
CIMPP::Voltage targetUdc; /* Target value for DC voltage magnitude. Default: nullptr */
CIMPP::Voltage uc; /* Converter voltage, the voltage at the AC side of the bridge. Converter state variable, result from power flow. Default: nullptr */
CIMPP::Voltage udc; /* Converter voltage at the DC side, also called Ud. Converter state variable, result from power flow. Default: nullptr */
CIMPP::Voltage valveU0; /* Valve threshold voltage. Forward voltage drop when the valve is conducting. Used in loss calculations, i.e. the switchLoss depend on numberOfValves * valveU0. Default: nullptr */
/** \brief Default: 0 */
std::list<CIMPP::ACDCConverterDCTerminal*> DCTerminals;

/** \brief All converters` DC sides linked to this point of common coupling terminal. Default: 0 */
CIMPP::Terminal* PccTerminal;

/** \brief Base apparent power of the converter pole. Default: nullptr */
CIMPP::ApparentPower baseS;

/** \brief Converter DC current, also called Id. Converter state variable, result from power flow. Default: nullptr */
CIMPP::CurrentFlow idc;

/** \brief Active power loss in pole at no power transfer. Converter configuration data used in power flow. Default: nullptr */
CIMPP::ActivePower idleLoss;

/** \brief The maximum voltage on the DC side at which the converter should operate. Converter configuration data used in power flow. Default: nullptr */
CIMPP::Voltage maxUdc;

/** \brief Min allowed converter DC voltage. Converter configuration data used in power flow. Default: nullptr */
CIMPP::Voltage minUdc;

/** \brief The nominal voltage on the DC side at which the converter is designed to operate. Converter configuration data used in power flow. Default: nullptr */
CIMPP::Voltage nomUdc;

/** \brief Number of valves in the converter. Used in loss calculations. Default: 0 */
CIMPP::Integer numberOfValves;

/** \brief Active power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */
CIMPP::ActivePower p;

/** \brief The active power loss at a DC Pole = idleLoss + switchingLoss*|Idc| + resitiveLoss*Idc^2 For lossless operation Pdc=Pac For rectifier operation with losses Pdc=Pac-lossP For inverter operation with losses Pdc=Pac+lossP Converter state variable used in power flow. Default: nullptr */
CIMPP::ActivePower poleLossP;

/** \brief Reactive power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */
CIMPP::ReactivePower q;

/** \brief Rated converter DC voltage, also called UdN. Converter configuration data used in power flow. Default: nullptr */
CIMPP::Voltage ratedUdc;

/** \brief Converter configuration data used in power flow. Refer to poleLossP. Default: nullptr */
CIMPP::Simple_Float resistiveLoss;

/** \brief Switching losses, relative to the base apparent power `baseS`. Refer to poleLossP. Default: nullptr */
CIMPP::PU switchingLoss;

/** \brief Real power injection target in AC grid, at point of common coupling. Default: nullptr */
CIMPP::ActivePower targetPpcc;

/** \brief Target value for DC voltage magnitude. Default: nullptr */
CIMPP::Voltage targetUdc;

/** \brief Converter voltage, the voltage at the AC side of the bridge. Converter state variable, result from power flow. Default: nullptr */
CIMPP::Voltage uc;

/** \brief Converter voltage at the DC side, also called Ud. Converter state variable, result from power flow. Default: nullptr */
CIMPP::Voltage udc;

/** \brief Valve threshold voltage. Forward voltage drop when the valve is conducting. Used in loss calculations, i.e. the switchLoss depend on numberOfValves * valveU0. Default: nullptr */
CIMPP::Voltage valveU0;

static const char debugName[];
const char* debugString() const override;
Expand Down
46 changes: 22 additions & 24 deletions CGMES_2.4.13_18DEC2013/ACDCConverterDCTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cim
#include <sstream>

#include "ACDCConverter.hpp"
#include "DCPolarityKind.hpp"

using namespace CIMPP;

ACDCConverterDCTerminal::ACDCConverterDCTerminal() : DCConductingEquipment(nullptr) {};
ACDCConverterDCTerminal::~ACDCConverterDCTerminal() {};
ACDCConverterDCTerminal::ACDCConverterDCTerminal() : DCConductingEquipment(nullptr) {}
ACDCConverterDCTerminal::~ACDCConverterDCTerminal() {}

static const std::list<CGMESProfile> PossibleProfilesForClass =
{
Expand Down Expand Up @@ -42,21 +41,6 @@ ACDCConverterDCTerminal::getPossibleProfilesForAttributes() const
return map;
}


bool assign_ACDCConverterDCTerminal_polarity(std::stringstream &buffer, BaseClass* BaseClass_ptr1)
{
if (ACDCConverterDCTerminal* element = dynamic_cast<ACDCConverterDCTerminal*>(BaseClass_ptr1))
{
buffer >> element->polarity;
if (buffer.fail())
return false;
else
return true;
}
return false;
}


bool assign_ACDCConverter_DCTerminals(BaseClass*, BaseClass*);
bool assign_ACDCConverterDCTerminal_DCConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2)
{
Expand All @@ -74,10 +58,24 @@ bool assign_ACDCConverterDCTerminal_DCConductingEquipment(BaseClass* BaseClass_p
return false;
}

bool assign_ACDCConverterDCTerminal_polarity(std::stringstream& buffer, BaseClass* BaseClass_ptr1)
{
ACDCConverterDCTerminal* element = dynamic_cast<ACDCConverterDCTerminal*>(BaseClass_ptr1);
if (element != nullptr)
{
buffer >> element->polarity;
if (!buffer.fail())
{
return true;
}
}
return false;
}

bool get_ACDCConverterDCTerminal_DCConductingEquipment(const BaseClass* BaseClass_ptr1, std::list<const BaseClass*>& BaseClass_list)
{
if (const ACDCConverterDCTerminal* element = dynamic_cast<const ACDCConverterDCTerminal*>(BaseClass_ptr1))
const ACDCConverterDCTerminal* element = dynamic_cast<const ACDCConverterDCTerminal*>(BaseClass_ptr1);
if (element != nullptr)
{
if (element->DCConductingEquipment != 0)
{
Expand All @@ -88,10 +86,10 @@ bool get_ACDCConverterDCTerminal_DCConductingEquipment(const BaseClass* BaseClas
return false;
}


bool get_ACDCConverterDCTerminal_polarity(const BaseClass* BaseClass_ptr1, std::stringstream& buffer)
{
if (const ACDCConverterDCTerminal* element = dynamic_cast<const ACDCConverterDCTerminal*>(BaseClass_ptr1))
const ACDCConverterDCTerminal* element = dynamic_cast<const ACDCConverterDCTerminal*>(BaseClass_ptr1);
if (element != nullptr)
{
buffer << element->polarity;
if (!buffer.str().empty())
Expand All @@ -111,17 +109,17 @@ const char* ACDCConverterDCTerminal::debugString() const

void ACDCConverterDCTerminal::addConstructToMap(std::unordered_map<std::string, BaseClass* (*)()>& factory_map)
{
factory_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal"), &ACDCConverterDCTerminal_factory));
factory_map.emplace("cim:ACDCConverterDCTerminal", &ACDCConverterDCTerminal_factory);
}

void ACDCConverterDCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map<std::string, assign_function>& assign_map)
{
assign_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal.polarity"), &assign_ACDCConverterDCTerminal_polarity));
assign_map.emplace("cim:ACDCConverterDCTerminal.polarity", &assign_ACDCConverterDCTerminal_polarity);
}

void ACDCConverterDCTerminal::addClassAssignFnsToMap(std::unordered_map<std::string, class_assign_function>& assign_map)
{
assign_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal.DCConductingEquipment"), &assign_ACDCConverterDCTerminal_DCConductingEquipment));
assign_map.emplace("cim:ACDCConverterDCTerminal.DCConductingEquipment", &assign_ACDCConverterDCTerminal_DCConductingEquipment);
}

void ACDCConverterDCTerminal::addPrimitiveGetFnsToMap(std::map<std::string, get_function>& get_map) const
Expand Down
7 changes: 5 additions & 2 deletions CGMES_2.4.13_18DEC2013/ACDCConverterDCTerminal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ namespace CIMPP
ACDCConverterDCTerminal();
~ACDCConverterDCTerminal() override;

CIMPP::ACDCConverter* DCConductingEquipment; /* Default: 0 */
CIMPP::DCPolarityKind polarity; /* Represents the normal network polarity condition. Default: 0 */
/** \brief Default: 0 */
CIMPP::ACDCConverter* DCConductingEquipment;

/** \brief Represents the normal network polarity condition. Default: 0 */
CIMPP::DCPolarityKind polarity;

static const char debugName[];
const char* debugString() const override;
Expand Down
103 changes: 53 additions & 50 deletions CGMES_2.4.13_18DEC2013/ACDCTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cim
#include "BusNameMarker.hpp"
#include "Measurement.hpp"
#include "OperationalLimitSet.hpp"
#include "Boolean.hpp"
#include "Integer.hpp"

using namespace CIMPP;

ACDCTerminal::ACDCTerminal() : BusNameMarker(nullptr) {};
ACDCTerminal::~ACDCTerminal() {};
ACDCTerminal::ACDCTerminal() : BusNameMarker(nullptr) {}
ACDCTerminal::~ACDCTerminal() {}

static const std::list<CGMESProfile> PossibleProfilesForClass =
{
Expand Down Expand Up @@ -52,34 +50,6 @@ ACDCTerminal::getPossibleProfilesForAttributes() const
return map;
}


bool assign_ACDCTerminal_connected(std::stringstream &buffer, BaseClass* BaseClass_ptr1)
{
if (ACDCTerminal* element = dynamic_cast<ACDCTerminal*>(BaseClass_ptr1))
{
buffer >> element->connected;
if (buffer.fail())
return false;
else
return true;
}
return false;
}

bool assign_ACDCTerminal_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1)
{
if (ACDCTerminal* element = dynamic_cast<ACDCTerminal*>(BaseClass_ptr1))
{
buffer >> element->sequenceNumber;
if (buffer.fail())
return false;
else
return true;
}
return false;
}


bool assign_BusNameMarker_Terminal(BaseClass*, BaseClass*);
bool assign_ACDCTerminal_BusNameMarker(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2)
{
Expand All @@ -96,6 +66,7 @@ bool assign_ACDCTerminal_BusNameMarker(BaseClass* BaseClass_ptr1, BaseClass* Bas
}
return false;
}

bool assign_Measurement_Terminal(BaseClass*, BaseClass*);
bool assign_ACDCTerminal_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2)
{
Expand All @@ -112,6 +83,7 @@ bool assign_ACDCTerminal_Measurements(BaseClass* BaseClass_ptr1, BaseClass* Base
}
return false;
}

bool assign_OperationalLimitSet_Terminal(BaseClass*, BaseClass*);
bool assign_ACDCTerminal_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2)
{
Expand All @@ -129,38 +101,38 @@ bool assign_ACDCTerminal_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClas
return false;
}

bool get_ACDCTerminal_connected(const BaseClass* BaseClass_ptr1, std::stringstream& buffer)
bool assign_ACDCTerminal_connected(std::stringstream& buffer, BaseClass* BaseClass_ptr1)
{
if (const ACDCTerminal* element = dynamic_cast<const ACDCTerminal*>(BaseClass_ptr1))
ACDCTerminal* element = dynamic_cast<ACDCTerminal*>(BaseClass_ptr1);
if (element != nullptr)
{
buffer << element->connected;
if (!buffer.str().empty())
buffer >> element->connected;
if (!buffer.fail())
{
return true;
}
}
buffer.setstate(std::ios::failbit);
return false;
}

bool get_ACDCTerminal_sequenceNumber(const BaseClass* BaseClass_ptr1, std::stringstream& buffer)
bool assign_ACDCTerminal_sequenceNumber(std::stringstream& buffer, BaseClass* BaseClass_ptr1)
{
if (const ACDCTerminal* element = dynamic_cast<const ACDCTerminal*>(BaseClass_ptr1))
ACDCTerminal* element = dynamic_cast<ACDCTerminal*>(BaseClass_ptr1);
if (element != nullptr)
{
buffer << element->sequenceNumber;
if (!buffer.str().empty())
buffer >> element->sequenceNumber;
if (!buffer.fail())
{
return true;
}
}
buffer.setstate(std::ios::failbit);
return false;
}


bool get_ACDCTerminal_BusNameMarker(const BaseClass* BaseClass_ptr1, std::list<const BaseClass*>& BaseClass_list)
{
if (const ACDCTerminal* element = dynamic_cast<const ACDCTerminal*>(BaseClass_ptr1))
const ACDCTerminal* element = dynamic_cast<const ACDCTerminal*>(BaseClass_ptr1);
if (element != nullptr)
{
if (element->BusNameMarker != 0)
{
Expand All @@ -172,6 +144,37 @@ bool get_ACDCTerminal_BusNameMarker(const BaseClass* BaseClass_ptr1, std::list<c
}



bool get_ACDCTerminal_connected(const BaseClass* BaseClass_ptr1, std::stringstream& buffer)
{
const ACDCTerminal* element = dynamic_cast<const ACDCTerminal*>(BaseClass_ptr1);
if (element != nullptr)
{
buffer << element->connected;
if (!buffer.str().empty())
{
return true;
}
}
buffer.setstate(std::ios::failbit);
return false;
}

bool get_ACDCTerminal_sequenceNumber(const BaseClass* BaseClass_ptr1, std::stringstream& buffer)
{
const ACDCTerminal* element = dynamic_cast<const ACDCTerminal*>(BaseClass_ptr1);
if (element != nullptr)
{
buffer << element->sequenceNumber;
if (!buffer.str().empty())
{
return true;
}
}
buffer.setstate(std::ios::failbit);
return false;
}

const char ACDCTerminal::debugName[] = "ACDCTerminal";
const char* ACDCTerminal::debugString() const
{
Expand All @@ -180,20 +183,20 @@ const char* ACDCTerminal::debugString() const

void ACDCTerminal::addConstructToMap(std::unordered_map<std::string, BaseClass* (*)()>& factory_map)
{
factory_map.insert(std::make_pair(std::string("cim:ACDCTerminal"), &ACDCTerminal_factory));
factory_map.emplace("cim:ACDCTerminal", &ACDCTerminal_factory);
}

void ACDCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map<std::string, assign_function>& assign_map)
{
assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.connected"), &assign_ACDCTerminal_connected));
assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.sequenceNumber"), &assign_ACDCTerminal_sequenceNumber));
assign_map.emplace("cim:ACDCTerminal.connected", &assign_ACDCTerminal_connected);
assign_map.emplace("cim:ACDCTerminal.sequenceNumber", &assign_ACDCTerminal_sequenceNumber);
}

void ACDCTerminal::addClassAssignFnsToMap(std::unordered_map<std::string, class_assign_function>& assign_map)
{
assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.BusNameMarker"), &assign_ACDCTerminal_BusNameMarker));
assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.Measurements"), &assign_ACDCTerminal_Measurements));
assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.OperationalLimitSet"), &assign_ACDCTerminal_OperationalLimitSet));
assign_map.emplace("cim:ACDCTerminal.BusNameMarker", &assign_ACDCTerminal_BusNameMarker);
assign_map.emplace("cim:ACDCTerminal.Measurements", &assign_ACDCTerminal_Measurements);
assign_map.emplace("cim:ACDCTerminal.OperationalLimitSet", &assign_ACDCTerminal_OperationalLimitSet);
}

void ACDCTerminal::addPrimitiveGetFnsToMap(std::map<std::string, get_function>& get_map) const
Expand Down
Loading