AMReX-Combustion / PeleLMeX

An adaptive mesh hydrodynamics simulation code for low Mach number reacting flows without level sub-cycling.
https://amrex-combustion.github.io/PeleLMeX/
BSD 3-Clause "New" or "Revised" License
29 stars 40 forks source link

Post-processing plt files #226

Closed bazharz closed 1 year ago

bazharz commented 1 year ago

I would like to perform post-processing on plt files, but I am having trouble understanding the data storage format within these files. Specifically, I want to extract the temperature field and calculate the temperature gradient using Python. Is it possible to achieve this?

esclapez commented 1 year ago

You can do a lot of things with Python using yt. There are examples of yt scripts reading Pele pltfile in here: https://github.com/nickwimer/ytScripts

Note however that computing gradients on multi-level AMR grids is not straightforward because pltfiles do not contain ghost cells, such that stencil-based operations will have issues at coarse/fine boundaries. Pele provides a set of C++ analysis tools PeleAnalysis that use the AMReX machinery to add and fill ghost cells in order to do this type of operations when needed. In particular the grad tool can compute the gradient for you and you can then open the resulting file with yt to access the data in python.