Blog #2: TOUGH is Tough

I have spent the last two weeks of my internship running some basic problems and examples and getting a feel for the inputs and outputs of a TOUGH2 simulation. The program is immensely powerful and has the ability to simulate such a wide variety of conditions, materials, processes, etc., but because of that, it is very complicated as well. The main input file consists of many text blocks where you define the materials, properties, initial and boundary conditions, specify the time steps and convergence criterion, generate the mesh, and add any other specifications your problem has. My primary tasks for the past couple of weeks have been writing these input files for existing problems to familiarize myself with the formatting and meaning. 

The first problem I worked on was a very simple problem tutorial given in the TOUGH short course. The task was to simulate water draining from a fully saturated column of sand. This tutorial went through the problem in four steps. The first was establishing a conceptual model and defining the properties of the sand and boundary elements. The next was generating the mesh to meet the specifications and include appropriate boundaries.  The third step was to establish hydrostatic conditions in the column, which included altering parameters and running a simulation. The last step used the hydrostatic data from step three as initial conditions and ran the simulation of the water draining from the column. This problem was very simple but very helpful. It provided partially finished input files with question marks where I needed to change the data or replace something. It also provided guiding questions to come up with the conceptualization, boundary conditions, and understand the output file. Without this tutorial, I likely would have been even more lost as I started to attempt more complicated problems.

Now, I have been working on various geothermal production problems. So far, I have kept to relatively simple and coarse meshes while I work to get the hang of TOUGH. It has been relatively slow going. Today I am working on a problem on heat sweep in a vertical fracture (see attached image), where you inject water at one point, run it through a fracture with boundaries of hot rock, and get steam output on the other side. Like the problem tutorial, I am running this in multiple steps. My first step was assigning materials and generating the mesh. Then, because it is vertical, I must account for gravity and establish steady conditions. Finally, I use those conditions as my initial conditions and run the simulation to completion. The first step of this process was especially slow going. Because I am not yet familiar with all of the components of a TOUGH2 input file, I must be constantly going through the appendices of the user manual so that I know what goes where what things default to, and what each number means. Additionally, I must determine the material properties and make any necessary assumptions. Then, perhaps the most tedious task, I must ensure that everything is properly aligned. The format for the input files for a TOUGH2 simulation is very exact, and if you have an extra space, period, unaligned number, etc., it will not work at all. Because of this, I have spent hours slowly reading through the files and looking for anything out of place that might be the cause of the errors I am running into. Luckily, I was able to fix my formatting issues in this problem and get a clean run of the first and second steps. But now, I am running into a problem with my third step, where the program runs but is not printing a complete output file. I will continue to work on this and hopefully be able to analyze the output and understand where I have been going wrong soon. 

Although I am having some trouble getting comfortable with the inputs and outputs of TOUGH2 and debugging, it is starting to make more sense. For the time being, I will continue to work slowly on somewhat simple and coarse problems to further familiarize myself with the program and files, so that when the time comes to work on more complicated things, I will have a strong understanding of the basics.