|
[Sponsors] |
May 7, 2013, 05:21 |
Display lift and Drag in paraview
|
#1 |
Member
Samer
Join Date: Jan 2013
Posts: 31
Rep Power: 13 |
Dear all
I am using openfoam 1.6-ext and i am testing a solver on a Turek Benchmark (oscillating elastic flap in a laminar incompressible flow) and i want to see the lift and drag on the flap, i included a header file in my main .C file that calculates the lift and drag: scalar lift = 0; scalar drag = 0; const vectorField& Sfp = mesh.boundary()[plateID].Sf(); forAll(p.boundaryField()[plateID], facei) { vector faceForce = p.boundaryField()[plateID][facei] * Sfp[facei]; lift += vector(0,1,0) & faceForce; drag += vector(1,0,0) & faceForce; } const vectorField& Sfc = mesh.boundary()[cylinderID].Sf(); forAll(p.boundaryField()[cylinderID], facei) { vector faceForce = p.boundaryField()[cylinderID][facei] * Sfc[facei]; lift += vector(0,1,0) & faceForce; drag += vector(1,0,0) & faceForce; } how can i know see these scalar fields in paraview? |
|
May 16, 2013, 13:51 |
|
#2 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
its not scalar field, its a scalar (just one value!!!), you can use
"Info" for example Code:
Info << "drag" << drag <<" lift"<< lift <<endl; or you can save it in a txt file
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calculation of lift and drag coefficients on airfoil | CoolHersheys | OpenFOAM Post-Processing | 5 | September 27, 2021 07:04 |
How to calculate lift, drag and lift distribution in Star CCM+? | israelcasillas94 | STAR-CCM+ | 4 | November 6, 2020 09:35 |
[OpenFOAM] Calculating Lift and Drag in Paraview (paraFoam) | scott | ParaView | 26 | August 22, 2019 07:26 |
wrong SU2 calculation for lift and drag coefficient for NAC4421 | mechy | SU2 | 7 | January 9, 2017 06:18 |
Correct lift but wrong pressure drag - possible? | zx | Main CFD Forum | 4 | July 28, 2007 00:38 |