Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spheres_packing_calculator-0.1.4.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

spheres_packing_calculator-0.1.4-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file spheres_packing_calculator-0.1.4.tar.gz.

File metadata

File hashes

Hashes for spheres_packing_calculator-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9f1404d2701d30cb83f96d42b7b7a0688abcd9df578db13ce919d155c161bbef
MD5 aca6cfbab916b205683b629c8a6d88f7
BLAKE2b-256 77ae2cf717d6bfa17825f896170e276f1ea285649e88fdc373197b4ac799f25f

See more details on using hashes here.

File details

Details for the file spheres_packing_calculator-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for spheres_packing_calculator-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d99c414b40967e007dec8693a62f54b4f4a35b10611c7130c0f1316cd7c24f6c
MD5 3e8115ce97b6bcbad316beace1e3a7ab
BLAKE2b-256 1fbd51089bd0a839ccf657b24d8af509cac18573bbf7645bda52a02041169b39

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page