forked from jgressier/aerokit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance numpy handling, examples and gallery
- Loading branch information
Showing
7 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# python compiled files | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
aero | ||
---- | ||
|
||
Python packages for compressible flow computations | ||
|
||
### Features | ||
* Mach dependent functions for isentropic total pressure, temperature and mass flow | ||
* local Rankine-Hugoniot shock wave equations | ||
* conical shock waves | ||
* misc: degree based trigo functions, Newton iterative solve, ODE integration | ||
|
||
### Installation & usage | ||
* `aero` folder must be placed in a PYTHONPATH structure | ||
* or append `$PWD`to your `PYTHONPATH` | ||
PYTHONPATH=$PWD:$PYTHONPATH python examples/test.py | ||
|
||
### Requirements | ||
* examples are plotted using [matplotlib](http://matplotlib.org) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Plot of local Rankine-Hugoniot equations (2D shock waves) | ||
@author: j.gressier | ||
""" | ||
|
||
import aero.degree as deg | ||
import aero.CompressibleFlow as aerof | ||
import aero.ShockWave as aerosw | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
npoints = 100 | ||
gam = 1.4 | ||
|
||
fig=plt.figure(1, figsize=(10,8)) | ||
fig.suptitle('Polar of Shock-Waves, $\gamma = %.1f$'%gam, fontsize=12, y=0.93) | ||
|
||
macharray = [ 1.05, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 2., 2.2, 2.5, 3., 3.5, 4., 5., 10., 100. ] | ||
|
||
for m in macharray: | ||
sig = np.linspace(deg.asin(1./m), 90., npoints+1) | ||
dev = aerosw.deflection_Mach_sigma(m, sig, gam) | ||
plt.plot(dev, sig, 'k-') | ||
plt.text(dev[npoints/2], sig[npoints/2], '%.3g'%m, horizontalalignment='center', verticalalignment='top', | ||
fontsize=8, bbox=dict(facecolor='white', alpha=0.8), | ||
rotation='60') | ||
|
||
#labels.append(legends[i]+", t=%.1f"%results[i][t].time) | ||
#legend(labels, loc='upper left',prop={'size':10}) | ||
plt.axis([0., 50., 0., 90.]) | ||
plt.xlabel('deviation $\Delta\\theta$', fontsize=10) | ||
plt.ylabel('shock angle $\sigma$', fontsize=10) | ||
plt.minorticks_on() | ||
plt.grid(which='major', linestyle='-', alpha=0.8) | ||
plt.grid(which='minor', linestyle=':', alpha=0.5) | ||
fig.savefig('polar.png', bbox_inches='tight') | ||
#show() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$PYTHONPATH" ] ; then | ||
export PYTHONPATH=$PWD | ||
else | ||
export PYTHONPATH=$PWD:$PYTHONPATH | ||
fi | ||
|
||
mkdir -p gallery | ||
cd gallery | ||
for fic in ../examples/*.py ; do | ||
echo run $fic | ||
${PYTHON:-python} $fic | ||
done |