Lightweight Python code for simulating the unconfined compression of cylindrical nonlinear poroelastic materials. The poroelastic sample is assumed to remain cylindrical during compression.
Features of the code include:
- Displacement- and force-controlled loading
- Finite strains and neo-Hookean responses
- Material reinforcement with a transversely isotropic fibre network
- Models for the engagement of the fibre network with deformation
- Deformation-dependent permeabilities
- Models for osmotic stresses and swelling (e.g. for hydrogels)
The code is able to compute:
- The equilibrium swelling of hydrogels with or without a fibre network
- Instantaneous, transient, and steady-state responses to a load
- Model parameters by fitting to stress-strain data or swelling data
The code uses Chebyshev spectral differentiation along with fully implicit time stepping. An analytical Jacobian is automatically built using SymPy, allowing for fast Newton iterations and easy generalisation of the model.
ucompress.py is available on PyPi and can be installed using pip:
pip install ucompress
The dependencies are minimal, all you need is SciPy, NumPy, and SymPy (these will automatically be installed alongside ucompress.py if you don't already have them). We recommend using a virtual environment when installing ucompress.py.
The code below will simulate the force-controlled unconfined compression
of a neo-Hookean material with constant permeability. The
axial stretch
import ucompress as uc
import matplotlib.pyplot as plt
pars = uc.parameters.example_parameters.NeoHookean()
mech = uc.mechanics.NeoHookean()
perm = uc.permeability.Constant()
model = uc.base_models.Poroelastic(mech, perm, pars)
problem = uc.experiments.ForceControlled(model, pars)
sol = problem.transient_response()
# plot the axial stretch vs time
plt.plot(sol.t, sol.lam_z)
plt.show()Changes to the model and experiment are straightforward. The code below simulates a displacement-controlled unconfined compression experiment of a fibre-reinforced neo-Hookean material that accounts for slack in the fibre network. The axial force needed to compress the sample is plotted as a function of time.
import ucompress as uc
import matplotlib.pyplot as plt
pars = uc.parameters.example_parameters.FibreRecruitment()
mech = uc.mechanics.FibreRecruitment(distribution = 'quartic')
perm = uc.permeability.Constant()
model = uc.base_models.Poroelastic(mech, perm, pars)
problem = uc.experiments.DisplacementControlled(model, pars)
sol = problem.transient_response()
# plot the force
plt.plot(sol.t, sol.F)
plt.show()To learn more about the capabilities of ucompress.py or to how to use it, please have a look at the tutorials. Please feel free to add a pull request if you would like to see a new feature or tutorial added.