Skip to main content

MaRGE3D package

Read the Docs Repo status CI pipeline Coverage PyPI - Package PyPI - Downloads

📜 Solver for Maxey-Riley-Gatignol Equations (MaRGE) in 3D flow based on the method by Daitche (2013). Analytical solution in simple vortex is provided to validate the method.

DOI

MaRGE3D solves the full MaRGE, including the Basset history term, for inertial particles moving in three-dimensional fluid flow fields. The history term is treated with the specialized quadrature schemes of Daitche, matched with first, second, and third order Adams–Bashforth methods. The package also provides an analytical reference solution for a particle in a three-dimensional vortex flow under gravity, which can be used to verify any implementation of a 3D MaRGE solver.

Attribition

You can freely use and reuse this code in line with its license. If you use it (or parts of it) for a publication, please cite

@article{Rathi2026,
  author  = {Rathi, Vamika and Ruprecht, Daniel},
  title   = {Numerical Modeling of Inertial Particles in Three-Dimensional Fluid Flow},
  journal = {Proceedings in Applied Mathematics and Mechanics},
  volume  = {26},
  number  = {2},
  pages   = {e70158},
  year    = {2026},
  doi     = {10.1002/pamm.70158},
  url     = {https://doi.org/10.1002/pamm.70158}
}

Installation

pip install marge3d

🔔 Checkout the latest documentation build and in particular the notebook tutorials

Structure of the code

The main functionality is found in the modules located in the ./marge3d folder:

  • numeric.py — NumericalSolver class implementing Daitche's first, second, and third order schemes for the full 3D MaRGE.
  • analytic.py — AnalyticalSolver class providing the analytical solution for a particle in a 3D vortex under gravity.
  • fields.py — VelocityField3D class defining the vortex velocity field.
  • params.py — DaitcheParameters class converting physical parameters into the dimensionless quantities (R, S, G) used by the solver.
  • utils.py — helper routines. Scripts to produce the figures from the paper can be found in the ./scripts folder. Tests are located in ./tests and can be run by typing
pytest ./tests/

while in the base folder of the code.

How can I reproduce figures from the paper "Numerical Modeling of Inertial Particles in Three-Dimensional Fluid Flow"?

The scripts to reproduce the figures from this paper can be found here.

  • Fig. 1 (left, positively buoyant particle trajectory) --> scripts/run_analytical_solution.py with particle_density = 500
  • Fig. 1 (right, negatively buoyant particle trajectory) --> scripts/run_Daitche_solution.py with particle_density = 1410
  • Fig. 2 (convergence, lighter particle, zero initial relative velocity) --> scripts/run_convergence.py with particle_density = 500 and zero initial relative velocity W0 = V0 - U0 = 0; vary the Stokes number for S = 3 (left) and S = 0.3 (right)
  • Fig. 3 (convergence, lighter particle, non-zero initial relative velocity) --> scripts/run_convergence.py with particle_density = 500 and W0 = (0, 0.1, 0); S = 3 (left) and S = 0.3 (right)
  • Fig. 4 (convergence, heavier particle, zero initial relative velocity) --> scripts/run_convergence.py with particle_density = 1410 and W0 = 0; S = 3 (left) and S = 0.3 (right)
  • Fig. 5 (convergence, heavier particle, non-zero initial relative velocity) --> scripts/run_convergence.py with particle_density = 1410 and W0 = (0, 0.1, 0); S = 3 (left) and S = 0.3 (right)

ℹ️ The Stokes number S is controlled through the particle radius, kinematic viscosity and characteristic time via S = (1/3) a²/(ν T). The analytical solution is only valid for particles less dense than the fluid (ρ_p/ρ_f < 5/8) and assumes zero initial relative velocity; for the heavier particle and for non-zero initial relative velocity, the error is computed against a higher-resolution numerical reference solution instead of the analytical one. The analytical and numerical solutions agree only for the characteristic values T = 0.1 and U = 0.4 used in the paper.

Acknowledgements

This project is funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – SFB 1615 – 503850735. Open access funding enabled and organized by Projekt DEAL.

Developers

Metadata

Release files for marge3d 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for marge3d 0.0.5
File Size Uploaded
marge3d-0.0.5.tar.gz 596.8 kB Details

Release files / marge3d-0.0.5.tar.gz

Download URL marge3d-0.0.5.tar.gz
Size 596.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2ff9a28405c081594eb05b8a4e02abde743b8fed5d6b89c75320b5351003a87e
BLAKE2b-256 checksum
How to use checksums
7bedee8393cd37765caa620548e8c5f6cc432fffd9388d3062bd59217f9c4bfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.5 This release

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page