-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add GeneratorShortCircuit extension * Add IdentifiableShortCircuit extension * Add units in documentation for getIpMax/setIpMax and add missing check for nan values in setIpMax Signed-off-by: Sébastien LAIGRE <[email protected]>
- Loading branch information
Showing
11 changed files
with
744 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
extensions/iidm/include/powsybl/iidm/extensions/iidm/GeneratorShortCircuit.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/** | ||
* Copyright (c) 2022, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#ifndef POWSYBL_IIDM_EXTENSIONS_IIDM_GENERATORSHORTCIRCUIT_HPP | ||
#define POWSYBL_IIDM_EXTENSIONS_IIDM_GENERATORSHORTCIRCUIT_HPP | ||
|
||
#include <powsybl/iidm/Extension.hpp> | ||
|
||
namespace powsybl { | ||
|
||
namespace iidm { | ||
|
||
class Generator; | ||
|
||
namespace extensions { | ||
|
||
namespace iidm { | ||
|
||
class GeneratorShortCircuit : public Extension { | ||
public: // Extension | ||
const std::string& getName() const override; | ||
|
||
const std::type_index& getType() const override; | ||
|
||
public: | ||
/** | ||
* Get the direct-axis subtransient reactance (also known as X''d) | ||
*/ | ||
double getDirectSubtransX() const; | ||
|
||
/** | ||
* Get the direct-axis transient reactance (also known as X'd) | ||
*/ | ||
double getDirectTransX() const; | ||
|
||
/** | ||
* Get the step-up transformer reactance if the generator has a non-modeled step-up transformer. | ||
*/ | ||
double getStepUpTransformerX() const; | ||
|
||
/** | ||
* Set the direct-axis subtransient reactance (also known as X''d) | ||
*/ | ||
GeneratorShortCircuit& setDirectSubtransX(double directSubtransX); | ||
|
||
/** | ||
* Set the direct-axis transient reactance (also known as X'd) | ||
*/ | ||
GeneratorShortCircuit& setDirectTransX(double directTransX); | ||
|
||
/** | ||
* Set the step-up transformer reactance | ||
*/ | ||
GeneratorShortCircuit& setStepUpTransformerX(double setUpTransformerX); | ||
|
||
private: // Extension | ||
void assertExtendable(const stdcxx::Reference<Extendable>& extendable) const override; | ||
|
||
private: | ||
GeneratorShortCircuit(Generator& generator, double directSubtransX, double directTransX, double stepUpTransformerX); | ||
|
||
friend class GeneratorShortCircuitAdder; | ||
|
||
private: | ||
double m_directSubtransX; | ||
|
||
double m_directTransX; | ||
|
||
double m_stepUpTransformerX; | ||
}; | ||
|
||
} // namespace iidm | ||
|
||
} // namespace extensions | ||
|
||
} // namespace iidm | ||
|
||
} // namespace powsybl | ||
|
||
#endif // POWSYBL_IIDM_EXTENSIONS_IIDM_GENERATORSHORTCIRCUIT_HPP |
95 changes: 95 additions & 0 deletions
95
extensions/iidm/include/powsybl/iidm/extensions/iidm/GeneratorShortCircuitAdder.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/** | ||
* Copyright (c) 2022, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#ifndef POWSYBL_IIDM_EXTENSIONS_IIDM_GENERATORSHORTCIRCUITADDER_HPP | ||
#define POWSYBL_IIDM_EXTENSIONS_IIDM_GENERATORSHORTCIRCUITADDER_HPP | ||
|
||
#include <powsybl/iidm/ExtensionAdder.hpp> | ||
#include <powsybl/stdcxx/math.hpp> | ||
|
||
namespace powsybl { | ||
|
||
namespace iidm { | ||
|
||
namespace extensions { | ||
|
||
namespace iidm { | ||
|
||
class GeneratorShortCircuitAdder : public ExtensionAdder { | ||
public: | ||
/** | ||
* Constructor | ||
*/ | ||
explicit GeneratorShortCircuitAdder(Extendable& extendable); | ||
|
||
/** | ||
* Copy constructor | ||
*/ | ||
GeneratorShortCircuitAdder(const GeneratorShortCircuitAdder&) = default; | ||
|
||
/** | ||
* Move constructor | ||
*/ | ||
GeneratorShortCircuitAdder(GeneratorShortCircuitAdder&&) = default; | ||
|
||
/** | ||
* Destructor | ||
*/ | ||
~GeneratorShortCircuitAdder() noexcept override = default; | ||
|
||
/** | ||
* Copy assignment operator | ||
*/ | ||
GeneratorShortCircuitAdder& operator=(const GeneratorShortCircuitAdder&) = delete; | ||
|
||
/** | ||
* Move assignment operator | ||
*/ | ||
GeneratorShortCircuitAdder& operator=(GeneratorShortCircuitAdder&&) = delete; | ||
|
||
/** | ||
* Set the direct-axis subtransient reactance (also known as X''d) | ||
*/ | ||
GeneratorShortCircuitAdder& withDirectSubtransX(double directSubtransX); | ||
|
||
/** | ||
* Set the direct-axis transient reactance (also known as X'd) | ||
*/ | ||
GeneratorShortCircuitAdder& withDirectTransX(double directTransX); | ||
|
||
/** | ||
* Set the step-up transformer reactance | ||
*/ | ||
GeneratorShortCircuitAdder& withStepUpTransformerX(double stepUpTransformerX); | ||
|
||
protected: | ||
/** | ||
* Creates the GeneratorShortCircuit extension. | ||
* | ||
* @param extendable the extendable | ||
* | ||
* @return the extension | ||
*/ | ||
std::unique_ptr<Extension> createExtension(Extendable& extendable) const override; | ||
|
||
private: | ||
double m_directTransX = 0.0; | ||
|
||
double m_directSubtransX = stdcxx::nan(); | ||
|
||
double m_stepUpTransformerX = stdcxx::nan(); | ||
}; | ||
|
||
} // namespace iidm | ||
|
||
} // namespace extensions | ||
|
||
} // namespace iidm | ||
|
||
} // namespace powsybl | ||
|
||
#endif // POWSYBL_IIDM_EXTENSIONS_IIDM_GENERATORSHORTCIRCUITADDER_HPP |
78 changes: 78 additions & 0 deletions
78
extensions/iidm/include/powsybl/iidm/extensions/iidm/IdentifiableShortCircuit.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* Copyright (c) 2022, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#ifndef POWSYBL_IIDM_EXTENSIONS_IIDM_IDENTIFIABLESHORTCIRCUIT_HPP | ||
#define POWSYBL_IIDM_EXTENSIONS_IIDM_IDENTIFIABLESHORTCIRCUIT_HPP | ||
|
||
#include <powsybl/iidm/Extension.hpp> | ||
|
||
namespace powsybl { | ||
|
||
namespace iidm { | ||
|
||
class Identifiable; | ||
|
||
namespace extensions { | ||
|
||
namespace iidm { | ||
|
||
class IdentifiableShortCircuit : public Extension { | ||
public: // Extension | ||
const std::string& getName() const override; | ||
|
||
const std::type_index& getType() const override; | ||
|
||
public: | ||
/** | ||
* Get maximum allowable peak short-circuit current [A] | ||
*/ | ||
double getIpMax() const; | ||
|
||
/** | ||
* Get minimum allowable peak short-circuit current [A] | ||
*/ | ||
double getIpMin() const; | ||
|
||
/** | ||
* Set maximum allowable peak short-circuit current [A] | ||
*/ | ||
IdentifiableShortCircuit& setIpMax(double ipMax); | ||
|
||
/** | ||
* Set minimum allowable peak short-circuit current [A] | ||
*/ | ||
IdentifiableShortCircuit& setIpMin(double ipMin); | ||
|
||
private: // Extension | ||
void assertExtendable(const stdcxx::Reference<Extendable>& extendable) const override; | ||
|
||
private: | ||
IdentifiableShortCircuit(Identifiable& identifiable, double ipMin, double ipMax); | ||
|
||
friend class IdentifiableShortCircuitAdder; | ||
|
||
private: | ||
/** | ||
* Minimum allowable peak short-circuit current | ||
*/ | ||
double m_ipMin; | ||
|
||
/** | ||
* Maximum allowable peak short-circuit current | ||
*/ | ||
double m_ipMax; | ||
}; | ||
|
||
} // namespace iidm | ||
|
||
} // namespace extensions | ||
|
||
} // namespace iidm | ||
|
||
} // namespace powsybl | ||
|
||
#endif // POWSYBL_IIDM_EXTENSIONS_IIDM_IDENTIFIABLESHORTCIRCUIT_HPP |
82 changes: 82 additions & 0 deletions
82
extensions/iidm/include/powsybl/iidm/extensions/iidm/IdentifiableShortCircuitAdder.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/** | ||
* Copyright (c) 2022, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
#ifndef POWSYBL_IIDM_EXTENSIONS_IIDM_IDENTIFIABLESHORTCIRCUITADDER_HPP | ||
#define POWSYBL_IIDM_EXTENSIONS_IIDM_IDENTIFIABLESHORTCIRCUITADDER_HPP | ||
|
||
#include <powsybl/iidm/ExtensionAdder.hpp> | ||
#include <powsybl/stdcxx/math.hpp> | ||
|
||
namespace powsybl { | ||
|
||
namespace iidm { | ||
|
||
namespace extensions { | ||
|
||
namespace iidm { | ||
|
||
class IdentifiableShortCircuitAdder : public ExtensionAdder { | ||
public: | ||
/** | ||
* Constructor | ||
*/ | ||
explicit IdentifiableShortCircuitAdder(Extendable& extendable); | ||
|
||
/** | ||
* Copy constructor | ||
*/ | ||
IdentifiableShortCircuitAdder(const IdentifiableShortCircuitAdder&) = default; | ||
|
||
/** | ||
* Move constructor | ||
*/ | ||
IdentifiableShortCircuitAdder(IdentifiableShortCircuitAdder&&) = default; | ||
|
||
/** | ||
* Destructor | ||
*/ | ||
~IdentifiableShortCircuitAdder() noexcept override = default; | ||
|
||
/** | ||
* Copy assignment operator | ||
*/ | ||
IdentifiableShortCircuitAdder& operator=(const IdentifiableShortCircuitAdder&) = delete; | ||
|
||
/** | ||
* Move assignment operator | ||
*/ | ||
IdentifiableShortCircuitAdder& operator=(IdentifiableShortCircuitAdder&&) = delete; | ||
|
||
IdentifiableShortCircuitAdder& withIpMax(double ipMax); | ||
|
||
IdentifiableShortCircuitAdder& withIpMin(double ipMin); | ||
|
||
protected: | ||
/** | ||
* Creates the IdentifiableShortCircuit extension. | ||
* | ||
* @param extendable the extendable | ||
* | ||
* @return the extension | ||
*/ | ||
std::unique_ptr<Extension> createExtension(Extendable& extendable) const override; | ||
|
||
private: | ||
double m_ipMin = stdcxx::nan(); | ||
|
||
double m_ipMax = stdcxx::nan(); | ||
}; | ||
|
||
} // namespace iidm | ||
|
||
} // namespace extensions | ||
|
||
} // namespace iidm | ||
|
||
} // namespace powsybl | ||
|
||
#endif // POWSYBL_IIDM_EXTENSIONS_IIDM_IDENTIFIABLESHORTCIRCUITADDER_HPP |
Oops, something went wrong.