Display lift and Drag in paraview
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? |
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 |
All times are GMT -4. The time now is 17:02. |