Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Changelog

## v.03
## v0.3

- Added `output_layout` solver option for long monitor output and a PostgreSQL example.
- Restricted monitored bus names and device ids to letters, digits, spaces, `_`, `.` and `-`.
Expand All @@ -24,6 +24,8 @@
- Fixed ESDC1A rate feedback to use the limited field-voltage rate.
- Fixed REGCA to hold the terminal voltage at `Vhvmax`, as PowerWorld does; `Khv` is accepted but unused.
- Added the FourBusLimits validation case, which drives the REPCA, REECB, REGCA, and ESDC1A limits.
- Added a `TwoArea` integration test comparing flat and hierarchical PhasorDynamics systems.
- Added rate feedback (`Kf`, `Tf`) to the IEEET1 exciters in the `TwoArea` case, whose generators lost synchronism without a fault.

## v0.2

Expand Down
4 changes: 2 additions & 2 deletions GridKit/Model/PhasorDynamics/Component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ namespace GridKit
/// Global indices of attached external signals
std::vector<IdxT> ws_indices_;

RealT time_;
RealT alpha_;
RealT time_{0};
RealT alpha_{0};

RealT freq_system_base_{60.0};
RealT va_system_base_{100.0e6};
Expand Down
2 changes: 2 additions & 0 deletions GridKit/Model/PhasorDynamics/SystemModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ namespace GridKit
ComponentT* getComponent(const std::string& label);
BranchT* getBranch(const std::string& id);

IdxT numBuses() const;
IdxT getBusId(IdxT gridkit_bus_id) const;
IdxT numComponents() const;
const std::string& getComponentLabel(IdxT gridkit_component_id) const;
IdxT numSubsystems() const;
Expand Down
21 changes: 21 additions & 0 deletions GridKit/Model/PhasorDynamics/SystemModelImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,27 @@ namespace GridKit
return bus;
}

/**
* @brief Return the number of this system's own buses, without those of
* its subsystems
*/
template <typename scalar_type, typename index_type>
typename SystemModel<scalar_type, index_type>::IdxT
SystemModel<scalar_type, index_type>::numBuses() const
{
return static_cast<IdxT>(buses_.size());
}

/**
* @brief Return the bus_id of one of this system's own buses
*/
template <typename scalar_type, typename index_type>
typename SystemModel<scalar_type, index_type>::IdxT
SystemModel<scalar_type, index_type>::getBusId(IdxT gridkit_bus_id) const
{
return buses_.at(gridkit_bus_id)->busID();
}

template <typename scalar_type, typename index_type>
typename SystemModel<scalar_type, index_type>::IdxT
SystemModel<scalar_type, index_type>::numComponents() const
Expand Down
2 changes: 2 additions & 0 deletions cases/PhasorDynamics/TwoArea/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Figure 1: One-line diagram of the TwoArea case.[^1]

This case is derived from the Kundur two-area system and includes exciters for use in GridKit.

The exciters use the rate feedback `Kf = 0.1` and `Tf = 1.0` from the DC1C sample data in IEEE 421.5-2016, Annex H, because the generators lose synchronism without it. These values are not specific to this case. All four exciters use `Vrmax = 3.0` for consistency.

Simulation and validation studies have not yet been implemented for this case.

[^1]: PowerWorld, [Simulator Help](https://www.powerworld.com/WebHelp/).
18 changes: 9 additions & 9 deletions cases/PhasorDynamics/TwoArea/TwoArea.case.json
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,8 @@
"Ta": 1.0,
"Ke": 0.0,
"Te": 0.0,
"Kf": 0.0,
"Tf": 0.0,
"Kf": 0.1,
"Tf": 1.0,
"Vrmin": -3.0,
"Vrmax": 3.0,
"E1": 0.0,
Expand All @@ -706,8 +706,8 @@
"Ta": 1.0,
"Ke": 0.0,
"Te": 0.0,
"Kf": 0.0,
"Tf": 0.0,
"Kf": 0.1,
"Tf": 1.0,
"Vrmin": -3.0,
"Vrmax": 3.0,
"E1": 0.0,
Expand All @@ -731,10 +731,10 @@
"Ta": 1.0,
"Ke": 0.0,
"Te": 0.0,
"Kf": 0.0,
"Tf": 0.0,
"Kf": 0.1,
"Tf": 1.0,
"Vrmin": -3.0,
"Vrmax": 0.0,
"Vrmax": 3.0,
"E1": 0.0,
"E2": 0.0,
"Se1": 0.0,
Expand All @@ -756,8 +756,8 @@
"Ta": 1.0,
"Ke": 0.0,
"Te": 0.0,
"Kf": 0.0,
"Tf": 0.0,
"Kf": 0.1,
"Tf": 1.0,
"Vrmin": -3.0,
"Vrmax": 3.0,
"E1": 0.0,
Expand Down
1 change: 1 addition & 0 deletions tests/IntegrationTests/PhasorDynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if(TARGET SUNDIALS::idas)
install(TARGETS test_pd_integration)

add_subdirectory(TenGen)
add_subdirectory(TwoArea)
endif()

if(GRIDKIT_ENABLE_ENZYME)
Expand Down
14 changes: 14 additions & 0 deletions tests/IntegrationTests/PhasorDynamics/TwoArea/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
add_executable(test_pd_two_area_hierarchical runTwoAreaHierarchicalTests.cpp)
target_link_libraries(
test_pd_two_area_hierarchical
PRIVATE GridKit::phasor_dynamics_systemmodel GridKit::solvers_dyn GridKit::testing)

configure_file(${CMAKE_SOURCE_DIR}/cases/PhasorDynamics/TwoArea/TwoArea.case.json TwoArea.case.json
COPYONLY)
configure_file(TwoAreaHierarchical.case.json TwoAreaHierarchical.case.json COPYONLY)

add_test(NAME PhasorDynamicsIntegrationTwoAreaHierarchical COMMAND test_pd_two_area_hierarchical)

install(TARGETS test_pd_two_area_hierarchical)
install(FILES ${CMAKE_SOURCE_DIR}/cases/PhasorDynamics/TwoArea/TwoArea.case.json
TwoAreaHierarchical.case.json DESTINATION share/gridkit/tests/PhasorDynamics/TwoArea)
13 changes: 13 additions & 0 deletions tests/IntegrationTests/PhasorDynamics/TwoArea/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# TwoArea Hierarchical Test

`TwoAreaHierarchical.case.json` has the same system parameters, buses and devices as the [TwoArea case](../../../../cases/PhasorDynamics/TwoArea/README.md) ([`TwoArea.case.json`](../../../../cases/PhasorDynamics/TwoArea/TwoArea.case.json)), split into the [subsystems](../../../../GridKit/Model/PhasorDynamics/INPUT_FORMAT.md#subsystems) below. The test `PhasorDynamicsIntegrationTwoAreaHierarchical` compares the two files.

System | Buses | Devices
-- | -- | --
Top level | 8 | None
`Area1` | 1, 2, 5, 6, 7 | Generators on buses 1 and 2 with their exciters and governors, the load on bus 7, and the branches between these buses and to bus 8
`Area2` | 3, 4, 9, 10 | Generators on buses 3 and 4 with their exciters and governors, the load on bus 8, and the branches between these buses and to bus 8

Bus 8 connects the two areas, so it stays at the top level, where both areas can use it. The load on bus 8 is in `Area2` because a system with subsystems cannot have devices of its own.

The hierarchical file is a separate copy of the data, so a change to the case must be made in both files.
Loading
Loading