morphogen 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- morphogen/__init__.py +60 -0
- morphogen/__main__.py +7 -0
- morphogen/_platform.py +55 -0
- morphogen/_public.py +153 -0
- morphogen/_utils.py +80 -0
- morphogen/_version.py +1 -0
- morphogen/analysis/__init__.py +174 -0
- morphogen/analysis/anisotropy.py +135 -0
- morphogen/analysis/basic.py +38 -0
- morphogen/analysis/cells.py +54 -0
- morphogen/analysis/connectivity.py +156 -0
- morphogen/analysis/correlation.py +195 -0
- morphogen/analysis/covariance.py +80 -0
- morphogen/analysis/fractal.py +54 -0
- morphogen/analysis/measures.py +188 -0
- morphogen/analysis/morphology.py +265 -0
- morphogen/analysis/particles.py +160 -0
- morphogen/analysis/percolation.py +2034 -0
- morphogen/analysis/power_laws.py +143 -0
- morphogen/analysis/random_sets.py +351 -0
- morphogen/analysis/stereology.py +289 -0
- morphogen/analysis/surface.py +107 -0
- morphogen/analysis/topology.py +92 -0
- morphogen/automata/__init__.py +74 -0
- morphogen/automata/engine.py +211 -0
- morphogen/automata/growth.py +686 -0
- morphogen/automata/lattice.py +143 -0
- morphogen/automata/reaction.py +255 -0
- morphogen/automata/rules.py +353 -0
- morphogen/automata/tilings.py +1715 -0
- morphogen/cli.py +3526 -0
- morphogen/config.py +2167 -0
- morphogen/contact/__init__.py +113 -0
- morphogen/contact/experiments.py +368 -0
- morphogen/contact/hertz.py +104 -0
- morphogen/contact/kernels.py +827 -0
- morphogen/contact/periodic.py +278 -0
- morphogen/contact/problem.py +578 -0
- morphogen/contact/surfaces.py +310 -0
- morphogen/coupling/__init__.py +43 -0
- morphogen/coupling/ageing.py +143 -0
- morphogen/coupling/diffusion.py +226 -0
- morphogen/coupling/fenicsx.py +484 -0
- morphogen/coupling/oxidation.py +447 -0
- morphogen/coupling/plates.py +247 -0
- morphogen/design/__init__.py +51 -0
- morphogen/design/csp.py +616 -0
- morphogen/design/frames.py +277 -0
- morphogen/design/search.py +287 -0
- morphogen/design/tiles.py +336 -0
- morphogen/distributions.py +312 -0
- morphogen/domain.py +203 -0
- morphogen/dynamics/__init__.py +179 -0
- morphogen/dynamics/model.py +638 -0
- morphogen/dynamics/openradioss.py +643 -0
- morphogen/dynamics/results.py +515 -0
- morphogen/fracture/__init__.py +170 -0
- morphogen/fracture/bulk.py +349 -0
- morphogen/fracture/cohesive.py +1614 -0
- morphogen/fracture/ductile.py +557 -0
- morphogen/fracture/lefm.py +1168 -0
- morphogen/fracture/mixed.py +1178 -0
- morphogen/fracture/periodic.py +733 -0
- morphogen/fracture/phasefield.py +714 -0
- morphogen/fracture/phasefield_finite.py +368 -0
- morphogen/fracture/surface.py +572 -0
- morphogen/fracture/toughness.py +566 -0
- morphogen/gpu.py +108 -0
- morphogen/gui/__init__.py +8 -0
- morphogen/gui/api.py +1927 -0
- morphogen/gui/desktop.py +387 -0
- morphogen/gui/icon.png +0 -0
- morphogen/gui/index.html +1909 -0
- morphogen/gui/server.py +229 -0
- morphogen/gui/tools/__init__.py +629 -0
- morphogen/gui/tools/compare.py +149 -0
- morphogen/gui/tools/contact.py +391 -0
- morphogen/gui/tools/couplings.py +1085 -0
- morphogen/gui/tools/crackfront.py +245 -0
- morphogen/gui/tools/design.py +224 -0
- morphogen/gui/tools/dynamics.py +824 -0
- morphogen/gui/tools/fracture.py +2586 -0
- morphogen/gui/tools/interop.py +1654 -0
- morphogen/gui/tools/learning.py +595 -0
- morphogen/gui/tools/mechanics.py +3881 -0
- morphogen/gui/tools/nonlocal_damage.py +1321 -0
- morphogen/gui/tools/phasefield.py +215 -0
- morphogen/gui/tools/physics.py +597 -0
- morphogen/gui/tools/stability.py +1756 -0
- morphogen/gui/tools/statistics.py +1408 -0
- morphogen/gui/viewer.js +1100 -0
- morphogen/homogenization/__init__.py +210 -0
- morphogen/homogenization/acoustics.py +566 -0
- morphogen/homogenization/amg.py +1005 -0
- morphogen/homogenization/apparent.py +1046 -0
- morphogen/homogenization/behaviours.cu +2285 -0
- morphogen/homogenization/behaviours.py +944 -0
- morphogen/homogenization/beremin.py +263 -0
- morphogen/homogenization/bifurcation.py +1085 -0
- morphogen/homogenization/bloch.py +507 -0
- morphogen/homogenization/bounds.py +226 -0
- morphogen/homogenization/core.py +458 -0
- morphogen/homogenization/coupled.py +1135 -0
- morphogen/homogenization/crystal.py +2967 -0
- morphogen/homogenization/dilatation.py +454 -0
- morphogen/homogenization/elements.py +157 -0
- morphogen/homogenization/fatigue.py +768 -0
- morphogen/homogenization/fe.py +1739 -0
- morphogen/homogenization/fenicsx.py +307 -0
- morphogen/homogenization/fft.py +499 -0
- morphogen/homogenization/fft_nonlinear.py +391 -0
- morphogen/homogenization/finite.py +613 -0
- morphogen/homogenization/flow.py +361 -0
- morphogen/homogenization/frames.py +1125 -0
- morphogen/homogenization/gpu.py +1241 -0
- morphogen/homogenization/harmonic.py +427 -0
- morphogen/homogenization/identification.py +579 -0
- morphogen/homogenization/kernels.py +760 -0
- morphogen/homogenization/laws.py +2061 -0
- morphogen/homogenization/materials.py +1080 -0
- morphogen/homogenization/mfront.py +589 -0
- morphogen/homogenization/networks.py +880 -0
- morphogen/homogenization/nonlinear.py +2612 -0
- morphogen/homogenization/ntfa.py +577 -0
- morphogen/homogenization/paths.py +476 -0
- morphogen/homogenization/photonic.py +467 -0
- morphogen/homogenization/poroelastic.py +212 -0
- morphogen/homogenization/porous.py +1120 -0
- morphogen/homogenization/postprocess.py +290 -0
- morphogen/homogenization/solvers.py +1140 -0
- morphogen/homogenization/tensors.py +240 -0
- morphogen/homogenization/voxel_fe.py +457 -0
- morphogen/homogenization/xfem.py +1016 -0
- morphogen/homogenization/zmat.py +1258 -0
- morphogen/iga/__init__.py +48 -0
- morphogen/iga/analysis.py +508 -0
- morphogen/iga/basis.py +214 -0
- morphogen/iga/geometry.py +501 -0
- morphogen/iga/homogenization.py +219 -0
- morphogen/iga/optimization.py +700 -0
- morphogen/iga/shapes.py +331 -0
- morphogen/image.py +128 -0
- morphogen/io/__init__.py +246 -0
- morphogen/io/amitex.py +741 -0
- morphogen/io/ebsd.py +881 -0
- morphogen/io/export.py +196 -0
- morphogen/io/geometry.py +158 -0
- morphogen/io/medit.py +147 -0
- morphogen/io/meshes.py +844 -0
- morphogen/io/metaimage.py +97 -0
- morphogen/io/mfront.py +1104 -0
- morphogen/io/native.py +57 -0
- morphogen/io/radioss.py +764 -0
- morphogen/io/solvers.py +371 -0
- morphogen/io/tables.py +278 -0
- morphogen/io/tiff.py +66 -0
- morphogen/io/vtk.py +701 -0
- morphogen/io/xdmf.py +200 -0
- morphogen/kernels/__init__.py +5 -0
- morphogen/kernels/annealing.py +192 -0
- morphogen/kernels/cells.py +69 -0
- morphogen/kernels/collective.py +87 -0
- morphogen/kernels/force_biased.py +595 -0
- morphogen/kernels/implicit.py +145 -0
- morphogen/kernels/leaves.py +132 -0
- morphogen/kernels/packing.py +304 -0
- morphogen/kernels/raster.py +279 -0
- morphogen/kernels/rsa.py +371 -0
- morphogen/kernels/union.py +135 -0
- morphogen/kernels/watershed.py +190 -0
- morphogen/laser/__init__.py +234 -0
- morphogen/laser/architectures.py +375 -0
- morphogen/laser/bending.py +216 -0
- morphogen/laser/cells.py +1694 -0
- morphogen/laser/design.py +940 -0
- morphogen/laser/figures.py +227 -0
- morphogen/laser/heat.py +804 -0
- morphogen/laser/materials.py +691 -0
- morphogen/laser/mechanics.py +1670 -0
- morphogen/laser/metallurgy.py +615 -0
- morphogen/laser/patterns.py +828 -0
- morphogen/laser/periodic.py +392 -0
- morphogen/laser/process.py +362 -0
- morphogen/laser/run.py +534 -0
- morphogen/laser/solid.py +216 -0
- morphogen/laser/specimen.py +200 -0
- morphogen/laser/structures.py +708 -0
- morphogen/learning/__init__.py +81 -0
- morphogen/learning/behaviour.py +398 -0
- morphogen/learning/data.py +328 -0
- morphogen/learning/learned.cpp +668 -0
- morphogen/learning/logarithmic.py +202 -0
- morphogen/learning/mfront.py +409 -0
- morphogen/learning/networks.py +767 -0
- morphogen/learning/run.py +212 -0
- morphogen/learning/standard.py +814 -0
- morphogen/learning/training.py +235 -0
- morphogen/mesh/__init__.py +29 -0
- morphogen/mesh/conforming.py +1423 -0
- morphogen/mesh/curved.py +600 -0
- morphogen/mesh/exact.py +1717 -0
- morphogen/mesh/octree.py +350 -0
- morphogen/mesh/polycrystal.py +1041 -0
- morphogen/mesh/polyhedra.py +677 -0
- morphogen/mesh/regularize.py +570 -0
- morphogen/mesh/surface.py +97 -0
- morphogen/mesh/tetra.py +512 -0
- morphogen/mesh/voxel.py +124 -0
- morphogen/micromorphic/__init__.py +31 -0
- morphogen/micromorphic/damage.py +359 -0
- morphogen/micromorphic/ductile.py +534 -0
- morphogen/micromorphic/finite.py +220 -0
- morphogen/micromorphic/microfoam.py +787 -0
- morphogen/micromorphic/space.py +341 -0
- morphogen/models/__init__.py +195 -0
- morphogen/models/affine.py +384 -0
- morphogen/models/automata.py +592 -0
- morphogen/models/base.py +500 -0
- morphogen/models/boolean.py +310 -0
- morphogen/models/bouligand.py +331 -0
- morphogen/models/branching.py +241 -0
- morphogen/models/combination.py +430 -0
- morphogen/models/deadleaves.py +766 -0
- morphogen/models/design.py +289 -0
- morphogen/models/ebsd.py +206 -0
- morphogen/models/fibers.py +1476 -0
- morphogen/models/foam.py +594 -0
- morphogen/models/gaussian.py +314 -0
- morphogen/models/growth.py +459 -0
- morphogen/models/hardcore.py +317 -0
- morphogen/models/hierarchical.py +269 -0
- morphogen/models/honeycomb.py +749 -0
- morphogen/models/implicit.py +177 -0
- morphogen/models/laminate.py +470 -0
- morphogen/models/lattice.py +351 -0
- morphogen/models/lattice_field.py +345 -0
- morphogen/models/levelset_foam.py +563 -0
- morphogen/models/nacre.py +411 -0
- morphogen/models/nested.py +924 -0
- morphogen/models/osteons.py +374 -0
- morphogen/models/pieces.py +167 -0
- morphogen/models/planar.py +126 -0
- morphogen/models/reconstruction.py +203 -0
- morphogen/models/scale_rich.py +1409 -0
- morphogen/models/scale_rich_3d.py +1616 -0
- morphogen/models/tessellation.py +735 -0
- morphogen/models/tiling_field.py +302 -0
- morphogen/models/tpms.py +197 -0
- morphogen/models/transparent.py +406 -0
- morphogen/models/union.py +141 -0
- morphogen/optimization/__init__.py +43 -0
- morphogen/optimization/cell.py +295 -0
- morphogen/optimization/filters.py +115 -0
- morphogen/optimization/mma.py +226 -0
- morphogen/optimization/run.py +219 -0
- morphogen/optimization/topology.py +632 -0
- morphogen/orientations.py +568 -0
- morphogen/parallel.py +599 -0
- morphogen/pipeline.py +978 -0
- morphogen/primitives.py +188 -0
- morphogen/results.py +564 -0
- morphogen/rve/__init__.py +73 -0
- morphogen/rve/report.py +627 -0
- morphogen/rve/scaling.py +363 -0
- morphogen/rve/study.py +1054 -0
- morphogen/rve/windows.py +345 -0
- morphogen/seeding.py +51 -0
- morphogen/settings.py +118 -0
- morphogen/stopping.py +48 -0
- morphogen/symmetry.py +384 -0
- morphogen/templates/activator_inhibitor.yaml +22 -0
- morphogen/templates/aggregation.yaml +23 -0
- morphogen/templates/boolean_cylinders.yaml +20 -0
- morphogen/templates/boolean_spheres.yaml +22 -0
- morphogen/templates/bouligand.yaml +28 -0
- morphogen/templates/cellular_automaton.yaml +25 -0
- morphogen/templates/coated_spheres.yaml +26 -0
- morphogen/templates/contact_fibers.yaml +27 -0
- morphogen/templates/cox_nanocomposite.yaml +22 -0
- morphogen/templates/cross_linked_fibers.yaml +26 -0
- morphogen/templates/curved_arcs.yaml +28 -0
- morphogen/templates/curved_fibers.yaml +24 -0
- morphogen/templates/dead_leaves.yaml +22 -0
- morphogen/templates/delaunay_network.yaml +22 -0
- morphogen/templates/dense_packing.yaml +22 -0
- morphogen/templates/diffusion.yaml +33 -0
- morphogen/templates/ebsd.yaml +34 -0
- morphogen/templates/ebsd_map.ctf +3087 -0
- morphogen/templates/fracture_composite.yaml +42 -0
- morphogen/templates/fracture_rubber.yaml +47 -0
- morphogen/templates/gaussian_excursion.yaml +17 -0
- morphogen/templates/graded_lattice.yaml +24 -0
- morphogen/templates/hardcore_fibers.yaml +22 -0
- morphogen/templates/hardcore_spheres.yaml +22 -0
- morphogen/templates/hierarchical_lattice.yaml +22 -0
- morphogen/templates/homogenization_acoustic_foam.yaml +36 -0
- morphogen/templates/homogenization_beremin.yaml +50 -0
- morphogen/templates/homogenization_cleavage.yaml +51 -0
- morphogen/templates/homogenization_cleavage_band.yaml +55 -0
- morphogen/templates/homogenization_contact.yaml +43 -0
- morphogen/templates/homogenization_crack_closure.yaml +49 -0
- morphogen/templates/homogenization_crystal_plasticity.yaml +50 -0
- morphogen/templates/homogenization_crystal_plasticity_fft.yaml +52 -0
- morphogen/templates/homogenization_crystallization.yaml +30 -0
- morphogen/templates/homogenization_debonding.yaml +43 -0
- morphogen/templates/homogenization_detwinning.yaml +58 -0
- morphogen/templates/homogenization_ductile_damage.yaml +47 -0
- morphogen/templates/homogenization_fatigue.yaml +40 -0
- morphogen/templates/homogenization_grain_fracture.yaml +56 -0
- morphogen/templates/homogenization_gyroid.yaml +30 -0
- morphogen/templates/homogenization_intergranular.yaml +43 -0
- morphogen/templates/homogenization_interphase.yaml +42 -0
- morphogen/templates/homogenization_mixed_loading.yaml +33 -0
- morphogen/templates/homogenization_ntfa.yaml +56 -0
- morphogen/templates/homogenization_piezoelectric.yaml +27 -0
- morphogen/templates/homogenization_polycrystal.yaml +30 -0
- morphogen/templates/homogenization_polycrystal_inclusions.yaml +30 -0
- morphogen/templates/homogenization_poroelastic.yaml +26 -0
- morphogen/templates/homogenization_rubber.yaml +40 -0
- morphogen/templates/homogenization_slip_cleavage.yaml +50 -0
- morphogen/templates/homogenization_spheres.yaml +31 -0
- morphogen/templates/homogenization_transport.yaml +29 -0
- morphogen/templates/homogenization_twinning.yaml +54 -0
- morphogen/templates/homogenization_viscoelastic.yaml +34 -0
- morphogen/templates/homogenization_viscoplastic.yaml +42 -0
- morphogen/templates/homogenization_voronoi.yaml +26 -0
- morphogen/templates/homogenization_xfem.yaml +23 -0
- morphogen/templates/hyperuniform_cells.yaml +24 -0
- morphogen/templates/laguerre.yaml +18 -0
- morphogen/templates/laser_bending.yaml +35 -0
- morphogen/templates/laser_cells.yaml +38 -0
- morphogen/templates/laser_corrugated.yaml +36 -0
- morphogen/templates/level_set_foam.yaml +29 -0
- morphogen/templates/menger_sponge.yaml +17 -0
- morphogen/templates/nacre.yaml +25 -0
- morphogen/templates/nucleation_growth.yaml +25 -0
- morphogen/templates/optimize_auxetic.yaml +29 -0
- morphogen/templates/optimize_auxetic_3d.yaml +27 -0
- morphogen/templates/optimize_bulk.yaml +23 -0
- morphogen/templates/optimize_conductivity.yaml +20 -0
- morphogen/templates/osteons.yaml +28 -0
- morphogen/templates/penetrable_spheres.yaml +21 -0
- morphogen/templates/poisson_fibers.yaml +21 -0
- morphogen/templates/random_laminate.yaml +26 -0
- morphogen/templates/random_lattice.yaml +27 -0
- morphogen/templates/random_walk_fibers.yaml +26 -0
- morphogen/templates/reaction_diffusion.yaml +22 -0
- morphogen/templates/reconstruction.yaml +22 -0
- morphogen/templates/rve_cellular_automaton.yaml +23 -0
- morphogen/templates/rve_crystal_plasticity_fft.yaml +51 -0
- morphogen/templates/rve_multiphysics.yaml +43 -0
- morphogen/templates/rve_poisson_fibers.yaml +22 -0
- morphogen/templates/rve_poisson_fibers_fe.yaml +33 -0
- morphogen/templates/rve_voronoi_windows.yaml +20 -0
- morphogen/templates/scale_rich_network.yaml +29 -0
- morphogen/templates/scale_rich_plates.yaml +30 -0
- morphogen/templates/sequential_dead_leaves.yaml +25 -0
- morphogen/templates/strut_lattice.yaml +21 -0
- morphogen/templates/tile_assembly.yaml +28 -0
- morphogen/templates/tpms.yaml +19 -0
- morphogen/templates/trabecular_bone.yaml +29 -0
- morphogen/templates/transparent_dead_leaves.yaml +23 -0
- morphogen/templates/vascular_tree.yaml +23 -0
- morphogen/templates/voronoi.yaml +20 -0
- morphogen/templates/wood.yaml +34 -0
- morphogen/templates/workflow.yaml +56 -0
- morphogen/texture.py +665 -0
- morphogen/theory.py +162 -0
- morphogen/viz/__init__.py +12 -0
- morphogen/viz/export.py +244 -0
- morphogen/viz/figures.py +707 -0
- morphogen/viz/png.py +148 -0
- morphogen/viz/sections.py +696 -0
- morphogen/viz/surfaces.py +1352 -0
- morphogen/viz/video.py +904 -0
- morphogen/viz/workflow.py +488 -0
- morphogen-1.0.0.dist-info/METADATA +2316 -0
- morphogen-1.0.0.dist-info/RECORD +381 -0
- morphogen-1.0.0.dist-info/WHEEL +4 -0
- morphogen-1.0.0.dist-info/entry_points.txt +5 -0
- morphogen-1.0.0.dist-info/licenses/LICENSE +674 -0
|
@@ -0,0 +1,691 @@
|
|
|
1
|
+
"""Materials of laser-architectured sheets: flow laws from tensile properties, the
|
|
2
|
+
strength of each hardness, and the steels of the PIMM studies.
|
|
3
|
+
|
|
4
|
+
**Flow law** (:class:`FlowLaw`). The true stress of the equivalent plastic strain,
|
|
5
|
+
Ludwik's ``σ(p) = σ0 + K((p + δ)^n − δ^n)`` (``δ = 10⁻⁴`` keeps the initial slope
|
|
6
|
+
finite) or Voce's ``σ0 + Q(1 − exp(−bp))``. Given the 0.2 % proof stress ``R_p`` (the
|
|
7
|
+
stress at a plastic strain of 0.2 %), the engineering tensile strength ``R_m`` and the
|
|
8
|
+
uniform elongation ``A_g`` (engineering) of a tensile test, Considère's condition
|
|
9
|
+
``dσ/dp = σ`` at the true plastic uniform strain ``p_u = ln(1 + A_g) − σ_u/E``, with
|
|
10
|
+
``σ(p_u) = σ_u = R_m (1 + A_g)``, fixes the two other parameters
|
|
11
|
+
(:func:`flow_parameters`): Ludwik's law when an exponent fits, Voce's otherwise (the
|
|
12
|
+
large strength ratios of martensite at small elongations).
|
|
13
|
+
|
|
14
|
+
**Strength of a hardness** (:class:`StrengthTable`). The tensile properties of the
|
|
15
|
+
states of a material (base, treated at several energies, carburized...) against their
|
|
16
|
+
Vickers hardness, measured; between them linear interpolation, beyond the last rows the
|
|
17
|
+
correlations of Pavlina & Van Tyne (2008) for steels (``R_p = −90.7 + 2.876 HV``,
|
|
18
|
+
``R_m = −99.8 + 3.734 HV``, MPa) shifted to meet the table, and the uniform elongation
|
|
19
|
+
extrapolated linearly (at least 2 %). Each point of a treated sheet gets the flow law
|
|
20
|
+
of its hardness.
|
|
21
|
+
|
|
22
|
+
**Presets** (:data:`PRESETS`, :func:`sheet_material`):
|
|
23
|
+
|
|
24
|
+
* ``aisi430``: ferritic stainless steel AISI 430, 0.5 mm (Wang et al. 2022): C 0.026,
|
|
25
|
+
Cr 18.7; base 160 HV, R_p 346 MPa, R_m 503 MPa, A_g 19.4 %; fully treated by the double
|
|
26
|
+
laser in argon at 15 and 20 kJ/m: 211.5 and 241.8 HV, R_p 489 and 540 MPa, R_m 624 and
|
|
27
|
+
703 MPa, A_g 15.5 and 13.7 % (the table); carburized (Wang 2022, thesis ch. 4): +130 %
|
|
28
|
+
HV, R_p +90 %, R_m +85 % (A_g assumed 10 %). Hardening by peak temperature (onset Ac1
|
|
29
|
+
= 1148 K, 310 HV near Tm = 1698 K for a single track), its gain at 1300 °C and its
|
|
30
|
+
tempering fitted to the mean hardness of the sheets fully treated by ten tracks at
|
|
31
|
+
1 mm pitch (211.5, 241.8 and 233.6 HV at 15, 20 and 25 kJ/m; computed 212, 240 and
|
|
32
|
+
235).
|
|
33
|
+
* ``annealed_ms1500``: MS1500 annealed at 850 °C for 1 h (ferrite–pearlite), 1 mm
|
|
34
|
+
(Wang 2022, thesis ch. 5): C 0.228, Si 0.242, Mn 1.73, Cr 0.19; 167 HV, R_p 300 MPa,
|
|
35
|
+
R_m 534 MPa, A_g 16.7 %; laser martensite as the as-received MS1500 (about 480 HV,
|
|
36
|
+
R_p 1300 MPa, R_m 1600 MPa, A_g 4 %; Lapouge et al. 2019, Wang 2020).
|
|
37
|
+
* ``dp1180``: dual-phase DP1180, 1 mm (Lapouge et al. 2019): 85 % martensite, 380 HV,
|
|
38
|
+
R_p 850 MPa, R_m 1200 MPa, A_g 5 %; tempered at Ac1, R_m 816 MPa (about 255 HV).
|
|
39
|
+
Laser tempering: soft tracks in a hard sheet.
|
|
40
|
+
|
|
41
|
+
Thermal properties: AISI 430 with the mean of the Eurocode stainless-steel laws used by
|
|
42
|
+
Wang et al. (conductivity 14.6 + 0.0127 θ, specific heat about 560 J/kg/K over the
|
|
43
|
+
cycle), the C–Mn steels with Lapouge et al.'s (28 W/m/K, 560 J/kg/K, 7860 kg/m³);
|
|
44
|
+
absorptivity 0.42 under argon (Wang et al. 2022), 200 W/m²/K on the faces (gas jets).
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
from __future__ import annotations
|
|
48
|
+
|
|
49
|
+
import math
|
|
50
|
+
from dataclasses import dataclass, field, replace
|
|
51
|
+
|
|
52
|
+
import numpy as np
|
|
53
|
+
|
|
54
|
+
from morphogen.laser.heat import ThermalProperties
|
|
55
|
+
from morphogen.laser.metallurgy import (
|
|
56
|
+
PeakHardening,
|
|
57
|
+
PeakSoftening,
|
|
58
|
+
Tempering,
|
|
59
|
+
TransformationHardening,
|
|
60
|
+
model_from_config,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
#: Offset of the Ludwik law (keeps its initial slope finite).
|
|
64
|
+
LUDWIK_OFFSET = 1e-4
|
|
65
|
+
#: Kinds of flow laws: Ludwik's power law, Voce's saturating law, Swift's (Hollomon's law
|
|
66
|
+
#: from the yield stress).
|
|
67
|
+
LAWS = ("ludwik", "voce", "swift")
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
@dataclass(frozen=True)
|
|
71
|
+
class FlowLaw:
|
|
72
|
+
"""True stress (MPa) of the equivalent plastic strain: ``ludwik``,
|
|
73
|
+
``σ0 + a((p + δ)^b − δ^b)`` (``a = K``, ``b = n``), ``voce``,
|
|
74
|
+
``σ0 + a(1 − exp(−b p))`` (``a = Q``, ``b`` the rate), or ``swift``,
|
|
75
|
+
``K (ε0 + p)^n`` (``a = K``, ``b = n``, ``ε0 = (σ0/K)^(1/n)``: Hollomon's ``σ = K ε^n``
|
|
76
|
+
from the yield stress ``σ0``, as Wang et al. 2023 for their phases)."""
|
|
77
|
+
|
|
78
|
+
kind: str
|
|
79
|
+
sigma0: float
|
|
80
|
+
a: float
|
|
81
|
+
b: float
|
|
82
|
+
offset: float = LUDWIK_OFFSET
|
|
83
|
+
|
|
84
|
+
def __post_init__(self):
|
|
85
|
+
if self.kind not in LAWS:
|
|
86
|
+
raise ValueError(f"flow law: one of {LAWS}")
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def code(self) -> int:
|
|
90
|
+
"""The index of the kind in the kernels."""
|
|
91
|
+
return LAWS.index(self.kind)
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def hollomon(cls, yield_strength: float, k: float, n: float) -> FlowLaw:
|
|
95
|
+
"""Hollomon's ``σ = K ε^n`` beyond the yield stress (a Swift law)."""
|
|
96
|
+
return cls("swift", float(yield_strength), float(k), float(n))
|
|
97
|
+
|
|
98
|
+
def stress(self, p):
|
|
99
|
+
p = np.asarray(p, dtype=float)
|
|
100
|
+
if self.kind == "ludwik":
|
|
101
|
+
d = self.offset
|
|
102
|
+
return self.sigma0 + self.a * ((p + d) ** self.b - d**self.b)
|
|
103
|
+
if self.kind == "swift":
|
|
104
|
+
return self.a * ((self.sigma0 / self.a) ** (1.0 / self.b) + p) ** self.b
|
|
105
|
+
return self.sigma0 + self.a * (1.0 - np.exp(-self.b * p))
|
|
106
|
+
|
|
107
|
+
def slope(self, p):
|
|
108
|
+
p = np.asarray(p, dtype=float)
|
|
109
|
+
if self.kind == "ludwik":
|
|
110
|
+
return self.b * self.a * (p + self.offset) ** (self.b - 1.0)
|
|
111
|
+
if self.kind == "swift":
|
|
112
|
+
q = (self.sigma0 / self.a) ** (1.0 / self.b) + p
|
|
113
|
+
return self.b * self.a * q ** (self.b - 1.0)
|
|
114
|
+
return self.a * self.b * np.exp(-self.b * p)
|
|
115
|
+
|
|
116
|
+
@classmethod
|
|
117
|
+
def from_tensile(
|
|
118
|
+
cls,
|
|
119
|
+
yield_strength: float,
|
|
120
|
+
tensile_strength: float,
|
|
121
|
+
uniform_elongation: float,
|
|
122
|
+
young: float = 210000.0,
|
|
123
|
+
) -> FlowLaw:
|
|
124
|
+
"""The law of a tensile test (see the module): Considère at the uniform
|
|
125
|
+
elongation."""
|
|
126
|
+
kind, s0, a, b = flow_parameters(
|
|
127
|
+
yield_strength, tensile_strength, uniform_elongation, young=young
|
|
128
|
+
)
|
|
129
|
+
return cls(LAWS[int(kind[0])], float(s0[0]), float(a[0]), float(b[0]))
|
|
130
|
+
|
|
131
|
+
def necking(self) -> tuple[float, float]:
|
|
132
|
+
"""True plastic strain at Considère's condition (rigid-plastic) and the
|
|
133
|
+
engineering tensile strength of the law."""
|
|
134
|
+
lo, hi = 1e-7, 5.0
|
|
135
|
+
for _ in range(200):
|
|
136
|
+
mid = 0.5 * (lo + hi)
|
|
137
|
+
if self.slope(mid) > self.stress(mid):
|
|
138
|
+
lo = mid
|
|
139
|
+
else:
|
|
140
|
+
hi = mid
|
|
141
|
+
p = 0.5 * (lo + hi)
|
|
142
|
+
return p, float(self.stress(p) * math.exp(-p))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def _bisect(fun, lo, hi, iterations: int = 60):
|
|
146
|
+
"""Vectorized bisection of a decreasing function on ``[lo, hi]``."""
|
|
147
|
+
lo, hi = lo.copy(), hi.copy()
|
|
148
|
+
for _ in range(iterations):
|
|
149
|
+
mid = 0.5 * (lo + hi)
|
|
150
|
+
up = fun(mid) > 0
|
|
151
|
+
lo = np.where(up, mid, lo)
|
|
152
|
+
hi = np.where(up, hi, mid)
|
|
153
|
+
return 0.5 * (lo + hi)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def flow_parameters(
|
|
157
|
+
yield_strength,
|
|
158
|
+
tensile_strength,
|
|
159
|
+
uniform_elongation,
|
|
160
|
+
*,
|
|
161
|
+
young: float = 210000.0,
|
|
162
|
+
offset: float = LUDWIK_OFFSET,
|
|
163
|
+
strict: bool = True,
|
|
164
|
+
):
|
|
165
|
+
"""Flow laws of tensile properties, vectorized: ``(kind, σ0, a, b)`` (kind 0:
|
|
166
|
+
Ludwik, 1: Voce). The law gives the proof stress at a plastic strain of 0.2 %,
|
|
167
|
+
``σ(0.002) = R_p``, and at the true plastic strain ``p_u = ln(1 + A_g) − σ_u/E`` of
|
|
168
|
+
the uniform elongation ``σ(p_u) = σ_u = R_m (1 + A_g)`` and ``dσ/dp = σ_u``
|
|
169
|
+
(Considère). Ludwik: ``K = σ_u (p_u + δ)^(1−n)/n``, ``n`` and ``σ0`` by nested
|
|
170
|
+
bisections; where no exponent fits (a large ratio ``R_m/R_p`` at a small elongation,
|
|
171
|
+
martensite), Voce: ``x/(e^x − 1) = σ_u p_u/(σ_u − σ0)`` with ``x = b p_u`` and
|
|
172
|
+
``Q = (σ_u − σ0)/(1 − e^(−x))``. ``strict``: raise on properties that no law fits
|
|
173
|
+
(else their parameters are NaN)."""
|
|
174
|
+
rp = np.atleast_1d(np.asarray(yield_strength, dtype=float))
|
|
175
|
+
rm = np.atleast_1d(np.asarray(tensile_strength, dtype=float))
|
|
176
|
+
ag = np.atleast_1d(np.asarray(uniform_elongation, dtype=float))
|
|
177
|
+
rp, rm, ag = (np.array(v, dtype=float) for v in np.broadcast_arrays(rp, rm, ag))
|
|
178
|
+
bad = (ag <= 0) | (rm * (1.0 + ag) <= rp)
|
|
179
|
+
if strict and bad.any():
|
|
180
|
+
raise ValueError("tensile properties: A_g > 0 and R_m (1 + A_g) > R_p")
|
|
181
|
+
ag = np.where(bad, 0.1, ag)
|
|
182
|
+
rm = np.where(bad, 2.0 * rp, rm)
|
|
183
|
+
su = rm * (1.0 + ag)
|
|
184
|
+
pu = np.maximum(np.log1p(ag) - su / young, 1e-3)
|
|
185
|
+
steep = su * (1.0 - pu) <= rp
|
|
186
|
+
if strict and steep.any():
|
|
187
|
+
raise ValueError(
|
|
188
|
+
"tensile properties: a hardening exponent above 1 (R_p too high "
|
|
189
|
+
"for the strength and elongation)"
|
|
190
|
+
)
|
|
191
|
+
bad |= steep
|
|
192
|
+
d = float(offset)
|
|
193
|
+
q = pu + d
|
|
194
|
+
n_lo, n_hi = np.full_like(su, 1e-3), np.full_like(su, 1.0)
|
|
195
|
+
|
|
196
|
+
def ludwik(s0):
|
|
197
|
+
"""Exponent, modulus and whether a root exists, for the initial stresses s0."""
|
|
198
|
+
f = lambda n: s0 + su / n * (q - d**n * q ** (1.0 - n)) - su # noqa: E731
|
|
199
|
+
ok = (f(n_lo) > 0) & (f(n_hi) < 0)
|
|
200
|
+
n = _bisect(f, n_lo, n_hi)
|
|
201
|
+
return n, su * q ** (1.0 - n) / n, ok
|
|
202
|
+
|
|
203
|
+
def g_ludwik(s0): # the proof stress minus R_p: increasing in s0
|
|
204
|
+
n, k, ok = ludwik(s0)
|
|
205
|
+
return np.where(ok, rp - (s0 + k * ((0.002 + d) ** n - d**n)), -1.0)
|
|
206
|
+
|
|
207
|
+
s_lo, s_hi = 0.2 * rp, rp.copy()
|
|
208
|
+
s0_l = _bisect(g_ludwik, s_lo, s_hi)
|
|
209
|
+
n, k, ok = ludwik(s0_l)
|
|
210
|
+
ok &= np.abs(g_ludwik(s0_l)) < 1e-6 * rp
|
|
211
|
+
|
|
212
|
+
def voce(s0):
|
|
213
|
+
r = su * pu / (su - s0)
|
|
214
|
+
x = _bisect(
|
|
215
|
+
lambda x: x / np.expm1(x) - r, np.full_like(su, 1e-6), np.full_like(su, 60.0), 80
|
|
216
|
+
)
|
|
217
|
+
return x / pu, (su - s0) / (-np.expm1(-x))
|
|
218
|
+
|
|
219
|
+
def g_voce(s0):
|
|
220
|
+
b, qv = voce(s0)
|
|
221
|
+
return rp - (s0 + qv * (-np.expm1(-b * 0.002)))
|
|
222
|
+
|
|
223
|
+
s0_v = _bisect(g_voce, s_lo, s_hi)
|
|
224
|
+
b_v, q_v = voce(s0_v)
|
|
225
|
+
bad |= ~ok & (np.abs(g_voce(s0_v)) > 1e-3 * rp)
|
|
226
|
+
if strict and bad.any():
|
|
227
|
+
raise ValueError("tensile properties: no Ludwik or Voce law fits them")
|
|
228
|
+
kind = np.where(ok, 0, 1).astype(np.int8)
|
|
229
|
+
out = [np.where(ok, s0_l, s0_v), np.where(ok, k, q_v), np.where(ok, n, b_v)]
|
|
230
|
+
out = [np.where(bad, np.nan, v) for v in out]
|
|
231
|
+
return (kind, *out)
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
@dataclass
|
|
235
|
+
class StrengthTable:
|
|
236
|
+
"""Tensile properties against hardness: rows ``(HV, R_p, R_m, A_g)`` (MPa, MPa,
|
|
237
|
+
engineering fraction), interpolated linearly, extrapolated by Pavlina & Van Tyne's
|
|
238
|
+
slopes (see the module)."""
|
|
239
|
+
|
|
240
|
+
rows: tuple
|
|
241
|
+
|
|
242
|
+
def __post_init__(self):
|
|
243
|
+
tab = np.asarray(self.rows, dtype=float).reshape(-1, 4)
|
|
244
|
+
tab = tab[np.argsort(tab[:, 0])]
|
|
245
|
+
if len(tab) < 1 or np.any(np.diff(tab[:, 0]) <= 0):
|
|
246
|
+
raise ValueError("strength table: rows of distinct hardnesses")
|
|
247
|
+
self.rows = tuple(map(tuple, tab))
|
|
248
|
+
self._t = tab
|
|
249
|
+
|
|
250
|
+
def properties(self, hv) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
|
|
251
|
+
"""``R_p``, ``R_m`` and ``A_g`` of hardnesses (arrays)."""
|
|
252
|
+
hv = np.asarray(hv, dtype=float)
|
|
253
|
+
t = self._t
|
|
254
|
+
if len(t) == 1:
|
|
255
|
+
rp = t[0, 1] + 2.876 * (hv - t[0, 0])
|
|
256
|
+
rm = t[0, 2] + 3.734 * (hv - t[0, 0])
|
|
257
|
+
ag = np.full_like(hv, t[0, 3])
|
|
258
|
+
else:
|
|
259
|
+
rp = np.interp(hv, t[:, 0], t[:, 1])
|
|
260
|
+
rm = np.interp(hv, t[:, 0], t[:, 2])
|
|
261
|
+
ag = np.interp(hv, t[:, 0], t[:, 3])
|
|
262
|
+
lo, hi = hv < t[0, 0], hv > t[-1, 0]
|
|
263
|
+
rp = np.where(lo, t[0, 1] + 2.876 * (hv - t[0, 0]), rp)
|
|
264
|
+
rm = np.where(lo, t[0, 2] + 3.734 * (hv - t[0, 0]), rm)
|
|
265
|
+
rp = np.where(hi, t[-1, 1] + 2.876 * (hv - t[-1, 0]), rp)
|
|
266
|
+
rm = np.where(hi, t[-1, 2] + 3.734 * (hv - t[-1, 0]), rm)
|
|
267
|
+
slope = (t[-1, 3] - t[-2, 3]) / (t[-1, 0] - t[-2, 0])
|
|
268
|
+
ag = np.where(hi, t[-1, 3] + slope * (hv - t[-1, 0]), ag)
|
|
269
|
+
ag = np.clip(ag, 0.02, 0.6)
|
|
270
|
+
rp = np.maximum(rp, 50.0)
|
|
271
|
+
rm = np.maximum(rm, 1.02 * rp / (1.0 + ag) + 1.0)
|
|
272
|
+
return rp, rm, ag
|
|
273
|
+
|
|
274
|
+
def flow(self, hv, young: float = 210000.0) -> tuple:
|
|
275
|
+
"""Flow laws ``(kind, σ0, a, b)`` of hardnesses (see :func:`flow_parameters`),
|
|
276
|
+
those of the nearest hardness of a grid of 0.5 HV (cached)."""
|
|
277
|
+
hv = np.asarray(hv, dtype=float)
|
|
278
|
+
key = float(young)
|
|
279
|
+
cache = self.__dict__.setdefault("_flow_cache", {})
|
|
280
|
+
if key not in cache:
|
|
281
|
+
lo = max(50.0, 0.6 * self._t[0, 0])
|
|
282
|
+
hi = max(1.6 * self._t[-1, 0], self._t[-1, 0] + 200.0)
|
|
283
|
+
grid = np.arange(lo, hi + 1e-9, 0.5)
|
|
284
|
+
params = flow_parameters(*self.properties(grid), young=young, strict=False)
|
|
285
|
+
valid = np.isfinite(params[1])
|
|
286
|
+
if not valid.any():
|
|
287
|
+
raise ValueError("strength table: no flow law fits its properties")
|
|
288
|
+
near = np.flatnonzero(valid)[
|
|
289
|
+
np.clip(
|
|
290
|
+
np.searchsorted(np.flatnonzero(valid), np.arange(len(grid))), 0, valid.sum() - 1
|
|
291
|
+
)
|
|
292
|
+
]
|
|
293
|
+
cache[key] = (lo, tuple(v[near] for v in params))
|
|
294
|
+
lo, params = cache[key]
|
|
295
|
+
i = np.clip(np.rint((hv - lo) / 0.5).astype(np.int64), 0, len(params[0]) - 1)
|
|
296
|
+
return tuple(v[i] for v in params)
|
|
297
|
+
|
|
298
|
+
@classmethod
|
|
299
|
+
def from_config(cls, data) -> StrengthTable:
|
|
300
|
+
if isinstance(data, StrengthTable):
|
|
301
|
+
return data
|
|
302
|
+
return cls(tuple(tuple(row) for row in data))
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
_YLD_FITS: dict = {}
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
def _yld2000_coefficients(material) -> tuple:
|
|
309
|
+
"""α1 ... α8 of the Yld2000-2d texture of a material (fitted once per data)."""
|
|
310
|
+
from morphogen.laser.mechanics import yld2000_from_data
|
|
311
|
+
|
|
312
|
+
a = material.anisotropy
|
|
313
|
+
key = tuple(
|
|
314
|
+
float(a[k]) if k in a else None
|
|
315
|
+
for k in ("s0", "s45", "s90", "sb", "r0", "r45", "r90", "rb", "a")
|
|
316
|
+
)
|
|
317
|
+
if key not in _YLD_FITS:
|
|
318
|
+
missing = [k for k in ("s0", "s45", "s90", "sb", "r0", "r45", "r90") if k not in a]
|
|
319
|
+
if missing:
|
|
320
|
+
raise ValueError(f"anisotropy yld2000: give {missing}")
|
|
321
|
+
_YLD_FITS[key] = yld2000_from_data(
|
|
322
|
+
a["s0"],
|
|
323
|
+
a["s45"],
|
|
324
|
+
a["s90"],
|
|
325
|
+
a["sb"],
|
|
326
|
+
a["r0"],
|
|
327
|
+
a["r45"],
|
|
328
|
+
a["r90"],
|
|
329
|
+
a.get("rb", a["r0"] / a["r90"]),
|
|
330
|
+
a.get("a", 6.0),
|
|
331
|
+
)[:8]
|
|
332
|
+
return _YLD_FITS[key]
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
@dataclass
|
|
336
|
+
class SheetMaterial:
|
|
337
|
+
"""A sheet: its thermal properties, its metallurgical response to the cycles of the
|
|
338
|
+
tracks, its strength against hardness, its elasticity (MPa), its density (kg/m³), its
|
|
339
|
+
usual thickness (mm) and absorptivity, its rolling texture (``anisotropy``: the
|
|
340
|
+
Lankford coefficients ``{"r0", "r45", "r90"}`` of Hill's 1948 criterion, or with
|
|
341
|
+
``"criterion": "yld2000"`` the yield stresses ``"s0", "s45", "s90", "sb"`` and the
|
|
342
|
+
coefficients ``"r0", "r45", "r90", "rb"`` of Barlat's Yld2000-2d and its exponent
|
|
343
|
+
``"a"``; the share ``"memory"`` of the texture the treated points keep;
|
|
344
|
+
:meth:`yield_criterion`),
|
|
345
|
+
the ``fracture`` of its hard points (``{"hardness":
|
|
346
|
+
HV, "critical": plastic strain, "radius": mm}``: the points at least that hard break
|
|
347
|
+
at that plastic strain, averaged over the radius; :class:`~morphogen.laser.mechanics.Fracture`)
|
|
348
|
+
and the sources of the data."""
|
|
349
|
+
|
|
350
|
+
name: str
|
|
351
|
+
thermal: ThermalProperties
|
|
352
|
+
metallurgy: TransformationHardening | PeakHardening
|
|
353
|
+
strength: StrengthTable
|
|
354
|
+
young: float = 210000.0
|
|
355
|
+
poisson: float = 0.3
|
|
356
|
+
thickness: float = 1.0
|
|
357
|
+
absorptivity: float = 0.42
|
|
358
|
+
description: str = ""
|
|
359
|
+
references: tuple = ()
|
|
360
|
+
extra: dict = field(default_factory=dict)
|
|
361
|
+
fracture: dict | None = None
|
|
362
|
+
anisotropy: dict | None = None
|
|
363
|
+
|
|
364
|
+
def yield_criterion(self, treated, angle: float = 0.0) -> np.ndarray:
|
|
365
|
+
"""The yield criterion of points of treated share ``treated``: Hill's 1948
|
|
366
|
+
(``(..., 5)``, :meth:`hill`) or, with ``anisotropy["criterion"] = "yld2000"``,
|
|
367
|
+
Barlat's Yld2000-2d (``(..., 10)``: α1 ... α8 fitted to the data of the sheet,
|
|
368
|
+
:func:`~morphogen.laser.mechanics.yld2000_from_data`, the exponent ``a``, 6 by
|
|
369
|
+
default, and the angle of the rolling direction): the texture where untreated,
|
|
370
|
+
the isotropic coefficients (α = 1, the same exponent) where the laser
|
|
371
|
+
transformed the steel, or the share ``memory`` of the texture's departure from
|
|
372
|
+
them, mixed in proportion between."""
|
|
373
|
+
a = self.anisotropy or {}
|
|
374
|
+
if a.get("criterion", "hill48") == "hill48":
|
|
375
|
+
return self.hill(treated, angle)
|
|
376
|
+
if a["criterion"] != "yld2000":
|
|
377
|
+
raise ValueError("anisotropy criterion: hill48 or yld2000")
|
|
378
|
+
coef = np.asarray(_yld2000_coefficients(self), dtype=float)
|
|
379
|
+
expo = float(a.get("a", 6.0))
|
|
380
|
+
t = np.clip(np.asarray(treated, dtype=float), 0.0, 1.0)[..., None]
|
|
381
|
+
treated_coef = 1.0 + float(a.get("memory", 0.0)) * (coef - 1.0)
|
|
382
|
+
al = (1.0 - t) * coef + t * treated_coef
|
|
383
|
+
tail = np.empty((*al.shape[:-1], 2))
|
|
384
|
+
tail[..., 0] = expo
|
|
385
|
+
tail[..., 1] = np.radians(angle)
|
|
386
|
+
return np.concatenate([al, tail], axis=-1)
|
|
387
|
+
|
|
388
|
+
def hill(self, treated, angle: float = 0.0) -> np.ndarray:
|
|
389
|
+
"""Hill's 1948 coefficients and the angle of the rolling direction of points of
|
|
390
|
+
treated share ``treated`` (``(..., 5)``, see
|
|
391
|
+
:func:`~morphogen.laser.mechanics.hill_from_r`): the sheet's texture
|
|
392
|
+
(``anisotropy``: ``{"r0", "r45", "r90"}``, the Lankford coefficients of the
|
|
393
|
+
rolled sheet) where it is untreated; where the laser transformed it, isotropic
|
|
394
|
+
(the new phases form with a weak texture) or, with ``"memory"`` ``m`` in
|
|
395
|
+
``anisotropy``, the isotropic coefficients plus ``m`` times the texture's
|
|
396
|
+
departure from them (1: the texture inherited whole, as when the treatment only
|
|
397
|
+
dissolves precipitates); mixed in proportion between; the rolling direction at
|
|
398
|
+
``angle`` degrees from the axis of the specimen."""
|
|
399
|
+
from morphogen.laser.mechanics import ISOTROPIC, hill_from_r
|
|
400
|
+
|
|
401
|
+
t = np.clip(np.asarray(treated, dtype=float), 0.0, 1.0)[..., None]
|
|
402
|
+
iso = np.asarray(ISOTROPIC[:4])
|
|
403
|
+
if not self.anisotropy:
|
|
404
|
+
base = treated_coef = iso
|
|
405
|
+
else:
|
|
406
|
+
a = self.anisotropy
|
|
407
|
+
base = np.asarray(hill_from_r(a["r0"], a["r45"], a["r90"])[:4])
|
|
408
|
+
treated_coef = iso + float(a.get("memory", 0.0)) * (base - iso)
|
|
409
|
+
coef = (1.0 - t) * base + t * treated_coef
|
|
410
|
+
ang = np.full((*coef.shape[:-1], 1), np.radians(angle))
|
|
411
|
+
return np.concatenate([coef, ang], axis=-1)
|
|
412
|
+
|
|
413
|
+
def critical_strain(self, hardness):
|
|
414
|
+
"""The critical plastic strain of points of the given hardness (None: ductile
|
|
415
|
+
sheet): ``fracture["hardness"]`` and ``["critical"]`` are a threshold and its
|
|
416
|
+
strain, or tables between which the brittleness (the inverse of the critical
|
|
417
|
+
strain) varies linearly (a partly transformed zone is less brittle)."""
|
|
418
|
+
if not self.fracture:
|
|
419
|
+
return None
|
|
420
|
+
hv = np.asarray(hardness, dtype=float)
|
|
421
|
+
h = np.atleast_1d(np.asarray(self.fracture["hardness"], dtype=float))
|
|
422
|
+
c = np.atleast_1d(np.asarray(self.fracture["critical"], dtype=float))
|
|
423
|
+
if h.size == 1:
|
|
424
|
+
return np.where(hv >= h[0], c[0], np.inf)
|
|
425
|
+
with np.errstate(divide="ignore"):
|
|
426
|
+
brittle = np.interp(hv, h, 1.0 / c, left=0.0)
|
|
427
|
+
return np.where(brittle > 0, 1.0 / np.where(brittle > 0, brittle, 1.0), np.inf)
|
|
428
|
+
|
|
429
|
+
@property
|
|
430
|
+
def density(self) -> float:
|
|
431
|
+
return self.thermal.density
|
|
432
|
+
|
|
433
|
+
@property
|
|
434
|
+
def base_hardness(self) -> float:
|
|
435
|
+
"""Hardness of the untreated sheet."""
|
|
436
|
+
m = self.metallurgy
|
|
437
|
+
return float(m.hardness(m.initial_state(1))[0])
|
|
438
|
+
|
|
439
|
+
def with_(self, **changes) -> SheetMaterial:
|
|
440
|
+
return replace(self, **changes)
|
|
441
|
+
|
|
442
|
+
@classmethod
|
|
443
|
+
def from_config(cls, data) -> SheetMaterial:
|
|
444
|
+
"""A preset name, or a mapping: ``preset`` (optional, the defaults) and any of
|
|
445
|
+
the fields (``thermal``, ``metallurgy`` with its ``kind``, ``strength`` rows...)."""
|
|
446
|
+
if isinstance(data, SheetMaterial):
|
|
447
|
+
return data
|
|
448
|
+
if isinstance(data, str):
|
|
449
|
+
return sheet_material(data)
|
|
450
|
+
data = dict(data)
|
|
451
|
+
base = sheet_material(data.pop("preset")) if "preset" in data else None
|
|
452
|
+
if "thermal" in data:
|
|
453
|
+
th = data["thermal"]
|
|
454
|
+
if base is not None and isinstance(th, dict):
|
|
455
|
+
th = replace(base.thermal, **th)
|
|
456
|
+
data["thermal"] = ThermalProperties.from_config(th)
|
|
457
|
+
if "metallurgy" in data:
|
|
458
|
+
met = data["metallurgy"]
|
|
459
|
+
if base is not None and isinstance(met, dict) and "kind" not in met:
|
|
460
|
+
kind = (
|
|
461
|
+
"softening"
|
|
462
|
+
if isinstance(base.metallurgy, PeakSoftening)
|
|
463
|
+
else "peak"
|
|
464
|
+
if isinstance(base.metallurgy, PeakHardening)
|
|
465
|
+
else "transformation"
|
|
466
|
+
)
|
|
467
|
+
params = {
|
|
468
|
+
k: getattr(base.metallurgy, k)
|
|
469
|
+
for k in type(base.metallurgy).__dataclass_fields__
|
|
470
|
+
}
|
|
471
|
+
params.update(met)
|
|
472
|
+
met = {"kind": kind, **params}
|
|
473
|
+
data["metallurgy"] = model_from_config(met)
|
|
474
|
+
if "strength" in data:
|
|
475
|
+
data["strength"] = StrengthTable.from_config(data["strength"])
|
|
476
|
+
if base is not None:
|
|
477
|
+
return replace(base, **data)
|
|
478
|
+
missing = {"name", "thermal", "metallurgy", "strength"} - set(data)
|
|
479
|
+
if missing:
|
|
480
|
+
raise ValueError(f"material: missing {sorted(missing)} (or give a preset)")
|
|
481
|
+
return cls(**data)
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
def _aisi430() -> SheetMaterial:
|
|
485
|
+
return SheetMaterial(
|
|
486
|
+
name="aisi430",
|
|
487
|
+
thermal=ThermalProperties(
|
|
488
|
+
conductivity=23.5, density=7700.0, heat_capacity=560.0, convection=200.0
|
|
489
|
+
),
|
|
490
|
+
metallurgy=PeakHardening(
|
|
491
|
+
table=((875.0, 0.0), (1082.0, 40.0), (1300.0, 110.0), (1425.0, 150.0), (1700.0, 150.0)),
|
|
492
|
+
base_hardness=160.0,
|
|
493
|
+
solidus=1425.0,
|
|
494
|
+
composition={"C": 0.026, "Si": 0.30, "Mn": 0.50, "Cr": 18.7, "Ni": 0.14},
|
|
495
|
+
carbon_hardening=560.0,
|
|
496
|
+
tempering=Tempering(start=8300.0, end=26800.0, floor=0.0),
|
|
497
|
+
),
|
|
498
|
+
strength=StrengthTable(
|
|
499
|
+
(
|
|
500
|
+
(160.0, 346.0, 502.9, 0.1939),
|
|
501
|
+
(211.5, 488.7, 623.5, 0.1552),
|
|
502
|
+
(241.8, 539.7, 702.5, 0.1365),
|
|
503
|
+
(370.0, 657.0, 930.0, 0.10),
|
|
504
|
+
)
|
|
505
|
+
),
|
|
506
|
+
thickness=0.5,
|
|
507
|
+
absorptivity=0.42,
|
|
508
|
+
description="ferritic stainless steel AISI 430 (18.7 Cr), hardened by martensite "
|
|
509
|
+
"and Cr carbides near its melting point; carburized from a graphite coating",
|
|
510
|
+
references=(
|
|
511
|
+
"Wang, Dirrenberger, Lapouge, Dubent (2022) Mater. Sci. Eng. A 831, 142205",
|
|
512
|
+
"Wang et al. (2022) J. Eng. Mater. Technol. 144, 041005",
|
|
513
|
+
"Wang (2022) PhD thesis, HESAM Université (ENSAM, PIMM)",
|
|
514
|
+
),
|
|
515
|
+
)
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
def _annealed_ms1500() -> SheetMaterial:
|
|
519
|
+
comp = {"C": 0.228, "Si": 0.242, "Mn": 1.730, "Cr": 0.190}
|
|
520
|
+
return SheetMaterial(
|
|
521
|
+
name="annealed_ms1500",
|
|
522
|
+
thermal=ThermalProperties(
|
|
523
|
+
conductivity=28.0, density=7860.0, heat_capacity=560.0, convection=200.0
|
|
524
|
+
),
|
|
525
|
+
metallurgy=TransformationHardening(
|
|
526
|
+
composition=comp,
|
|
527
|
+
superheat=50.0,
|
|
528
|
+
solidus=1480.0,
|
|
529
|
+
martensite=0.0,
|
|
530
|
+
matrix_hardness=167.0,
|
|
531
|
+
critical_time=3.0,
|
|
532
|
+
slow_time=30.0,
|
|
533
|
+
tempering=Tempering(constant=20.0, start=9000.0, end=20000.0, floor=0.0, minimum=190.0),
|
|
534
|
+
),
|
|
535
|
+
# the martensite of the tracks: Hollomon's law identified by Wang et al. (2023,
|
|
536
|
+
# K 1966 MPa, n 0.06), uniform elongation from Considère (the 0.036 of the bulk
|
|
537
|
+
# martensite tested alone is its fracture, which the matrix delays)
|
|
538
|
+
strength=StrengthTable(
|
|
539
|
+
(
|
|
540
|
+
(167.0, 300.0, 534.0, 0.167),
|
|
541
|
+
(480.0, 1300.0, 1560.0, 0.062),
|
|
542
|
+
)
|
|
543
|
+
),
|
|
544
|
+
thickness=1.0,
|
|
545
|
+
absorptivity=0.42,
|
|
546
|
+
description="MS1500EZ annealed at 850 °C for 1 h (ferrite-pearlite, 0.23 C, 1.7 Mn), "
|
|
547
|
+
"hardened by laser tracks of martensite",
|
|
548
|
+
references=(
|
|
549
|
+
"Wang, Bouaziz, Dirrenberger, Lapouge (2023) steel res. int. 94, 2200695",
|
|
550
|
+
"Lapouge et al. (2019) Mater. Sci. Eng. A 752, 128-135",
|
|
551
|
+
"Maynier, Jungmann, Dollet (1978) Hardenability concepts with applications to "
|
|
552
|
+
"steel, AIME, 518-545",
|
|
553
|
+
),
|
|
554
|
+
)
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
def _dp1180() -> SheetMaterial:
|
|
558
|
+
comp = {"C": 0.15, "Si": 0.2, "Mn": 1.8}
|
|
559
|
+
return SheetMaterial(
|
|
560
|
+
name="dp1180",
|
|
561
|
+
thermal=ThermalProperties(
|
|
562
|
+
conductivity=28.0, density=7860.0, heat_capacity=560.0, convection=200.0
|
|
563
|
+
),
|
|
564
|
+
metallurgy=TransformationHardening(
|
|
565
|
+
composition=comp,
|
|
566
|
+
ac1=727.0,
|
|
567
|
+
ac3=827.0,
|
|
568
|
+
superheat=50.0,
|
|
569
|
+
solidus=1480.0,
|
|
570
|
+
martensite=0.85,
|
|
571
|
+
martensite_hardness=420.0,
|
|
572
|
+
matrix_hardness=165.0,
|
|
573
|
+
critical_time=3.0,
|
|
574
|
+
slow_time=30.0,
|
|
575
|
+
tempering=Tempering(constant=20.0, start=9000.0, end=20000.0, floor=0.0, minimum=200.0),
|
|
576
|
+
),
|
|
577
|
+
strength=StrengthTable(
|
|
578
|
+
(
|
|
579
|
+
(165.0, 300.0, 480.0, 0.20),
|
|
580
|
+
(255.0, 600.0, 816.0, 0.08),
|
|
581
|
+
(380.0, 850.0, 1200.0, 0.05),
|
|
582
|
+
(480.0, 1300.0, 1600.0, 0.04),
|
|
583
|
+
)
|
|
584
|
+
),
|
|
585
|
+
thickness=1.0,
|
|
586
|
+
absorptivity=0.42,
|
|
587
|
+
description="dual-phase DP1180 (85 % martensite), softened by laser tempering",
|
|
588
|
+
references=("Lapouge et al. (2019) Mater. Sci. Eng. A 752, 128-135",),
|
|
589
|
+
)
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
def _22mnb5() -> SheetMaterial:
|
|
593
|
+
comp = {"C": 0.22, "Si": 0.25, "Mn": 1.25, "Cr": 0.2}
|
|
594
|
+
return SheetMaterial(
|
|
595
|
+
name="22mnb5",
|
|
596
|
+
thermal=ThermalProperties(
|
|
597
|
+
conductivity=34.0, density=7850.0, heat_capacity=650.0, convection=200.0
|
|
598
|
+
),
|
|
599
|
+
metallurgy=TransformationHardening(
|
|
600
|
+
composition=comp,
|
|
601
|
+
superheat=50.0,
|
|
602
|
+
solidus=1480.0,
|
|
603
|
+
martensite=0.0,
|
|
604
|
+
matrix_hardness=185.0,
|
|
605
|
+
critical_time=3.0,
|
|
606
|
+
slow_time=30.0,
|
|
607
|
+
tempering=Tempering(constant=20.0, start=9000.0, end=20000.0, floor=0.0, minimum=200.0),
|
|
608
|
+
),
|
|
609
|
+
# as delivered (75 % ferrite, 25 % pearlite: R_p about 400, R_m 450-550 MPa,
|
|
610
|
+
# uniform elongation 18 %) and quenched (martensite up to 605 HV10, R_m
|
|
611
|
+
# 1590-1600 MPa; its uniform elongation 3.25 % measured alone, 0.06 from
|
|
612
|
+
# Considère as for the annealed MS1500): Karbasian & Tekkaya (2010), Merklein et
|
|
613
|
+
# al. (2006)
|
|
614
|
+
strength=StrengthTable(
|
|
615
|
+
(
|
|
616
|
+
(185.0, 400.0, 520.0, 0.18),
|
|
617
|
+
(550.0, 1150.0, 1590.0, 0.06),
|
|
618
|
+
)
|
|
619
|
+
),
|
|
620
|
+
thickness=1.5,
|
|
621
|
+
absorptivity=0.4,
|
|
622
|
+
description="boron steel 22MnB5 as delivered (ferrite and pearlite), hardened by "
|
|
623
|
+
"laser tracks of martensite (the steel of hot stamping; laser-patterned tubes of "
|
|
624
|
+
"Kim & Yoon 2021)",
|
|
625
|
+
references=(
|
|
626
|
+
"Karbasian H., Tekkaya A.E. (2010) J. Mater. Process. Technol. 210, 2103-2118",
|
|
627
|
+
"Kim H.-g., Yoon J. (2021) Compos. Struct. 262, 113633",
|
|
628
|
+
),
|
|
629
|
+
)
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
def _aa6082_t6() -> SheetMaterial:
|
|
633
|
+
return SheetMaterial(
|
|
634
|
+
name="aa6082_t6",
|
|
635
|
+
thermal=ThermalProperties(
|
|
636
|
+
conductivity=170.0, density=2700.0, heat_capacity=950.0, convection=200.0
|
|
637
|
+
),
|
|
638
|
+
# T6 (105 HV); overaged near 350-400 °C (about 60 HV, no ageing again);
|
|
639
|
+
# dissolved above about 480 °C then naturally aged (55 HV just after, about
|
|
640
|
+
# 80 HV after days): Piccininni & Palumbo (2020), Myhr & Grong (1991)
|
|
641
|
+
metallurgy=PeakSoftening(
|
|
642
|
+
base_hardness=105.0,
|
|
643
|
+
solidus=585.0,
|
|
644
|
+
table=(
|
|
645
|
+
(200.0, 0.0),
|
|
646
|
+
(250.0, -8.0),
|
|
647
|
+
(300.0, -25.0),
|
|
648
|
+
(350.0, -40.0),
|
|
649
|
+
(400.0, -45.0),
|
|
650
|
+
(450.0, -38.0),
|
|
651
|
+
(500.0, -25.0),
|
|
652
|
+
(600.0, -25.0),
|
|
653
|
+
),
|
|
654
|
+
),
|
|
655
|
+
# the solution-treated state just after the laser (yield about 70 MPa), the
|
|
656
|
+
# naturally aged one (T4-like) and T6
|
|
657
|
+
strength=StrengthTable(
|
|
658
|
+
(
|
|
659
|
+
(55.0, 70.0, 170.0, 0.20),
|
|
660
|
+
(80.0, 150.0, 240.0, 0.15),
|
|
661
|
+
(105.0, 290.0, 330.0, 0.07),
|
|
662
|
+
)
|
|
663
|
+
),
|
|
664
|
+
young=70000.0,
|
|
665
|
+
poisson=0.33,
|
|
666
|
+
thickness=1.0,
|
|
667
|
+
absorptivity=0.3,
|
|
668
|
+
description="age-hardened aluminium alloy AA6082-T6 softened by laser tracks "
|
|
669
|
+
"(the precipitates dissolved above about 250 °C; tailor heat-treated blanks)",
|
|
670
|
+
references=(
|
|
671
|
+
"Piccininni A., Palumbo G. (2020) Materials 13, 1576",
|
|
672
|
+
"Myhr O.R., Grong O. (1991) Acta Metall. Mater. 39, 2693-2702",
|
|
673
|
+
),
|
|
674
|
+
)
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
#: The materials of the PIMM studies (see the module) and alternative ones.
|
|
678
|
+
PRESETS = {
|
|
679
|
+
"aisi430": _aisi430,
|
|
680
|
+
"annealed_ms1500": _annealed_ms1500,
|
|
681
|
+
"dp1180": _dp1180,
|
|
682
|
+
"22mnb5": _22mnb5,
|
|
683
|
+
"aa6082_t6": _aa6082_t6,
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
def sheet_material(name: str) -> SheetMaterial:
|
|
688
|
+
"""A preset material (:data:`PRESETS`)."""
|
|
689
|
+
if name not in PRESETS:
|
|
690
|
+
raise ValueError(f"material: one of {sorted(PRESETS)}, got {name!r}")
|
|
691
|
+
return PRESETS[name]()
|