PyTOUGH: trying to visualize interblock fluxes for a MINC mesh with 'write_vtk'
I've been working with MINC meshes with the aid of PyTOUGH, which is quite handy, however, when I want to visualize (interblock) fluxes using the 'write_vtk' function of listing objects it appears a conflict between my geometry (mulgrid object) and my TOUGH2 grid object. Since the TOUGH2 grid has complementary matrix blocks (and connections), a mismatch between the geometry and the gird arises and 'write_vtk' cannot compute fluxes. I tried using the blockmapping option of 'write_vtk' to 'restrict' the processing only to the primary mesh elements but it still returns error, it seems that intrablock connections remain in the t2gird and 'write_vtk' cannot handle them.
Is it actually possible to compute/plot fluxes for MINC-t2grid objects with 'write_vtk'? If it is, what is the right way to do it?
Thank you in advance
I've just had a look at this. You're right, write_vtk() won't currently work for VTK output of flux vectors on MINC grids.
The block map approach won't solve the problem - that is only for re-mapping the block names to a different naming convention. What we'd need to make this work is some additional mechanism for excluding blocks and connections in the listing file (i.e. the MINC ones) from the write_vtk() process. Not an easy fix, unfortunately...
Hi Adrian, thank you for this
I see... A straightforward alternative would be to duplicate the 't2gird' object before applying the MINC processing: we save one of them for the 'write_vtk' method and proceed with the other to the MINCed model. Once the simulation is done one has to edit the listing file (flow.out) to remove all MINC blocks and connections. Results in the file are displayed as primary grid first and MINC grid second, so a few lines of code can achieve this. We finally define the listing object with the edited output file and apply 'write_vtk' with the non MINCed t2gird. It works, for those who prefer bypassing a modification to the 'write_vtk' method.