Skip to content

Commit

Permalink
add tests for hyperelastic foam model
Browse files Browse the repository at this point in the history
  • Loading branch information
adtzlr committed Nov 16, 2024
1 parent fbbb00f commit 2bf245d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
33 changes: 21 additions & 12 deletions tests/test_constitution.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,42 +341,51 @@ def neo_hooke(C, mu=1):

for model, kwargs, incompressible in [
(neo_hooke, {"mu": 1}, True),
(fem.constitution.saint_venant_kirchhoff, {"mu": 1, "lmbda": 20.0}, False),
(fem.constitution.neo_hooke, {"mu": 1}, True),
(fem.constitution.mooney_rivlin, {"C10": 0.3, "C01": 0.8}, True),
(fem.constitution.yeoh, {"C10": 0.5, "C20": -0.1, "C30": 0.02}, True),
(fem.saint_venant_kirchhoff, {"mu": 1, "lmbda": 20.0}, False),
(fem.neo_hooke, {"mu": 1}, True),
(fem.mooney_rivlin, {"C10": 0.3, "C01": 0.8}, True),
(fem.yeoh, {"C10": 0.5, "C20": -0.1, "C30": 0.02}, True),
(
fem.constitution.third_order_deformation,
fem.third_order_deformation,
{"C10": 0.5, "C01": 0.1, "C11": 0.01, "C20": -0.1, "C30": 0.02},
True,
),
(fem.constitution.ogden, {"mu": [1, 0.2], "alpha": [1.7, -1.5]}, True),
(fem.constitution.arruda_boyce, {"C1": 1.0, "limit": 3.2}, True),
(fem.ogden, {"mu": [1, 0.2], "alpha": [1.7, -1.5]}, True),
(fem.arruda_boyce, {"C1": 1.0, "limit": 3.2}, True),
(
fem.constitution.extended_tube,
fem.extended_tube,
{"Gc": 0.1867, "Ge": 0.2169, "beta": 0.2, "delta": 0.09693},
True,
),
(
fem.constitution.van_der_waals,
fem.van_der_waals,
{"mu": 1.0, "beta": 0.1, "a": 0.5, "limit": 5.0},
True,
),
(
fem.constitution.alexander,
fem.alexander,
dict(C1=0.117, C2=0.137, C3=0.00690, gamma=0.735, k=0.00015),
True,
),
(
fem.constitution.anssari_benam_bucchi,
fem.anssari_benam_bucchi,
dict(mu=0.29, N=26.8),
True,
),
(
fem.constitution.lopez_pamies,
fem.lopez_pamies,
dict(mu=[0.2699, 0.00001771], alpha=[1.08, 4.40]),
True,
),
(
fem.storakers,
dict(
mu=[4.5 * (1.85 / 2), -4.5 * (-9.2 / 2)],
alpha=[1.85, -9.2],
beta=[0.92, 0.92],
),
False,
),
]:
umat = fem.Hyperelastic(model, **kwargs)

Expand Down
1 change: 1 addition & 0 deletions tests/test_constitution_jax.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def test_hyperelastic_jax():
md.yeoh,
md.third_order_deformation,
md.miehe_goektepe_lulei,
md.storakers,
]:
umat = mat.Hyperelastic(W, **W.kwargs)
solid = fem.SolidBody(umat=umat, field=field)
Expand Down

0 comments on commit 2bf245d

Please sign in to comment.