Skip to content
Snippets Groups Projects
jarunanp's avatar
jarunanp authored
19d4ff3a
History
Name Last commit Last update
README.md
config.yaml
results_to_vtk.py

This Python script converts a TOUGH2 result file to VTK format for visualization with Paraview

Install Conda on Mac OS

$ conda --version
conda 4.6.2

$ conda create -n py3 python=3

$ conda activate py3

Installing required Python packages

$ pip3 install pyyaml
$ pip3 install pyevtk

Config file

The input file config.yaml contains some metadata of the results file.

filename_in: "/path/to/resultfile/openBC_prod_10yr.csv"
filename_out: "/path/to/output/directory/no/extension/openBC_prod_10yr"

# dimension
npoint_d1: 80
npoint_d2: 40
npoint_d3: 15

# layer thickness only in z direction
layer_top: 5
layer_middle: 5
layer_bottom: 5

Run the script

$ python3 results_to_vtk.py

The script will create a binary VTK file with the name: /path/to/output/directory/no/extension/openBC_prod_10yr.vts