The Simulator is a C++ implementation of the model described in the article by Cs. Fazekas et al (2006) A simple dynamic model of the primary circuit in VVER plants for controller design purposes. The model parameters used are those from the Unit 3 of the Paks Nuclear Power Plant in Hungary.
UI text is currently in Brazilian Portuguese. Translating should be relatively straightforward. Most code comments and variable names are in English and match the naming adopted in the article.
- Equations are computed in real time (actually every sampling step) by Euler's method
- All the model variables and parameters are available, though only some were shown in the UI for simplicity
- Multi-threading capabilities
- A PI Controller with possible synchronous sampling
- A restful HTTP server for remote operation
- A simple Python UI for remote operation
- A friendly main UI showing the Process Diagram with graph-plotting capabilities
The main UI diagram was adapted with permission from a World Nuclear Association diagram for a Generic PWR (please note that the original diagram does NOT show a VVER) to match the description given in the article.
In the /img
folder contains an earlier version of the process diagram, which shows a vertical steam generator. This agrees with most western PWR designs, but to more accurately represent the VVER, it was later replaced by a new diagram with an horizontal steam generator. If you wish to use the vertical diagram, use the file main_vert.cpp.bkp
instead of main.cpp
.The code changes required mostly involve repositioning the UI widgets.
To include new widgets or move the existing ones, capture the target top-left corner position by defining SHOW_MOUSE_POS
as true
and moving the mouse to the desired place.
The project uses cpp-httplib for the HTTP Server, Dear ImGui for the User Interface, stb_image for loading the process diagram and Eigen for matrix operations. The development branch of Eigen is required to use the new matrix slicing API.
The project was built with MinGW-w64 and GCC 8.1, and there are build scripts available which use GNU make.
There's a prebuilt binary inside /bin
, it was compiled and tested with Windows 10 version 18363 and should be ready to run.
To build, run build.bat
.A compressed folder with all the libraries used to build is available in libs_backup.7z
for convenience. The makefile assumes they are stored in C:/libs
.
The python remote control app uses PySide2 for the UI and Requests for HTTP requests.
Some of the screenshots show the vertical steam generator version. Here's the new main window:
Plotting real time charts:
Simple Qt for Python Remote Control: