Skip to content

Commit

Permalink
Add the Blatz-Ko hyperelastic foam model (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
adtzlr authored Nov 17, 2024
1 parent 6b2d58b commit a0fa71a
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/felupe/constitution/autodiff/jax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ These material model formulations are defined by a strain energy density functio

.. autosummary::

blatz_ko
miehe_goektepe_lulei
mooney_rivlin
storakers
Expand Down Expand Up @@ -90,6 +91,8 @@ formulations in :class:`~felupe.constitution.jax.Material`.

.. autofunction:: felupe.constitution.jax.updated_lagrange

.. autofunction:: felupe.constitution.jax.models.hyperelastic.blatz_ko

.. autofunction:: felupe.constitution.jax.models.hyperelastic.miehe_goektepe_lulei

.. autofunction:: felupe.constitution.jax.models.hyperelastic.mooney_rivlin
Expand Down
3 changes: 3 additions & 0 deletions docs/felupe/constitution/autodiff/tensortrax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ These material model formulations are defined by a strain energy density functio
alexander
anssari_benam_bucchi
arruda_boyce
blatz_ko
extended_tube
finite_strain_viscoelastic
lopez_pamies
Expand Down Expand Up @@ -96,6 +97,8 @@ and :func:`~felupe.constitution.tensortrax.updated_lagrange` material formulatio

.. autofunction:: felupe.constitution.tensortrax.models.hyperelastic.arruda_boyce

.. autofunction:: felupe.constitution.tensortrax.models.hyperelastic.blatz_ko

.. autofunction:: felupe.constitution.tensortrax.models.hyperelastic.extended_tube

.. autofunction:: felupe.constitution.tensortrax.models.hyperelastic.finite_strain_viscoelastic
Expand Down
2 changes: 2 additions & 0 deletions src/felupe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
alexander,
anssari_benam_bucchi,
arruda_boyce,
blatz_ko,
constitutive_material,
extended_tube,
finite_strain_viscoelastic,
Expand Down Expand Up @@ -278,6 +279,7 @@
"alexander",
"anssari_benam_bucchi",
"arruda_boyce",
"blatz_ko",
"extended_tube",
"finite_strain_viscoelastic",
"isochoric_volumetric_split",
Expand Down
2 changes: 2 additions & 0 deletions src/felupe/constitution/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
alexander,
anssari_benam_bucchi,
arruda_boyce,
blatz_ko,
extended_tube,
finite_strain_viscoelastic,
lopez_pamies,
Expand All @@ -78,6 +79,7 @@
"alexander",
"anssari_benam_bucchi",
"arruda_boyce",
"blatz_ko",
"extended_tube",
"finite_strain_viscoelastic",
"isochoric_volumetric_split",
Expand Down
3 changes: 3 additions & 0 deletions src/felupe/constitution/jax/models/hyperelastic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from ._blatz_ko import blatz_ko
from ._miehe_goektepe_lulei import miehe_goektepe_lulei
from ._mooney_rivlin import mooney_rivlin
from ._storakers import storakers
from ._third_order_deformation import third_order_deformation
from ._yeoh import yeoh

__all__ = [
"blatz_ko",
"miehe_goektepe_lulei",
"mooney_rivlin",
"storakers",
Expand All @@ -13,6 +15,7 @@
]

# default (stable) material parameters
blatz_ko.kwargs = dict(mu=1)
miehe_goektepe_lulei.kwargs = dict(mu=0, N=100, U=0, p=2, q=2)
mooney_rivlin.kwargs = dict(C10=0, C01=0)
storakers.kwargs = dict(mu=[0], alpha=[2], beta=[1])
Expand Down
33 changes: 33 additions & 0 deletions src/felupe/constitution/jax/models/hyperelastic/_blatz_ko.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
"""
This file is part of FElupe.
FElupe is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FElupe is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FElupe. If not, see <http://www.gnu.org/licenses/>.
"""
from functools import wraps

from jax.numpy import sqrt, trace
from jax.numpy.linalg import det

from ....tensortrax.models.hyperelastic import blatz_ko as blatz_ko_docstring


@wraps(blatz_ko_docstring)
def blatz_ko(C, mu):

I1 = trace(C)
I2 = (I1**2 - trace(C @ C)) / 2
I3 = det(C)

return mu * (I2 / I3 + 2 * sqrt(I3) - 5)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ._alexander import alexander
from ._anssari_benam_bucchi import anssari_benam_bucchi
from ._arruda_boyce import arruda_boyce
from ._blatz_ko import blatz_ko
from ._extended_tube import extended_tube
from ._finite_strain_viscoelastic import finite_strain_viscoelastic
from ._lopez_pamies import lopez_pamies
Expand All @@ -31,6 +32,7 @@
"alexander",
"anssari_benam_bucchi",
"arruda_boyce",
"blatz_ko",
"extended_tube",
"finite_strain_viscoelastic",
"lopez_pamies",
Expand All @@ -51,6 +53,7 @@
alexander.kwargs = dict(C1=0, C2=0, C3=0, gamma=100, k=0)
anssari_benam_bucchi.kwargs = dict(mu=0, N=100)
arruda_boyce.kwargs = dict(C1=0, limit=100)
blatz_ko.kwargs = dict(mu=0)
extended_tube.kwargs = dict(Gc=0, Ge=0, beta=1, delta=0)
lopez_pamies.kwargs = dict(mu=[0, 0], alpha=[1, 4])
miehe_goektepe_lulei.kwargs = dict(mu=0, N=100, U=0, p=2, q=2)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# -*- coding: utf-8 -*-
"""
This file is part of FElupe.
FElupe is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FElupe is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FElupe. If not, see <http://www.gnu.org/licenses/>.
"""

from tensortrax.math import sqrt, trace
from tensortrax.math.linalg import det


def blatz_ko(C, mu):
r"""Strain energy function of the Blatz-Ko isotropic hyperelastic
`foam <https://doi.org/10.1122/1.548937>`_ material formulation [1]_.
Parameters
----------
C : tensortrax.Tensor or jax.Array
Right Cauchy-Green deformation tensor.
mu : float
The shear modulus.
Notes
-----
The Poisson ratio of the Blatz-Ko model formulation is :math:`\nu = 0.25`. The
strain energy function is given in Eq. :eq:`psi-blatz-ko`
.. math::
:label: psi-blatz-ko
\psi = \frac{\mu}{2} \left(\frac{I_2}{I_3} + 2 \sqrt{I_3} - 5 \right)
The shear modulus :math:`\mu` is related to young's modulus as denoted in Eq.
:eq:`shear-modulus-blatz-ko`.
.. math::
:label: shear-modulus-blatz-ko
\mu = \frac{2 E}{5}
Examples
--------
First, choose the desired automatic differentiation backend
.. pyvista-plot::
:context:
>>> # import felupe.constitution.jax as mat
>>> import felupe.constitution.tensortrax as mat
and create the hyperelastic material.
.. pyvista-plot::
:context:
>>> import felupe as fem
>>>
>>> umat = mat.Hyperelastic(mat.models.hyperelastic.blatz_ko, mu=1.0)
>>> ax = umat.plot()
.. pyvista-plot::
:include-source: False
:context:
:force_static:
>>> import pyvista as pv
>>>
>>> fig = ax.get_figure()
>>> chart = pv.ChartMPL(fig)
>>> chart.show()
References
----------
.. [1] P. J. Blatz and W. L. Ko, "Application of Finite Elastic Theory to the
Deformation of Rubbery Materials", Transactions of the Society of Rheology, vol.
6, no. 1. Society of Rheology, pp. 223–252, Mar. 01, 1962. doi: 10.1122/1.548937.
"""

I1 = trace(C)
I2 = (I1**2 - trace(C @ C)) / 2
I3 = det(C)

return mu * (I2 / I3 + 2 * sqrt(I3) - 5)
1 change: 1 addition & 0 deletions tests/test_constitution.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ def neo_hooke(C, mu=1):
),
False,
),
(fem.blatz_ko, dict(mu=1.0), 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 @@ -68,6 +68,7 @@ def test_hyperelastic_jax():
md.third_order_deformation,
md.miehe_goektepe_lulei,
md.storakers,
md.blatz_ko,
]:
umat = mat.Hyperelastic(W, **W.kwargs)
solid = fem.SolidBody(umat=umat, field=field)
Expand Down

0 comments on commit a0fa71a

Please sign in to comment.