Visualization¶
Visualization of the results produced by PFLOTRAN can be achieved using several different utilities including commercial and open source software. Plotting 2D or 3D output files can be done using the commercial package Tecplot, or the opensource packages ParaView and VisIt. Both Paraview and VisIt are capable of remote visualization on parallel architectures.
Several potentially useful hints on using these packages are provided below.
Tecplot¶
In order to change the default file format in TecPlot so that it recognizes
.tec
files, place the following in thetecplot.cfg
file:
$!FileConfig FNameFilter {InputDataFile = "*.tec"}
VisIt¶
Inactive cells can be omitted by going to Controls -> Subset and unchecking Material_ID[0].
In 3D to scale the size of one of the coordinate axes go to Controls -> View and check box Scale 3D Axes and set desired scaling factor in box to right.
To make 2D plots use Operators -> Slicing -> Slice.
For 3D plots Operators -> Slicing -> ThreeSlice is useful.
Instructions to set up geomechanical and flow data simultaneously in VisIt:
Open VisIt.
Select the \(1\times 2\) layout button on Window 1 to open a new window (Window 2).
Now make Window 1 active by checking the first button on Window 1.
Click on Open and select *-geomech-*.xmf database.
Click on Add –> Pseudocolor –> rel_disp_z and click Draw (Set Auto apply to avoid clicking Draw repeatedly).
Select the domain and rotate it to a preferred angle.
Select Window 2 and make it active.
Click Open and select pflotran.h5 or pflotran-*.h5 (This file contains all the subsurface flow data).
Click on e.g. Add –> Pseudocolor –> Gas Saturation (or other desired variable).
Click on Lock view and Lock time on both windows (This will sync views and times on both windows).
After a window pops up, select Yes.
With Window 2 active select: Operators –> Slicing –> ThreeSlice.
Double click on three slice and change x and y to appropriate values.
Select Window 1.
Select Controls –> Expressions.
Click New and add a name (e.g., disp_vector). Select Vector Mesh Variable.
Under Definition, add <rel_disp_x _lb_m_rb_>,<rel_disp_y _lb_m_rb_>,<rel_disp_z _lb_m_rb_>, Apply and Dismiss.
Click Add –> Vector –> disp_vector.
Double click Vector under pflotran-geomech-*.xmf database:disp_vector.
Select Form and set Scale to e.g. 0.5. Then select Rendering and change magnitude color from Default to difference (select a color scheme of your choice).
Apply and Dismiss.
Double click Pseudocolor –> rel_disp_z. Select e.g. hot_desaturated for color table. Set opacity to 50%. Apply and Dismiss.
Next, for mesh movement click: Operators –> Transforms –> Displace. After a window pops up, dismiss it.
Double click Displace, change Displacement multiplier to e.g., \(10000\). Click on Displacement Variable –> Vectors –> disp_vectors. Dismiss the window saying no data etc. Apply and Dismiss.
Finally, click the play button to watch movie. Rotate the domain to a convenient angle before doing so.
Gnuplot, MatPlotLib¶
For 1D problems or for plotting PFLOTRAN observation, integral flux and mass balance output, the opensource software packages gnuplot and matplotlib are recommended.
With gnuplot and matplotlib it is possible to plot data from several files in the same plot. To do this with gnuplot it is necessary that the files have the same number of rows, e.g. time history points. The files can be merged during input by using the
paste
command as a pipe: e.g.plot '< paste file1.dat file2.dat' using 1:($n1*$n2)
plots the product of variable in file 1 in column
n1
times the variable in file 2 in columnn2
of the merged file.When using gnuplot it is possible to number the output file columns with
PRINT_COLUMN_IDS
added to theOUTPUT
keyword. This is only useful, however, withFORMAT TECPLOT POINT
output option.Gnuplot also provides for real-time plots by simply adding the following lines after the usual plot directives
... plot ... pause n reread
where n denotes the pause time between plot points in seconds.