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.
Metadata
Release files for ucompress 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ucompress-1.0.0.tar.gz | 63.2 kB | Without provenance | Details for ucompress-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ucompress-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for ucompress-1.0.0-py3-none-any.whl |
Total release size: 125.6 kB
Release files / ucompress-1.0.0.tar.gz
| Download URL | ucompress-1.0.0.tar.gz |
|---|---|
| Size | 63.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d75f834dd74edacc718b7757f72af0faa0648508bfd1d09707e48c545dc5dc4f
|
|
BLAKE2b-256 checksum How to use checksums |
0e78fe484c742d40c864ec98e8b2bf873dfc9c96ae10a5b1b3bb09766d3cdae8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Release files / ucompress-1.0.0-py3-none-any.whl
| Download URL | ucompress-1.0.0-py3-none-any.whl |
|---|---|
| Size | 62.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3467941fdcad8b52fbba6836d28035d729c9b477be59250176507d69665fd0f
|
|
BLAKE2b-256 checksum How to use checksums |
3e002e603ac74fb9a541f82a435b1215c325be501851ae7eda238f8e00b22a4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Security for ucompress 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.