Calculates a precise packing density for spherical particles in a 3d cartesian region
Project description
Requirements
This package requires Python 3.6 or later. Install dependencies via pip:
pip install -r requirements.txt
Dependencies: NumPy: For efficient numerical operations. SciPy: For Simpson's rule integration. PyVista: For reading and handling .vtk files. OS: For handling and import of files
Key Functions
compute_packing_density(file, boundaries=None, report_progress=False) Description: Computes the packing density of particles in a cuboidal region.
Args: file (str): Path to the .vtk file containing particle data. boundaries (dict, optional): Defines cuboidal region (x_min, x_max, etc.). Defaults to dataset bounds. report_progress (bool, optional): If True, prints progress during computation.
Returns: Float representing the packing density.
single_cap_intersection(R, a) Description: Calculates the volume of a single spherical cap.
double_cap_intersection(R, a, b) Description: Calculates the volume of a double spherical cap intersection.
triple_cap_intersection(R, a, b, c) Description: Calculates the volume of a triple spherical cap intersection.
How It Works
Read Data: Uses PyVista to read .vtk files containing particle coordinates and radii.
Define Boundaries: Boundaries are calculated from the dataset by default or can be user-specified.
Volume Calculation: Single, double, and triple cap intersections are evaluated using numerical methods for accurate volume determination.
Packing Density: The total particle volume inside the defined boundaries is divided by the cuboidal cell volume to compute packing density.
Testing
Tests will be added in a future release.
Limitations
Currently optimized for spherical particles only. Requires .vtk files with properly formatted particle data. Numerical integration precision depends on num_simpson_sample_points (adjustable).
Planned Features
Add support for non-spherical particle shapes. Include formal tests in the next version. Performance optimization for very large datasets.
License
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
Acknowledgements
This project uses:
PyVista for file handling. Numerical integration methods from SciPy. Inspiration from computational geometry techniques.
Contact
For questions or support, reach out to:
Name: Freddie Barter Email: fjbarter@outlook.com
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
File details
Details for the file spheres_packing_calculator-0.1.4.tar.gz
.
File metadata
- Download URL: spheres_packing_calculator-0.1.4.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f1404d2701d30cb83f96d42b7b7a0688abcd9df578db13ce919d155c161bbef |
|
MD5 | aca6cfbab916b205683b629c8a6d88f7 |
|
BLAKE2b-256 | 77ae2cf717d6bfa17825f896170e276f1ea285649e88fdc373197b4ac799f25f |
File details
Details for the file spheres_packing_calculator-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: spheres_packing_calculator-0.1.4-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d99c414b40967e007dec8693a62f54b4f4a35b10611c7130c0f1316cd7c24f6c |
|
MD5 | 3e8115ce97b6bcbad316beace1e3a7ab |
|
BLAKE2b-256 | 1fbd51089bd0a839ccf657b24d8af509cac18573bbf7645bda52a02041169b39 |