Blog #4: Visualizations and New Software

Currently, I am watching an output file grow and grow and grow as the simulation I am running executes. This is one of the most complicated simulations I have run, simply because it has a larger and finer mesh, so the fact that it is taking a couple of minutes is not surprising.  It's funny, having a simulation that takes more than seconds to run seems like forever, but doing the same thing as a physical experiment could take months or even years. I think so far, that has been one of the biggest takeaways of my internship. In the last couple of weeks, I have been able to simulate multiple types of problems and within each problem I have made multiple adjustments and variations that only require adding or deleting some characters and waiting for another simulation to run. If this were to be done in an in-person experiment, each little variation could be an extreme expense of time and money. By having a numerical model and being able to run simulations, you can learn so much about behavior and relationships with only a computer and your fingers. It is truly incredible and will only become more and more relied upon and valuable as technology continues to grow, and I am so excited to have a glimpse into the power of simulations, computers, and numerical models.

Despite this, sometimes just looking at thousands of lines of numbers is not very helpful, lucky for me there is software to help me out with this too. I am a very visual learner, so the output files of TOUGH simulations - which consist only of numbers and text - can often be daunting. I have been relying on excel and plotting for most of my visualizations, but that isn't always very helpful because I am only able to look at a couple elements at a time. So, I asked my host about a visualization software that I could use. It took a while to find one that would suit my needs because the most commonly used program only offers year long, rather expensive licenses. Thankfully, Professor Keurfon Luu of LBNL has developed an opensource python package called toughio that meets all of my visualization and TOUGH needs. I was able to download the package and although I ran into some difficulties, Professor Luu was very responsive and very helpful and I am now using toughio frequently. 

Toughio has two main functionalities that are of use to me. The first is that you can write TOUGH input and mesh files. The ability to write mesh is particularly helpful because it is written in python and you can use loops and declare the materials of elements within the code. Although the TOUGH meshmaker can write a mesh thoroughly, it is very tedious and if you want to change the materials of elements you have to first generate the mesh and then go through and individually change everything. As my next task, I am working to write a mesh in toughio that consists of a handful of orthogonal fractures. I have yet to begin this, but it will get me more familiar with toughio and hopefully be a more elegant way to write a complicated mesh file. The other aspect of toughio that I have been using is the command-line programs that convert TOUGH export files into files that can be read by visualization software. The programs are very simple but very powerful, as converting thousands of lines of text into a proper format is extremely tedious, and very easy to mess up. After running these commands, you can then import the exported files into a visualizer. I have been using ParaView, another opensource software to do these visualizations and it has been very helpful in understanding my output files and if I am going wrong somewhere.

Toughio and ParaView are both new to me, so learning how to use them has been a little slow going, as learning TOUGH early on was. But as I continue to work with these Softwares and learn their implications, I am becoming more comfortable and amazed by what they can do, and I can't wait to continue to get results and learn in the last few weeks of my internship.