Repository navigation
integrate co-simulation into phasor dynamics applications - #638
superwhiskers wants to merge 1 commit into
Conversation
9d1b684 to
9c1127f
Compare
9c1127f to
8b4b442
Compare
lukelowry
left a comment
There was a problem hiding this comment.
Initial thoughts. I like the extraction of the application code
| @@ -0,0 +1,167 @@ | |||
| { | |||
There was a problem hiding this comment.
I would prefer this data go under examples/, for now, or atleast a subfolder of cases/PhasorDynamics/IEEE39/, since this seems specific to one possible co-simulation scenario
There was a problem hiding this comment.
I agree. A README describing the example (and how the two split files relate to the full system) would also be helpful.
8b4b442 to
71aaf18
Compare
fb9d963 to
f234f7d
Compare
f234f7d to
a90b153
Compare
- add client/server modes to `DynamicSimulation` and `ContingencyAnalysis` - introduce simulation runners to coordinate events, interface solves, and monitor output - remove standalone co-simulation examples - add a partitioned ieee39 example - document co-simulation configuration and execution
a90b153 to
9b4f0df
Compare
|
I suppose it depends how this is intended to be consumed in other ORNL projects, but an alternative design could treat all |
My understanding is that simulation instances are servers, delivering computation result per request of the cosim platform. @hambrickjc, please chime in. |
pelesh
left a comment
There was a problem hiding this comment.
Great start!
A couple of requests to organize the code better:
- In
applications/PhasorDynamicsdirectory create separate subdirectories for dynamic simulations, continegency analysis, cosimulations, and application utilities (code shared between all apps). - Have once class per file only.
- Put utilities specific to an app in that app's directory.
- Remove changes to
Loggerclass as those appear to be only formatting changes. The "TODO" item there should be placed in an issue, not in the code.
| if(GRIDKIT_ENABLE_ZMQ) | ||
| target_link_libraries(DynamicSimulation PRIVATE GridKit::co_sim GridKit::solvers_steady) | ||
| target_link_libraries(ContingencyAnalysis PRIVATE GridKit::co_sim GridKit::solvers_steady) | ||
| endif() |
There was a problem hiding this comment.
Can we have a separate cosimulation application here? Conceptually, I don't think DynamicSimulation and ContingencyAnalysis themselves should link GridKit::co_sim and GridKit::solvers_steady.
| @@ -0,0 +1,123 @@ | |||
| #pragma once | |||
There was a problem hiding this comment.
Please add a header for the new files, with your name as the author and a short description of what the file does.
| { | ||
| namespace PhasorDynamics | ||
| { | ||
| inline CoSim::RunResult runCoupledClientStudies( |
There was a problem hiding this comment.
Some documentation for these functions would be helpful: what they do and how one will later use them.
| using NextCoupledStudy = std::function<std::optional<StudyData>()>; | ||
| using CompleteCoupledStudy = std::function<void(Testing::TestStatus)>; |
There was a problem hiding this comment.
These alias names for std::function<> are not intuitive to me. I wouldn't be able to infer the type when NextCoupledStudy and CompleteCoupledStudy are later used. Some documentation would also help.
| ```sh | ||
| sh /path/to/build/examples/PhasorDynamics/CoSimulation/run_cosim.sh \ | ||
| --case ieee39 | ||
| ``` |
There was a problem hiding this comment.
Can we register in CMake to run these examples?
| } | ||
|
|
||
| /// Parse command line options to a simulation application. | ||
| inline SimulationOptions parseSimulationOptions( |
There was a problem hiding this comment.
Are we supporting an input file as well, or only command line arguments? I prefer input files.
There was a problem hiding this comment.
Simulation options should be specified in the *solver.json file. Command line options should override input file options.
I don't know that there's much of an established convention. For simple simulations, you might see more traditional client/server architectures. For more complex co-simulations, you might see a coordinator that manages everything and then the simulations instances are pub/sub. I would recommend staying as agnostic to the communication architecture as you can. |
Description
integrates the co-simulation interface into the phasor dynamics applications
closes #469
closes #547
Proposed changes
DynamicSimulationandContingencyAnalysismonitor output
Checklist
-Wall -Wpedantic -Wconversion -Wextra.