SINTEF / Splipy

Spline modelling made easy.
GNU General Public License v3.0
100 stars 18 forks source link

Corner-point grid: reader #82

Closed VikingScientist closed 4 years ago

VikingScientist commented 5 years ago

This needs to be finished by Tuesday.

Currently the model builds 3 geometries:

It should (but does not currently yet) build the corresponding textures to a given model. This is done by sampling the exact geometry and figuring out which cell any given evaluation point is located at.

It should (but does not currently yet) build three different high-order (high continuity) geometries:

VikingScientist commented 5 years ago

diagonal_compare

This model has diagonal meshlines and a great many degenerate (disabled) cells. Trying to do a 6-side coons patch fit on this will fail. The correct approach is to do a 2-side fit to the top and bottom side, and linear interpolation between these.

The geometry can be found that the OPM repository: PeriodicTilted.grdecl

diagonal_grdecl The same geometry when converted directly from grdecl to vtu (grdecl2vtu from opm-grid )

VikingScientist commented 5 years ago

geom_p3_approx LocalGridGeometry.grdecl (not available online). Left: (perspective view) exact geometry Right: (perspective view) cubic spline approximation

This geometry has a non-linear distribution of the layers through the z-direction. We need to fit all 6 sides to correctly capture this geometric feature.

corner-point-grid Same mesh when viewed in paraview.

corner-point-grid-details Details from the mesh boundary. Notice that jumps ever only appear in the z-direction, hence any geometry would be C0,0-1

TheBB commented 5 years ago

I have a commit on my own grdecl branch on top of this PR with my own suggested changes.

https://github.com/TheBB/Splipy/commit/4920dfec1fb93efbf727be0797de2d09561aefe7

Here's the textures for actnum and poro in the diagonal lines model with two evaluation points per knotspan. I guess the latter would look cooler if the model were oriented differently.

https://user-images.githubusercontent.com/619375/47659932-45f40f00-db96-11e8-9b3b-cc91ed463199.png https://user-images.githubusercontent.com/619375/47660021-750a8080-db96-11e8-95f7-822ec0c9f42c.png

Edit: removed the inline images since they are really tall.

Also note that I added a dependency on tqdm in that commit that hasn't been accounted for yet in setup.py.

VikingScientist commented 5 years ago

I did not see you make any changes to setup.py

TheBB commented 5 years ago

Also note that I added a dependency on tqdm in that commit that hasn't been accounted for yet in setup.py.

Exactly. I'm always unsure as a library developer whether I should be writing progress bars to stdout without being asked to do so, so I left that out for the time being.

VikingScientist commented 5 years ago

Oooh. So that's what the tqdm does. Have it dump progress bar as default, with the silent=False argument in the function signature.

VikingScientist commented 5 years ago

In addition to the comments above, make some really simplistic alteration to grdecl_test.py and make an internal grdecl_to_ifem.py-script locally which does the rescaling and dumping of material properties. The syntax for textures in xinp files is:

  <elasticity>                                                                 
    <texturematerial set="Model" file="material.png">                          
      <range min="0.00" max="0.25"  E="1.0" nu="0.4" rho="1"/>                 
      <range min="0.25" max="0.50"  E="2" nu="0.4" rho="1"/>                   
      <range min="0.50" max="0.75"  E="3" nu="0.4" rho="1"/>                   
      <range min="0.75" max="1.00"  E="4" nu="0.4" rho="1"/>                   
    </texturematerial>                                                         
  </elasticity>                                                                

This is how it's done in 2D. For 3D textures we would need to provide one or more of the dimensional size: n1, n2 and/or n3 so IFEM can reassemble the 2D-image into a 3D texture, for instance

    <texturematerial set="Model" file="material.png" ny="512">

if you tile the image vertical by z-direction-slices and x-direction is horizontal.

VikingScientist commented 5 years ago

I think this is ready to merge

VikingScientist commented 4 years ago

No objections to this pull request. Shameless self-merge ensuing.