Skip to content

Commit f3d5dd6

Browse files
authored
Cleanup old Component Constructors (#627)
* Consistant constructors * Adjust breaking tests and defaults * Update README and CHANGELOG
1 parent c9a6497 commit f3d5dd6

50 files changed

Lines changed: 268 additions & 595 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Added `enable` and `disable` solver events that put a branch in or out of service.
1111
- `verify()` returns `Model::ConfigurationChecks` listing every configuration problem instead of an error count.
1212
- Added `Model::ParameterReader`
13+
- Removed legacy PhasorDynamics component constructors in favor of constructors taking model data.
1314

1415
## v0.2
1516

‎GridKit/Model/PhasorDynamics/Branch/Branch.hpp‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@ namespace GridKit
5454
using MonitorT = Model::VariableMonitor<Branch, BranchData>;
5555

5656
public:
57-
Branch(BusT* bus1, BusT* bus2);
58-
Branch(BusT* bus1,
59-
BusT* bus2,
60-
RealT R,
61-
RealT X,
62-
RealT G,
63-
RealT B,
64-
RealT tap = 1.0,
65-
RealT phase = 0.0);
6657
Branch(BusT* bus1, BusT* bus2, const ModelDataT& data);
6758
virtual ~Branch();
6859

@@ -192,7 +183,7 @@ namespace GridKit
192183
BusT* bus1_;
193184
BusT* bus2_;
194185
RealT R_{0.0};
195-
RealT X_{0.0};
186+
RealT X_{0.01};
196187
RealT G_{0.0};
197188
RealT B_{0.0};
198189
RealT Gmag_{0.0};

‎GridKit/Model/PhasorDynamics/Branch/BranchImpl.hpp‎

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -26,60 +26,11 @@ namespace GridKit
2626
* Model size:
2727
* - Number of equations = 0
2828
* - Number of internal variables = 0
29-
*/
30-
template <typename scalar_type, typename index_type>
31-
Branch<scalar_type, index_type>::Branch(BusT* bus1, BusT* bus2)
32-
: bus1_(bus1),
33-
bus2_(bus2),
34-
R_(0.0),
35-
X_(0.01),
36-
G_(0.0),
37-
B_(0.0),
38-
tap_(1.0),
39-
phase_(0.0),
40-
bus1_id_(0),
41-
bus2_id_(0)
42-
{
43-
size_ = 0;
44-
setDerivedParams();
45-
}
46-
47-
/**
48-
* @brief Construct a new Branch
4929
*
5030
* @param bus1 - pointer to bus-1
5131
* @param bus2 - pointer to bus-2
52-
* @param R - line series resistance
53-
* @param X - line series reactance
54-
* @param G - total line shunt conductance
55-
* @param B - total line shunt susceptance
56-
* @param tap - off-nominal tap magnitude on bus1 side
57-
* @param phase - phase shift angle in radians
32+
* @param data - branch parameters and monitored-variable selections
5833
*/
59-
template <typename scalar_type, typename index_type>
60-
Branch<scalar_type, index_type>::Branch(BusT* bus1,
61-
BusT* bus2,
62-
RealT R,
63-
RealT X,
64-
RealT G,
65-
RealT B,
66-
RealT tap,
67-
RealT phase)
68-
: bus1_(bus1),
69-
bus2_(bus2),
70-
R_(R),
71-
X_(X),
72-
G_(G),
73-
B_(B),
74-
tap_(tap),
75-
phase_(phase),
76-
bus1_id_(0),
77-
bus2_id_(0)
78-
{
79-
size_ = 0;
80-
setDerivedParams();
81-
}
82-
8334
template <typename scalar_type, typename index_type>
8435
Branch<scalar_type, index_type>::Branch(BusT* bus1, BusT* bus2, const ModelDataT& data)
8536
: bus1_(bus1),

‎GridKit/Model/PhasorDynamics/Branch/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Figure 1: Branch model.
2929
Symbol | Units | JSON | Description | Typical Value | Note
3030
-----------------|--------|---------|-----------------------------------------|---------------|-----
3131
$R$ | [p.u.] | `R` | Branch series resistance | |
32-
$X$ | [p.u.] | `X` | Branch series reactance | |
32+
$X$ | [p.u.] | `X` | Branch series reactance | 0.01 | Default when omitted
3333
$G$ | [p.u.] | `G` | Total line shunt conductance | 0.0 |
3434
$B$ | [p.u.] | `B` | Total line shunt susceptance | 0.0 |
3535
$G_\mathrm{mag}$ | [p.u.] | `Gmag` | Magnetizing shunt conductance at bus 1 | 0.0 |

‎GridKit/Model/PhasorDynamics/Controller/REECB/Reecb.hpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ namespace GridKit
111111
static constexpr RealT INITIALIZATION_TOLERANCE =
112112
static_cast<RealT>(100.0) * std::numeric_limits<RealT>::epsilon();
113113

114-
Reecb(BusT* bus);
115114
Reecb(BusT* bus, const ModelDataT& data);
116115
~Reecb();
117116

‎GridKit/Model/PhasorDynamics/Controller/REECB/ReecbImpl.hpp‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,6 @@ namespace GridKit
4848
RealT vref{};
4949
};
5050

