acroucher / PyTOUGH

A Python library for automating TOUGH2 simulations of subsurface fluid and heat flow
GNU Lesser General Public License v3.0
96 stars 36 forks source link

Feature request: VTK import #15

Open tirons opened 6 years ago

tirons commented 6 years ago

It does not appear that PyTOUGH has an import VTK feature? I am wondering how difficult that would be? I am willing to contribute.

I have VTK files (vts) which I have converted from PETREL GRDECL meshes. I want to close the loop and get them into TOUGH2/REACT for simulation.

Cheers

acroucher commented 6 years ago

You mean import from VTK to t2grid? That should be possible. Off the top of my head, I think it would involve:

Implementation-wise, one question would be whether to use the VTK Python bindings or an alternative like meshio, to read the VTK mesh into Python. VTK may have geometric functions included for computing block volumes etc.? On the other hand, meshio is often more portable and less problematic than VTK.

tirons commented 6 years ago

Thanks! Sorry to be getting back so late.

I've been using PyVTK bindings, and currently can already convert SUTRA and PETREL grids into VTK, and convert from VTK into SUTRA and PETREL/ECLIPSE. Basically, like you said, I just need to work on the conversion to TOUGH grids, which are specified in quite a different fashion than the columnar data in PETREL.

I'll look into meshio, I have mainly been using vts (vtkStructuredGrid) which I don't think is supported by meshio.

I'll keep you appraised of my progress, if I have something worth sharing, I'll submit a pull request for pyTOUGH. Thanks!

-Trevor

On 26 March 2018 at 16:53, Adrian Croucher notifications@github.com wrote:

You mean import from VTK to t2grid? That should be possible. Off the top of my head, I think it would involve:

  • constructing block names in some sensible way
  • calculating the block volumes and centroids, and connection areas and distances
  • assigning rock types? not sure if you have any rock data in your VTK- could just leave this out and assign a default rock type everywhere
  • assign default PARAM data

Implementation-wise, one question would be whether to use the VTK Python bindings or an alternative like meshio, to read the VTK mesh into Python. VTK may have geometric functions included for computing block volumes etc.? On the other hand, meshio is often more portable and less problematic than VTK.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/acroucher/PyTOUGH/issues/15#issuecomment-376337644, or mute the thread https://github.com/notifications/unsubscribe-auth/APbWFJ_C0Xj3M8NwBlSragXJd-LVdH1Xks5tiXFqgaJpZM4StBko .