|
[Sponsors] |
How to extract Cl, Cd value through python for 2D airfoil simulation? |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Vishnu_iitb
Join Date: Oct 2020
Location: Mumbai
Posts: 16
Rep Power: 5 ![]() |
Hello there,
Using Python, I would like to directly extract the coefficient of lift and drag from a naca 0012 airfoil simulation, which is exactly same as the case in Quick Start . So I ran the Quick case by using the subprocess package in Python (code is attached below). I can see that the SCREEN_OUTPUT prints CL and CD values, but it seems the values are not stored anywhere. I want to know how can I directly extract the value of CL, CD from the solver using python. If not is there a way to save the CL, CD values to a .csv file directly? Any help is much appreciated. Note: I tried out the pySU2 package, but I am running into an error and not sure how to proceed further. The issue is elaborated here Code:
import subprocess subprocess.run(' SU2_CFD inv_NACA0012.cfg', shell=True) |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 596
Rep Power: 17 ![]() |
You can find the values for lift and drag in the history output file:
https://su2code.github.io/docs_v7/Cu...history-output You can use either the field name or the group output name Code:
HISTORY_OUTPUT= ITER RMS_RES AERO_COEFF |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Vishnu_iitb
Join Date: Oct 2020
Location: Mumbai
Posts: 16
Rep Power: 5 ![]() |
Thanks a lot for your speedy response! I have another question: Is it not directly possible to extract the aerodynamic coefficients from the SU2 solver instead of writing it to an output file and then reading it? The reason why I am asking this is while performing a multidisciplinary optimization it is desirable for the optimizer to have a 'direct memory access' instead of using input/output files as the former savessignificant time,minimizes potential loss of accuracy and reduces storage space in disks.
|
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 596
Rep Power: 17 ![]() |
There are a couple of examples for the pywrapper in TestCases/py_wrapper, you can first run them to make sure that everything is working properly on your local machine (if you haven't done so already)
|
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFX/Fluent- Underprediction of Lift Coeffcient in 2D Airfoil Simulation | DanielBarreiro | Main CFD Forum | 4 | September 2, 2021 02:16 |
Airfoil 2D cfd simulation | Cocorito90 | OpenFOAM Running, Solving & CFD | 14 | December 19, 2016 03:43 |
airfoil 2D simulation: position of lift force on the airfoil | Koenieboy | Main CFD Forum | 2 | March 13, 2012 06:44 |
NO STAGNATION POINT FOR AIRFOIL SIMULATION | Rif | Main CFD Forum | 6 | February 4, 2008 07:33 |
Airfoil Simulation for Validation Purposes | Angela Bong | Main CFD Forum | 7 | September 13, 2006 13:04 |