Black Lives Matter. Please consider donating to Black Girls Code today.

Show and Tell: Dash for tokamak heat flux prediction

Recently created a dash GUI for use with a code, H.E.A.T., that predicts the heat fluxes and temperatures on divertor plasma facing components in nuclear fusion tokamak reactors. Fusion is a potential clean energy source that produces no carbon or long-lived radioactive waste, and uses water for fuel. The physics code that runs under the hood is python, and I was originally coding raw HTML5/JS/CSS, but decided to give dash a try and keep it all in python. The results are good! Grateful to the dash community for providing such a useful suite of tools. Thanks everyone!

The code is here (dash is located in source/dashGUI.py)

And there are a set of slides describing the physics here

Some examples of the user interface:

An example of the HEAT output:

3 Likes

Very sweet! What components are used to render these graphs?
image

@chriddyp these rendering are done in ParaView, another open source project, which is the (multi-)industry standard for scientific visualization. The ParaView “show and tell” is located here.

ParaView can read a ton of filetypes, it can generate movies and time varying output, it can run in parallel on petascale supercomputers or GPU clusters while sending data back to client machines, it can be used with virtual reality headsets, and it can do a lot of other stuff that I probably don’t know about.

ParaView has desktop version, and a python interface, but it also has a web version. In the previous version of HEAT (where I coded all HTML5/JS/CSS by hand), I would launch a separate ParaView web server and then embed the server webpage into an iFrame in html. I would generate all the VTK objects using HEAT, then use the web server to visualize them. I still need to add this into a new tab in the Dash version of HEAT, but my punchlist is long and that is a low priority compared to some of my physics deliverables. For the images shown above, I just rendered in ParaView on my local machine.

One of these days (probably in the next six months), I will embed the ParaView server into my dash app like I had in previous html5 versions of HEAT. I think there is a really cool use case here where I use dash to built my custom application, do heavy rendering on a GPU cluster using ParaView, then display inside the dash app using paraviewweb, all in python.

2 Likes