CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Display lift and Drag in paraview

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 7, 2013, 05:21
Default Display lift and Drag in paraview
  #1
Member
 
Samer
Join Date: Jan 2013
Posts: 31
Rep Power: 13
SamerAli is on a distinguished road
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?
SamerAli is offline   Reply With Quote

Old   May 16, 2013, 13:51
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
its not scalar field, its a scalar (just one value!!!), you can use
"Info" for example
Code:
Info << "drag" << drag <<" lift"<< lift <<endl;
to show it in terminal
or you can save it in a txt file
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


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