Skip to content

Monte Carlo framework for 2D divergence-dependent PDEs with coordinate mapping and general polygonal domains

Notifications You must be signed in to change notification settings

maddiepr/2d-pde-simulation-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ§ͺ Probabilistic Simulation Framework for 2D PDEs

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 Structure

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

πŸ“ˆ Features

  • 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

πŸ§ͺ Example Usage

Run the simulation from the terminal:

python Main.py

πŸ”’ Access & License

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.

About

Monte Carlo framework for 2D divergence-dependent PDEs with coordinate mapping and general polygonal domains

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages