-
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.
Signed-off-by: Sébastien LAIGRE <[email protected]>
- Loading branch information
Showing
8 changed files
with
1,093 additions
and
4 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
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,211 @@ | ||
/** | ||
* 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_UTIL_TWTDATA_HPP | ||
#define POWSYBL_IIDM_UTIL_TWTDATA_HPP | ||
|
||
#include <complex> | ||
#include <string> | ||
|
||
#include <powsybl/iidm/ThreeWindingsTransformer.hpp> | ||
#include <powsybl/iidm/util/LinkData.hpp> | ||
|
||
namespace powsybl { | ||
|
||
namespace iidm { | ||
|
||
class ThreeWindingsTransformer; | ||
|
||
class TwtData { | ||
public: | ||
TwtData(const ThreeWindingsTransformer& twt, double epsilonX, bool applyReactanceCorrection); | ||
|
||
TwtData(const ThreeWindingsTransformer& twt, double epsilonX, bool applyReactanceCorrection, | ||
bool twtSplitShuntAdmittance); | ||
|
||
TwtData(const ThreeWindingsTransformer& twt, int phaseAngleClock2, int phaseAngleClock3, double epsilonX, | ||
bool applyReactanceCorrection, bool twtSplitShuntAdmittance); | ||
|
||
double getB1(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getB2(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getComputedP(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getComputedQ(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getG1(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getG2(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
const std::string& getId() const; | ||
|
||
double getP(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getQ(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getR(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getRatedU(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getStarTheta() const; | ||
|
||
double getStarU() const; | ||
|
||
double getTheta(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getU(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
double getX(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
bool isConnected(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
bool isMainComponent(const ThreeWindingsTransformer::Side& side) const; | ||
|
||
int getPhaseAngleClock2() const; | ||
|
||
int getPhaseAngleClock3() const; | ||
|
||
double getRatedU0() const; | ||
|
||
private: | ||
static double alpha(const ThreeWindingsTransformer::Leg& leg); | ||
|
||
static double getB1(const ThreeWindingsTransformer::Leg& leg, bool twtSplitShuntAdmittance); | ||
|
||
static double getB2(const ThreeWindingsTransformer::Leg& leg, bool twtSplitShuntAdmittance); | ||
|
||
static double getG1(const ThreeWindingsTransformer::Leg& leg, bool twtSplitShuntAdmittance); | ||
|
||
static double getG2(const ThreeWindingsTransformer::Leg& leg, bool twtSplitShuntAdmittance); | ||
|
||
static double getR(const ThreeWindingsTransformer::Leg& leg); | ||
|
||
static double getTheta(const ThreeWindingsTransformer::Leg& leg); | ||
|
||
static double getV(const ThreeWindingsTransformer::Leg& leg); | ||
|
||
static double getValue(double initialValue, double rtcStepValue, double ptcStepValue); | ||
|
||
static double getX(const ThreeWindingsTransformer::Leg& leg); | ||
|
||
static bool isMainComponent(const ThreeWindingsTransformer::Leg& leg); | ||
|
||
static double rho(const ThreeWindingsTransformer::Leg& leg, double ratedU0); | ||
|
||
static bool valid(double voltage, double theta); | ||
|
||
private: | ||
std::complex<double> calculateOneConnectedLegFlow(double u, double theta, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixLeg, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixFirstOpenLeg, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixSecondOpenLeg); | ||
|
||
std::complex<double> calculateOneConnectedLegShunt(const LinkData::BranchAdmittanceMatrix& closeLeg, | ||
const LinkData::BranchAdmittanceMatrix& firstOpenLeg, | ||
const LinkData::BranchAdmittanceMatrix& secondOpenLeg); | ||
|
||
std::complex<double> calculateOneConnectedLegStarBusVoltage(double u, double theta, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixLeg, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixFirstOpenLeg, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixSecondOpenLeg); | ||
|
||
void calculateThreeConnectedLegsFlowAndStarBusVoltage(double u1, double theta1, double u2, double theta2, | ||
double u3, double theta3, | ||
const LinkData::BranchAdmittanceMatrix& branchAdmittanceLeg1, | ||
const LinkData::BranchAdmittanceMatrix& branchAdmittanceLeg2, | ||
const LinkData::BranchAdmittanceMatrix& branchAdmittanceLeg3); | ||
|
||
LinkData::BranchAdmittanceMatrix calculateTwoConnectedLegsAdmittance(const LinkData::BranchAdmittanceMatrix& firstCloseLeg, | ||
const LinkData::BranchAdmittanceMatrix& secondCloseLeg, | ||
const LinkData::BranchAdmittanceMatrix& openLeg); | ||
|
||
LinkData::Flow calculateTwoConnectedLegsFlow(double u1, double theta1, double u2, double theta2, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixLeg1, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixLeg2, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixOpenLeg); | ||
|
||
std::complex<double> calculateTwoConnectedLegsStarBusVoltage(double u1, double theta1, double u2, double theta2, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixLeg1, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixLeg2, | ||
const LinkData::BranchAdmittanceMatrix& admittanceMatrixOpenLeg); | ||
|
||
private: | ||
std::string id; | ||
|
||
double p1; | ||
double q1; | ||
double p2; | ||
double q2; | ||
double p3; | ||
double q3; | ||
|
||
double u1; | ||
double theta1; | ||
double u2; | ||
double theta2; | ||
double u3; | ||
double theta3; | ||
|
||
double r1; | ||
double x1; | ||
double r2; | ||
double x2; | ||
double r3; | ||
double x3; | ||
|
||
double g11; | ||
double b11; | ||
double g12; | ||
double b12; | ||
double g21; | ||
double b21; | ||
double g22; | ||
double b22; | ||
double g31; | ||
double b31; | ||
double g32; | ||
double b32; | ||
|
||
double rho1; | ||
double alpha1; | ||
double rho2; | ||
double alpha2; | ||
double rho3; | ||
double alpha3; | ||
|
||
double ratedU1; | ||
double ratedU2; | ||
double ratedU3; | ||
|
||
bool connected1; | ||
bool connected2; | ||
bool connected3; | ||
bool mainComponent1; | ||
bool mainComponent2; | ||
bool mainComponent3; | ||
|
||
double computedP1; | ||
double computedQ1; | ||
double computedP2; | ||
double computedQ2; | ||
double computedP3; | ||
double computedQ3; | ||
|
||
double starU; | ||
double starTheta; | ||
|
||
int phaseAngleClock2; | ||
int phaseAngleClock3; | ||
double ratedU0; | ||
}; | ||
|
||
} // namespace iidm | ||
|
||
} // namespace powsybl | ||
|
||
#endif // POWSYBL_IIDM_UTIL_TWTDATA_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
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
Oops, something went wrong.