Simulates the unconfined compression of a poroelastic material
Project description
ucompress.py
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 material responses
- Material reinforcement with a transversely isotropic fibre network
- Models for the engagement of fibre network with deformation
- Deformation-dependent permeabilities
- Models for osmotic stresses and swelling (e.g. for hydrogels)
- Functions to fit stress-strain 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.
Installing ucompress.py
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.
Getting started
The code below will simulate the force-controlled unconfined compression of a neo-Hookean material with constant permeability. The axial stretch $\lambda_z$ is then plotted as a function of time using matplotlib.
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()
Learning more
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ucompress-1.0.0.tar.gz.
File metadata
- Download URL: ucompress-1.0.0.tar.gz
- Upload date:
- Size: 63.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d75f834dd74edacc718b7757f72af0faa0648508bfd1d09707e48c545dc5dc4f
|
|
| MD5 |
4bda7b70500470dcfb8f542bd043238a
|
|
| BLAKE2b-256 |
0e78fe484c742d40c864ec98e8b2bf873dfc9c96ae10a5b1b3bb09766d3cdae8
|
File details
Details for the file ucompress-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ucompress-1.0.0-py3-none-any.whl
- Upload date:
- Size: 62.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3467941fdcad8b52fbba6836d28035d729c9b477be59250176507d69665fd0f
|
|
| MD5 |
979d800acec97cf9154901017f6eb20b
|
|
| BLAKE2b-256 |
3e002e603ac74fb9a541f82a435b1215c325be501851ae7eda238f8e00b22a4d
|