Following the discussion in #642 it was concluded that the implementation of a generic branch could be an addition to Power Grid Model.
We can make a new component generic_branch, which models branches as a Pi model; i.e. the user can specify:
k: transformer ratio (float)
theta0 / theta1 / theta2: angle shift
r0_series / r1_series / r2_series
x0_series / x1_series / x2_series
g0_shunt / g1_shunt / g2_shunt
b0_shunt / b1_shunt / b2_shunt
Note: except for k, all attributes are given for zero, positive and negative sequence.
steps to follow
In order to add a new component to Power Grid Model the following steps need to be taken:
[ ] Check if the available input/update/output data suffices (check power-grid-model/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/input.hpp / update.hpp / output.hpp or in the documentation directly)
[ ] If not, add the new data format to code_generation/data/attribute_classes/input.json / update.json / output.json + run code_generation/code_gen.py
[ ] Create a new component in a new power-grid-model/power_grid_model_c/power_grid_model/include/power_grid_model/component/[component].hpp file that at least inherits from Base, but in this case GenericBranch should inherit from Branch
[ ] If necessary: add new enums or exceptions
[ ] Create the necessary unit tests in power-grid-model/tests/cpp_unit_tests/test_[component].cpp
[ ] Add the test_[component].cpp to power-grid-model/tests/cpp_unit_tests/CMakeLists.txt
[ ] Add component to power_grid_model_c/power_grid_model/include/power_grid_model/all_components.hpp
[ ] Not necessary for this component (If necessary update main_core/topology.hpp / input.hpp / output.hpp / update.hpp)
[ ] Add component to code_generation/data/dataset_class_maps/dataset_definitions.json + re-run code_generation/code_gen.py
[ ] Add validation test cases to tests/data
[ ] Update input/update data validator for the new component: src/power_grid_model/validation/validation.py + add corresponding tests
The user needs to be able to provide the attributes of r, x, g, b, k, theta for positive, negative and zero sequence. So the attribute list is actually 3 times as described.
Following the discussion in #642 it was concluded that the implementation of a generic branch could be an addition to Power Grid Model.
We can make a new component
generic_branch
, which models branches as a Pi model; i.e. the user can specify:Note: except for
k
, all attributes are given for zero, positive and negative sequence.steps to follow
In order to add a new component to Power Grid Model the following steps need to be taken:
power-grid-model/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/
input.hpp
/update.hpp
/output.hpp
or in the documentation directly)code_generation/data/attribute_classes/
input.json
/update.json
/output.json
+ runcode_generation/code_gen.py
power-grid-model/power_grid_model_c/power_grid_model/include/power_grid_model/component/[component].hpp
file that at least inherits from Base, but in this caseGenericBranch
should inherit fromBranch
power-grid-model/tests/cpp_unit_tests/test_[component].cpp
test_[component].cpp
topower-grid-model/tests/cpp_unit_tests/CMakeLists.txt
power_grid_model_c/power_grid_model/include/power_grid_model/all_components.hpp
main_core/topology.hpp
/input.hpp
/output.hpp
/update.hpp
)code_generation/data/dataset_class_maps/dataset_definitions.json
+ re-runcode_generation/code_gen.py
tests/data
src/power_grid_model/validation/validation.py
+ add corresponding testsNote: the order is recommended, but not necessary