|
[Sponsors] |
September 13, 2015, 14:51 |
How to plot drag and lift coeffs.
|
#1 |
Senior Member
mohsen kh
Join Date: Jan 2013
Location: Iran
Posts: 125
Rep Power: 14 |
Hi
I used icoFoam to simulate flow around a cylinder for Re=100. (U=1 D=1 rho=1 and nu=.01) I add some lines to my control dict to calculate the drag and lift coeffs. ---------------------------------------------------------------------- functions { forces { type forceCoeffs; functionObjectLibs ( "libforces.so" ); outputControl timeStep; outputInterval 1; patches ( wall ); pName p; UName U; rhoName rhoInf; log true; rhoInf 1; CofR ( 0 0 0 ); liftDir (0 1 0); dragDir ( 1 0 0 ); pitchAxis ( 0 0 0 ); magUInf 1; lRef 1; Aref 1; } } ----------------------------------------------------- finally I had a forceCoeffs.dat file in postProcessing folder. My main question is how to plot cd and cl data (16000 data) to have something like the attached picture. Last edited by m5m5kh; September 13, 2015 at 14:54. Reason: picture |
|
September 29, 2015, 20:29 |
|
#2 |
Member
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 76
Rep Power: 12 |
There is an OpenFOAM function which you can use called 'foamMonitor', you should try it out. I usually use it to check if the results are going the way I expect them to be. After that I use python to properly generate my graphs.
|
|
October 7, 2015, 14:25 |
|
#3 |
Member
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 76
Rep Power: 12 |
I saw that you sent me a private message, but i will answer it here so other people can see it too.
So as you pointed out, you've got your forceCoeffs.dat To use the foamMonitor, just go in the terminal and write: Code:
foamMonitor ./postProcessing/0/forceCoeffs.dat Code:
foamMonitor -yrange [0:1.5] ./postProcessing/0/forceCoeffs.dat https://github.com/OpenFOAM/OpenFOAM...ed0738f5b4a1c1 |
|
February 17, 2022, 07:38 |
Facing error
|
#4 |
New Member
Orissa
Join Date: Feb 2022
Posts: 16
Rep Power: 4 |
while running the above code i am getting error.
|
|
February 17, 2022, 09:33 |
|
#5 |
New Member
Federico Nahuel Ramírez
Join Date: Dec 2020
Location: Spain
Posts: 16
Rep Power: 5 |
You may need to put the limits in quotation marks
Code:
foamMonitor -g -y "[0:1.5]" ./postProcessing/0/forceCoeffs.dat |
|
February 17, 2022, 09:44 |
|
#6 |
New Member
Orissa
Join Date: Feb 2022
Posts: 16
Rep Power: 4 |
I am getting error while running the code in the control dict it is showing rho is not defined and many errors
|
|
February 21, 2022, 04:21 |
|
#7 |
New Member
Federico Nahuel Ramírez
Join Date: Dec 2020
Location: Spain
Posts: 16
Rep Power: 5 |
Could you post your controlDict and the error?
|
|
February 24, 2022, 02:50 |
|
#8 |
New Member
Orissa
Join Date: Feb 2022
Posts: 16
Rep Power: 4 |
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application icoFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 1.0; deltaT 0.01; writeControl timeStep; writeInterval 20; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; functions { forces { type forceCoeffs; functionObjectLibs ( "libforces.so" ); outputControl timeStep; outputInterval 1; patches ( wall ); pName p; UName U; rhoName rhoInf; log true; rhoInf 1; CofR ( 0 0 0 ); liftDir (0 1 0); dragDir ( 1 0 0 ); pitchAxis ( 0 0 0 ); magUInf 1; lRef 1; Aref 1; } } // ************************************************** *********************** // Error:- --> FOAM FATAL ERROR: (openfoam-2112) Could not find rho:rho From void Foam::functionObjects::forces::initialise() in file forces/forces.C at line 229. FOAM exiting |
|
February 24, 2022, 05:00 |
|
#9 |
New Member
Federico Nahuel Ramírez
Join Date: Dec 2020
Location: Spain
Posts: 16
Rep Power: 5 |
I'm using version 2012 and not 2112, but i guess the configuration should be the same.
Instead of Code:
rhoName rhoInf; Code:
rho rhoInf; That's why the error says Code:
Could not find rho:rho |
|
March 28, 2022, 04:12 |
|
#10 |
Member
Join Date: Mar 2018
Posts: 33
Rep Power: 8 |
What gnuplot version do I need to install to use foamMonitor?
Btw, if gnuplot does not work for you for whetever reason, I have an octave code I made for plotting aero coefficients in openfoam. It is more complicated than using gnuplot though |
|
April 26, 2022, 00:37 |
|
#11 |
New Member
Suraj Garad
Join Date: Feb 2018
Location: Kharagpur
Posts: 16
Rep Power: 8 |
Hi,
I have tried both, but it didn't work for me. Also I have gone through all existing threads here. I am using openfoam 2112. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
wrong SU2 calculation for lift and drag coefficient for NAC4421 | mechy | SU2 | 7 | January 9, 2017 06:18 |
[OpenFOAM] Display lift and Drag in paraview | SamerAli | ParaView | 1 | May 16, 2013 13:51 |
How to plot Lift and Drag Coefficients using tecplot 360 | RuiVO | Tecplot | 5 | April 13, 2012 15:17 |
Lift and Drag Monitor Point Values Converging to Zero | Josh | CFX | 24 | May 9, 2011 11:38 |
Correct lift but wrong pressure drag - possible? | zx | Main CFD Forum | 4 | July 28, 2007 00:38 |