51-
/**
52-
* @brief Construct an unconfigured REECB controller
53-
*
54-
* @param[in] bus Terminal bus measured by the controller.
55-
*/
56-
template <typename scalar_type, typename index_type>
57-
Reecb<scalar_type, index_type>::Reecb(BusT* bus)
58-
: bus_(bus)
59-
{
60-
size_ = static_cast<IdxT>(Utilities::enum_size<ReecbInternalVariables>());
61-
setDerivedParameters();
62-
}
63-
6451
/**
6552
* @brief Construct REECB from model data
6653
*

‎GridKit/Model/PhasorDynamics/Controller/REPCA/Repca.hpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ namespace GridKit
116116
public:
117117
static constexpr RealT INITIALIZATION_TOLERANCE = static_cast<RealT>(1.0e-12);
118118

119-
Repca(BusT* bus);
120119
Repca(BusT* bus, const ModelDataT& data);
121120
~Repca();
122121

‎GridKit/Model/PhasorDynamics/Controller/REPCA/RepcaImpl.hpp‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,6 @@ namespace GridKit
2828
/// Logger used for REPCA diagnostics.
2929
using Log = ::GridKit::Utilities::Logger;
3030

31-
/**
32-
* @brief Construct REPCA with its documented parameter defaults
33-
*
34-
* The regulated bus is retained, the model is sized, and every
35-
* parameter keeps its documented default. No monitor or signal
36-
* connection is created.
37-
*
38-
* @param[in] bus Regulated bus measured by the controller.
39-
*/
40-
template <typename scalar_type, typename index_type>
41-
Repca<scalar_type, index_type>::Repca(BusT* bus)
42-
: bus_(bus)
43-
{
44-
size_ = static_cast<IdxT>(Utilities::enum_size<RepcaInternalVariables>());
45-
setDerivedParameters();
46-
}
47-
4831
/**
4932
* @brief Construct REPCA from model data
5033
*

‎GridKit/Model/PhasorDynamics/Converter/REGCA/Regca.hpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ namespace GridKit
9999
using ExternalVariablesT = RegcaExternalVariables;
100100

101101
public:
102-
Regca(BusT* bus);
103102
Regca(BusT* bus, const ModelDataT& data);
104103
~Regca();
105104

‎GridKit/Model/PhasorDynamics/Converter/REGCA/RegcaImpl.hpp‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ namespace GridKit
2727
{
2828
using Log = ::GridKit::Utilities::Logger;
2929

30-
/**
31-
* @brief Construct a sized but unconfigured REGCA converter.
32-
*
33-
* @param[in] bus Terminal bus the converter injects into.
34-
*/
35-
template <typename scalar_type, typename index_type>
36-
Regca<scalar_type, index_type>::Regca(BusT* bus)
37-
: bus_(bus)
38-
{
39-
size_ = static_cast<IdxT>(Utilities::enum_size<RegcaInternalVariables>());
40-
}
41-
4230
/**
4331
* @brief Construct a REGCA converter from model data.
4432
*

0 commit comments

Comments
 (0)