DHARA is a general solver for partial differential equations (PDEs) written in Python, designed to run efficiently on both CPUs and GPUs. It combines the flexibility of Python with high-performance libraries like NumPy for CPUs and CuPy for GPUs, enabling large-scale scientific simulations with the same codebase. Built with a modular and object-oriented design, DHARA is easy to extend and adapt to new physical models or numerical methods. It supports parallelization with MPI, efficient memory use, and time integration schemes, making it a versatile tool for studying fluid dynamics and related problems. Currently, DHARA is closed-source; for more details and collaboration opportunities, please visit Vayusoft Labs.
Libraries required: NumPy, CuPy (for GPUs), h5py, mpi4py, matplotlib
Modular architecture of DHARA
Object-oriented design:
DHARA is developed using an object-oriented programming paradigm, where functionalities are organized into modular and extensible components. This design makes it simple to maintain, reuse, and extend the solver for new physical models or numerical schemes.
Problem class:
At the core, a dedicated problem class (e.g., Hydro3D
) serves as the central interface for setting up and evolving simulations. It handles grid initialization, array allocation, boundary conditions, and external forcing, while also coordinating numerical flux computations.
Flux solvers:
Numerical fluxes are computed through specialized solver classes such as KTConvFlux
for convective terms and ViscousFlux
for viscous terms. Different high-order reconstructions (e.g., WENO, CWENO, TENO) are available as modular plug-ins.
Time integration:
Time advancement is managed by the TimeEvolution
class, which supports explicit schemes like eSSPRK2, eSSPRK3, and standard Runge–Kutta methods. A solve_single_step
routine updates the solution for one timestep, ensuring flexibility to switch schemes easily.
I/O management:
Data handling is performed by the DataIO
class, which uses the h5py library to store simulation fields and global statistics in HDF5 format. This ensures portability, parallel I/O support, and compatibility with analysis tools.
Extensibility:
Thanks to its modular structure, new solvers, numerical methods, or physical models can be included with minimal changes. This makes DHARA not just a solver but a framework for PDE-based research.