CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Script for an airfoil polar plots computation (http://www.cfd-online.com/Forums/openfoam/76916-script-airfoil-polar-plots-computation.html)

maddalena June 8, 2010 10:34

Script for an airfoil polar plots computation
 
Hello everybody,

With a fixed mesh, I would like to calculate aerodynamic coefficient at different angles of attack for an airfoil, i.e. obtain the cl-alpha and cd-alpha curves. Is there anyone that has a written script for this purpose?

If not, could you suggest me how to write it? I know the real basis of writing script, but I still miss how to write math operations and editing files for doing something like velocity projections on the coordinate axis.

Any help?

Cheers,


maddalena

kev4573 June 8, 2010 14:34

PyFoam is used routinely for this type of parameter variation. http://openfoamwiki.net/index.php/Co...eter_Variation

maddalena June 9, 2010 08:33

Quote:

Originally Posted by kev4573 (Post 262141)
PyFoam is used routinely for this type of parameter variation. http://openfoamwiki.net/index.php/Co...eter_Variation

Ok, I downloaded and installed PyFoam... I miss something vital: how can I run that utility?:o

kev4573 June 9, 2010 09:18

PyFoam is a python library that can be used in python scripts. The examples on that page can be copied into a script and run from the command line.

maddalena June 9, 2010 09:45

Quote:

Originally Posted by kev4573 (Post 262294)
PyFoam is a python library that can be used in python scripts. The examples on that page can be copied into a script and run from the command line.

This is not exactly what I meant: I did not get that typing python doInletVariation.py I could run the utility. In any case...

Do you know if there are some kind of documentations that explain the programming basis? I mean: open, reading and writing files, operations, things like that. I am trying to understand what the example files do, but all the variables are called with the same name, thus I cannot understand if they are "keywords" or what...

In addition, what are the functions already implemented in python? For example, is there any function that works like sol.changeBoundary("inlet", ...) but for the controlDict file? Where can I find these kind of information?

Thaknk for your time and support,

mad

kev4573 June 9, 2010 13:55

I'm not sure there is any further documentation other than that wiki page. It sounds painful, but I would suggest just looking through the pyfoam code to figure out what functions are available and how it works..

Yes, you can modify any openfoam dictionary with pyfoam I believe - http://openfoamwiki.net/index.php/Co...ions_for_walls
. I've used similar code to this to modify other dictionaries.


All times are GMT -4. The time now is 15:53.