Skip to content

Commit ec42ea9

Browse files
committed
Add load data structure.
1 parent 889dbd7 commit ec42ea9

7 files changed

Lines changed: 61 additions & 31 deletions

File tree

src/Model/PhasorDynamics/Branch/Branch.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ namespace GridKit
3636
X_(0.01),
3737
G_(0.0),
3838
B_(0.0),
39-
bus1ID_(0),
40-
bus2ID_(0)
39+
bus1_id_(0),
40+
bus2_id_(0)
4141
{
4242
size_ = 0;
4343
}
@@ -67,8 +67,8 @@ namespace GridKit
6767
X_(X),
6868
G_(G),
6969
B_(B),
70-
bus1ID_(0),
71-
bus2ID_(0)
70+
bus1_id_(0),
71+
bus2_id_(0)
7272
{
7373
}
7474

@@ -80,8 +80,8 @@ namespace GridKit
8080
X_(data.X),
8181
G_(data.G),
8282
B_(data.B),
83-
bus1ID_(data.fbus),
84-
bus2ID_(data.tbus)
83+
bus1_id_(data.bus1_id),
84+
bus2_id_(data.bus2_id)
8585
{
8686
size_ = 0;
8787
}

src/Model/PhasorDynamics/Branch/Branch.hpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,15 @@
1111
#include <Model/PhasorDynamics/Component.hpp>
1212

1313
// Forward declarations.
14-
namespace GridKit
15-
{
16-
namespace PhasorDynamics
17-
{
18-
template <typename RealT, typename IdxT>
19-
struct BranchData;
20-
}
21-
} // namespace GridKit
22-
2314
namespace GridKit
2415
{
2516
namespace PhasorDynamics
2617
{
2718
template <class ScalarT, typename IdxT>
2819
class BusBase;
20+
21+
template <typename RealT, typename IdxT>
22+
struct BranchData;
2923
}
3024
} // namespace GridKit
3125

@@ -154,8 +148,8 @@ namespace GridKit
154148
real_type X_;
155149
real_type G_;
156150
real_type B_;
157-
const IdxT bus1ID_;
158-
const IdxT bus2ID_;
151+
const IdxT bus1_id_;
152+
const IdxT bus2_id_;
159153
};
160154

161155
} // namespace PhasorDynamics

src/Model/PhasorDynamics/Branch/BranchData.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ namespace GridKit
2929
RealT G{0.0}; ///< line shunt conductance
3030
RealT B{0.0}; ///< line shunt charging
3131

32-
IdxT fbus{0}; ///< Unique ID of bus 1
33-
IdxT tbus{0}; ///< Unique ID of bus 2
32+
IdxT bus1_id{0}; ///< Unique ID of bus 1
33+
IdxT bus2_id{0}; ///< Unique ID of bus 2
3434
};
3535
}
3636
}

src/Model/PhasorDynamics/Bus/BusData.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @file BusData.hpp
33
* @author Slaven Peles (peless@ornl.gov)
4-
* @brief Modeling data for branches (transmission lines)
4+
* @brief Modeling data for buses (nodes)
55
*
66
*/
77
#pragma once

src/Model/PhasorDynamics/Load/Load.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <iostream>
66

77
#include <Model/PhasorDynamics/Bus/Bus.hpp>
8+
#include <Model/PhasorDynamics/Load/LoadData.hpp>
89

910
namespace GridKit
1011
{
@@ -34,14 +35,12 @@ namespace GridKit
3435
: bus_(bus),
3536
R_(R),
3637
X_(X)
37-
3838
{
3939
}
4040

4141
template <class ScalarT, typename IdxT>
4242
Load<ScalarT, IdxT>::Load(bus_type* bus, IdxT component_id)
4343
: bus_(bus)
44-
4544
{
4645
size_ = 0;
4746
component_id_ = component_id;

src/Model/PhasorDynamics/Load/Load.hpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ namespace GridKit
1111
{
1212
template <class ScalarT, typename IdxT>
1313
class BusBase;
14-
}
14+
15+
template <typename RealT, typename IdxT>
16+
struct LoadData;
17+
} // namespace PhasorDynamics
1518
} // namespace GridKit
1619

1720
namespace GridKit
@@ -33,16 +36,17 @@ namespace GridKit
3336
using Component<ScalarT, IdxT>::yp_;
3437
using Component<ScalarT, IdxT>::tag_;
3538
using Component<ScalarT, IdxT>::f_;
36-
using Component<ScalarT, IdxT>::g_;
37-
using Component<ScalarT, IdxT>::yB_;
38-
using Component<ScalarT, IdxT>::ypB_;
39-
using Component<ScalarT, IdxT>::fB_;
40-
using Component<ScalarT, IdxT>::gB_;
41-
using Component<ScalarT, IdxT>::param_;
39+
// using Component<ScalarT, IdxT>::g_;
40+
// using Component<ScalarT, IdxT>::yB_;
41+
// using Component<ScalarT, IdxT>::ypB_;
42+
// using Component<ScalarT, IdxT>::fB_;
43+
// using Component<ScalarT, IdxT>::gB_;
44+
// using Component<ScalarT, IdxT>::param_;
4245
using Component<ScalarT, IdxT>::component_id_;
4346

44-
using bus_type = BusBase<ScalarT, IdxT>;
45-
using real_type = typename Component<ScalarT, IdxT>::real_type;
47+
using real_type = typename Component<ScalarT, IdxT>::real_type;
48+
using bus_type = BusBase<ScalarT, IdxT>;
49+
using model_data_type = LoadData<real_type, IdxT>;
4650

4751
public:
4852
Load(bus_type* bus);
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @file LoadData.hpp
3+
* @author Slaven Peles (peless@ornl.gov)
4+
* @brief Modeling data for loads
5+
*
6+
*/
7+
#pragma once
8+
9+
10+
namespace GridKit
11+
{
12+
namespace PhasorDynamics
13+
{
14+
/**
15+
* @brief Contains modeling data for a Load
16+
*
17+
* @tparam RealT Real parameter data type
18+
* @tparam IdxT Integer parameter data type
19+
*
20+
* Integer parameters are of the same type as matrix and vector indices.
21+
*
22+
* @todo Decide on naming scheme for model parameters.
23+
*/
24+
template <typename RealT, typename IdxT>
25+
struct LoadData
26+
{
27+
RealT R{0.0}; ///< load resistance
28+
RealT X{0.0}; ///< load reactance
29+
30+
IdxT bus_id{0}; ///< Unique ID of bus 1
31+
};
32+
}
33+
}

0 commit comments

Comments
 (0)