-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface_penny.py
More file actions
64 lines (49 loc) · 2.17 KB
/
Copy pathinterface_penny.py
File metadata and controls
64 lines (49 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""Interface-concentrated porosity with penny-shaped voids.
Demonstrates the worst-case morphology for interlaminar shear strength
(ILSS): porosity peaked at every ply-to-ply interface (``distribution =
'interface'``) and shaped as oblate ``penny`` voids (high aspect ratio,
elevated stress-concentration factor). Penny voids amplify the through-
thickness stress concentration much more than spherical voids of the same
``Vp``. Saves the through-thickness porosity profile (a comb of peaks at
each interface) as a PNG.
Run from the repo root::
python examples/interface_penny.py
"""
import os
import sys
_REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if _REPO_ROOT not in sys.path:
sys.path.insert(0, _REPO_ROOT)
import matplotlib # noqa: E402
matplotlib.use("Agg")
from porosity_fe import ( # noqa: E402
MATERIALS,
FEVisualizer,
build_empirical_pipeline,
)
OUT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "output")
os.makedirs(OUT_DIR, exist_ok=True)
def main() -> None:
material = MATERIALS["T800_epoxy"]
pf, mesh, solver = build_empirical_pipeline(
material, 0.03,
mesh_res=(30, 10, 24),
porosity_config=dict(distribution="interface", void_shape="penny"),
)
res_ilss = solver.get_failure_load(mode="ilss", model="judd_wright")
res_comp = solver.get_failure_load(mode="compression", model="judd_wright")
z, Vp_z = pf.effective_porosity_profile(nz=400)
print("Material: T800_epoxy")
print(f"Vp (mean): {pf.Vp * 100:.2f}% (interface, penny)")
print(f"Vp (peak): {Vp_z.max() * 100:.2f}% at z = "
f"{z[Vp_z.argmax()]:.3f} mm")
print(f"ILSS knockdown: {res_ilss['knockdown']:.4f}")
print(f"ILSS strength: {res_ilss['failure_stress']:.1f} MPa "
f"(positive magnitude)")
print(f"Compression KD: {res_comp['knockdown']:.4f}")
print(f"Compression sigma: {res_comp['failure_stress']:.1f} MPa")
out_png = os.path.join(OUT_DIR, "interface_penny_profile.png")
FEVisualizer.plot_porosity_field(pf, save_path=out_png)
print(f"PNG saved: {out_png}")
if __name__ == "__main__":
main()