This Python script, referred to as "residuals_monitor.py", allows the user to monitor the residuals of their simulation in real-time while it is running, through a dashboard in their browser. It reads the log file to retrieve the data and plots the residuals of some variables as well as the continuity. Additionally, this program analyzes the variables I generally use in my simulations due to the solvers and turbulence models I work with, but feel free to modify it according to your needs.
Furthermore, there is another script named "residuals_plot.py" that has been created to save the residual graphs as .png images.
- Make sure that the log file already exists (either by running the simulation before the script or creating the file using
touchin the Linux terminal). - In the script, set the
log_filevariable to your log file. - Run the script and open the server started by the script (typically at
http://127.0.0.1:8080/).
- An example log file can be found in the files.
- After the simulation is complete, copy the script to the simulation folder.
- In the script, set the
log_filevariable to your log file. - Run the code. A "figures" folder will be created containing two .png files related to the simulation residuals.
- An example log file can be found in the files.