pyroll-project / pyroll-core

PyRoll rolling simulation framework - core library.
https://pyroll.readthedocs.io
BSD 3-Clause "New" or "Revised" License
11 stars 7 forks source link

Improve Contur representation by adding more points #170

Closed GRPlan closed 5 months ago

GRPlan commented 5 months ago

At the moment RyRoll uses a minimalistic approach to represent result conturs. Straight segments just have a start- and endpoint, no mater how long they actually are.

Kontur_0a

For comparison with conturs from measurements or FEM calculations user might consider the use of polar coordinates. For this approach it is beneficial when more points are present on the contur.

Kontur_1a

My current appraoch to improve the contur-representation uses length and segmentize from shapely package.

    perimeter = length(out_profile)
    out_profile = out_profile.segmentize(perimeter / divions)

divisions is a parameter to control the level of refinement. For me divisions = 50 yields good results in medium to small size KOCKS processes.

Check whether it is possible to make this a PyRoll standard behavior.

axtimhaus commented 5 months ago

We may add a config parameter for the divisions, so zero means than no further refinement, and positive values refine the overall profile. But I would stick to no refinement as default. You could then refine all profiles with one line before solving like this:

from pyroll.core import Config

Config.PROFILE_CONTOUR_REFINEMENT = 50