pyapes: PYthon Awesome Partial differential Equation Solver (general purpose finite difference PDE solver)
pyapes is designed to solve various engineering problems in rectangular grid.
The goal of pyapes (should be/have) is
- Cross-platform
- Both tested on Mac and Linux (Arch)
- Windows support is under testing
- GPU acceleration in a structured grid with PyTorch
- Use of
torch.Tensor. User can choose eithertorch.device("cpu")ortorch.device("cuda").
- Use of
- Generically expressed (OpenFOAM-like, human-readable formulation)
We recommend to use poetry to manage/install all dependencies.
-
From
gitgit clone git@gitlab.ethz.ch:kchung/pyapes.git cd pyapes poetry install -
From
pypipython3 -m pip install pyapes # or poetry add pyapes
- Core dependency
python >= 3.10- As of 19.02.2023,
torchdoes not support 3.11 properly (for the official release). Therefore, stick topython3.10.
- As of 19.02.2023,
torch >= 1.10.0
- Dependencies from my personal projects
pymyplot(plotting tools)pymytools(misc. tools including data I/O, logging, etc.)
-
CPU/GPU(CUDA) computation using
torch -
(OpenFOAM like) generically expressed solver
>>> solver.set_eq(fdm.laplacian(1.0, var) == rhs) >>> solver.solve()
-
FDM Discretizations
- Spatial:
Grad,Laplacian,Div- Supports flux limiter
upwindfor theDivoperator
- Supports flux limiter
- Temporal:
Ddt
- Spatial:
-
Boundary conditions:
- Supports
Dirichlet,Neumann,Periodic, andSymmetry
- Supports
-
Demo cases in
jupternotebooks
Check our demos files
- Boundary conditions
- Inflow/Outflow
- Need different derivative order at the cell face
- Additional features
- High order time discretization
- Immersed body BC
- Higher order flux limiters (
quick)
- Additional features
- Testing and validation
-
Ddtclass (implementation is tested but haven't validated with practical test cases)
-
- Working on demo files
- The Poisson equation
- The advection-diffusion equation
- The Burgers' equation
- The Navier-Stokes equation at low Reynolds numbers
- The Black-Scholes equation