No Description

Snow f4cb814b69 Minor readme update 8 years ago
hdpg1d c895fbc526 Added customizable tol and maxIt 8 years ago
test d64c87a161 Fixed tests 8 years ago
.gitignore 9071da17ce Updated ignore list 8 years ago
.travis.yml 421d8c303d Updated tests 8 years ago
LICENSE e57d36cd1c Initial commit 8 years ago
MANIFEST.in 7016eff45d Completed cfg file query 8 years ago
README.md f0880841cb Add hdg reference 8 years ago
requirements.txt ed84c1bb70 Added a seperate requirement file 8 years ago
setup.py d5abeb3132 Bump version 8 years ago

README.md

HDPG1D

This is a python package that solves 1-Dimensional PDEs using hybridizable discontinuous Petrov-Galerkin discretization, a novel FEA discretization that ensures the best solution quality without extra stablization mechanism. The following image shows the solution of 1D inviscid Burger's equation using HDPG discretization.

\frac{\partial u}{\partial t} + \frac{1}{2} \frac{\partial u^2}{\partial x} = 0, \quad \text{in } \Omega \in [0,1].

Notice that the oscillations near the shock are well controlled even without any artificial stablization mechanism.

The main task of this project is to build an automated CFD framework based on HPDG discretization and robust adaptive mesh refinement. The solver is currently capable of solving 1D linear convection-diffusion-reaction equations of the following form with Dirichlet boundary condition,

c_1\frac{\partial u}{\partial x} + c_2\frac{\partial^2 u}{\partial x^2} + c_3u = f,

where $c_1$, $c_2$, and $c_3$ are constants and $f$ is the forcing term.

This package currently only has HDG discretization as a preliminary discretization, please refer to this paper for implementation details.

Install

In the souce directory:

python setup.py sdist
cd dist/
pip install hdpg1d

Usage

In terminal, call:

PGsolve

Follow the prompts to setup problem, visualize solution, and check convergence plot.

Convergence plot

The error on the convergence plot is calculated using approximated 'exact' solution with higher polynomial functions and higher number of elements. Therefore, the error plot, especially the adaptive solution error, may not be accurate after certain error threshold.

Adaptive method

By default, the solver seeks to adapt mesh based on the right boundary flux. The solver stops after the estimated error is lower than a user defined tolerance or reaches maximum iteration number.

Problem setup

PGsolve provides two methods to setup the problem:

  • Command line interface: when PGsolve is called from command line, it offers the option to setup the problem manually instead of use the default parameters. The parameters could be changed in command line are
    • convection coefficient $c_1$
    • diffusion coefficient $c_2$
    • reaction coefficient $c_3$
    • order of polynomial basis functions
    • initial number of elements
    • stablization parameters $\tau^+$ and $\tau^-$
  • Configuration file: config.json is the sample configuration file comes with the application, specifying default parameters in command line interface. To customize parameters including forcing term and boundary condtions, create config.json in the current working directory or in your home directory ~/, copy the content of the sample configuration file, and change the value of each entry according to the specific problem. Running PGsolve in the currecnt working directory will then use values in the file as default parameters.

To-do

  • Support non-linear problems
  • Support time-marching
  • More adaptive target functions
  • Adaptive HDPG solution routine