|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Join Date: Nov 2010
Posts: 52
Rep Power: 4 ![]() |
Hi SU2 users,
Is there already python script exists that automatically takes the converged solution of the current angle of attack as restart solution to compute the next angle of attack and so on ... to complete the lift polar. Instead of always doing this process manually to do the polars. Thanks and regards. |
|
|
|
|
|
|
|
|
#2 | |
|
New Member
David Tucker
Join Date: Jan 2013
Posts: 15
Rep Power: 2 ![]() |
Quote:
...I'm also not worried about space, so I just copy/paste a run directory to the next run (each AoA is a sub-directory of that) and run the script. Since I'm running on a KRAKEN Cray 5 system, I also need a submit script. As I say...not terribly sophisticated, and I am currently "tail"ing each output file one by one and transferring the CL and CD values. If you get anything more slick I'd be interested in taking a look! Good Luck! Dave |
||
|
|
|
||
|
|
|
#3 |
|
Member
Trent Lukaczyk
Join Date: Feb 2011
Location: Stanford, CA
Posts: 33
Rep Power: 4 ![]() |
This is a good example to try with the new SU2 python package! Here's an example python script -
Code:
#!/usr/bin/env python
# imports
import SU2
import numpy as np
import pylab as plt
from copy import deepcopy
# load config, start state
config = SU2.io.Config('inv_NACA0012.cfg')
state = SU2.io.State()
# prepare config
config.NUMBER_PART = 2
config.EXT_ITER = 99999
config.RESTART_SOL = 'YES'
# find solution files if they exist
state.find_files(config)
# angles to run
angles = np.linspace(-10.,10.,7)
# start results data
results = SU2.util.bunch()
results.AoA = angles
results.DRAG = []
results.LIFT = []
# iterate angles
for angle in angles:
# local config and state
konfig = deepcopy(config)
ztate = deepcopy(state)
# set angle of attack
konfig.AoA = angle
print 'AoA = ' , konfig.AoA
# run su2
drag = SU2.eval.func('DRAG',konfig,ztate)
lift = SU2.eval.func('LIFT',konfig,ztate)
# append results
results.DRAG.append(drag)
results.LIFT.append(lift)
#: for each angle
# plotting
plt.figure()
plt.plot( results.AoA , results.DRAG )
plt.show()
# save data
SU2.io.save_data('results.pkl',results)
|
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CentFOAM Python Script Installation: Error | socon009 | OpenFOAM Installation | 2 | May 26, 2012 09:36 |
| paraView in shell mode (python script running) | Prosiaczek | OpenFOAM | 2 | March 19, 2012 08:54 |
| [ParaView] SurfaceFlow filter in python script | yohey | ParaView | 2 | March 18, 2012 08:43 |
| Script for an airfoil polar plots computation | maddalena | OpenFOAM | 5 | June 9, 2010 13:55 |
| Thin foil analsis (sail) - Lift Coeff Problem | Kelvin | CFX | 3 | December 22, 2008 16:22 |