CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Paraview & paraFoam

Display lift and Drag in paraview

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 7, 2013, 04:21
Default Display lift and Drag in paraview
  #1
Member
 
Samer
Join Date: Jan 2013
Posts: 31
Rep Power: 4
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, 12:51
Default
  #2
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
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
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating Lift and Drag in Paraview (paraFoam) scott OpenFOAM Paraview & paraFoam 7 April 16, 2014 07:13
[ANSYS Meshing] Lift & Drag Meshing Techniques tylerplowright ANSYS Meshing & Geometry 6 May 2, 2012 23:53
Lift and Drag Monitor Point Values Converging to Zero Josh CFX 24 May 9, 2011 10:38
Correct lift but wrong pressure drag - possible? zx Main CFD Forum 4 July 27, 2007 23:38
drag and lift coefficient No CD-adapco 5 July 13, 2004 10:21


All times are GMT -4. The time now is 18:51.