Defining Flow Stress from Interpolated Data - The Classic Way
In this notebook it is shown, how to define a flow stress function from interpolated data using the interpolation functions from scipy.
The concept can be transferred to any other material data as well.
First, we need to import some packages.
importpyroll.basicaspr# PyRolL itselfimportpandasaspd# pandas for data importimportnumpyasnp# numpy for numeric calculationsimportscipy.interpolateasinterpolate# scipy.interpolate for interpolations
We import the data to interpolate from a CSV file using pandas. The result is a dataframe containing all data from the file. Note, that the column names are derived from the first row of the file.
To make available to PyRolL, we have to implement hooks.
The flow_stress hook is the main hook for calculation flow stress, it returns the flow stress depending on the current state of the profile.
Another hook regarding flow stress is flow_stress_function. It returns a function of the classic flow stress parameters strain, strain rate and temperature to enable plugins to calculate their own variations of flow stress.
Lets run the solution procedure of the roll pass.
We see no errors claiming that a flow stress value is missing.
pass1.solve(in_profile)
Profile
classifiers
{'diamond', 'generic_elongation'}
cross_section
Polygon
area
0.0018470652317200606
height
0.0447243903911893
perimeter
0.1684260697843319
width
0.06560167360406856
cross_section_error
-0.0360789946906479
cross_section_filling_ratio
0.9639210053093521
density
7500.0
filling_error
-0.143021899359
filling_ratio
0.856978100641
length
0.0
specific_heat_capacity
690
strain
0.19349552465258638
t
0.07056039637464354
temperature
1369.1993359636003
Lets check, if our new hooks are really used. We check that the flow stress value stored in the out profile of the pass is numerically equal to a manually calculated value using the respective strain.
If everything went fine, we shall se no output of this statement, otherwise an error message.