test(materials): assert J2 yield after radial return for PerfectPlasticity

Add a focused regression that `compute_stress` lands on the von Mises surface when
the trial state lies outside yield, using the returned backstress state.

- SPDX header refresh for the file.
This commit is contained in:
Jukka Aho
2026-05-09 18:46:11 +03:00
parent aabca484a3
commit c631eb6d1c
+11 -2
View File
@@ -1,5 +1,5 @@
# This file is a part of JuliaFEM. # SPDX-FileCopyrightText: 2015-2026 Jukka Aho
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md # SPDX-License-Identifier: MIT
using Test using Test
using JuliaFEM using JuliaFEM
@@ -135,6 +135,15 @@ using Tensors
@test norm(σ) < mat.σ_y # Below yield @test norm(σ) < mat.σ_y # Below yield
end end
@testset "J2 yield surface after radial return (‖dev(σ−α)‖_vm ≈ σᵧ)" begin
mat = PerfectPlasticity(E = 210e9, ν = 0.3, σ_y = 250e6, H = 2.1e9)
ε = SymmetricTensor{2,3}((0.02, -0.005, 0.0, 0.0, 0.0, 0.0))
σ, _, st = compute_stress(mat, ε, NamedTuple(), 0.0)
s = dev(σ - st.α)
seq = sqrt(3 / 2 * (s s))
@test seq mat.σ_y rtol = 1e-5 atol = 1.0
end
@testset "Plastic response (above yield)" begin @testset "Plastic response (above yield)" begin
# Test that material yields when stress exceeds yield # Test that material yields when stress exceeds yield
mat = PerfectPlasticity(E=210e9, ν=0.3, σ_y=250e6, H=1e9) mat = PerfectPlasticity(E=210e9, ν=0.3, σ_y=250e6, H=1e9)