The Concept of Profiles
Think of a Profile
object as of a state of the workpiece somewhere in the pass sequence. Every unit
has an incoming and an outgoing profile. Also, you must provide a profile as definition for the initial workpiece being
processed in the pass sequence.
The shape and the extent of the profile is defined by its Profile.cross_section
hook.
The value type of this hook is a shapely.Polygon
providing all of its functionality in planar geometry.
PyRolL patches a few things within shapely for convenience and user experience, especially while developing plugins.
Other parts of PyRolL use shapely geometry objects, too.
For creating an initial profile, several class methods exist in the Profile
class. One can either derive the
profile shape from an existing groove object by use of the Profile.from_groove()
method, or created some
standard shapes use of the other class methods of Profile
, like Profile.round()
. More values can be
given as keyword arguments and are saved automatically as explict hook values in the instance. Which you may or must provide
depends on the loaded plugins.
- class Profile(**kwargs)
Represents a profile aka a workpiece state.
Using the
__init__
is not recommended, use one of the factory class methods instead.- classmethod box(height: float, width: float, corner_radius: float = 0, **kwargs) BoxProfile
Creates a box shaped profile (a real rectangular shape with rounded corners, without imperfections of box grooves). A box is oriented to stand on its side, use
square()
to create a corner standing square.- Parameters:
height – the height of the box profile, must be > 0
width – the width of the box profile, must be > 0
corner_radius – the radius of the square’s corners, must be >= 0, <= height / 2 and <= width / 2
kwargs – additional keyword arguments to be passed to the Profile constructor
- Raises:
ValueError – if arguments are out of range
- classmethod diamond(height: float, width: float, corner_radius: float = 0, **kwargs) DiamondProfile
Creates a diamond shaped profile (a real diamond shape with rounded corners, without imperfections of diamond grooves). A diamond is oriented to stand on its corner.
- Parameters:
height – the height of the diamond profile, must be > 0
width – the width of the diamond profile, must be > 0
corner_radius – the radius of the diamond’s corners, must be >= 0, <= height / 2 and <= width / 2
kwargs – additional keyword arguments to be passed to the Profile constructor
- Raises:
ValueError – if arguments are out of range
- fits_material(key: str)
Return true, if the given material key is present in the profile’s material hook (case-insensitive), otherwise false.
- classmethod from_groove(groove: GrooveBase, width: float | None = None, filling: float | None = None, height: float | None = None, gap: float | None = None, **kwargs) Profile
Create a profile instance based on a given groove. The dimensioning of the profile is determined by the parameters
width
,filling
,height
andgap
. Give exactly one ofwidth
andfilling
. Give exactly one ofheight
andgap
.- Parameters:
groove – the groove the profile should be created from
width – the width of the resulting profile, must be > 0
filling – the filling ratio of the groove, must be > 0
height – the height of the profile, must be > 0
gap – the gap between the groove contours (roll gap), must be >= 0
kwargs – additional keyword arguments to be passed to the Profile constructor
- Raises:
TypeError – on invalid argument combinations
ValueError – if arguments are out of range
- classmethod from_polygon(cross_section: Polygon, classifiers: Set[str], **kwargs) Profile
Creates a custom profile from a shapely polygon object.
- Parameters:
cross_section – a polygon representing the cross-section shape
classifiers – a set of strings classifying the shape
kwargs – additional keyword arguments to be passed to the Profile constructor
- classmethod hexagon(side: float | None = None, height: float | None = None, diagonal: float | None = None, corner_radius: float = 0, **kwargs) HexagonProfile
Creates a hexagonal shaped profile (a real hexagonal shape with rounded corners, without imperfections of hexagonal grooves). A hexagon is oriented to stand on its side. Give exactly one of
side
,height
anddiagonal
.- Parameters:
side – the side length of the hexagonal profile, must be > 0
height – the height of the hexagonal profile when standing on the flat base, must be > 0
diagonal – the diagonal length of the hexagonal profile (corner-to-corner distance)
corner_radius – the radius of the hexagon’s corners, must be >= 0, <= diagonal / 2
kwargs – additional keyword arguments to be passed to the Profile constructor
- Raises:
TypeError – on invalid argument combinations
ValueError – if arguments are out of range
- plot(**kwargs)
Returns a matplotlib figure visualizing this instance. It is not required to implement this method. :param kwargs: keyword arguments passed to the figure constructor
- Raises:
RuntimeError – if matplotlib is not importable
TypeError – if the current type does not support plotting
- classmethod round(radius: float | None = None, diameter: float | None = None, **kwargs) RoundProfile
Creates a round shaped profile (a real circle round, without imperfections of round grooves). Give exactly one of
radius
anddiameter
.- Parameters:
radius – the radius of the round profile, must be > 0
diameter – the diameter of the round profile, must be > 0
kwargs – additional keyword arguments to be passed to the Profile constructor
- Raises:
TypeError – on invalid argument combinations
ValueError – if arguments are out of range
- classmethod square(side: float | None = None, diagonal: float | None = None, corner_radius: float = 0, **kwargs) SquareProfile
Creates a square shaped profile (a real square with rounded corners, without imperfections of square grooves). A square is oriented to stand on its corner, use
box()
to create a side standing one. Give exactly one ofside
anddiagonal
.- Parameters:
side – the side length of the square profile, must be > 0
diagonal – the diagonal’s length of the square profile, must be > 0. Note, that the diagonal is measured at the tips, as if the corner radii were not present for consistency with
box()
.corner_radius – the radius of the square’s corners, must be >= 0 and <= side / 2
kwargs – additional keyword arguments to be passed to the Profile constructor
- Raises:
TypeError – on invalid argument combinations
ValueError – if arguments are out of range
- chemical_composition
Chemical composition of the profile’s material as dict of element symbols to atom fractions (0 to 1).
- classifiers
Classifiers of the profile’s shape’s type.
- core_temperature
Temperature of the profile core.
- cross_section
Shape of the profile’s cross-section.
- density
Mean density (specific weight) of the profile material.
- elastic_modulus
Mean elastic modulus of the profile material.
- equivalent_height
Height of the equivalent rectangle.
- equivalent_radius
Radius of a equivalent round.
- equivalent_rectangle
Equivalent rectangle geometry for use with equivalent flat pass models.
- equivalent_width
Width of the equivalent rectangle.
- flow_stress
Mean flow stress of the profile material.
- flow_stress_function
Flow stress depended on strain, strain-rate and temperature
- grain_size
Average grain size of the profile’s material.
- heat_penetration_number
Mean heat penetration number of the profile material.
- height
Maximum height (y-direction).
- length
Length of the workpiece (x-direction).
- material
String or sequence of strings classifying the material of the profile. Can be used by material databases to retrieve respective data.
- microstructure_composition
Phase resp. constituent composition of the profile’s material as dict of constituent names to volume fractions (0 to 1).
- poissons_ratio
Mean Poisson’s ratio of the profile material.
- scale_thickness
Thickness of the scale covering the profile.
- specific_heat_capacity
Mean specific heat capacity of the profile material.
- strain
Mean equivalent strain of the profile cross-section.
- surface_temperature
Mean temperature of the profile surface.
- t
Temporal coordinate.
- temperature
Mean temperature of the profile cross-section.
- thermal_conductivity
Mean thermal conductivity of the profile material.
- thermal_diffusivity
Mean thermal diffusivity of the profile material.
- velocity
Mean material flow velocity.
- width
Maximum width (z-direction).
- x
Spacial coordinate in rolling direction.
Derived classes
For the units types, specialized versions of the Profile
class are defined as nested classes within the respective unit class.
They all maintain their own hooks, so it is possible to specify hooks on profiles only for those places, were they are applicable.
Profile Classifiers
As profile have an infinite variety of cross-section shapes, for the use of empirical models, the shape must be classified.
This is achieved by the Profile.classifiers
hook, which returns a set of string classifiers describing the shape of the profile.
Model hook functions can check the contents of this set to determine, if the model approach they provide is suitable to the given profile.
Grooves and roll passes make use of the same classifiers, as they transfer their classifiers to the new outgoing profile.
Currently, the PyRolL Core uses the following classifiers:
"round"
An approximately circular cross-section. Corresponds to the
RoundGroove
."false_round"
An approximately circular cross-section with flanks. Corresponds to the
FalseRoundGroove
. Commonly in combination with"round"
."oval"
An approximately oval-shaped cross-section. Umbrella class for all more specific ovals.
"circular_oval"
An approximately oval-shaped cross-section. Corresponds to the
CircularOvalGroove
. Commonly in combination with"oval"
."flat_oval"
An approximately oval-shaped cross-section. Corresponds to the
FlatOvalGroove
. Commonly in combination with"oval"
."swedish_oval"
An approximately oval-shaped cross-section. Corresponds to the
SwedishOvalGroove
. Commonly in combination with"oval"
."diamond"
An approximately diamond resp. rhombus shaped cross-section, includes squares. Corresponds to the
DiamondGroove
."square"
An approximately square shaped cross-section. Corresponds to the
SquareGroove
. Commonly in combination with"diamond"
."box"
An approximately rectangular shaped cross-section. Corresponds to the
BoxGroove
."flat"
An approximately rectangular shaped cross-section originating from flat rolling. Corresponds to the
FlatGroove
."gothic"
An approximately square-shaped cross-section with curved edges. Corresponds to the
GothicGroove
."3fold"
A cross-section with 3-fold rotation symmetry. Such profiles typically originate from three-roll passes. Can be combined with other classifiers for further distinguishing.
"rotated"
Indicates, that the profile has been rotated by a rotator unit and therefore does not have its common orientation anymore.
"vertical"
Indicates, that the profile has been rotated by 90° relative to its common orientation.
"edged"
Indicates, that the profile has been rotated by 45° relative to its common orientation. Often that means rotating a profile from standing on edge to standing on its side or vice versa. Commonly found in square-oval pass sequences.
"mirrored"
Indicates, that the profile has been rotated by 180° relative to its common orientation.
"constricted"
Indicates, that the profile has a constriction in its base. Corresponds mainly to
ConstrictedBoxGroove
andConstrictedSwedishOvalGroove
. Therefore, commonly in combination with"box"
and"swedish_oval"
."upset"
Indicates, that the profile originates from an upsetting groove and is therefore rotated by 90° with respect to other grooves of this type. See f.e.
UpsetOvalGroove
andUpsetBoxGroove
.