This project implements a Monte Carlo simulation framework for solving divergence-dependent partial differential equations (PDEs) in 2D domains. It models stochastic particle dynamics with reflecting boundary conditions and supports coordinate mapping for solving PDEs in simplified geometries.
π§ This repository is a public-facing subset of a larger research codebase developed as part of graduate work at UNC Chapel Hill. Some core components have been omitted or abstracted for confidentiality.
project_root/
βββ config.py # Defines simulation parameters, initial conditions, and domain setup
βββ diffusion_simulator.py # Core simulation function for 2D advection-diffusion processes
βββ geometry.py # Wall definitions, intersection logic, and reflection angle computation
βββ ititial_conditions.py # Helper functions for setting particle initial positions and values
βββ main.py # Entry point for running a simulation using the config and simulator
βββ utils/
β βββ io.py # Functions to save simulation data (.csv, .npz) and configs (.json)
β βββ __init__.py # Marks the utils folder as a package
βββ step_models.py # Modular diffusion step generators (e.g., constant, mapped)
βββ vector_utils.py # Vector rotation and linear algebra utilities
βββ results/ # Directory where simulation outputs are saved
βββ README.md # Project overview, instructions, and documentation
- Simulates 2D advection-diffusion PDEs with divergence-dependent drift
- Supports reflecting walls and arbitrary polygonal geometries
- Allows custom coordinate mappings (e.g., half-plane, quarter-plane, L-shaped)
- Modular structure: plug in different step models and reflection rules
- Outputs
.npz
,.csv
, and.json
formats for easy analysis and reproducibility
Run the simulation from the terminal:
python Main.py
This repository is for demonstration purposes only. Some files and methods have been withheld for confidentiality.
Please do not reuse or redistribute without written permission.
π¬ Contact:
If you'd like to learn more or discuss the project in a technical interview, feel free to reach out via LinkedIn or email.