Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Davide-sd committed Feb 9, 2022
1 parent 25bed63 commit c7edcec
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 34 deletions.
61 changes: 30 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## pygasflow
# pygasflow

[![Documentation Status](https://readthedocs.org/projects/pygasflow/badge/?version=latest)](https://pygasflow.readthedocs.io/en/latest/?badge=latest) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Davide-sd/pygasflow/HEAD)

**pygasflow** provides a few handful functions to quickly perform quasi-1D ideal gasdynamic (perfect gas) computations with Python (see requirements below).

Expand All @@ -12,43 +14,36 @@ The following charts has been generated with the functions included in this pack
<img src="imgs/shock-reflection.png" width=250/>
</div>

At the moment, the following flow relations are implemented:
* Isentropic flow
* Fanno flow
* Rayleigh flow
* Shock wave relations (normal shock, oblique shock, conical shock)

The package contains the following sub-modules:
* `isentropic.py`: contains all the functions to solve isentropic flows;
* `fanno.py`: contains all the functions to solve fanno flows;
* `rayleigh.py`: contains all the functions to solve rayleigh flows;
* `showckwaves.py`: contains all the functions to solve normal/oblique/conical shock wave;
* `solvers`: the previous modules contains dozens of functions: it's hard to remember them all. For convenience, a few solvers have been implemented that, by providing a few parameters, solves the flows by computing the most important ratios (pressure ratio, ..., critical temperature ratio, ...). **These are most likely the functions you will want to use**.
* `nozzles`: it contains a few function and classes to understand convergent-divergent nozzles, Rao's TOP nozzles (Thrust Optmizie Parabolic), Minimum Length nozzle with Method of Characteristics. Nozzles can be used to quickly visualize their geometric differences or to solve the isentropic expansion through them with the `De_Laval_Solver`.

* `isentropic.py`: functions to solve isentropic flows;
* `fanno.py`: functions to solve Fanno flows;
* `rayleigh.py`: functions to solve Rayleigh flows;
* `showckwaves.py`: functions to solve normal / oblique / conical shock waves;
* `solvers`: the previous modules contains dozens of functions. For convenience, a few solvers have been implemented that, by providing a few parameters, solves the flows by computing the most important ratios (pressure ratio, ..., critical temperature ratio, ...). **These are most likely the functions you will want to use**.
* `nozzles`: functions and classes to understand convergent-divergent nozzles, Rao's TOP nozzles (Thrust Optmizie Parabolic), Minimum Length nozzle with Method of Characteristics. Nozzles can be used to quickly visualize their geometric differences or to solve the isentropic expansion with the `De_Laval_Solver` class.

Look at the [Usage](#Usage) section for more informations. If you find any errors, submit an issue or a pull request!

**_TODO_**:

1. Need to find a better/smarter way to chose the range where to apply bisection method..
3. Take a look at the different _TODO_ sections in the code.
## Installation

The repository is avaliable on PyPi:

## Requirements and Installation
```
pip install pygasflow
```

* Python >= 3.6
* numpy
* scipy
* matplotlib
And also on Conda:

To install this package:
1. Download this repository.
2. Open the terminal, move into the `pygasflow` parent folder.
3. Install it with this command (all the dependencies should auto install): `python3 -m pip install .`
```
conda install -c davide_sd pygasflow
```


## Usage

The easiest way to use this code is to call the interested solver. At the moment, the following solvers are implemented:
The easiest way to use this code is to call a solver. The following solvers are implemented:

* `isentropic_solver`
* `fanno_solver`
Expand All @@ -57,12 +52,16 @@ The easiest way to use this code is to call the interested solver. At the moment
* `conical_shockwave_solver`
* `De_Laval_Solver`: isentropic expansion through the Convergent-Divergent nozzle.

Let's say you need to solve an isentropic flow. You start by importing the `isentropic_solver`:
Let's say you need to solve an isentropic flow:

`from pygasflow import isentropic_solver`
```
from pygasflow import isentropic_solver
help(isentropic_solver)
```

I strongly suggest to take a look at the notebooks contained in the [examples](examples/) folder. Also, take a look at the [pygasflow/tests](pygasflow/tests/) folder for more usage examples.
Should a solver not be sufficient for your use case, feel free to explore the code implemented inside each flow's type, maybe you'll find a function that suits your needs.

Should the solvers not be sufficient for your use case, feel free to explore the code implemented inside each flow's type, maybe you'll find a function that suits your needs. The code is well documented: I went for a natural language nomenclature since (I bet) most of us are using and advanced editor with autocompletion. For instance, the critical temperature T/T* is defined as `critical_temperature_ratio` across the different flows, and so on. To import a specific function defined inside a specific flow type, you can do (for instance):
Please:

`from pygasflow.isentropic import critical_temperature_ratio`
* take a look at the notebooks contained in the [examples](examples/) folder. You can also try this package online with Binder. [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Davide-sd/pygasflow/HEAD)
* visit the [documentation page](https://pygasflow.readthedocs.io/en/latest/).
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ def readme():
description = 'Ideal Gasdynamics utilities for Python 3.6+',
long_description = readme(),
classifiers=[
'License :: GNU GPL v3',
'Programming Language :: Python :: 3.6',
'Topic :: Engineering :: Propulsion',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python :: 3.9',
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Physics"
],
keywords='gasdynamic shockwave fanno rayleigh isentropic flow perfect gas',
url = 'https://github.com/Davide-sd/pygasflow',
Expand Down

0 comments on commit c7edcec

Please sign in to comment.